280 likes | 441 Views
F.I.R.S.T Robotics Sensors 101. Michael Reffler Mentor FRC Team 1089 Hightstown, NJ MReffler@gmail.com. January 5 th 2008 Montgomery High School Skillman, NJ. Agenda Sensors 101. General Points CMUCam-2 Yaw Rate/Gyro Accelerometer Gear Tooth Encoders Potentiometers
E N D
F.I.R.S.T Robotics Sensors 101 Michael Reffler Mentor FRC Team 1089 Hightstown, NJ MReffler@gmail.com January 5th 2008 Montgomery High School Skillman, NJ
AgendaSensors 101 • General Points • CMUCam-2 • Yaw Rate/Gyro • Accelerometer • Gear Tooth • Encoders • Potentiometers • Sonic Range Finder • Other Sensors • Sensor Navigation • Information Resources • Vendors and Suppliers • Questions ?
General Points Sensors 101 • Balance your drivetrain mechanically • Programming Techniques • State Machines • Function Driven • Multiple fallback implementations for when sensors or appendages break • Pay close attention to LIMITS when designing for sensors • Use RF shielded cabling/wiring • Physical protection/project boxes
CMUCam2Sensors 101 • What can you do with the camera? • Track colors, e.g., illuminated target • Locate the scoring goal • Orient the robot or a turret to the goal • Heading & angle or distance • Drive to the goal
CMUCam2 Sensors 101 • CMUCam2 Camera • Labview / Focusing and Calibrating • CMUCam2 GUI / Focusing and Calibrating • RC default camera code-Kevin Watson
CMUCam2Labview Interface • Camera Focus • Load Sample Configuration • Track Colors / View Results
CMUCam2Kevin Watson Camera Code • Just does the camera tracking • Load initial calibration data • Tracking.h Settings • PAN/TILT servo pwm assignment • Reversing servo direction • Camera/tracking menus through Hyperterminal • Camera settings stored permanently on the RC • Use Get_Tracking_State() • Use Pan/Tilt angles for direction and distance
CMUCam2Finding Range to the Light range = Height_of_Light – Height_of_Camera / tan(tilt_angle_radians)
Yaw Rate GyroSensors 101 • Yaw Rate Gyro (ADXRS150) • Measures angular rate (150o/sec) along the Z axis. • Supply voltage 5V. • Output – analog. • Alternative Yaw Rate Gyro (ADXRS300) • Measures angular rate (300o/sec) along the Z axis
Yaw Rate GyroSensors 101 • What can you do with the gyro sensor ? • Application: Stability control, guidance. • Rotate robot left or right while the gyro reading is less than Xo. • If robot rotates too fast (the rate of change of the gyro sensor) then reduce motor speed (good in any mode).
Dual Axis AccelerometerSensors 101 • Dual Axis Accelerometer (ADXL 311) • Measures dynamic and static acceleration on both X and Y axis. • Supply voltage 5 V. • Output – analog. Bandwidth 3KHZ. • Sampling frequency > 6 KHZ.
Dual Axis AccelerometerSensors 101 • What can you do with the accelerometer? • Application: tilt or motion sensor. • Am I standing straight? • Measure pitch and roll in degrees. • Pitch = asin(Ax/1g); Roll asin(Ay/1g). • Orient an arm. • Collision detection.
Gear Tooth Sensors 101 • Gear Tooth Sensors (2) • AT642LSH Peak Detecting Gear Tooth Sensor. • Generates a pulse when a gear tooth is detected. • Speed of the gear: pulse rate. • Cannot easily determine direction of the gear • Digital Output. • Supply voltage: 12 V.
Gear ToothSensors 101 • What can you do with the gear tooth sensors? • Control the speed of the wheel. • Adjust for relative speed difference between wheels. • AUTONOMOUS MODE: • Move d feet distance. • Circumference of the wheel. • 2 * PI * R / Gear Teeth = Inches per Pulse.
Quadrature EncodersSensors 101 • Encoders are commonly used as feedback devices for motor controllers. • An encoder is a sensor that uses light to sense the speed and direction of a rotary shaft. • Encoders produce quadrature outputs which indicate the speed and direction of the shaft. • Inherently free from contact wear and the digital outputs are bounce less. • Provide greater accuracy and precision. • Digital Output (2) (A & B). • Supply Voltage 5 V.
Quadrature EncodersSensors 101 • What can you do with encoders? • Everything you can do with a gear tooth sensor. • PLUS : • Direction indication (you can now tell which direction your going even if you are being pushed in an opposite direction). • Greater Precision/Accuracy • Higher Speeds • AUTONOMOUS MODE: • Move d feet distance. • Circumference of the wheel. • 2 * PI * R / CountsPer = Inches per Pulse.
PotentiometersSensors 101 • Measures the rotation angle in terms of electrical degrees. • 0o to 300o-340o depending on the pot. • Use Linear Taper NOT Audio Taper. • Wire Wound, Conductive Plastic. • Limited number of revolutions. • Unlimited versions are available, but rare. • Sliders are available instead of rotational. • 100K ohm for the OI. • 10K, 5K, 1K ohm for the RC. • Analog Output. • Supply Voltage 5V.
PotentiometersSensors 101 • What can you do with potentiometers? • Measure the angle of an elbow on an arm • Move the arm up or down until Xo is reached • Measure the turn of a turret • Turn left or right until Xo is reached • Raise or lower a telescoping arm • Move up or down until Xo is reached
Sonar/Sonic RangersSensors 101 • Emit a sound and measure the time of flight distance. • Ranges: 6 inches – 20 feet, with a field of view of approximately 30o. • Other versions available with smaller/narrower beam widths. • Analog Output ~9.8mv inch • Supply Voltage 3.3-5.5V
Sonar/Sonic RangersSensors 101 • What can I do with a sonic range finder? • Measure the distance to an object. • Listen for approaching objects. • Another robot is approaching so move away.
Touch/Bumper SensorsSensors 101 • If pressure is applied to it, an electrical signal is generated. • What can you do with it? • I already bumped into something. I better get back, stop, or move around it.
Infrared SensorsSensors 101 • Emit modulated infrared (IR) energy and measure amount of (IR) returned. • Range: inches to several feet. • Led IR sensors have ranges of 3-5 inches. • Problems: Most venues use halogen/tungsten lighting. 90% of the energy emitted is infrared radiation.
Light SensorsSensors 101 • Red LED emits light and a phototransistor measures the incoming light. • What can you do with a light sensor? • Recognize objects of certain colors. • Follow a line. • Problems: Ambient light and battery level affect sensor readings.
Autonomous NavigationSensors 101 • Find the light. • CMUCam2 Get_Tracking_State(). • Get direction left or right degrees (pan angle). • Get distance to the light (tilt angle and a lookup table). • Turn towards the light. • Use the gyro to turn to the matching pan angle. • Drive towards the light. • Encoders / Gear tooth (Counts per inch). • Gyro keep driving straight (+/- a few degrees). • Fine tune. • Sonic Ranger creep in until inches away. • Raise the arm. • Potentiometer measure the upward angle.
Information ResourcesSensors 101 • ChiefDelphi – White Papers • Working the Angles • http://www.chiefdelphi.com/media/papers/1755 • Sample Gyro code • Quadrature Encoders • http://www.chiefdelphi.com/media/papers/1490 • Sample Encoder code • Kevin Watson FAQ’s and Sample Code • http://www.kevin.org/frc/camera/ • http://www.kevin.org/frc/gyro/ • http://www.kevin.org/frc/encoder/
Vendors and SuppliersSensors 101 • Digi-Key Electronics • http://www.digikey.com/ • Newark in One • http://www.newark.com/ • Mouser Electronics • http://www.mouser.com/ • Jameco Electronics • http://www.jameco.com/ • Sparkfun • http://www.sparkfun.com/ • USDigital • http://www.usdigital.com/