Society of Robots - Robot Forum

Electronics => Electronics => Topic started by: harisankarsa on October 20, 2007, 08:58:50 PM

Title: Can we replace servos with stepper or geared motors in the $50 robot??
Post 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.......
Title: Re: Can we replace servos with stepper or geared motors in the $50 robot??
Post by: paulstreats on October 20, 2007, 09:24:44 PM
not without modifying the code...
Title: Re: Can we replace servos with stepper or geared motors in the $50 robot??
Post by: Admin on October 20, 2007, 11:08:08 PM
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)
Title: Re: Can we replace servos with stepper or geared motors in the $50 robot??
Post by: Tsukubadaisei on October 21, 2007, 12:28:40 AM
and not without getting a stronger body.
stepper motors are heavy.
Title: Re: Can we replace servos with stepper or geared motors in the $50 robot??
Post by: Ro-Bot-X on October 21, 2007, 11:40:42 AM
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

Title: Re: Can we replace servos with stepper or geared motors in the $50 robot??
Post by: Ro-Bot-X on October 21, 2007, 11:58:52 AM
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.
Title: Re: Can we replace servos with stepper or geared motors in the $50 robot??
Post by: fr4ncium on November 20, 2007, 04:56:23 PM
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!
Title: Re: Can we replace servos with stepper or geared motors in the $50 robot??
Post by: bens on November 20, 2007, 05:17:19 PM
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?

Quote
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.
Title: Re: Can we replace servos with stepper or geared motors in the $50 robot??
Post by: Admin on November 20, 2007, 10:03:33 PM
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.
Title: Re: Can we replace servos with stepper or geared motors in the $50 robot??
Post by: fr4ncium on November 20, 2007, 10:52:37 PM
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. 
Title: Re: Can we replace servos with stepper or geared motors in the $50 robot??
Post by: bens on November 20, 2007, 11:53:17 PM
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/).