Make a servo controlled auto throttle

I have a small engine that has variable loads and the stock mechanical speed controller.... well to put it simple.. SUCKS!!

My vision is having one of my arduino's take over the throttle. I want to maintain a 3200 rpm and I have a tach pulse signal that I can use as an input. My problem is tolerances... Example if the rpm is 3100 the servo over compensates both ways and its all downhill from there.

I'd like to figure out a way to make minor adjustments for +/- 300 rpm and more drastic adjustment for over that. Can anyone help me write this code???

Sounds like you need a PID controller.

Can you help me out with this… I am a hardware and wiring guy who is learning Arduino code. Once you start talking PID I’m lost!

dave0000011111:
Once you start talking PID I’m lost!

Did you follow the link to the Playground in Riva’s post? On that playground page there’s a link to a basic example.

PID sounds complicated but basically you will supply it with something like the current rpm, the target rpm your aiming for and it will calculate a return value to apply to the throttle to adjust the rpm toward your target.

There are hundreds of examples online and maybe someone has already do pretty much what you need but if your lost with PID then find tutorials that help explain. There is a nice one (IMO) here.