It seems reasonable to expect that when you program a robot to drive straight, it should just work. And, of course, this is what the Move Steering block in the EV3 Software is designed to do.
The Move Steering block makes use of shaft encoders in the motors and a proportional feedback controller in the software, to keep the motors in sync with each other.
Test this out for yourself by programming a two-wheeled robot to drive forward for 10 rotations, using the Move Steering block. Pick the robot up and start the program. While the program is running, grab one of the wheels and see what happens to the other.
The Move Steering block certainly makes it easier for beginners to get started with programming than if they had to use separate blocks for each motor. A trade off for this simplicity, however, is that the details of how the block works are hidden from the user. In particular, the proportional feedback processes involved in moving a two-wheeled robot forward.
Real robots don’t drive straight
A decade ago, Fred Martin, a Computer Science professor at University of Massachusetts Lowell, wrote an insightful paper about this topic, provocatively titled Real robots don’t drive straight.
Martin’s paper raises important questions about engineering education and robotics competitions in particular. Through a focus on feedback control, he explores the role of robotics in education, and the pedagogical challenge to develop technologies and activities that highlight key ideas in the fields being taught.
In the paper, Martin argues that feedback is a central process not only in our lives but also in engineered systems. Feedback is pervasive, but often invisible.
“Autonomic body processes, like temperature regulation and breathing, happen without our conscious attention, and learned activities, like balancing and walking, are performed without deliberate attention.”
“Over time, our ability to engineer feedback systems has also steadily improved, to the point where vehicles and processes that would normally be highly unstable (e.g., a fighter jet aircraft) can be made to “fly straight.”
Martin concludes that “both biological and engineering systems do make contact corrections, be they minimal to the edge of perception. As educators, we must introduce students to this central principle, not hide it from them. Real robots don’t drive straight.”
Some of the reasons that robots don’t drive straight
Here are some of the reasons that a typical EV3 robot might not drive straight and some suggestions.
- Variations in the friction or other internal factors affecting performance of the motors. Try swapping over the motors or replacing them if you have spare
- Carpet pile direction. Try running the robot in the opposite direction, or at right angles
- Centre of balance / symmetry. Check for symmetry in terms of construction, weight, material, wheels, axis of rotation, and balance. Is there more friction on one side, and possibly slipping on the other?
- Robot construction. Check that the wheels are well connected to the axis and frame, and that the beams and other bricks are firmly connected to each other.
- Caster wheel not aligned, sticking. If there are free wheels in the back, make sure that both of them are placed in equal directions before starting the robot.
- When starting the robot try to make an even pressure on the start button, otherwise the robot may not start straight. Try putting a short wait time after pressing the button, so that the pressure of your finger doesn’t cause problems.
- Wheels or gears catching or rubbing more on one side than the other.
- Dust/dirt causing a loss of traction. Clean the tires and perhaps sweep the floor.
- Try using brake, not coast, to finish a movement.
- Try reducing motor power – e.g. NXT motors set to 70% perform more consistently than 100%. See also this analysis of NXT motor internals by Philippe “Philo”Hurbain (external link).
- Ramp up power to avoid jump starts at higher power.
- Are any friction pins (black, black) being used for gears where frictionless (tan, grey) or axles should be used? See also this post by Ian Chow-Miller.
- Different tyres may provide different amounts of traction.
- Check for bent axles and unseated tyres.
A better approach?
If we accept that real robots don’t drive straight, then perhaps a better approach is to avoid giving our students challenges that rely on dead reckoning. Instead we should provide opportunities to use physical constraints and/or sensor information to localise and update the movement of their robots.
Whether a feedback approach is suitable obviously depends on how the challenge is framed, but might include one or more of the following strategies.
- drive along a track
- use an ultrasonic sensor to follow a wall
- use a light sensor to follow a line
- use a compass and/or GPS sensor to follow a bearing
- use an IR beacon to determine a direction and infer a distance