PWM duty cycle based on battery level