Beijing
Offline
Full Member
Karma: 3
Posts: 181
Skype name habib.derbyshire
|
 |
« on: August 06, 2012, 02:35:41 am » |
I am building an Arduino controlled robot-car with a hacked RC car, I heard there is a way you can reverse polarity on the PWM pins to change the direction the motor spins. How is that done? Thanks so much.
|
|
|
|
|
Logged
|
What is man's best friend? The breadboard!
|
|
|
|
SW Scotland
Offline
Edison Member
Karma: 6
Posts: 1053
Arduino rocks
|
 |
« Reply #1 on: August 06, 2012, 03:49:31 am » |
You simply reverse the motor connections to whatever is driving it. If however you wish to reverse the "phasing" of the PWM signal, (change 20% on, 80% off, to 80% on, 20% off) simply feed it through a transistor or fet to invert the signal (phase).
|
|
|
|
|
Logged
|
|
|
|
|
Beijing
Offline
Full Member
Karma: 3
Posts: 181
Skype name habib.derbyshire
|
 |
« Reply #2 on: August 06, 2012, 05:52:50 am » |
So does a transistor reverse the polarity?
|
|
|
|
|
Logged
|
What is man's best friend? The breadboard!
|
|
|
|
SW Scotland
Offline
Edison Member
Karma: 6
Posts: 1053
Arduino rocks
|
 |
« Reply #3 on: August 06, 2012, 07:07:17 am » |
Used in common collector mode a transistor reverses the phase. Polarity is a relative thing. If your reference point is the circuit negative (commonly referred to as GND) then all signals are positive polarity. If you use VCC as your reference point then all signals are negative polarity.
|
|
|
|
|
Logged
|
|
|
|
|
Beijing
Offline
Full Member
Karma: 3
Posts: 181
Skype name habib.derbyshire
|
 |
« Reply #4 on: August 06, 2012, 07:20:31 am » |
So can I use a transistor to make negative positive and positive negative to make to motor spin to other direction? Thanks so much and sorry if this question seems silly
|
|
|
|
|
Logged
|
What is man's best friend? The breadboard!
|
|
|
|
Gosport, UK
Offline
Faraday Member
Karma: 19
Posts: 3118
|
 |
« Reply #5 on: August 06, 2012, 07:45:51 am » |
|
|
|
|
|
Logged
|
|
|
|
|
Montreal
Offline
Edison Member
Karma: 16
Posts: 2209
Per aspera ad astra.
|
 |
« Reply #6 on: August 06, 2012, 08:09:27 am » |
How it looks like your " with a hacked RC car"? There is a big chance , that it already has H-bridge, probably 2 of them. Post a picture. There is a pics from my last project, also based on "hacked R/C car" http://coolarduino.files.wordpress.com/2012/07/dscf0080.jpg On top and top-right you can see 4 +4 transistors, essential part of 2 H-bridges
|
|
|
|
|
Logged
|
|
|
|
|
Beijing
Offline
Full Member
Karma: 3
Posts: 181
Skype name habib.derbyshire
|
 |
« Reply #7 on: August 06, 2012, 08:12:14 am » |
Thank you so much!
|
|
|
|
|
Logged
|
What is man's best friend? The breadboard!
|
|
|
|
Montreal
Offline
Edison Member
Karma: 16
Posts: 2209
Per aspera ad astra.
|
 |
« Reply #8 on: August 06, 2012, 10:26:41 am » |
You are welcome. Just figure out two signal lines of inputs to those bridges, "cut-in" with arduino and you would be able to take full control of the car. Some thoughts: - turn on/off leds representing right/left turning signals; - -//- front/rear lights; - "beep" horn; - add voice module, which would play "yes, sir!" or "no, sir" whenever radio receiver outputs some signals.
|
|
|
|
|
Logged
|
|
|
|
|
Beijing
Offline
Full Member
Karma: 3
Posts: 181
Skype name habib.derbyshire
|
 |
« Reply #9 on: August 06, 2012, 08:37:37 pm » |
Thanks sooooo much. How do you add a voice module? Is it some sort of speaker? I heard there's something called a piezo, is that it?
|
|
|
|
|
Logged
|
What is man's best friend? The breadboard!
|
|
|
|
Montreal
Offline
Edison Member
Karma: 16
Posts: 2209
Per aspera ad astra.
|
 |
« Reply #10 on: August 06, 2012, 08:42:01 pm » |
|
|
|
|
|
Logged
|
|
|
|
|
Beijing
Offline
Full Member
Karma: 3
Posts: 181
Skype name habib.derbyshire
|
 |
« Reply #11 on: August 06, 2012, 09:00:48 pm » |
Hey Magician, Sorry I didn't see your post of the hacked RC car. What I mean by hacked is that it is bare bones-just the chassis and the motors. So I don't think it has an H-bridge. Thanks
|
|
|
|
|
Logged
|
What is man's best friend? The breadboard!
|
|
|
|
Beijing
Offline
Full Member
Karma: 3
Posts: 181
Skype name habib.derbyshire
|
 |
« Reply #12 on: August 06, 2012, 09:01:50 pm » |
Do I have to use a shield? Is there a bare-bones way to do it?
|
|
|
|
|
Logged
|
What is man's best friend? The breadboard!
|
|
|
|
Montreal
Offline
Edison Member
Karma: 16
Posts: 2209
Per aspera ad astra.
|
 |
« Reply #13 on: August 06, 2012, 09:17:15 pm » |
Simply to reverse a polarity you can do with a relay. Better way is H-bridge, as it was suggested above. http://www.talkingelectronics.com/projects/H-Bridge/H-Bridge-1.htmlIf you are newbie, I don't think you are up to build one, search for shields, or at least for IC, L293 and L298 pretty common for starters. There are also a kits available, I just build one myself recently : http://www.solarbotics.com/product/k_cmd/Though, after I assembled it I realized I need more current
|
|
|
|
|
Logged
|
|
|
|
|
Beijing
Offline
Full Member
Karma: 3
Posts: 181
Skype name habib.derbyshire
|
 |
« Reply #14 on: August 06, 2012, 11:44:56 pm » |
Thank you so much for your help!
|
|
|
|
|
Logged
|
What is man's best friend? The breadboard!
|
|
|
|
|