It is currently March 28th, 2024, 1:08 pm

Need help to convert fan speed RPM to percentage

Get help with creating, editing & fixing problems with skins
Post Reply
User avatar
Rambytes
Posts: 27
Joined: August 30th, 2017, 10:36 pm

Need help to convert fan speed RPM to percentage

Post by Rambytes »

Hello everyone,

I've read alot about this and I cannot get working solution to show my computer fan speed into percentage instead of RPM.

With le software SpeedFan, i've push to the limit each fan of my computer to check the maximum RPM of each fan. For example, the fan that help my GPU to get fresh air have a maximum RPM of 1700.

Right now my widget show 672 RPM, but I want to have a percentage instead, so display 39%

How to get this? (and sorry for my english)
User avatar
CyberTheWorm
Posts: 860
Joined: August 22nd, 2016, 11:32 pm
Location: Surrey, B.C., Canada

Re: Need help to convert fan speed RPM to percentage

Post by CyberTheWorm »

Something like this

Code: Select all

[MeasurePercent]
Measure=Calc
Percent=(#FanSpeed# / (#MaxFanSpeed#/100))
User avatar
balala
Rainmeter Sage
Posts: 16109
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Need help to convert fan speed RPM to percentage

Post by balala »

CyberTheWorm wrote:Something like this

Code: Select all

[MeasurePercent]
Measure=Calc
Percent=(#FanSpeed# / (#MaxFanSpeed#/100))
A small mistake: the Percent option of this measure should be Formula:

Code: Select all

[MeasurePercent]
Measure=Calc
Formula=(#FanSpeed# / (#MaxFanSpeed#/100))
I also would rewrite this formula as Formula=( 100 * #FanSpeed# / #MaxFanSpeed# )
User avatar
Rambytes
Posts: 27
Joined: August 30th, 2017, 10:36 pm

Re: Need help to convert fan speed RPM to percentage

Post by Rambytes »

.......okay, but how to display this? Variables? I really don't understand.

This is where I check the speed of the fan

Code: Select all

[MeasureSpeed]
Measure=Plugin
Plugin=SpeedFanPlugin
SpeedFanType=FAN
SpeedFanNumber=2
DynamicVariables=1
And this to display the speed:

Code: Select all

[RPMDisplay]
Meter=STRING
MeasureName=MeasureSpeed
X=40
Y=30
AntiAlias=1
NumOfDecimals=0
Text=%1
User avatar
balala
Rainmeter Sage
Posts: 16109
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Need help to convert fan speed RPM to percentage

Post by balala »

Rambytes wrote:.......okay, but how to display this? Variables? I really don't understand.
No, you don't need to add further variables. Just replace the in MeasureName option of the [RPMDisplay] meter the name of the measure you'd like to see: MeasureName=MeasurePercent
User avatar
Rambytes
Posts: 27
Joined: August 30th, 2017, 10:36 pm

Re: Need help to convert fan speed RPM to percentage

Post by Rambytes »

Are you sure? The result is 0

Where the #FanSpeed# and #MaxFanSpeed# is for?

I really don't understand... most of the time I understand but not this one... (if my english was better, but i can't explain)

What I mean is where #FanSpeed# get is value from?

Can you build the complete code, with this I will understand more
User avatar
balala
Rainmeter Sage
Posts: 16109
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Need help to convert fan speed RPM to percentage

Post by balala »

Rambytes wrote:Are you sure? The result is 0

Where the #FanSpeed# and #MaxFanSpeed# is for?

I really don't understand... most of the time I understand but not this one... (if my english was better, but i can't explain)

What I mean is where #FanSpeed# get is value from?

Can you build the complete code, with this I will understand more
I understood, don't worry...
First I can't try the above code, because I'm not using the SpeedFan Plugin, so this is a just theoretical solution.
Second sorry, I've copied the code of CyberTheWorm, without thinking too much. Now I see I've omitted something: based on your initial request, I'd say that probably you have to define the MaxFanSpeed variable into the [Variables] section of your code:

Code: Select all

[Variables]
MaxFanSpeed=1700
This is the value you've talked about in your initial request.
Now modify the Formula option of the [MeasurePercent] measure either to Formula=( 100 * MeasureSpeed / #MaxFanSpeed# ), or to Formula=( 100 * [color=#FF0000][[/color]MeasureSpeed[color=#FF0000]][/color] / #MaxFanSpeed# ) (see with red the differences between the two formulas). Try first the first formula, but I suppose it wont work. If it does, it's ok, you have nothing to do more, but if it doesn't, just try the second one, too. But in this case be careful to not forget to also add a DynamicVariables=1 option to the [MeasurePercent] measure.
I hope this will make the code to work well. Sorry for the inconvenience caused by my inattention.
User avatar
Rambytes
Posts: 27
Joined: August 30th, 2017, 10:36 pm

Re: Need help to convert fan speed RPM to percentage

Post by Rambytes »

WooHoo.... now is working, and using the second formula :)

Thanks alot, you're my hero of the day!
User avatar
balala
Rainmeter Sage
Posts: 16109
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Need help to convert fan speed RPM to percentage

Post by balala »

You're welcome and thanks for the appreciation.
Post Reply