how to radio control dc motors cheaply

8

Click here to load reader

Upload: jack-azad

Post on 26-Nov-2015

40 views

Category:

Documents


3 download

DESCRIPTION

sadgrrgfnb

TRANSCRIPT

  • http://www.instructables.com/id/How-To-Radio-Control-DC-Motors-Cheaply/

    Home Sign Up! Browse Community Submit All Art Craft Food Games Green Home Kids Life Music Offbeat Outdoors Pets Photo Ride Science Tech

    How To Radio Control DC Motors Cheaplyby Al1970 on June 14, 2008

    Table of Contents

    How To Radio Control DC Motors Cheaply . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

    Intro: How To Radio Control DC Motors Cheaply . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

    Step 1: How It All Works . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

    Step 2: How To Hook Up The VEX Reciever To The Interface Chip . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

    Step 3: How To Hook Up A Microcontroller To The Interface Chip . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

    Step 4: List Of The Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

    Step 5: Pin Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

    Related Instructables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

    Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

  • http://www.instructables.com/id/How-To-Radio-Control-DC-Motors-Cheaply/

    Intro: How To Radio Control DC Motors CheaplyFor the people who don't know what a "VEX" is. It is a company that sells robotic parts and kits. They sell a "VEX" transmitter and receiver on their site for $129.99 butyou can get a "VEX" transmitter and receiver for about $20 on "Ebay" and many other places.The "VEX" transmitter is a 6 channel FM transmitter with 2 joysticks that can go up & down and from side to side. On the backside of the transmitter there are 4 buttonswhich control channel 5 and channel 6. The transmitter controls can be set to tank-style or arcade-style. The transmitter has a host of other features.

    This makes it a very cheap way to remote control servos. The only problem is that you can only control servos motors and you need to buy an expensive $149.99 "VEX"microcontroller just in order to do that. That is until now!

  • http://www.instructables.com/id/How-To-Radio-Control-DC-Motors-Cheaply/

  • http://www.instructables.com/id/How-To-Radio-Control-DC-Motors-Cheaply/

    Step 1: How It All WorksThis low cost ($14.95) "motor interface chip" can be bought at: http://robotics.scienceontheweb.net The chip can decode the signals from the "VEX" receiver to control upto 8 motor's H-bridges and 1 driver. It can also receive commands from another microcontroller chip to control the motors. This interface chip uses 3 output pins to controla motor's H-Bridge. Two pins to control the motor's direction and one pin to control the motor's speed by using P.W.M.

    The chip uses the input from the two buttons on channel 5 to control the input from the "VEX" transmitter left joystick so that it can control 6 motors. The chip uses theinput from the other 2 buttons on channel 6 to lock in the high or low output on pin 14 of the motor interface chip.

    The motor interface chip has the following features. These features may not work since a receiver may pick up a signal from anywhere. We assume no responsibledirectly or indirectly from using these parts. WARNING! NEVER USE THE REMOTE ON A ROBOT THAT CAN CAUSE DAMAGE IF IT GOES OUT OF CONTROL. Ifyour robot goes out of transmitter range; the motor interface chip may shut down the motors and give control to a microcontroller if your robot is using one. This may alsobe true if you turn your transmitter off.

    The motor interface chip does not use a serial port tocommunicate with other microcontrollers. This means you can use a very inexpensive microcontroller chip to be the brains of your robot.

    Putting a low on pin 2 will cause all the motors to operate at half the power level when using the transmitter.

    Step 2: How To Hook Up The VEX Reciever To The Interface ChipMotors, relays and power supplies will cause radio interference; so pick a spot on your robot where the "VEX" reciever is far away from these things. I mounted mine on a43 in. long mast that was attach to the robot's base.

    The "VEX" reciever comes with a yellow cable. Plug the cable into the "VEX" reciever, the other end of the cable plugs into a telephone handset jack. You must buy thejack. Since I will not know the colors of the wires coming out of your jack; I will referent the yellow cable wires. If you look at the yellow cable you will see 4 wires whichare yellow, green, red and white. The yellow wire gets wired to + 5 volts. The green wire is the signal and it gets wired to pin 6 on the interface chip. The red wire getswired to ground. The white wire is not used.

    You need to wire a 4.7 K pull up resistor from pin 6 on the Interface Chip to the + 5 volts. You will also want to wire a 2200 uf capacitor across the power wires close tothe "VEX" reciever.

    Pin 2 is an input pin. It must be wired and NOT left floating. It can be wired to + 5 volts or ground thru a 47 ohm resistor. It can also be wired to pin 14.

    Option 1: pin 2 high will give the full range of power to the motors.

    Option 2: pin 2 low will give half the range of power to the motors.

    Option 3: pin 2 wired to pin 14. When channel 6 top button is pressed it gives the full range of power to the motors. When channel 6 bottom button is pressed it gives halfthe range of power to the motors.

  • http://www.instructables.com/id/How-To-Radio-Control-DC-Motors-Cheaply/

    Step 3: How To Hook Up A Microcontroller To The Interface ChipYour microcontroller if you are using one can communicatewith the Interface Chip over 3 wires.

    Pin 7 on the Interface Chip is the input for the data bit. When the pin is low it is a zero data bit. When the pin is high it is a one data bit. Your microcontroller must outputthe data bit before the clock pulse. The data bit must be at least 40 us long.

    Pin 16 on the Interface Chip is the input for the clock bit. Your microcontroller must output a high pulse for at least .5 us.

    Pin 5 on the Interface Chip is an output pin. When this pin goes high it is to let your microcontroller know that it is ready to receive the next command. This pin will go lowif the Interface Chip is getting a signal from the "VEX" transmitter. This pin will also go low and stay low if there was a communication error between your microcontrollerand the Interface Chip.

    Pin 4 is an output pin. If there is a communication error between the Interface Chip and your microcontroller, this pin will go high and stay high . A reset must be done inorder to clear this error.

    Step 4: List Of The CommandsThere are 32 commands that the interface chip understands. All the commands are 3 bytes or 24 bits long. The format for the commands are as follows.

    The 1st byte that is sent is always the command byte which is the left most number on the list below.

    The 2nd byte sent may be a PWM byte. It is a number between 0 and 50. When a 0 is sent the P.W.M. pulse is low which means the motor will be off. When the number50 is sent the P.W.M. pulse is high which means the motor will be on at full power. When the number 25 is sent the motor will run at about half power. As seen on the listsometimes the 2nd byte is just 0 which is being used just for a place holder. It has no affect on the motor.The 3rd byte sent may be a PWM byte or an error checking number.

    Example:To order motor 1 to go at full speed and motor 2 to go at half speed forward, the command would be.1 50 25

    To order motor 7 to go backward at 10% power, the command would be.16 5 16

    1 Motor 1 & 2 forward, PWM #, PWM # (no error checking)2 Motor 1 & 2 backward, PWM #, PWM # (no error checking)3 Motor 1 forward, PWM #, 34 Motor 1 backward, PWM #, 45 Motor 2 forward, PWM #, 56 Motor 2 backward, PWM #, 67 Motor 3 forward, PWM #, 78 Motor 3 backward, PWM #, 89 Motor 4 forward, PWM #, 910 Motor 4 backward, PWM #, 1011 Motor 5 forward, PWM #, 1112 Motor 5 backward, PWM #, 1213 Motor 6 forward, PWM #, 1314 Motor 6 backward, PWM #, 1415 Motor 7 forward, PWM #, 1516 Motor 7 backward, PWM #, 1617 Motor 8 forward, PWM #, 1718 Motor 8 backward, PWM #, 1819 All motors speed, PWM #, 1920 Motor 1 & 2 speed, PWM #, PWM # (no error checking)21 Motor 1 & 2 stop, X, 21 (pins low)22 Motor 1 stop, 0, 22 (pins low)23 Motor 2 stop, 0, 23 (pins low)24 Motor 3 stop, 0, 24 (pins low)25 Motor 4 stop, 0, 25 (pins low)26 Motor 5 stop, 0, 26 (pins low)27 Motor 6 stop, 0, 27 (pins low)28 Motor 7 stop, 0, 28 (pins low)29 Motor 8 stop, 0, 29 (pins low)30 All motors stop, 0, 30 (pins low)31 Pin 14 high, 0, 31

  • http://www.instructables.com/id/How-To-Radio-Control-DC-Motors-Cheaply/

    32 Pin 14 low, 0, 32

    Step 5: Pin SummaryInput Pins

    Pin 1 If it goes low it does a rest (MCLR)Pin 2 If low it only gives one half of the output to the motorsPin 6 "VEX" receiverPin 7 commands and data from another microcontrollerPin 33 data interruptPin 11 + 5 voltsPin 32 + 5 voltsPin 12 groundPin 31 ground

    Output Pins

    Pin 34 P.W.M. for motor 1Pin 35 High when joystick 1 is leftPin 36 High when joystick 1 is rightPin 37 P.W.M. for motor 2Pin 38 High when joystick 2 is upPin 15 High when joystick 2 is downPin 16 P.W.M. for motor 3Pin 17 High when joystick 3 is upPin 18 High when joystick 3 is downPin 23 P.W.M. for motor 4Pin 24 High when joystick 4 is leftPin 25 High when joystick 4 is rightPin 26 P.W.M. for motor 5Pin 19 High when joystick 3 is up and top button 5 is pressPin 20 High when joystick 3 is down and top button 5 is pressPin 21 P.W.M. for motor 6Pin 22 High when joystick 4 is left and top button 5 is pressPin 27 High when joystick 4 is right and top button 5 is pressPin 28 P.W.M. for motor 7Pin 29 High when joystick 3 is up and bottom button 5 is pressPin 30 High when joystick 3 is down and bottom button 5 is pressPin 8 P.W.M. for motor 8Pin 9 High when joystick 4 is left and bottom button 5 is pressPin 10 High when joystick 4 is right and bottom button 5 is pressPin 14 Stays high when top button 6 is press; goes low when bottom button 6 is pressPin 5 Tells other microcontroller it can send the next commandPin 4 Goes high if a command error has been detected

    All the other pins are not being used. No need to put pull-ups on these pins.

    Related Instructables

    Simple ArduinoRoboticsPlatform! byCalcProgrammer1

    PIC RC MotorController (andexample legorobot) byPaulMakesThings

    Sparky - DIYWeb-BasedTelepresenceRobot bysparkyrust

    iRover:RemotelycontrollediRobot Create(or Roomba) bytechgeek75

    iRobot CreatePersonal HomeRobot bydttworld

    HOW TO MAKEA simple RCSPY ROBOT bycharbelharfouche

    Comments29 comments Add Comment

    momomo68 says: Feb 4, 2011. 5:27 PM REPLYI realize this is an old post- I'm having trouble finding how to control 5-6 dc motors w/ remote control because the links are no good anymore, any current infoon the topic? Thank you.

    haclil says: Mar 24, 2009. 11:56 AM REPLYAnyone know why radio-controlled model (electric) trains aren't marketed? Seems like a good idea to me because: RC offers more commands than existingcontrol systems; speaking of transformers, RC offers lower input voltages; should be easy to run several trains and keep each under separate control. I askbecause I'm planning to build a model railroad.

  • http://www.instructables.com/id/How-To-Radio-Control-DC-Motors-Cheaply/

    evad says: Jun 19, 2009. 1:10 PM REPLYBecause the latest in model train control is DCC- Basically, the track has a constant DC voltage, and AC signals from a controller are sent "on top of " thetrack voltage, and the engine has a receiver / decoder. They can be had with many channels. Some live steam and garden railway folks use R/C

    kissiltur says: Sep 22, 2009. 1:30 PM REPLYI wondered if anyone was doing that with trains. Thanks.

    123KA says: Nov 27, 2010. 2:35 AM REPLYWow thanks for this instructable I am building a robot for my son with some parts fromRC Tanks that I got from here. We didnt have the budget for all of the radio gear but this has really helps... Thank You.

    akhile1996 says: Mar 12, 2010. 2:56 AM REPLY i am actully feeling bad as VEX is not present in ebay india.So please reccomend something else.

    akinich says: Apr 17, 2010. 12:59 PM REPLYheyi live in india toowhere do u live?i live in chennaiby the way my name is also akhil(aki)

    ben_englund says: Mar 31, 2010. 7:26 PM REPLYFor cheap RC gear go tohttp://www.raidentech.nethttp://www.hobbycity.comhttp://dealextreme.comThey have pretty much everything you need

    Ben

    adam 101 says: Sep 26, 2009. 6:37 PM REPLYdoes the PWM come from the remote or a micro controller?

    Al1970 says: Sep 26, 2009. 11:13 PM REPLYComes from the micro.

    adam 101 says: Oct 1, 2009. 9:01 AM REPLYso you are saying i cant control speed remotely with this?

    Br547 says: Apr 28, 2009. 7:45 AM REPLYIs this the same thing as the vex signal splitter that vex offers on there web site?

    Al1970 says: Jun 19, 2009. 9:44 PM REPLYHi: No. It is not make by "VEX" This chip can control up to 8 DC motors.

    SaurabhSingh says: Jan 14, 2009. 2:14 AM REPLYI NEED A HELP REGARDING MY PROJECT OF "RC HELICOPTER" I HAVE TO CONTROL THE SPEED OF FOUR DC MOTORS BY MEANS OF IRREMOTE CONTROL

    TheTrustedOne says: Dec 22, 2008. 9:59 AM REPLYIs it just me or is that "interface chip" a PIC16F uC, probably pre-programmed with your guess is as good as mine firmware?

    yourtubemeera says: Jul 10, 2008. 4:45 AM REPLYhellodoes anybody has the circuit diagram of this robothttp://www.robotroom.com/Sandwich.htmli really wanna make thisn don hav money to buy d book or the PCB

  • http://www.instructables.com/id/How-To-Radio-Control-DC-Motors-Cheaply/

    Procrastination says: Dec 5, 2008. 6:05 PM REPLYsearch "line follower" and I'll bet the sandwich curcuit is copyrighted but general line followers arn't

    The Jamalam says: Jun 20, 2008. 9:20 AM REPLYthe front of the control looks like a face and the back looks like a pair of eyes :P

    benthekahn says: Jun 19, 2008. 4:00 PM REPLYI found a place to buy the Vex remote and receiver for $30.

    Al1970 says: Jun 19, 2008. 11:16 PM REPLYYou can get them on EBay for less.

    chadsly says: Jun 16, 2008. 6:58 AM REPLYThis is really cool. I'm hoping to get the chance to turn my electric lawn mower into a remote controlled lawn mower. This should work well. The link on thesecond page worked, but when I click to purchase it, the link sent me to a web host. Can you check those links again?

    Al1970 says: Jun 17, 2008. 1:22 AM REPLYHi chadsly: The links do work but it is a free web site so they work only when they want to LOL. The link would take you to PAYPAL. You can just gothere and send the money to: [email protected] At some point do you want to give the lawn mower a brain?

    alexhalford says: Jun 15, 2008. 12:08 PM REPLYCan PWM be used on AC motors and if not how could I control the speed of an AC motor? Thanks Great 'ible Alex Halford

    Al1970 says: Jun 15, 2008. 3:32 PM REPLYHi: Speed control for some A.C. motors is done by clipping the peaks of the AC waveform. But there are many types of A.C. motors and they don't allwork the same way.

    dchall8 says: Jun 14, 2008. 5:11 PM REPLYOh, yeah! That's what I'm talking about!! Here's a question for you. Can you do something similar to control the motors on an RC airplane or car with awireless X-Box or Playstation controller?

    Al1970 says: Jun 15, 2008. 12:20 AM REPLYHi dchall8: I don't have a wireless X-Box or Playstation controller so I wouldn't know. I am sure they could NOT be used for an airplane, the range wouldbe too short. The VEX transmitter was just so cheap on Ebay, I had to give it a try.

    dchall8 says: Jun 15, 2008. 11:09 AM REPLYA power boost and antenna for a game controller seems like a worthwhile project for someone. The game controllers already have the joysticks, butthey also have a lot of other buttons that could be used to do other things on the vehicle. For example if you had an aerial photography plane, youcould pan, tilt, zoom, adjust the focus, etc. from one very inexpensive controller.

    mrbob1000 says: Jun 14, 2008. 6:27 PM REPLYa wile ago i saw an rc car that was controlled by a playstation 2 controller but i dont know if you can still find one. i also saw a xbox controller (old one notnew) controlling a rc heli (home made) wirelessly.

    joejoerowley says: Jun 14, 2008. 2:11 PM REPLYVery Cool! This will be very useful for a stage I building in the fall. Thanks Joe