Log in

View Full Version : motor - changing rotation way with one pulsd



xnihilo
- 21st April 2008, 12:59
Hello,
i wonder if someone might know.

i need to make a motor rotate in one direction then it the opposite direction everytime i send a pulse with a pic.

let's imagine i use pin ra0 of a pic16f684; i output 5v for 150ms to some mysterious/magical mcguffin ic, motor turns clockwise for 150ms. later i output again 5v for 150ms but motor will turn counter clockwise for 150ms.

motor has to change direction at every pulse and rotate for the duration of the pulse.

Does such cheap magical ic exist???

Thanks.

skimask
- 21st April 2008, 14:13
let's imagine i use pin ra0 of a pic16f684; i output 5v for 150ms to some mysterious/magical mcguffin ic, motor turns clockwise for 150ms. later i output again 5v for 150ms but motor will turn counter clockwise for 150ms.
motor has to change direction at every pulse and rotate for the duration of the pulse.
Does such cheap magical ic exist???
Thanks.
Probably not...but why not make said 'magical' IC yourself by using...oh...I don't know...something like a...well...maybe...a....PIC...
No, a PIC most likely wouldn't actually be able to DRIVE a motor, but you could easily connect it to an H-bridge setup and drive it from there.

sayzer
- 21st April 2008, 14:29
Right here it is.

http://www.picbasic.co.uk/forum/showthread.php?t=6548

I did no magic but it is possible.

Just modify it as you need.


:)

eggman
- 21st April 2008, 20:44
Another possibility is to use two relays, controlled by two pins of the PIC. One for forward the other for reverse. See the simple attached drawing

xnihilo
- 21st April 2008, 23:43
Sayzer, Eggman,

Thank you both.

regards!

PS:
Skimask: that was the idea, using a pic to control the stuff but I can dedicate only one pin to control the motor so probably the idea of Sayzer is the one that might best fit my needs... Even if I will need to use relays anyway because the motor will be more than 5V.

Jumper
- 22nd April 2008, 07:19
are you even sure the motor will have enough time to even move before the time is up?

sayzer
- 22nd April 2008, 08:41
Another possibility is to use two relays, controlled by two pins of the PIC. One for forward the other for reverse. See the simple attached drawing

It is also possible to make it using one dual contact relay.

Right here it is: http://www.picbasic.co.uk/forum/showthread.php?t=8567

However, our friend xnihilo needs to control the whole thingie with one pin.

-----------------

xnihilo
- 23rd April 2008, 07:17
are you even sure the motor will have enough time to even move before the time is up?

Yes, 150ms are enough for my 6v 340 ohms motor.

keithdoxey
- 23rd April 2008, 09:01
Sayzer, Eggman,

Thank you both.

regards!

PS:
Skimask: that was the idea, using a pic to control the stuff but I can dedicate only one pin to control the motor so probably the idea of Sayzer is the one that might best fit my needs... Even if I will need to use relays anyway because the motor will be more than 5V.

Dont forget that the relay will probably take around 25mS to operate and release so a solid state solution might be much better.

thee is also the life of the relay to consider. If you are changing direction every 150ms that is over 3.3 complete cycles of the relay every second. Even with a life of 1 million operations it will take less than 85 hours to reach that figure !!!!!

xnihilo
- 23rd April 2008, 23:26
Dont forget that the relay will probably take around 25mS to operate and release so a solid state solution might be much better.

thee is also the life of the relay to consider. If you are changing direction every 150ms that is over 3.3 complete cycles of the relay every second. Even with a life of 1 million operations it will take less than 85 hours to reach that figure !!!!!

5ms is the time it takes to activate my relay.

The motor turns everytime a shot is fired by the lasergame player (it's used as recoil simulator), I beleive he will not shoot more that a few dozen 'bullets" per game session, so player will be old before the motor is dead.

keithdoxey
- 24th April 2008, 09:16
5ms is the time it takes to activate my relay.

The motor turns everytime a shot is fired by the lasergame player (it's used as recoil simulator), I beleive he will not shoot more that a few dozen 'bullets" per game session, so player will be old before the motor is dead.

OK, understand the application now :)

I was thinking this was something that ran continuously !!!

xnihilo
- 27th April 2008, 21:21
OK, understand the application now :)

I was thinking this was something that ran continuously !!!

I finaly could find a Tubular Solednoid that may be what I need event if it still more expensive than a motor.