I am making my first Custom PCB design, I have to control VFD by 0- 10V using ESP32 0- 3.3V PWM signal
I came to know I should use an op-amp so I choose LM358 and then simulated it on Proteus. At a gain of 3.03, I am getting exactly what I want, but I am worried about the result in reality vs simulation
I need a suggestion, will this circuit be okay, or should I do some modifications
I moved your topic to an appropriate forum category @leansolution.
In the future, when creating a topic please take some time to pick the forum category that best suits the subject of your topic. There is an "About the _____ category" topic at the top of each category that explains its purpose.
I am not sure what you want to achieve or if your circuit will achieve that. Your circuit will change a 3.3V PWM signal into a 10V PWM signal, not a 0-10V analog signal. Which did you want?
If you want a 10V PWM signal, there are simpler circuits to achieve this.
A common LM358 is no a rail2rail opamp.
It's supply needs to be about 3.5volt higher than the required output voltage.
A 12volt supply might not be enough to output 10volt.
Leo..
Can you give a description of the VFD drive controller you are interfacing to. There may be other ways, apart from the OP amp solution, to deliver a 10v PWM signal using the 12v supply, an Arduino and maybe a couple of transistors.
Oops I missed that. It is the same principle but with the low pass filter design which has been previously mentioned.
I played around with some values to get reasonable ripple across the range.
The opamp solution proposed in the OP could also be better maybe also using another opamp as a buffer.
With the values here and 2000Hz PWM 0.2% duty cycle give 500mV and 80% duty cycle gives 10 volts.
I reproduced your simulation of the DC based circuit. But with PWM input the circuit inverts the pulses. This apparent phase inversion or whatever rather puzzles me but I confirmed it by first simulating with pulsed input instead of DC and then with a scope on a test circuit. I used a TL072 opamp, which I think is roughly equivalent to your LM358.
Two example results: both used a frequency of 500 Hz and a 1.0V
amplitude pulse signal from my sig gen.
With duty cycle set to 50% output was. 9V
A duty cycle of 25% delivered average DC output of 7V.
As already suggested up thread, you can if necessary add RC smoothing to the opamp’s output.