Compensation system adapted for use with a battery-powered, PWM-driven portable electronic device to enable consistent power to the device load despite battery voltage drop resulting from battery depletion, comprising: a voltage divider circuit for proportionally adjusting the voltage to a measurable range; an analog-to-digital converter for receiving the output from the voltage divider and converting it into a digital voltage value; and a microprocessing unit for running software code steps for receiving digital voltage input and user-determined power setting input for determining a compensating duty cycle for application by the software to the PWM to drive the load consistently at the user-determined power setting despite decrease in battery voltage resulting from battery depletion.