go_away

Author Topic: Motor controler  (Read 1380 times)

0 Members and 1 Guest are viewing this topic.

Offline michaelghayesTopic starter

  • Jr. Member
  • **
  • Posts: 9
  • Helpful? 0
Motor controler
« on: October 24, 2009, 02:36:43 AM »
I want to turn the chassis of an old remote control car into the body of my robot.

the car has 5 wheels driven by 2 dc motors.  its wheels are on 2 arms (one on each side), which can be rotated in relation to the body, so the body can tilt, while the wheels stay on the ground.  this feature is driven by another dc motor.

I've taken it apart to a certain extent but am leaving the motor housing (which is full of gears which would be very difficult to put back in place)
and looked at the chip.  basically the chip is a receiver with 3 h bridges, but i don't think I'll be able to use any of them for my purposes.  I've tested the wires attaching to the chip, and there are 2 which power each motor, the wires that control the wheels are much thicker, so i presume these require a higher current, but i don't really know much about how current or electricity in general works or is measured. 

what i want to do, is buy a motor controller (or 2), and use them to control the wheels, and control these motor controllers with my axon.  I have looked around and found a couple of cheap boards which look like they might work, but i don't know if they will work for these motors

here are the 2 controllers i found:
http://www.solarbotics.com/cad/products/k_cmd/
and
http://www.sparkfun.com/commerce/product_info.php?products_id=8905

the robot runs on a 6v battery, but i don't really have much information on the moters, except that they have lots of gears, I assume that they are very fast and use the gears to increase torque, the car itself is very fast, and at full speed is difficult to control. I am hoping to be able to have it move at a slower speed when i use it for my robot

Would either of these work? how do i tell what my stall current is (i have read that that is the maximum amount of current that a motor can draw, so that is how i tell if the controllers will work)

and once i have the controller, how do i use it to control my robot, i have been using continues rotation servos which just send pulses to every once in a while, with these i have read you use the similar similar pulse method to control the speed, but  for full speed it says to have a continuous current, so how would you continue to send a current from the pin without stopping the rest of the program?


Offline corrado33

  • Supreme Robot
  • *****
  • Posts: 611
  • Helpful? 11
Re: Motor controler
« Reply #1 on: October 24, 2009, 09:51:29 AM »
I'm not sure if those motor controllers will work, but here are a few pieces of advice.

I highly doubt you'll be able to modify the gearing of the motors, unless you plan on buying extra gearing and basically making your own gear ratios (With chains or belts are simply metal gears).  My advice would just be to run the motors at low power so that they don't go fast.  The only advantage to using your own gears would be you'd get more torque, but I doubt you'll need it.

You could always make your own motor controller.  Here is the H-Bridge tutorial on this site.  http://www.societyofrobots.com/schematics_h-bridgedes.shtml

You are right about sending the pulses to the motor.  It's called PWM or pulse width modulation (I believe  ;D ), and generally your micro controller will have a couple PWM output ports.  Here's the wikipedia page.  http://en.wikipedia.org/wiki/Pulse-width_modulation

I'm not sure how to tell what the stall current is, but my guess would be to let the current run through the multimeter to the motor and hold the motor still, for  A VERY SHORT AMOUNT OF TIME.  Most motors will sustain damage if held still under power for a long time.  There might be a better way, so honestly I'd see if anybody else has any better ideas first. 

Offline blackbeard

  • Supreme Robot
  • *****
  • Posts: 575
  • Helpful? 4
Re: Motor controler
« Reply #2 on: October 24, 2009, 10:03:18 AM »
do you have some old servos? rip out the control boards and use those!
"sure, you can test your combat robot on kittens... But all your going to do is make kitten juice"

First step: Build androids with AI
Next step: Give them vaginas

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,659
  • Helpful? 169
    • Society of Robots
Re: Motor controler
« Reply #3 on: October 24, 2009, 12:44:58 PM »
I bought two of those SF motor drivers:
http://www.sparkfun.com/commerce/product_info.php?products_id=8905

and just got them in this morning! They are tiny!

I'll be hooking them up to my Axon soon when I have time, so if you get stuck I can definitely help you. But I haven't used them yet, so couldn't say how good they are.

Offline michaelghayesTopic starter

  • Jr. Member
  • **
  • Posts: 9
  • Helpful? 0
Re: Motor controler
« Reply #4 on: October 24, 2009, 04:58:40 PM »
Thanks for the help! I've done some more testing on the board on the car and have discovered that i can actually use it as my h bridge.  I tied the grounds of my axon power source to the ground of the cars power source, and I have found six contact points which when a current is applied from the axon, control the wheels and arms of the car (forward and reverse for each wheel, and  up and down for the arms)  the problem i have is that I cant get a strong enough signal voltage from the axon.  when i apply the power directly from the power source the wheels work fairly well, but when  I apply the signal current, (which comes out as about 2.2 volts, when the axon has 4.5 volt power supply)  with a control file that looks like this:

void main(void);
while(1)
{
     wheel_left(700);
     wheel_right(700);
}

the motor just stalls, when i pick it up the wheels turn, but they don't get enough power to actually move the car

this means that each pin is outputting half the time, and the voltage is only half the total available voltage on the axon, and is not strong enough to allow the current to pass through the transistors.  The ideal voltage would be around 6v, but if i keep adding to my code, (for example adding servos, sensors and the motors)  the amount of time that each output pin will be active becomes less and less.

I guess what i need is a way to boost the voltage, or to be able to have a continuous output on a signal pin, but I have no idea how this would be done, any help on either of these would be greatly appreciated, but i would prefer to be able to just use the output of the axon without adding another circuit for the amplification, so if there is a way to switch on and off output pins, rather than having them only output one at a time in the way i showed above tha would be the best solution.

one other idea i had was combining multiple output pins, because the axon has so many, but this would only help if i could activate more than one at a time, and im not sure if I could increase voltage doing this, because if you just connect the pins that would increase the current right  I don't really know much about electricity has you can probably tell from my posts, but i like messing around with stuff until it works, even if i don't understand how it works
« Last Edit: October 24, 2009, 05:03:33 PM by michaelghayes »

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,659
  • Helpful? 169
    • Society of Robots
Re: Motor controler
« Reply #5 on: October 24, 2009, 07:50:26 PM »
That code you showed is for servos - meaning its a small pulse every now and then.

What you want is either PWM, or just turning the pins high. You can find code to both in the Axon code examples.

Offline michaelghayesTopic starter

  • Jr. Member
  • **
  • Posts: 9
  • Helpful? 0
Re: Motor controler
« Reply #6 on: October 25, 2009, 11:03:00 PM »
Thanks for the help!  I've got it working, I managed to connect the axon controller so that it has full control of the car.  I've begun to learn how to control dc motors using PWM, (thanks for that)  and I've hooked up a single stationary infrared sensor to the front which is basically just a bumper, and now i have a very simple (and jerky) obstacle avoidance robot.  I put up a video here:
http://www.michaelghayes.com/?page_id=116
« Last Edit: October 26, 2009, 01:49:51 AM by michaelghayes »

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,659
  • Helpful? 169
    • Society of Robots
Re: Motor controler
« Reply #7 on: October 26, 2009, 05:33:35 AM »
lol thats quite a lot of tape on your robot! :P

Offline michaelghayesTopic starter

  • Jr. Member
  • **
  • Posts: 9
  • Helpful? 0
Re: Motor controler
« Reply #8 on: October 26, 2009, 05:14:49 PM »
yup,  love the stuff, I can move everything around while I'm still adding more hardware, ill build something more permanent when i know what other sensors/servos i'm going to add

 


Get Your Ad Here

data_list