I want to drive a pump regulator from an Arduino. The pump regulator takes an analog input 0-10 VDC (+-0.5% resolution, <%0.2 ripple). I have a 24V supply available. Keeping things simple, I see three options:
PWM -> low side mosfet fed from a 24 to 10V buck converter -> RC filter ->
PWM -> RC filter -> OP-amp fed from 24V ->
I2C/SPI -> DAC -> OP-amp fed from 24V ->
0.5% resolution is ~200 levels -> 8-bit. 0.2% is ~20 mV ripple. So the resolution is probably not a problem, but I'm not sure how practical it is to achieve ~20 mV with the PWM solution. Ripple is usually a tradeoff against response time, but the datasheet of the pump regulator doesn't seem to specify that. What would you go for?
The resolution and ripple are unrelated. The ripple is a measure of how constant the output voltage is, and that is entirely determined by the DAC output impedance and voltage regulation (an RC filter provides no voltage regulation).
I would use a 0-10V DAC module. This one should work standalone, but you may need to buffer the output with a low impedance voltage follower (op amp).
Yes agree, unrelated, but they are two of the factors to consider when choosing a solution right. Thanks, that's an interesting module, which I guess has a boost circuit on it. But I'm looking to do a custom circuit/PCB so that I can connect everything more cleanly.
Depending on the rate at which the voltage will need to change, PWM is certainly suitable.
You need a fast PWM and a decent filter as explained here. https://www.skillbank.co.uk/arduino/pwm2.htm
You can use the circuit shown, and use the second op amp in the package to amplify the signal to the voltage you require.
You will need to choose an op amp that will run rail-rail if you want to get near 0V out.
Alternatively provide a negative voltage rail. https://www.skillbank.co.uk/arduino/op-amps.htm
Very practical, but it depends on how fast you want the signal to settle on a new value. Given that it's a pump regulator, it probably doesn't have to be very fast at all. This means you could R/C filter the heck out of your PWM signal, making it very stable indeed. It'll just be kind of slow to respond to (large) changes in PWM duty cycle.