I still see 700uVpp ripple (vref10 node) in the pigrew's simulation.
How should your dual PWM work? What is the trick?
FYI - the best PWM equipped STM32 is the STM32F334 series. It includes 217ps resolution timers.
For example you can generate a 100kHz PWM with ~15.5bit resolution:
144Mx32/100k = 46080 (100% duty)
46080*0.7 = 32256 (70% duty)
You are absolutely correct, my simulation increases the ripple. Darn.
I've realized that the R4 100 ohm resistor is the problem. The switches are loading the output C4 capacitor, causing extra ripple. So, either that capacitor value needs increase, the series R4 needs a decrease, or the R1 values need to be larger.
I'm running into stability issues with reducing R4. 75 ohm seems OK.
Increasing R1 makes the initial transient longer, but seems OK. It may also help somewhat with charge injection.
Increasing C4 to 15u or 22u, along with increasing R1 to 200k seems to be a winner. The ripple is so small I can't zoom in that far in LTSpice. I think I need to build it and measure it at this point. However, the startup time is now a good 15 seconds for stabilization.
But, there are HF spikes on vx,x1,x2,x3 at the pulse edges. Adding a C5 from the switch drain to ground helps a little bit.
I'm still undecided between using the passive LPF and a Sallen-Key on the output. And now I've found
Linear Tech Design note 9... But it also adds to the power requirements (another 6 mA).
Try the attached simulation? I'm sure it's not perfect, but it seems close. I don't know if the 2nd switch is a good idea or not. I can't see much of a difference in simulation. I added a (commented out) parameter step in the simulation to change the PWM phase. Having the pulses back-to-back seems optimal. However, it seems good enough without the 2nd switch, and there would be fewer of the big spikes to add offset, as I expect the spikes to be temperature/frequency dependent.
Do we have a target spec for the turn-on transient time?
The STM32F334 HR timer does look interesting, but using 10 mA makes it less than ideal. I looked around and I think that the MSP430F51 has a similar type of circuit running on a dedicated high frequency oscillator, but I _think_ has a lower power footprint. I just ordered a few free samples, and I'll see if I can get a HR PWM going (it'll take a good week for them to be delivered, so no results on that sooner. The analog stuff is more interesting, anyway.).