Society of Robots - Robot Forum
Electronics => Electronics => Topic started by: harisankarsa on October 20, 2007, 08:58:50 PM
-
Can we replace servos with stepper or geared motors in the $50 robot??I think that we need not change the code if we change the motor,but do we need to change the circuit??pls help me.......
-
not without modifying the code...
-
and not without making/buying motor drivers . . .
servos are the best option to stay cheap and simple (you just gotta trust me on this one)
-
and not without getting a stronger body.
stepper motors are heavy.
-
DC motors (gearhead motors are best for robotics):
Schematic:
ATmega 8 L298N Gearhead Motor
______ ______ ______
| +V--| | | |
|-----Enable-------| Motor |--------| DC |
MCU |-----PWM---------| | | |
|-----Direction----| Driver |--------| Motor |
______|-------GND--------|______| |______|
Enable pin may be directly connected high instead at the microcontroller.
Pros:
- faster speed
- variable speed
- integrated gearbox
- more power
- brake
- can recharge the battery when slowing down
Cons:
- at least 2 pins used on the microcontroller (MCU)
- needs an adequate power motor driver
Stepper motors:
Schematic:
ATmega 8 L297 L298N Bipolar Stepper
______ ______ _______ ________
| +5V--| | +V--| | | |
|-----Steps--------| Step |----------| Motor |--------| Stepper|
MCU |-----Direction----| |----------| |--------| |
|-----Mode--------| coder |----------| Driver |--------| Motor |
| | |----------| |--------| |
______|-------GND--------|______|--GND--|______| |_______|
Mode pin may be connected directly high or low for selecting full step or half step mode.
Pros:
- good precision
- variable speed
- brake (holds position)
Cons:
- at least 2 pins used on the microcontroller (MCU)
- needs eighter a software step coding routine or a stepper coder
- needs an adequate power motor driver
- medium power
Servo motors: (continuous rotation)
Schematic:
ATmega 8 Servo
______ _______
|-+5V | |
| +6V--| Servo |
MCU |-----PWM---------| |
|------GND---------| Motor |
______| |______|
Pros:
- only one pin used from the microcontroller
- integrated driver
- integrated gearbox
Cons:
- moderate speed
- moderate power
- moderate variable speed
-
I should have added that all motors are driven by sending pulses. But each motor has it's own pulse routine:
DC motors:
Pulse Width Modulation signal with a frequency of roughly 2 kHz. If the direction pin is low, the motor will be driven by the width of the high period during one cycle. If the direction pin is high, the motor is driven by the width of the lower period during one cycle. Wider period will result in higher speed.
Stepper motors:
Positive pulses signal, each pulse rezults in one step of the motor. Higher pulse frequency results in higher speed of the motor.
Servo motors:
Pulse Width Modulation signal with a frequency of 50 Hz. The width of the high period during one cycle determins the direction and speed of the servo. 1 ms pulse results in servo rotating counterclockwise at max speed, 2 ms pulse results in servo rotating clockwise at max speed. 1.5 ms pulse will stop the servo. A pulse between these values will varry the speed in the coresponding direction.
-
I have a similar question, and this topic is less than a month old, so I'll stick it here.
I scrapped a couple DC motors from a dual cassette player and am trying to find a way to use them in place of permanently modifying a couple servos (snipping the mechanical stop) for the $50 robot. Is this possible? How much more difficult, electronics wise, would it be to do this and wire up an h-bridge? (I'm not that concerned about the coding aspect). Can anyone suggest a good h-bridge to buy?
Secondly, the DC motors are a little strange, I think. They have four wires coming out of them, labeled -, +, A and B. + and - are obvious, and the motor works fine if I just hook up those two to a power supply, but I have no idea what A and B are, or what I'd do as far as the PWM signal goes. Thanks!
-
Can anyone suggest a good h-bridge to buy?
What kind of current will these motors be drawing and at what voltage did you want to run them?
They have four wires coming out of them, labeled -, +, A and B. + and - are obvious, and the motor works fine if I just hook up those two to a power supply, but I have no idea what A and B are, or what I'd do as far as the PWM signal goes. Thanks!
I'm thinking there are two possibilities:
1) Most likely the motors have integrated encoders, and you're getting quadrature feedback via the A and B leads. Try treating A and B as outputs and see what kind of signals you get from them as the motor runs. I'd expect a cassette player would probably want to have encoders on its motors.
2) The motors have some sort of integrated control circuitry, but I don't think this is all that likely.
-
Hmmmm I'm thinking encoders too . . . attach A and B to an oscilloscope to see a quick output . . . an encoder would give you a square wave.
-
Looks like it's drawing around 23mA at 9V, but I'm not sure if the battery I'm using is fully charged.
I'll check the A B voltage difference when I'm back at the university and have access to an osc.
-
I'm sure there are quite a few controllers/drivers you could get for your motors, but the only two in your range that I have personal experience with (and can hence recommend) would be Pololu's dual serial motor controller (http://www.pololu.com/products/pololu/0101/) and micro dual serial motor controller (http://www.pololu.com/products/pololu/0410/).