Diesel Motor/Generator Controller

This page describes a controller that I built in 1996 for a 12.5KW diesel motor/generator set. The generator is driven by a 2 cylinder Chinese diesel engine. In order to keep the generator's output frequency near 60Hz over the full load range, I designed a controller to adjust the throttle position to keep the engine speed near 1800 RPM. The picture above shows a frontal view of the finished system (click on it for a larger image).

The controller's circuit board is housed in a black box located in the upper right corner of the frame. The throttle positioner is housed in a blue box located down on the runner. You can see the actuator cable running from the positioner box through some pulleys up to the throttle lever on the injector body. The box in the center of the upper portion of the frame houses gauges (DC volts, DC amps, RPM, engine temperature and oil pressure) along with the starter switch, heater switch and kill switch.

The heart of the control system is a Basic Stamp II microcontroller. (If I were to embark on this project today I would probably use the ZX-24 instead because it is a much more powerful controller and yet is Stamp-compatible. See the ZBasic and ZX-24 Site for more information.) There is a magnetic pickup positioned near the flywheel teeth which provides a pulse train proportional to engine speed. A linear actuator (a stepper motor that moves a threaded shaft axially through the motor body) is used to effect throttle positioning. The controller samples the engine speed and then adjusts the throttle position attempting to keep the RPM relatively constant.

In order to be able to display an indication of the generator's load, a current transformer was made for each power leg by winding some turns of enameled copper around a pseudo-toroid core made of steel. The voltage from the center-tapped winding is conditioned by an op amp circuit and then fed to an analog-to-digital converter. Using empirical data, code was written to perform an approximate piecewise linear transformation of the current transformer signal to a current value in amps.

Here is a picture of the back side of the genset in which you can see the generator, battery, starter and alternator (for recharging the battery).
To the left is a picture of the controller board. This is the first PCB that I had ever made; it is double sided. You can see a few red wires tacked onto the PCB to fix areas where the traces were etched through.

The wide ribbon cable goes to an LCD on the housing cover on which is displayed the computed engine RPM and generator frequency along with an indication of the generator load. The narrow ribbon cable goes to a serial connector to allow reprogramming. At the bottom of the housing are potentiometers for adjusting the LCD brightness and backlighting and a switch for manual operation.

This picture shows the linear actuator that changes the throttle position. The two disks on the shaft contact limit switches at the extremes of motion. The leftmost disk is slotted and rides on a guide bar to keep the shaft from turning.
The PBasic code for the controller is available here. The schematics for the circuitry used for the controller are available as images (Page 1, Page 2, Page 3, Page 4 and Page 5) or as an ExpressSCH schematic here (right click, Save As to your disk). The full schematic can be most conveniently viewed and printed using the ExpressSCH schematic drawing program that can be downloaded free here.

If you wish, you may email me with questions or comments.

Don Kinzer