Maker Pro
Maker Pro

Parallel port motor control

foxmjay

May 12, 2011
5
Joined
May 12, 2011
Messages
5
Hello Guys,

Please i need some little help and suggestions. the idea is to control a DC normal motor in both 2 directions using Parallel port.

I managed to get this working the schematic is attached. The batteries V1 and V3 are where 2 PINs from parallel port are supposed to be connected ( was just testing using the simulator) . The parallel port output is about 2V .

The problem is even if i measure the output voltage to the motor which it's about +/-5V , the turn force of the motor is not the same as if i supply it directly with 5V . i was wondering what cause this but can't figure it out . Please if someone have any suggestion that will be great.

Thanks
 

Attachments

  • motorCtrl.jpg
    motorCtrl.jpg
    122.9 KB · Views: 334

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
The LM324 almost certainly can't swing its output all the way to the supply rails (thus reducing the potential voltage to the motor) and it also may not be able to switch the current required for the motor (which will compound the first problem).

Using the op amp to switch mosfets would probably be the simplest solution.
 

foxmjay

May 12, 2011
5
Joined
May 12, 2011
Messages
5
hmm, i've also tried with LA6324N but it seems it has the same characteristics as the LM324. do you know any one that could work better in this case ?.

Thanks
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
Using the op amp to switch mosfets would probably be the simplest solution.

Alternatively, you should look for an op-amp with mosfet output and capable of driving the current required for the motor. Since you don't specify the current required, I can't be much more specific.
 

foxmjay

May 12, 2011
5
Joined
May 12, 2011
Messages
5
hmm Mosfet transistor where the hell i can find one , and where can i connect it XD . I'll try look for a high current op amp 1st.

Thanks a lot for your help .
 

foxmjay

May 12, 2011
5
Joined
May 12, 2011
Messages
5
Finally got this working , i've used the H-bridge circuit, the schema is here : http://postimage.org/image/1kn4oi1b8/
And a little play around with it
:D

Here is a sample Python code to use parallel port if someone need it :

import parallel #import library
p=parallel.Parallel() # initialize parallel

p.setData(0x40) # send the data to the 8 parallel ports in Hexa 0x40 it's 0100 0000 , that's mean it will send the 2V (i think ) on the 7th pin and 0V to the
 

Resqueline

Jul 31, 2009
2,848
Joined
Jul 31, 2009
Messages
2,848
As usual with these simple bridges; be aware that if both inputs happen to be high at the same time the power supply will be short-circuited.
So in software, make very sure you turn off one output before turning on the other. Using all four separate inputs to the bridge you can implement motor braking.
 

foxmjay

May 12, 2011
5
Joined
May 12, 2011
Messages
5
Oh hm, i didn't notice that it may have a short-circuit , Thanks i'll make sure to not send on both. do you have any idea how to prevent short-circuit in this bridges circuit , or is there other ways ?

Thanks
 

Resqueline

Jul 31, 2009
2,848
Joined
Jul 31, 2009
Messages
2,848
I don't have a link at hand but there are circuits out there implementing such control protection in hardware, at the expense of a couple of extra transistors or digital gates.
 
Top