# PWM controller for a servo coil (flow valve)

I am designing a PWM controller for a butterfly type flow valve operated by a servo. I have some information for the servo like input signal range (0-100mA), servo coil resistance (75 Ohm) and inductance (150mH). I am thinking of a simple architecture as per picture below. I have a few questions to address:

1. At what frequency should I drive the servo. What are the means to determine best frequency at which you have better control?
2. I set servo voltage source to 7.5V (75 Ohm * 100mA). I do realize that impedance of the coil will depend on frequency (PWM DC). What approach should I use to set the servo voltage. I assume it needs to be at a voltage such that control current doesn't exceed 100mA at 100% PWM duty cycle?
3. How to pick an appropriate fly-back diode?
4. How to decrease current ripple at the servo coil. Right now my simulation shows 20mA current ripple. Is this appropriate?
5. Any other considerations or issues I need to think about?

• Have you studied the specification sheet for the servo? Commented Jul 19, 2021 at 15:53
• The only information for the servo I have is provided above Commented Jul 19, 2021 at 15:56

1. Take something like $$\f_{PWM}\geq 10\dfrac{R}{2\pi L}\$$ , at least 1kHz for your solenoid.

2. Actually you should implement a PI current controller with current sense feedback, the supply voltage shall be quite higher - use standard available voltages (12V),15V, 24V, 48V.

3. Any fast switching diode, you can use schottky.

4. By further increasing PWM frequency. Your application doesn't need flat curve, rather it would be even beneficial to superimpose yet another low frequency signal to spoil this flatness - see: dithering for servo valves. For a "simple quasi" dither function, you could use a variable PWM frequency link

5. Current PI controller. Dither. Intelligent MOSFET switches (highside and lowside), some of them can provide low frequency PWM output with current sense and overcurrent protection - an easy way to interface your MCU with all features needed to make a SC/Overtemperature protected current controller.

EDIT:

I have drawn a high side P-MOSFET switch with a current sense (3.3 ohm) shunt, RC filter 15k/68n and a rail to rail opamp (I have just picked one, available in LT Spice). At PWM period of 300us (3.3 kHz) and duty time of 200us I get something like 100mA output and 5% dither. You could implement a variable PWM frequency according to the link, so that dither remains cca. 5% on the whole range. The current sense is an option. The PMOS driver is suitable for absolute maximum voltage of 20V, it's fast switching, no need to worry on MCU startup GPIO impedance.

• Thanks, this extremely helpful. Commented Jul 19, 2021 at 21:17
• @AlexDrake see edit, also ti.com/lit/ug/tidudf9/… Commented Jul 20, 2021 at 12:00
• Thank you so much for such a detailed answer. I have additional questions about the LTspice circuit. Commented Jul 20, 2021 at 23:21
• This is great. I appreciate your detailed answer to my questions. I am going through the references you pointed out at. I have a couple of additional question related to the circuit you simulated. Is there a particular reason for R2 being 68 Ohm? same question for R2? R1? What is the purpose of D2 and D4 diodes? Would I use the OP191's output as feedback to adjust PWM duty cycle? Commented Jul 20, 2021 at 23:26
• @AlexDrake R2: it has to be a low value to speed up the switching time and thus minimize the switching loss. R1 is the pull-up for the Q1, D1 prevents cross conduction of Q1 and Q2. forum.arduino.cc/t/… D2/D4 do clamp shunt voltage to max. +/-0.65V . OP191 may not be the best choice, it has to be low offset , rail to rail, possibly with embedded input protection diodes, so you can eliminate D2/D4. Commented Jul 21, 2021 at 6:55

To minimize current ripple, you want to choose a PWM frequency whose period is much shorter than the L/R time constant of the coil. (Keep in mind that as you go higher in frequency, your drive circuitry will dissipate more power.)

For the voltage, you could use a higher voltage so that your controller can achieve 100mA with out saturating to 100% duty cycle. The effective voltage is equal to your input voltage * duty cycle. Your steady state current is calculated by dividing your effective voltage by the DC resistance of the coil.

To size your flyback diode, make sure if can handle the full current and power that the coil can handle.

On a side note, your simulation does not appear to contain the coil resistance. You should include it to get accurate simulation results.