Load resistance change detection
Here is a sketch of what the solution might look like. Using some clever software, you can use this to stabilize the duty cycle on some particular value of resistance (current flow) no matter what the battery voltage is. You can sample the current during the ON state to make sure you're still close, then increase and decrease the duty cycle from there.

I just winged this circuit together from memory, so please read up on 'constant current circuits' to see the specifics of how to design the op-amp circuit and how to get the gain you need and how to select a correctly sized sense resistor.

Hope this helps!







simulate this circuit &ndash; Schematic created using CircuitLab