stepper motor vs optical encoder! Need advice for my school project.
Tony_tsi
Posts: 98
I am working on a project for the college that I attend. I am building a robot that will perform certain tasks in a 4' x 8' area. I need an accurate way to to track the amount of revolutions that the wheels turn on the robot in order to more easily track the robots location. I will be using a propeller for the brain and have an option of 5 V 12 V or 24 V for the drive motors. While motor size is not a large issue is preferred that the motor be the size of a Coke can or smaller. I have a good amount of experience with stepper motors and a small amount of experience with optical encoders. I basically have two options for the drivetrain of the robot.
option #1 Stepper motors
The good part about using a stepper motor is I can count the steps and know exactly how many revolutions the wheel has turned. The bad part about stepper motors is that they're usually very large require a lot of power and a fair amount of circuitry to operate them properly.
option #2 optical encoder
The good part about using optical encoder is it would allow for a wide variety of motors. I think used correctly optical encoders can be as accurate as stepper motors. The bad part about optical encoders is that I don't have much experience with them and I was told by a friend that an optical encoder would be very hard to keep track of using a propeller.
If you any ideas or suggestions please help me out. Thank you!
option #1 Stepper motors
The good part about using a stepper motor is I can count the steps and know exactly how many revolutions the wheel has turned. The bad part about stepper motors is that they're usually very large require a lot of power and a fair amount of circuitry to operate them properly.
option #2 optical encoder
The good part about using optical encoder is it would allow for a wide variety of motors. I think used correctly optical encoders can be as accurate as stepper motors. The bad part about optical encoders is that I don't have much experience with them and I was told by a friend that an optical encoder would be very hard to keep track of using a propeller.
If you any ideas or suggestions please help me out. Thank you!
Comments
You do realize, that these two are not guaranteed to follow ? - wheel slip is very common, and needs to be allowed for.
Quadrature counting is not hard on the prop. It is only if you want to push well into the MHz that you need care.
Just pop into the OBEX, and search for Quadrature.
There are a few objects in the OBEX for using optical encoders. Combine that with a PWM object to control the motor and some math and you are set. There is at least one object that combines all three of those. Different motor drivers are controlled in different ways. Some, like Parallax's HB-25, use a servo pulse signal to control. Others use two pwm inputs, or one pwm input and two on/offs to set direction and braking, or serial or...?
Controlling a stepper really does not require more circuitry, It does require an additional H bridge but it also doesn't need the encoder stuff. There are plenty of stepper drivers out there that will work as easily as a regular motor driver - and there are objects in the OBEX for running steppers too. As far as knowing exactly how far the wheel has turned with a stepper... well, as long as no steps are missed that will work. You don't really count the steps, you create the steps and tell the motor to move. There is no feedback letting you know if it did what you told it to (open loop). This is where having a quadrature encoder is helpful. An encoder does tell you if it has moved, it closes the loop. You can of course put an encoder on a stepper.
The surface you run on will greatly impact the open-loop performance, especially on diff-drive spins and turns. Also, ramping the start-up and slow down phases of movement will greatly improve the ability to carry a load without stalling. Just doing simple slamming them on and off driving places big limits on the maximum RPM and load you can carry.
In the case of a mobile robot, not really. You will "know" that the wheel is stationary when powered up but you will not know where the wheel (robot) is relative to it's surroundings. A position sensor will not help much here.
In the case of a CNC type machine you will need* a position sensor in the form of a limit switch, although even a quadrature encoder equipped machine needs the same thing. Only a machine with absolute position encoders would not require it.
It should not move unintentionally when power is applied. Unless the mechanics are poorly designed, the stepper will move as it is commanded. You only need an encoder on a stepper if the stepper motor misses steps, but if it missing steps then the motor is not matched to the system or it is being driven improperly.
* Some CNC machines are powered on in a known position, no position sensor of any kind is required.