PID controlled motor controller (based on measured RPM instead of PWM)

Example:

The motors both rotate at 1000 rpm with no load going (mA value 200 mA) from 1000 to 2000 rpm takes relatively not that much extra PWM.
But what if both rotate at 1000 rpm with a load going (mA value 1000 mA) from 1000 to 2000 rpm takes more PWM (If the max RPM can actually be reached!).

So I thougt: what if I know the actual RPM and current value? Maybe I can optimize the PID algorithm with the extra data?

Maybe I first have to do some testing to see what really happens......

Cheers.

With true P&ID its not important that the mapping of the pwm output tracks linearly with the motor range with or without load, as the P&ID just compares the desired rpm (the setpoint) with the actual real time rpm measurement (the process variable) and the output just says 'send more output' or 'send less output' in response to that error until the error is zero where then the output will just remain where it last was until the P&ID once again detects an error. That auto feedback correcting action means the absolute value of the output pwm signal is not important, just that it does cause the motor to speed up or slow down when the P&ID algorithm makes a correction to the output value. One optimizes a P&ID loop by changing the 'constant tuning values' used for the P,I and D terms, not by other external means.

Lefty