Shop OBEX P1 Docs P2 Docs Learn Events
Motor control? — Parallax Forums

Motor control?

orrinbareorrinbare Posts: 32
edited 2011-06-10 12:25 in BASIC Stamp
I have a bs2 on the super carrier board. My goal is to use a bi-directional motor with a spool to lift an object. The problem is I need to get from the 5 volt output of the stamps pins and vdd to the voltage needed by the motor. My original thought was to use 2 relays. one dual pole, dual throw relay to control the direction of rotation and another relay to simply turn off and on the power to to the other relay. i have a separate power source for the motor so thats not the issue. my problem is i can't get the bs2 to throw the relay. its a 5 volt relay and when i touch the coil leads directly to the vss and vdd i can here it throw, but when i connect one end to vss and the other to a pin and program the pin high, it won't throw. my multimeter shows voltage going through, but only 1.5 to 2 volts. I read that the bs2 can't power a relay so i stopped trying, but i need a way to make this work without buying a motor controller.

an alternative solution would be to use the servos that came with my boe bot to lift the object, but i'm fairly certain they don't have the torque. i need a way to somehow lift the object using the motor or servo and basic radio shack parts. I can order online for parrallax if i have to, but i'd like to get this project finished soon.

thanks so much for any advice or input!

Comments

  • LeonLeon Posts: 7,620
    edited 2011-06-03 15:26
    Use an L293 H-bridge.
  • Mike GreenMike Green Posts: 23,101
    edited 2011-06-03 17:04
    Nuts and Volts Column #6 discusses the use of a driver transistor for a relay or small motor. The Stamp I/O pins can't handle the amount of current needed for most relays, so an external switching transistor is needed. Go to the main Parallax webpage and click on the Resources tab. You'll see a link to the Nuts and Volts Column index.

    You can also use an L293 H-bridge or its equivalent, but a relay will work fine for simple on/off and reversal.
  • ercoerco Posts: 20,256
    edited 2011-06-03 17:57
    Two SPDT relays make a more versatile controller than one SPST and one DPDT. Have a look at my favorite setup at http://forums.parallax.com/showthread.php?106382-4-State-Relay-H-Bridge&highlight=relay+h-bridge
  • orrinbareorrinbare Posts: 32
    edited 2011-06-05 22:26
    thanks for the help guys! @ Leon The h bridge is one good idea, but the transistor will work fine for what i'm doing, i may use that in the future though. @ Mike, I had never even tried the nuts & volts column before, I had no idea it was so useful! So the transitor basically acts like a very small relay that i can use to switch a bigger relay if i'm understanding correctly. this opens up a lot of possibilities for me. @ erco, it would probably be simpler, but i'm going for redundancy with this project. it will be used in a chicken coop to open and close a door to keep anything outside from getting in to the chickens at night, this thing needs to be able to be as safe as possible and if a programming or other mistake throws my dpdt relay at the wrong time it just tries to close a closed door or open and open one, the limit switch stops it immidiatly, no harm done. but if somehow both single pole relays were to come on at the same time and send current to both poles of the motor that could cause problems correct? the extra spst relay just cuts all power to the dpdt relay so that it doesn't have to relay on the limit switches to stop the motor. like i said, redundancy. in my experience, simple isn't always safe.
  • Mike GreenMike Green Posts: 23,101
    edited 2011-06-06 09:16
    If you use one of erco's circuits, you'll be fine. If you use the 2nd circuit (Fwd/Rev/Brake/Coast), you have a choice. The way he shows it, the motor is dynamically braked when everything is off. That means that the motor is hard to turn with power off. If you supply current to both relays, the motor is allowed to coast (turn freely). If you swap the NC and NO connections, the motor will coast with power off and is dynamically braked when both relays are on. Both are useful. It depends on what you're using the motor for.

    Remember that the diodes added in the coast circuit have to handle the full current of the motor (whatever that is). The maximum current drawn by a motor can be several times the "running" current (when moving freely at full speed).
  • orrinbareorrinbare Posts: 32
    edited 2011-06-06 18:25
    yeah, i definatly understand the usefullness of his idea, its just not something that would matter on this project. I'm controlling a 6 volt dc bi-directional motor that is driving a spool thats pulling up a .5 lb metal sliding door in our chicken coop. when the current stops flowing, the motor stops immediately anyway, no need for brakes
  • ajwardajward Posts: 1,130
    edited 2011-06-08 14:11
    Hey erco...
    erco wrote: »
    Two SPDT relays make a more versatile controller than one SPST and one DPDT. Have a look at my favorite setup at http://forums.parallax.com/showthread.php?106382-4-State-Relay-H-Bridge&highlight=relay+h-bridge

    Laying this out on one of my breadboards this afternoon. Didn't have the relays, but an excellent excuse to buy a few more gadgets!! (She who dies with the most gadgets wins!) ;-)
  • ajwardajward Posts: 1,130
    edited 2011-06-08 15:07
    ajward wrote: »
    Hey erco...

    Laying this out on one of my breadboards this afternoon. Didn't have the relays, but an excellent excuse to buy a few more gadgets!! (She who dies with the most gadgets wins!) ;-)

    So for so good. Haven't added the coasting diodes... not sure those would be needed with the small critter I have in mind.
  • ercoerco Posts: 20,256
    edited 2011-06-08 22:49
    If you get some Schottky diodes with just 0.3V drop, you'll love 'em. It's worth the risk. Plus, NOBODY ELSE has ever done it besides me. Only you and I will be privy to the wonder of coasting and braking, and it will our little secret!

    Just DO IT, ajward! You'll do the right thing!
  • orrinbareorrinbare Posts: 32
    edited 2011-06-10 12:25
    actually erco i just saw it in a section of the nuts and volts column lol.

    Hey, got a question for y'all. The motor is out of a small drill. its 4.8 volts. the power supply i like 7.6 or something on my meter (the power supply is rated at 6 volts, but my meter says otherwise). the power supply used to charge a set of batteries and the batteries powered the motor. The power supply will now be plugged in permanently and the relay will allow power to the motor twice a day, for about 2 seconds each. Will this small amount of use hurt the motor with 7 volts? it seems like it might, if so how can i step down the voltage? if i use a resistor to do it, that would work wouldn't it? i don't know what to do here
Sign In or Register to comment.