fan speed control

I use PWM to control fan speed.
The fan will return a tacho to represent the factual speed(RPM).

The lookup table will contain the to be used PWM settings for the
requested speed. The speed needs to be converted as the PWM output is not
linear with the voltage of the connected fan. Depending on the load of the
fan the to be used PWM characteristics will differ.

But I don't know how to write a lookup table.
Do I must to try every PWM to corresponding RPM?
So, I want to know the fan how to give the factual RPM.

Thanks advanced.
 
I chage the fan speed according to the temperature.

The lookup table will contain the to be used PWM settings for the requested speed. The speed needs to be converted as the PWM output is not linear with the voltage of the connected fan. Depending on the load of the fan the to be used PWM characteristics will differ.

The lookup table can be used to make the conversion between the received tacho pulses and the corresponding fan speed. Note that this is the conversion table for 500ms tacho pulse measurement.
 
flylionking said:
I chage the fan speed according to the temperature.

The lookup table will contain the to be used PWM settings for the requested speed. The speed needs to be converted as the PWM output is not linear with the voltage of the connected fan. Depending on the load of the fan the to be used PWM characteristics will differ.

The lookup table can be used to make the conversion between the received tacho pulses and the corresponding fan speed. Note that this is the conversion table for 500ms tacho pulse measurement.

Perhaps you are making this more difficult than it needs to be. If the temperature is too high, increase the PWM output. That will tend to cool the temperature down to where it should be. If the temperature is too low, decrease the PWM, which will allow the temperature to rise. Why make it any more complicated than that? Specifically, why do you want to monitor the exact fan speed?