Quote Originally Posted by daan.joubert View Post
Hi Alain and others,
Thank you all for info given, it is much appreciated.

Alain, regarding the linear problem - I have tested the actual distance travel of the servo arm by connecting a ruler to the arm.
To test I then adjusted the speed voltage, taking voltage readings and distance readings as I go along.
The distance values on Excel graph showed a non linear line in comparison to the linear nature of the voltage.
/Daan Joubert
Your gains might need to be fractional all the way up to 20 times and more via your vresistors via adc. Example engine running no load 1500 rpm, adc 1.5/5 * 256 = 77. setpoint = 77,unknown but say pwm 25, all gains apart from p set to zero. 25% load applied engine droops to 500rpm,adc 0.5/5 * 256 = 26. 77-26= 51, pwm output 51. If output to much p gain * 0.8 etc,to little * 1.5 etc. You should get to the stage of engine hunting turn the gain slightly below this. This is then where the data from i and d comes into play and slightly tweaking each one results in a reactive genset regardless of load.