isolated 5v PWM to 0-10V
No this circuit wont work. I tried it out and I did not work because of many reasons.

when opto is switched on 12 volts is being provided to the base of Q1 and Q2.
therefore, Q1 switches on and provides 12 volts to RC Low Pass filter.
But , when opto is switched Off , base of Q1 &amp; Q2 is grounded by 20k resistor which dramatically increases the switch on time of Q2, because of which we get a triangular waveform at the RC network and not a 12volt square wave.

to solve this issue, I reduced r17 to 1k to reduce switching on time of Q2. this created more problems . Now when Opto is switched on , 12 volts gets divided between r16 and r17 and base of transistor now gets 6v at 100% duty cycle. and because Vbe = 0.7v , we are getting 5.3v at the emitter of Q1.

to solve all these issues , use two opto couplers instead of Q1 and Q2 and no need of u9 , r16 and r17. Works flawlessly.