I know RAB was speaking somewhat tongue in cheek, but for the computer geeks, out there, it has been done. My cpu (ATMega8) only cost $5.00 (including a/d converters and all). That was the cheapest part of the whole thing. You probably won't be able to get a stepper motor and leadscrew for anything less than $100.
To save you the grief of writing a PID controller. Here you go free of charge...
error=TARGETRPM-rpm;
// calculate the proportional portion
pterm=((long)error*pgain);
// calculate the integral portion
// If we are at the stepper limit, and still want to go higher,
// do not add any more to the integral
if(!(PINB & LIMITHI) && pterm > 0) {
temp=sumerror;
}
else {
temp = sumerror + error;
}
if(temp > 5000){ // limit the integral windup
temp=5000;
}
else if(temp < -5000){
temp=-5000;
}
sumerror = temp;
iterm = (igain * sumerror)/32; // note!! /32 gives us more fractional resolution for the igain variable
// Calculate the derivative portion
dterm = dgain * (rpm - lastrpm);
lastrpm = rpm;
governorcorrection = (pterm + iterm + dterm) / 256;
That was the easy part, the hard part comes in tuning the gain variables. These will be different for each and every system. Unless you want the fun of learning how to build a controller and program it, I don't suggest you do it. You are better off experimenting with different springs until the oscillation goes away.
If you want to see how I built my controller, go to
http://martin.nile.googlepages.com/automaticgeneratorcontroller. Source code can be had at
http://code.google.com/p/ngencontrol/ To show how my controller behaves, this graph shows the stock governor (purple line) versus PID governor (green line) when the engine load goes from zero to 5000 watts.
Note, it is normal for any P type governor (such as a spring) to exhibit "sag", or oscillation when load is applied. You can minimize the sag by increasing gain (using a stronger spring). The system starts to exhibit oscillation when the gain gets too high. In your case, you can minimize the oscillation with a weaker spring, but at the cost of having the RPM drop when load is applied.
My controller is great. Unfortunately, I haven't figured out how to use a computer to make my Changfa any quieter.