I am using a small engine to make a minimum use power backup for powering some lights and a fan if my power goes out.
let me describe the system. Motor connected to a 24v alternator (40 amp max) which charges 2 old car batteries ( I'd rather use deep cycle but the alternator won't charge them correctly), the batteries are connected to a old rotary converter (or motor generator if you prefer) which takes 24amps@ 28vdc and outputs 3.5amps@ 115vac 60hz (pure sine wave).
the motors throttle has a stepper motor attached to it (its surplus from a coleman generator), but I'm sure I could attach a servo to it.
what I want is to use a arduino to control the throttle during loads.
should I attach a small motor to the output and use that as a comparator?
Sounds like you want to control the throttle to get a constant RPM. You will need some way to detect engine RPM. Perhaps an inductive pickup near the spark plug would work. I think I would use a servo rather than a stepper for this application.
Remember that on a small engine there isn't a 1:1 correlation between throttle and fuel intake or rpm and power. The throttle only adjusts tension on the governor, and the governor attempts to match RPM to the speed set by the throttle (by providing more fuel/air mix) as the load on the engine changes. If the throttle controlled fuel/air intake directly then the RPM on your lawnmower would be all over the map as you pushed it around your yard -- not to mention it would rev out of control if it was sitting still on pavement.
It's a good question as to how you'd want to control the engine RPM based on load assuming that your goal is peak efficiency for the generator. You nearly need a dynometer and a way to measure the fuel rate to accurately figure that out. Perhaps you could fudge it and watch the governor position and increase RPM when the engine starts bogging down?
I think I would use a servo rather than a stepper for this application.
Why? The stepper motor can be positioned more accurately. Just curious about your reasoning.
Driving hardware is simpler (power and signal) compared to a stepper. To get the stepper to a known position there would need to be an additional limit switch. The control loop (PID) doesn't need the servo to be steady because it will be continuously adjusting position based on engine RPM.
Another way to control it would be a small DC gearmotor and H-bridge driver... Basically what a hobby servo already contains.