# Analysis generate PWM use op-amp.

#### Sakamoto21

Joined Jan 20, 2023
9
Please help me to understand this circuit about analysis voltage each point and how to calculate time charge and discharge time on triangle signal.
If use Op-Amp NJM2904C
Thank you.

#### Attachments

• 107.6 KB Views: 26

#### KeithWalker

Joined Jul 10, 2017
2,724
Is this homework? If so, we need to see your best effort before we can offer any help.
I designed a circuit almost identical to this to be used as a radio controlled motor controller for electric flight.thirty years ago:

#### crutschow

Joined Mar 14, 2008
31,580
The output slew-rate of that op amp is 0.6V/μs typical which gives a rise and fall time of the 5V square-wave to the MOSFET gate of about 3μs, which may be slower than desired for fast switching of the MOSFET.
For a faster signal you could use comparators instead of op amps.

#### Sakamoto21

Joined Jan 20, 2023
9
Is this homework? If so, we need to see your best effort before we can offer any help.
I designed a circuit almost identical to this to be used as a radio controlled motor controller for electric flight.thirty years ago:
It's not homework. I interest for this circuit I try to calculate and simulate follow file attach, I'm not sure that.

#### Electron Design

Joined Jan 20, 2023
14
Please help me to understand this circuit about analysis voltage each point and how to calculate time charge and discharge time on triangle signal.
If use Op-Amp NJM2904C
Thank you.
You need an oscilloscope to measure the charge and discharge time. There are formula’s on the internet but with an scoop it much easier. Good luck!

#### Audioguru again

Joined Oct 21, 2019
5,595
I agree that the lousy old NJM2904 (copy of an LM358) is too slow for PWM. Usually a very fast comparator (not an opamp) is used for PWM.
Also, with a supply that is only 5V, the output high voltage of the NJM2904 opamp is only 3.8V which is too low to turn on most Mosfets. The output high voltage of a comparator would be 5V.

Isn't the oscillator frequency heard as a whistle produced by the motor? It should be ultrasonic.

#### Audioguru again

Joined Oct 21, 2019
5,595
My simulation uses a modern dual opamp that is almost "rail to rail" and the frequency of the oscillator is 9346Hz that most people can hear:

#### Attachments

• 17.5 KB Views: 7

#### KeithWalker

Joined Jul 10, 2017
2,724
I agree that the lousy old NJM2904 (copy of an LM358) is too slow for PWM. Usually a very fast comparator (not an opamp) is used for PWM.
Also, with a supply that is only 5V, the output high voltage of the NJM2904 opamp is only 3.8V which is too low to turn on most Mosfets. The output high voltage of a comparator would be 5V.

Isn't the oscillator frequency heard as a whistle produced by the motor? It should be ultrasonic.
When I designed my RC motor controller, I used LM358 opamps because that was what was readily available. The switching was fast enough to drive the three FETs in parallel for a 20A motor without any heating problems.The switching frequency was around 1KHz which did produce a slight audible tone. That was an advantage because then I knew when it was working correctly. The switching frequency was high enough to avoid motor commutation problems which was all that was really important. I got around the problem of getting enough voltage to drive the FET gates by putting the receiver +5V supply in series with the motor battery. I built and ran quite a number of them for years until suitable brushless motors became available.
I found out many years ago that a circuit does not have to be optimized to the ultimate extreme to make it work reliably and successfully.
P.S. I did not do an in-depth analysis of the circuit before I built it. The bits I was not sure about were designed on a breadboard by trial and error.

#### dl324

Joined Mar 30, 2015
15,511
Attached is a National Semiconductor application note showing this oscillator using a comparator. The calculation for the upper and lower trip points is simplified by choosing R1=R2=R3. I noticed that they didn't show the equation for Va2 when this wasn't the case. This is the equation for both trip points without requiring them to be the same value:

EDIT: Add application note regarding hysteresis:

#### Attachments

• 66 KB Views: 5
• 125.4 KB Views: 2
Last edited: