Society of Robots - Robot Forum

Electronics => Electronics => Topic started by: andrwo2 on April 08, 2012, 05:56:29 AM

Title: URGENT please @ Controlling motors
Post by: andrwo2 on April 08, 2012, 05:56:29 AM
 Hey guys ,  im really pressed to submit my project and i just can't figure out how to control it !!

i have  two  24 volt motors  that are gonna be mounted by 12 volt 50 amph  car battery  to drive a wheelchair

i want to use  any kind of control  either  relays , H-bridge  or pic 16F877A 

TO be able to to have  4 working stats  :  1 -   2 motors going forward
                                                                  2 -  2 motors going backward
                                                                  3 -   first motor forward , second motor backward
                                                                  4-   first motor backward , second motor  forward
 I dunno this could be done through joistics ? or 2  toggle switchs  ( 1 forward reverse , the other left and right )
i really have no clue at all of how to do it  as im a mechanical engineer !   
 waiting for your helps

if anymore info needed  im always online :)
Title: Re: URGENT please @ Controlling motors
Post by: Soeren on April 08, 2012, 11:42:36 AM
Hi,

Hey guys ,  im really pressed to submit my project and i just can't figure out how to control it !!
Seems you should have started earlier then!

Never ever write "URGENT" in a subject line - it's not urgent to anybody besides you and may make people ignore you for a while/completely.


i want to use  any kind of control  either  relays , H-bridge  or pic 16F877A 

TO be able to to have  4 working stats  : 
1 -  2 motors going forward
2 -  2 motors going backward
3 -  first motor forward , second motor backward
4 -  first motor backward , second motor  forward

I dunno this could be done through joistics ? or 2  toggle switchs  ( 1 forward reverse , the other left and right )
i really have no clue at all of how to do it  as im a mechanical engineer !   
 waiting for your helps
It can be done in almost any way you can imagine, so you have to make up your mind about how you want it.

The fastest way to make it work will be with simple contacts of course, but you'd need some that can handle the current.
Next up would be relays (controlled by switches) and you could control the relays from your PIC via drivers.
You can get a joystick that is simply pushing 4 micro-switches.
You'd need to either be very precise when controlling the motors, as switching from eg. forward to right without time to stop, would make one motor fully reverse, with hefty spikes of Back EMF as a result (and perhaps damage to the drive train), not to mention that if you ran a wheel chair that way, the passenger would sue you if he survived.


if anymore info needed  im always online :)
At least that explains why you didn't get it finished on time ;)
Title: Re: URGENT please @ Controlling motors
Post by: jkerns on April 08, 2012, 04:10:28 PM
Also, you are going to have to find out how much current your motors will draw before you can decide what exactly will be able to control them.

Do you need just full speed on and off (could be a wild ride). Or do you need to control the speed of the motors?

In any event, you will need some form of H bridge - be it a bunch of switches, relays, discrete componants, or an IC, the principals are the same.

Somewhere around here is an H bridge tutorial that will give you the big picture - start there.

Jim (Also a mechanical engineer).
Title: Re: URGENT please @ Controlling motors
Post by: andrwo2 on April 11, 2012, 09:14:37 AM
First thank you guys for help ,

i'm trying to use  pic 16F84A  to control them by the code ,

the problem  is with the current my motors draws about 5 to 6 ampere  while working on load  .

the speed is not necessary for me  , i just want to control the directions .

my problem is how to  connect the pic to the relays and then the relays to the motor

so it can handle the current  and 12 volt  for the motor , instead of the 5 volts of the pic

this is a simple diagram i draw it  i dunno it's wrong or fault
Title: Re: URGENT please @ Controlling motors
Post by: Soeren on April 12, 2012, 10:31:53 PM
Hi,

i'm trying to use  pic 16F84A  to control them by the code ,
The 16F84 is way past its "best before" date. Why not use something a bit more current, like a PIC 16F628 (it's cheaper and have more program memory and such)?


my problem is how to  connect the pic to the relays and then the relays to the motor
so it can handle the current  and 12 volt  for the motor , instead of the 5 volts of the pic
The attached schematic should do. You need one of these for each motor.
Use common automotive relays. They're made for high currents and are way cheaper than other relays.

The power for the motors should go on a separate short (heavy gauge) wire, directly to the 12V battery.
"Forward" and "Reverse" goes to I/O pins on the PIC and the terms may be reversed, depending on which way 'round you connect the motor.

The grounds should all be tied together to the VSS of the PIC.


this is a simple diagram i draw it  i dunno it's wrong or fault
Besides lacking relay drivers, you can't just connect a (switch) joystick like that - you need to pull up each input with eg. a 10k resistor and use the switches to pull the inputs towards VSS ("ground").