I have a DC motor that needs to be RPM regulated, that is, it needs to turn at constant RPM regardless of the load. I've read this can be done by monitoring current thru the motor windings and appropriately linearly increasing the motor driving voltage.
I have a triangle oscillator and a comparator to generate the PWM. Reference voltage (goes from 0 to 10 V) on the comparator 'selects' desired duty cycle. PWM is running at 20 kHz. Motor is driven by this PWM through PMOS with low-side current sensing done via OPAMP.
Linear current increase linearly increases the reference voltage which again linearly increases the duty cycle.
The problem is when the PMOS is turned off, there is no current thus no voltage sensed and no reference voltage set (for duty cycle). I want previous duty cycle (reference voltage) to stay unchanged for a couple of PWM pulses (lets say 5ms for now) and then change to a new value.
I could have current sensing OPAMP with offset to generate some general duty cycle (reference voltage) with no current. But that would still cause drops in the duty cycle when PMOS turned off.
I'am thinking PI regulator done with OPAMP integrator, would that work, how would I go about implementing it?
EDIT: Its a PMOS with motor and current sensing resistor on low-side.