# Best way to make a DC motor reverse direction with prop 2



## GOT (Apr 17, 2007)

Looks like I am getting a prop 2 (my first venture into computer control). I need to power a DC gear motor, make it pause, then reverse direction. What would be the best way to do this? Details like how to wire it to the prop 2 and relays (and the best relays to use - I've never worked with those either), and a quick program example would be great!


----------



## Otaku (Dec 3, 2004)

I can't offer advice on the Prop 2, but I am curious about the application. Indexing a motor without some type of sensor feedback can result in the motor stopping and starting in various positions. Time On and Time Off doesn't usually have the repeatability you'll need.


----------



## gmacted (Jan 18, 2006)

Check out this thread. It may be of some use to you.


----------



## GOT (Apr 17, 2007)

Otaku, you are probably right. Thanks for the insite. I want to raise/lower a pannel about 3ft but I do need to stop it within a few inches. I guess I need to figure out some switch for feedback. With that, I still need to figure out the whole prop 2/relay thing for a foward and reverse current.


----------



## GOT (Apr 17, 2007)

gmacted, that was a good thread, if a little brain-frying. Something to start with anyway. I think the prop 2 will help with some of those timing issues. Choice of the relay (hopefully below $10 apiece) and wiring details are my main issues. I haven't decided on a motor. It has to be strong enough to lift a 4'x4' foam board pannel with 2 servos attached at a rate of about 1' per second.


----------



## gmacted (Jan 18, 2006)

GOT said:


> gmacted, that was a good thread, if a little brain-frying. Something to start with anyway. I think the prop 2 will help with some of those timing issues. Choice of the relay (hopefully below $10 apiece) and wiring details are my main issues. I haven't decided on a motor. It has to be strong enough to lift a 4'x4' foam board pannel with 2 servos attached at a rate of about 1' per second.


The limit switches could be inputs to the prop-2 and the prop-2 then could select the direction relay (forward/reverse) via output.

A wiper motor would be a good choice. They're cheap and provide a lot of torque.


----------



## The_Caretaker (Mar 6, 2007)

Use a H-bridge for direction, do a search on wikipedia


----------



## Otaku (Dec 3, 2004)

You could also use this circuit:

http://www.hauntforum.com/showthread.php?t=10832

It can be triggered from a relay on a 2 sec. 9VDC pulse. I don't know how long you want the foam panel to stay up before dropping, but the circuit allows a 6-12 pause between the 180° rotations. You also need to add some hardware to the wiper motor to accomodate the optosensor, but it's minimal stuff.


----------



## randyaz (May 26, 2006)

You will definately need a feedback circuit (limit switches) to start, pause, and start the motor at a specific location.

An alternative would be a motor controller with a position sensor. Here is what I used... http://spooksterville.com/site/index.php?option=com_content&task=view&id=16&Itemid=25
The cost is alittle high ($56) but if you want precise contol of the shaft position and minimum hassel this is a good solution.


----------



## GOT (Apr 17, 2007)

I have some simple, physical switches that I think will work. I don't need precision. I did take Caretaker's advice and Wikied the H-bar. I found what I think is the perfect solution for me.
http://www.mcmanis.com/chuck/robotics/tutorial/h-bridge/bjt-bridge.html
I'll let you know how it turns out once I get all my stuff. Now I just have to find a couple of $10 12V reversible DC motors that spin about 150 RPM.


----------



## gmacted (Jan 18, 2006)

GOT said:


> I have some simple, physical switches that I think will work. I don't need precision. I did take Caretaker's advice and Wikied the H-bar. I found what I think is the perfect solution for me.
> http://www.mcmanis.com/chuck/robotics/tutorial/h-bridge/bjt-bridge.html
> I'll let you know how it turns out once I get all my stuff. Now I just have to find a couple of $10 12V reversible DC motors that spin about 150 RPM.


All Electronics has something that may be of interest to you. A DC Motor($6) with a gearhead($7.50) that rotates at 120 RPM @ 12V DC. Not bad for $13.50.


----------



## Otaku (Dec 3, 2004)

gmacted said:


> The limit switches could be inputs to the prop-2 and the prop-2 then could select the direction relay (forward/reverse) via output.
> 
> A wiper motor would be a good choice. They're cheap and provide a lot of torque.


Greg, I think you've got the right solution here. The SPST limit switches (roller snap switches at top and bottom of travel) would tell the Prop-2 when to cut power and pause, then select the reversed polarity output to bring the panel down. When the lower limit switch is closed the sequence stops and waits for the next trigger. The switches act as hard stops for the panel, eliminating location problems. You could even do this with an astable timing circuit.


----------



## TommaHawk (Sep 18, 2007)

Here's a diagram of my circuit driving a wiper motor in the fashion you're talking about - I use this to raise and lower a couple of different items (a small LCD monitor and a home theater remote) with a single push of a button (momentary switch). Works great and is a crowd pleaser.

It works like a CD drive on a computer - push the button and the mechanism runs until it hits one microswitch (instantly killing power to the motor). Push the button again and it reverses direction until it hits the other microswitch.

Those are 1N4001 diodes with the polarity shown with the white stripes. Common automotive 12v SPDT relays (cheap and reliable). The different wire colors apply to a relay socket I use. I'd recommend: http://www.surpluscenter.com/item.asp?UID=2008072410492122&item=11-3222&catname=electric (two of these).


----------



## TommaHawk (Sep 18, 2007)

You'd just have to figure out how to get the Prop Controller to send a quick pulse in place of the physical switch I use - whatever timings you want between it going up and going down...


----------



## GOT (Apr 17, 2007)

Gmacted, I saw that motor/gearhead. I just don't know if it is reversible.


----------



## Otaku (Dec 3, 2004)

The DC motor would be, as well as the gearhead.


----------



## GOT (Apr 17, 2007)

Here is the panel I will be raising, lowering. They will see this through a 2'x2' frosted glass pane. The pannel has a diamond in it that is illuminated with white LEDs (a light box on the fake ceiling). However, 2 servos can make the diamond get larger or smaller. I will initially hold the panel high enough that the diamond shape is just discernable, but very out of focus. I will then use the servos to make the diamond light grow larger (thus coming closer as the fake elevator "rises"). Once the diamond has reached its full size, I will lower the panel down to just inches of the frosted glass. I think if I time it right, it should look like the panel was dropping from a distance rather just three feet (that's all I got for this). Then, as the elevator "lowers", I will raise the panel to its original height and use the servos to make the diamond slowly disappear (as the elevator drops down, down, down&#8230. I think it will work. Might not be perfect but what do they expect for free.


----------



## GOT (Apr 17, 2007)

Ya, but will the motor do something nasty like make the outer casing hot and electrocute my cat as he walks by?


----------



## Otaku (Dec 3, 2004)

GOT said:


> Ya, but will the motor do something nasty like make the outer casing hot and electrocute my cat as he walks by?


LOL! Nah, cats have nine lives - he'll be fine. As for reversing the motor, I've never run into a DC motor that didn't reverse rotation when the polarity was flipped, even the large 110VAC/VDC motors.


----------



## GOT (Apr 17, 2007)

After spending $20 on components for 4 H-bars and all night coming up with a plan for soldering them up, I found out that they have H-bar chips for $2. Should have done better research.

http://graigroup.files.wordpress.com/2008/04/tech-tutorials.pdf


----------



## Garage-Of-Evil (Jul 24, 2007)

Rather then kill yourself with all the relay boards and prototyping and such, use this:
http://www.parallax.com/Store/Acces...efault.aspx?SortField=ProductName,ProductName


----------



## GOT (Apr 17, 2007)

Looks like a cool product, but I have already blown my budget. I'll have to deal with the $2 prototyping approach. Maybe next year.


----------



## JonnyMac (Apr 5, 2007)

This thread (in the EFX-TEK forums) shows how to control a motor with common relays.

http://www.efx-tek.com/php/smf/index.php?topic=653.0


----------

