Maker Pro
Maker Pro

Controlling a motor.

CyberWizard

Sep 17, 2014
15
Joined
Sep 17, 2014
Messages
15
I'm still trying to learn eletronics, can someone tell me if this can work or where did i went wrong?
Trying to make this work as a Segway motor controller, when I lean ( forward or backward) I offset the variable resistor causing the op amps to respond.

 

Gryd3

Jun 25, 2014
4,098
Joined
Jun 25, 2014
Messages
4,098
Two problems.
One bigger than the other.

Look at your transistors.
OpampA triggers both Q1 and Q2... there will be no current flow through the motor.
OpampA must trigger two diagonally opposite transistors, and OpampB gets the other two.
Q1 + Q4, and Q2 + Q3
There may be something I have missed, but that's what popped out at me right away.

The other thing to note is that you are digitally controlling a motor that may require a more 'analogue' control to remain stable. This is not as important as the first note though.
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,752
Joined
Nov 17, 2011
Messages
13,752
Welcome to our forum.
The schematic is a bit small, so it's hard to recognize what the voltage at U2:A, pin2 or U2B, pin5 respectively is.

Your circuit is based on the right idea, but has some drawbacks if not outright faults:

- the collectors of Q1 and Q2 are not connected to the positive supply.

- the emitters of Q3 and Q4 are not connected to ground (or negative supply).

- assuming that the voltage at U2:A, pin2 (see above) is a reference or threshold, either U2:A or U2:B will output a high positive voltage. These amplifiers are not operated in a linear region, so their outputs are either a high positve voltage or a voltage near ground. How near to Vcc or GND depends on the specific type of amplifier. If you don't use rail-to-rail opamps, you'll see a few volts above GND or below Vcc.

- if you were thinking to create a variable speed control using this setup: it will not work for the following reasons:
1) the opamps are either high or low at the output, see above. No analog control voltage will develop.
2) even if you were to modify the opamp circuit such that it creates an output voltage proportional to the position of the potentiometer, you would almost instantly destroy the transistors. Why? Because if e.g. Q2 and Q4 are both conducting only a bit, a high short circuit current will flow from VCC through Q2 and Q4 to ground creating nothing but losses (heat) in the transistors. You don't operate an H-bridge in linear mode, you use e.g. PWM to turn the transistors always completely on or off.
3) as it is connected, U2:A would turn on Q1 and Q2 simultaneously. This will pt both ends of the motor in connection with Vcc. The motor will not turn. LIkewise will U2:B turn on or off Q3 and Q4 simultaneously, connectig both ends of the motor to GND which will also not provide power to the motor.
No power, no torque.
An H-bridge (i suppose that's what you meant to construct) works by turning on Q1 and Q4 while Q2 and Q3 are off and vice versa.

- the circuit lacks any regulation or feedback. A segway is not just controlled by powering the motors a bit more or less in either direction. A segway contains a controller (e.g. PID type) that has the input from the driver (leaning forward and backward) as well from the vehicle (speed, tilt, ...) and uses the feedback algorithm to stabilize the vehicle. You may want to peruse this article for more information.
 

CyberWizard

Sep 17, 2014
15
Joined
Sep 17, 2014
Messages
15
Thanks all for the replys :p ( Specially Harald Kapp cheers for the detailed info )
I updated the scheme, heres how it looks now ( AND WORKING )!
 
Last edited:

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,752
Joined
Nov 17, 2011
Messages
13,752
Work it may, but only in your simulation. The opamps are still operated as comparators. Also with a real opamp you will still loose lots of power in the transistors.
Look for example at Q1. If U2:B's output is at Vcc, the emitter of Q1 will be at Ve=Vcc-Vbe=Vcc-0.6V (approx.). Therefore since the voltae at the collector is Vcc, the voltage Vce is Vce=Vcc-Ve=Vcc-(Vcc-0.6V)=0.6V. Power loss in Q1 will be P=0.6V*Ice.
If you were to fully saturated Q1, Vce could be as low as 0.2V...0.2V which will reduce the power loss to 1/3 or 1/6 of your circuit.
It is standard pratcice to use complementary transistors here: NPN (or NMOS) in the lower legs of the bridge, PNP (or PMOS) in the upper legs. You need additional circuitry to generate the inverter control signals for the transistors in that case.

Also you still have no regulator. Your motors wil either fully accelerate forward od backward. I see no way to run them at controlled speed - and no way to stop them.
 

Gryd3

Jun 25, 2014
4,098
Joined
Jun 25, 2014
Messages
4,098
Work it may, but only in your simulation. The opamps are still operated as comparators. Also with a real opamp you will still loose lots of power in the transistors.
Look for example at Q1. If U2:B's output is at Vcc, the emitter of Q1 will be at Ve=Vcc-Vbe=Vcc-0.6V (approx.). Therefore since the voltae at the collector is Vcc, the voltage Vce is Vce=Vcc-Ve=Vcc-(Vcc-0.6V)=0.6V. Power loss in Q1 will be P=0.6V*Ice.
If you were to fully saturated Q1, Vce could be as low as 0.2V...0.2V which will reduce the power loss to 1/3 or 1/6 of your circuit.
It is standard pratcice to use complementary transistors here: NPN (or NMOS) in the lower legs of the bridge, PNP (or PMOS) in the upper legs. You need additional circuitry to generate the inverter control signals for the transistors in that case.

Also you still have no regulator. Your motors wil either fully accelerate forward od backward. I see no way to run them at controlled speed - and no way to stop them.
Playing with the comparator references could allow for a 'dead band' right in the middle.
It would also be good a good idea to put in diodes to protect the transistors if this circuit was to get built.
 

Arouse1973

Adam
Dec 18, 2013
5,178
Joined
Dec 18, 2013
Messages
5,178
Isn't that strange, I work with one of the guys that designed part of the SEGWAY when he worked for BAE Systems. I have actually seen footage of him driving the first prototypes around an office block. He showed me the large Gyro housing used for controlling the balancing, it's very impressive I must say.
Adam
 
Top