# Need help to understand circuit!!!

#### pppopey

Joined Sep 27, 2011
13
Hi everyone

This following schematic is of a 24V DC motor speed control circuit that can handle a little bit over 10A.

Could anyone help me in the basic understanding of this circuit, how it works and what do the main components do.

It'll be a big help.

If you need anything else please let me know.

PS: In the schematic, getting rid of the jumper makes it 24V. IC = lm324, TR2 & TR3 = 9013, TR4 = 9012, TR1 = BC547, Zener = 10V, Mosfet = IRF3205

#### Attachments

• 68.2 KB Views: 100

#### t_n_k

Joined Mar 6, 2009
5,455
Overall it looks like a pulse-width modulated system. IC1/1 is an oscillator - triangular wave - which establishes the baseline switching frequency. IC1/2 is a comparator which sets the pulse width in conjunction with the control pot VR1 and the oscillator output signal. Changing VR1 changes the PWM depth and hence the average DC voltage applied to the motor. TR2,3&4 form a low impedance gate drive switching interface between the PWM generation and the switching MOSFET. TR1,ZD1,R11,R12,C3 are a DC regulator to provide a smooth regulated DC to the aforementioned parts of the circuit. D2 is the free-wheeling / motor back emf protection for the MOSFET. I think D1 probably prevents reverse discharge of the DC regulator input capacitance C4 through the load, when the MOSFET turns on.

#### SgtWookie

Joined Jul 17, 2007
22,230
D1 protects the circuitry if the power leads are reversed, and prevents discharge of C4 when the MOSFET turns on. C4 provides filtering to the input power. Jumper J would be removed for 24v operation, installed for 12v operation; R12 is a much lower value resistor than R11. ZD1, likely a 12v Zener diode, maintains a steady voltage on C3. TR1's emitter will follow that voltage, but about 0.7v lower; C5 will therefore be charged to about 11.3v. Essentially, R11/R12/J/C3/C4/ZD1/TR1 are a low-dropout voltage regulator.

IC1/1 is a free-running astable multivibrator. The output at pin 7 would look like a square wave. C1 is charged/discharged via R4 from/to the output on pin 7. The wave form on C1 resembles a triangle.

When pin 6, the inverting (+) input (connected to C1), is lower than the non-inverting (-) input, the output (pin 7) goes high. C1 charges via R4 until the inverting input goes higher than the non-inverting input. When that happens, the output goes low. This starts discharging C1, and also changes the voltage at the junction of R1/R2/R3, a set of resistors that are likely all the same value.

If the output is low, R2 and R3 are essentially in parallel, so the voltage at the junction of the three resistors will be 1/3 the supply voltage.
If the output is high, R1 and R3 are in parallel, so the junction will be at 2/3 the supply voltage.

The frequency of oscillation is controlled by the values of R4 and C1.

IC1/2 is used as a comparator. The triangle wave on C1 is fed to the inverting (-) input, and the non-inverting input has a reference voltage from pot VR1. R5 and R6 serve to keep the pot adjustment range to permit 0% to 100% PWM duty cycle output.

The LM324's output won't go higher than about Vcc-1.5v (in this case, 11.3v-1.5=9.8v), so TR2 is used to get the extra 1.5v back. R7 limits the base current, R8 ensures TR2 gets turned off when IC1/2's output is low.

R9 sources current to pull up the collector of TR2 when it's not conducting.
TR3 and TR4 are a common collector voltage follower. They multiply the small amount of current sourced by R9 and sunk by TR2 to charge/discharge the gate of the MOSFET much more quickly than would be possible without them. R10 keeps the MOSFET turned OFF in case there is a failure of R9 or TR3. D2 is the flywheel diode; without that, there would be no path for current when the MOSFET turned off, and the voltage on the MOSFET drain would rapidly increase until the MOSFET breakdown voltage was exceeded, damaging it.

[eta]
Whoops, when I started typing, nobody else had replied yet. But, Jony's highlighting of the functional blocks will help a lot to follow my narrative.

Last edited:

#### t_n_k

Joined Mar 6, 2009
5,455
D1 protects the circuitry if the power leads are reversed, and prevents discharge of C4 when the MOSFET turns on.
I didn't mention the D1 reverse polarity connection issue because a reverse "short" current would still flow via the MOSFET intrinsic reverse diode and the diode D2.

#### pppopey

Joined Sep 27, 2011
13
I am seriously amazed by the level of detail everyone put in the replies. Thankyou so much t_n_k, SgtWookie, Jony130.

I am a second year electronic student and I am trying to build a motor speed control circuit for a 24V, 300W motor.

If it is not too much to ask for, as you guys have already provided me with such intense detail of the working of the circuit, I have the values of the components of the schematic, attached to this thread.

It is actually a schematic of a motor speed control for 12/24V motor with max current handling ability of upto 15A. Could you be able to guide me how to approach for calculating eg: the resistor values, what kind of output am I looking for out of IC1 and IC2. And biasing the transistors and mosfets, as these terms are still new to me.

I want to learn as much as I can about this schematic's working and its calculations for component values and component choice.

#### Attachments

• 175.9 KB Views: 42

#### t_n_k

Joined Mar 6, 2009
5,455
Attached some results of simulation

#### Attachments

• 8.6 KB Views: 45
• 23.2 KB Views: 47

#### pppopey

Joined Sep 27, 2011
13
thanks so much for the simulations - t_n_k, Appreciated !!!

#### pppopey

Joined Sep 27, 2011
13
The frequency of oscillation is controlled by the values of R4 and R2.
you mentioned that the frequency of oscillation is controlled by R4 and R2, do you know whats the formula for that?

#### SgtWookie

Joined Jul 17, 2007
22,230
you mentioned that the frequency of oscillation is controlled by R4 and R2, do you know whats the formula for that?
That was a typo; frequency is actually controlled by R4 and C1.

The approximate calculation for frequency is 1/2.2*R4*C1.
So, if R is 50k and C1 is 0.1uF (100nF), you'll get about 91Hz for the base frequency. It's not an exact formula, but it's close enough.

The LM324 is a slow opamp, and the MOSFET driver is less than optimal. If you increase the frequency significantly, you will wind up with the MOSFET spending more time in the linear region generating heat. Decreasing the frequency will result in more core losses in the device being powered.

#### pppopey

Joined Sep 27, 2011
13
Essentially, R11/R12/J/C3/C4/ZD1/TR1 are a low-dropout voltage regulator.

Why do we need a voltage regulator at around 10V in the circuit?

#### pppopey

Joined Sep 27, 2011
13
The LM324 is a slow opamp, and the MOSFET driver is less than optimal. If you increase the frequency significantly, you will wind up with the MOSFET spending more time in the linear region generating heat. Decreasing the frequency will result in more core losses in the device being powered.
What do you suggest i do? Some one suggested me a 555 timer would be a good oscillator for this circuit and another suggested a LM393 chip.

#### SgtWookie

Joined Jul 17, 2007
22,230
Why do we need a voltage regulator at around 10V in the circuit?
The unit was designed to operate from both 12v and 24v. If a MOSFET Vgs (voltage on the gate referenced to the source terminal) exceeds ±20v, the MOSFET will be destroyed.

The regulator mainly protects against this happening while operating from 24v, but will also protect against surges/transients when operating from 12v.

#### SgtWookie

Joined Jul 17, 2007
22,230
What do you suggest i do? Some one suggested me a 555 timer would be a good oscillator for this circuit and another suggested a LM393 chip.
It would actually be better to use a couple of LM311 single comparators, as they can sink more current than LM393 (dual) or LM339 (quad) comparators can. All of the mentioned comparators have open-collector outputs, which means that they can sink current, but not source current - so they need a pull-up resistor on the output to serve as a current source.

As an alternative to using a pair of comparators, a 555 could be substituted for the triangle wave generator, and the remaining comparator can compare the triangle wave to a reference signal.

#### pppopey

Joined Sep 27, 2011
13
thanks for that Sgt!!!

by the way, i have a concern. I got told that mosfet switches in khz range. my operating frequency is 100hz. 1/(2.2 * 50k*100uF) = 100hz.

Is this going to be the same as the mosfet switching frequency? If so, shouldn't it be in khz range for the mosfet to work properly dissipating less power?

#### pppopey

Joined Sep 27, 2011
13
This is the schematic I made. I tried it on breadboard and powered the scooter with it so i can say very well that it worked. I tried the previous schematic but it did not work, specially the drive circuit.

The mosfet was not switching on properly and so was heating up. A friend of mine told me to put this circuit with the 2 BJTs. He did no know the theory behind it bt told me that i will work. And it did. I do not know how and why it works, nor do i know the calculations.

Could I please ask you to explain me a little how this circuit works and how the two BJTs work well for the Mosfet driving. By the way, the frequency I am operating is at 80Hz and the scooter is able to run well without the mosfet getting hot.

PS: R4 is 5K, not 2.5K

#### Attachments

• 113.8 KB Views: 22
Last edited:

#### pppopey

Joined Sep 27, 2011
13
It would actually be better to use a couple of LM311 single comparators, as they can sink more current than LM393 (dual) or LM339 (quad) comparators can. All of the mentioned comparators have open-collector outputs, which means that they can sink current, but not source current - so they need a pull-up resistor on the output to serve as a current source.
Thanks SgtWookie, I tried the above but for some reason the circuit seems to work better in reality with the LM324N.

I just uploaded my schematic that I made. It works in reality but I did it through trial and error and I need proper understanding of it why it works.

If I can once again please ask you to give me a detailed overview of this circuit with any calculations ideas if possible, just like you did it the first time I uploaded one.

I loved your explanation, you have no idea how much it helped.

It would mean a great deal to me sir.

#### Attachments

• 113.8 KB Views: 22

#### SgtWookie

Joined Jul 17, 2007
22,230
Your schematic isn't terribly different from the other one, but there are changes for the worse.

I don't know why you have the values of R5 and R6 so low? Much of the travel of the PWM % pot will not have any effect, and the middle range will be very sensitive.

You replaced the original 10v regulator with a 78L12. If you're going to operate on 24v, that will be OK - but not for 12v, as the output will never get to 12v, so it will not be regulated. This will cause the PWM% to change with battery voltage. The original regulator was a low-dropout 10v regulator, that will work pretty well down to ~11v input.

The 78L12 is not rated for large voltage spikes, so the reverse-EMF of the motor will probably kill it quickly.

You've replaced the voltage follower gate driver with a single saturated switch. I don't know why you did that.

I went through and explained how the original circuit worked, and now you have made a number of changes that will result in problems, for what reasons I don't know.

#### pppopey

Joined Sep 27, 2011
13
sorry, R5 is 5.6K and R6 is 4.7K, and potentiometer is 10k... I was actually testing with the scooter's throttle which worked at the other values... but I am using the 10k potentiometer only. Sorry, I forgot to include that.

And i plan to operate at 24V only

#### pppopey

Joined Sep 27, 2011
13
The 78L12 is not rated for large voltage spikes, so the reverse-EMF of the motor will probably kill it quickly.

You've replaced the voltage follower gate driver with a single saturated switch. I don't know why you did that.
what can I add to 78L12 to protect it from large voltage spikes?

the voltage driver, I made the previous one and tried it thrice, checking all the connections, but it did not work properly. That is why I had to try another one.

In this driver, the MOSFET switches ON and OFF all the way