Download presentation
Published byMelanie Neal Modified over 9 years ago
1
Today Midterm Demo Magellan has arrived Demo II: Demolition Derby
Reform Teams Lab 5 Hand out wheel encoders and servo motors Wheel encoders and odometry discussion Robot Building Lab: Wheel Encoders and Odometry
2
Our New Addition: Magellan Pro
Pentium III 800 MHz onboard industrial PC 16 sonar sensors 16 IR sensors 16 bump sensors High-precision Laser Range Finder Odometric sensors Differential drive low-level processor (Motorola MC68332) communicates with drive motors sound Ethernet and Wireless Flex control system and Linux-based Mobility high-level programming Robot Building Lab: Wheel Encoders and Odometry
3
Mobility Software CORBA-based Software Development Environment
Building blocks to construct robot control system Supports multiple robot systems Mobility Object Manager (MOM) – Java based GUI Robot Building Lab: Wheel Encoders and Odometry
4
Midterm Demo Use behavior/priority based control to combine: Two runs
ground sensing, light following, bumper reaction, and IR obstacle avoidance and tracking Two runs First run is time trial Second run in decreasing order of time of first run Score is least time over both runs Penalty of +10 seconds for each time you cross through a ground object Robot Building Lab: Wheel Encoders and Odometry
5
Demo II: Demolition Derby
Label robot kit with team number Label robot with team number Put kits circle/square and robots in middle Run program from midterm Extra credit points in order of finish Re-form teams Inventory major components of kit and report any missing/broken pieces Robot Building Lab: Wheel Encoders and Odometry
6
New Teams (Robot Stays with Team Name, People Move)
Team 1: Max D Peysakhov, Omar Hasan, Edward Whatley Team 2: Timothy S. Souder, Eric D. Pancoast, Ed Burger Team 3: Donovan Artz, Christopher J Flynn, Michael R. DeLaurentis Team 4: Kang Chen, Umesh Kumar, Brian J. Summers Team 5: Lisa P. Anthony, Matthew A Curran, Andrea J. Glenbockie Team 6: Daryl L Falco, Andrew R. Mroczkowski, Chris Cera Robot Building Lab: Wheel Encoders and Odometry
7
Lab 5 Wheel Encoders and Odometry Robot Building Lab: Wheel Encoders and Odometry
8
Lab 5 Wheel encoders Odometry Servo motors
Robot Building Lab: Wheel Encoders and Odometry
9
Break-Beam Sensors Pairs of light-emitting and light- detecting components used in the break-beam configuration Light-emitting component aimed at a light-detecting component When opaque object comes between emitter and detector, the beam of light is occluded, and the output of the detector changes Any pair of compatible emitter– detector devices may be used. Discrete infrared LED, phototransistor and various commercial break-beam optosensors (copyright Prentice Hall 2001) Robot Building Lab: Wheel Encoders and Odometry
10
Break-Beam Sensors Building
For sensing objects between larger gaps, use discrete emitters and detectors Interface to HB the same as for the reflective optosensors Emitter LED powered from HB +5v supply through dropping resistor Detector phototransistor connected between sensor signal line and ground Polarity is not indicated by length of device leads; look for + marking (copyright Prentice Hall 2001) Robot Building Lab: Wheel Encoders and Odometry
11
Use of Break Beams for Shaft Encoding
Measures the angular rotation of an axle, reporting position and/or velocity information Example: speedometer, which reports how fast the wheels are turning; odometer, which keeps track of the number of total rotations Single-Disk Shaft Encoder A perforated disk is mounted on the shaft and placed between the emitter–detector pair. As the shaft rotates, the holes in the disk chop the light beam. Hardware and software connected to the detector keeps track of these light pulses, thereby monitoring the rotation of the shaft. (copyright Prentice Hall 2001) Robot Building Lab: Wheel Encoders and Odometry
12
Our Wheel Encoders Optical encoder to measure wheel rotation of each drive wheel Slotted disk attached to wheel or motor shaft “Break-beam” IR counts number of slots that pass in given time (ports 7,8 ) Enable_encode, disable_encoder, read_encoder (number of on/offs since last reset), reset_encoder Max 32,767 counts (16 bit) Encoder library must be loaded Robot Building Lab: Wheel Encoders and Odometry
13
Counting Encoder Clicks
To make sense of data from a shaft encoder, install a routine that repeatedly checks the sensor value. If the encoder wheel turns faster than the routine checks the sensor state, it will start missing transitions and lose track of the shaft’s rotation Variables for algorithm: encoder_state - Keeps track of last encoder reading:1 if high (above 128), 0 if low (below 128) encoder_counter - Keeps running total of encoder “clicks” (copyright Prentice Hall 2001) Robot Building Lab: Wheel Encoders and Odometry
14
Library Drivers to do the Counting
Machine language routine loaded into IC’s underlying layer of direct 68HC11 code, with user interface - IC binary (ICB) files installed in interrupt structure of 68HC11 Monitors shaft encoder values and calculates encoder steps and velocity needs quickly and at regular intervals HB’s software libraries include set of routines for supporting shaft encoders for both position- counting and velocity measurement. For each analog input on HB, a pair of shaft encoder routines is provided. Once loaded into IC, the encoder routines are automatically active; no additional commands are needed to turn them on. Each encoder0_counts variable (running total of transitions on encoder sensor) will automatically increment every time it senses a transition on its corresponding encoder sensor The encoder0_velocity value (velocity measurement) is continuously updated Robot Building Lab: Wheel Encoders and Odometry (copyright Prentice Hall 2001)
15
Driver Software Hysteresis
Library routines use two thresholds to track changes in the raw encoder reading Reading must rise above a high threshold value to be considered high, and then fall below a low threshold to be considered low Square wave changes state either when encoder reading rises above 200, or falls below 50 When encoder value is between these two thresholds, square wave “waits” for value to reach threshold before changing state The sine wave represents the raw encoder value. The dashed square wave represents the encoder state of the driver routine — each transition on the square wave corresponds to an encoder count. (copyright Prentice Hall 2001) Robot Building Lab: Wheel Encoders and Odometry
16
Measuring Velocity Driver routines measure rotational velocity as well as position Subtract difference in the position readings after an interval of time has elapsed Velocity readings can be useful for a variety of purposes Robot that has an un-powered trailer wheel with a shaft encoder can easily tell whether it is moving or not by looking at encoder activity on the trailer wheel. If the robot is moving, the trailer wheel will be dragged along and will have a non-zero velocity. If the robot is stuck, whether or not its main drive wheels are turning, the trailer wheel will be still. Velocity information can be combined with position information to perform tasks like causing a robot to drive in the straight line, or rotate a certain number of degrees. These tasks are inherently unreliable because of mechanical factors like slippage of robot wheels on the floor and backlash in geartrains, but to a limited extent they can be performed with appropriate feedback from shaft encoders. (copyright Prentice Hall 2001) Robot Building Lab: Wheel Encoders and Odometry
17
Programming Encoders ao(); }
/* Normal encoders, on ports 7 and 8. Must load encoders.lis to use this, more info in the HB manual. */ void main(void) { enable_encoder(0); /* Turn on encoder on port 7 */ motor(0, 20); while (read_encoder(0) < 130) ; reset_encoder(0); motor(0, -20); ao(); } /* Using encoders on analog ports 0 through 5 Must load the relevant file, sendr0.icb in this case. Consult the readme in the libs directory for info. */ void main(void) { motor(0, 20); while (encoder0_counts < 130) ; encoder0_counts = 0; motor(0, -20); ao(); /* Note that these analog functions also provide velocity information */ } Robot Building Lab: Wheel Encoders and Odometry
18
Lab 5 Wheel encoders Odometry Servo motors
Robot Building Lab: Wheel Encoders and Odometry
19
Dead Reckoning (deductive reckoning)
Integration of incremental motion over time Given known start position/orientation (pose) Given relationship between motor commands and robot displacement (linear and rotational) Compute current robot pose with simple geometric equations Provides good short-term relative position accuracy Accumulation of errors in long-term – wheel slippage, bumps, etc., Robot Building Lab: Wheel Encoders and Odometry
20
Problems with Dead Reckoning
Calibration, uncertain robot geometry Friction, wheel slippage Errors grow without bound unless periodic absolute position corrections from other sensors used Robot Building Lab: Wheel Encoders and Odometry
21
Odometry Errors Systematic Errors Non-systematic Errors
Asymmetries, uncertainties in robot dimensions Kinematic imperfections* Can be measured and adjusted for – vehicle-specific calibration Non-systematic Errors Bumps, uneven floors, slippage More difficult to handle but not as dominant as systematic errors on smooth indoor surfaces Frequent absolute position adjustments needed in any case *kinematics: given starting point and motor commands, specify ending point Robot Building Lab: Wheel Encoders and Odometry
22
Systematic Errors Two primary sources:
Unequal wheel diameters (Ed) – lead to curved trajectory Uncertainty about wheel base (Eb) – lead to errors in turn angle Errors may also be affected by load distribution Vehicle-specific calibration needed – for error correction in software Careful experiments needed to measure errors accurately Periodic absolute pose updates cannot be avoided but the frequency can be reduced Robot Building Lab: Wheel Encoders and Odometry
23
Reducing Odometry Error with Absolute Measurements
Uncertainty Ellipses Change shape based on other sensor information Artificial/natural landmarks Active beacons Model matching – compare sensor-induced features to features of known map – geometric or topological (Labs 8 and 9) Robot Building Lab: Wheel Encoders and Odometry
24
Systematic Errors Unequal wheel diameters – curved trajectory, or
Uncertainty about wheel base – errors in turn angle Same resulting pose Try to correct errors in software But need to be careful about experiments to ensure that errors are corrected and not just hidden in specific tests (lab 6) Periodic absolute pose updates cannot be avoided Robot Building Lab: Wheel Encoders and Odometry
25
Odometry Design Considerations
Smaller wheelbases are more prone to orientation errors Castor wheels that bear significant weight induce slippage Limit speed during turning to reduce slippage Limit accelerations Error changes with wear and load distribution changes (as well as surface differences) Battery charge effects motor power Robot Building Lab: Wheel Encoders and Odometry
26
Lab 5 Wheel encoders Odometry Servo motors
Robot Building Lab: Wheel Encoders and Odometry
27
Servo Motors Package includes:
Dc motor Gear reduction Shaft positioning sensor and control circuit Command output shaft to move to a certain angular position Three wires: power, ground and control Use digital port number 9 Robot Building Lab: Wheel Encoders and Odometry
28
Attaching Sonar and Circuit Board
Attach forward-facing servo motor to robot Can use to mount various sensors that can actively scan a scene In particular, sonar and light sensor Robot Building Lab: Wheel Encoders and Odometry
29
Wiring Sonar and Circuit Board
3 connections SPI expansion header (2 pin cable) Digital port 7 (3 pin cable) Power expansion header (4 pin cable) Robot Building Lab: Wheel Encoders and Odometry
30
Next Week Take-home part of Lab
Build differential drive robot that includes wheel encoders, room for all previous sensors, room for servo turret Same as lab 2: Program to move in a pattern of forward, backward, left, right, movements, in a small area. Include both straight lines, standing turns, and curves --- without using wheel encoders for now Demo at start of next class Read on-line documents and answer questions specified at Lab 6: Localization, odometry, virtual path following, and proportional control Robot Building Lab: Wheel Encoders and Odometry
31
Review: Lab 4 Programs Global variables for: calibration variables
light-state, ground-state, bumper state, IR state Function to calibrate ground sensor using buttons (done) Function to determine light-state (done) Function to determine ground state (done) Function to move toward light (done) Function to move away from ground obstacle (done) Function to detect bumper state (in-class/home) Function to react to bumper collision (in-class) Function to calibrate IR sensors (in-class) Function to determine IR state (in-class) Function to avoid and track IR-detected obstacles (at home) void main(void) { calibrate start processes to keep track of: light, ground, bumper, IR states (with good use of defer) behavior/priority based control program to switch between: light following, collision reaction, ground reaction, obstacle avoidance – according to priority scheme (at home) } Robot Building Lab: Wheel Encoders and Odometry
32
References Robot Building Lab: Wheel Encoders and Odometry
33
New Teams Team 1: Max D Peysakhov, Omar Hasan, Edward Whatley
Team 2: Timothy S. Souder, Eric D. Pancoast, Ed Burger Team 3: Donovan Artz, Christopher J Flynn, Michael R. DeLaurentis Team 4: Kang Chen, Umesh Kumar, Brian J. Summers Team 5: Lisa P. Anthony, Matthew A Curran, Andrea J. Glenbockie Team 6: Daryl L Falco, Andrew R. Mroczkowski, Chris Cera Robot Building Lab: Wheel Encoders and Odometry
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.