creating 0-10v analog output with lm324n

Hello. I need to control an ABB VFD with 0-10v analog input. So i need arduino to output 0-10v. I found a schematic from this page http://aqualedsource.com/shop/download/PWM2Ballast-0v-10v_converter.pdf . It uses lm324n op amp. As i am a noob, when it comes to electronics i have a question about the ground connection. I have an arduino, which gets its power supply, lets say from USB. The 12v comes from a different AC/DC adapter. How should i make the connections? Should they both be supplied from the same source? Or I just put grounds together?

Thanks in advance

Is the output Only 0 & 10V? Or do you need voltages in between too?

I need values between also. Its a water sparying equipment and i need to control the pump via VFD to get different amounts of water.

All GNDs need to be connected, they form a common reference point.

R2 & C1 make a lowpass filter, so PWM from arduino looks like a DC level. The op amp and R7/R1 make an amplifier with gain of (1 + R7/R1).