Patent ID: 7430102

Claim:
A system for controlling a solenoid, comprising: a voltage source connected to the solenoid; a current sensor for sensing a current through the solenoid; a switch for controlling the current through the solenoid; a processor connected to the voltage source, the current sensor, and the switch, wherein the processor is configured to maintain a substantially constant current through the solenoid to compensate for changes to the voltage source or the solenoid resistance by generating a PWM signal for controlling the current through the solenoid, and wherein the PWM signal is based on a first signal associated with the voltage source and a second signal associated with the current sensor, wherein the processor comprises a computer readable medium encoded with a program for: acquiring a line signal from the voltage source; acquiring a sense signal from the current sensor; computing a duty cycle based on the line signal and the sense signal; and computing an intermediate resistance based on the line signal, the sense signal, a sense resistance, and a previous duty cycle; and a switch driver connected between the processor and the switch.