F.I.R.S.T Robotics F.I.R.S.T Robotics Sensors 101 Sensors 101 Michael Reffler Michael Reffler Mentor FRC Team Mentor FRC Team 1089 1089 Hightstown, NJ Hightstown, NJ [email protected][email protected]January 5 th 2008 Montgomery High School Skillman, NJ
27
Embed
F.I.R.S.T Robotics Sensors 101 Michael Reffler Mentor FRC Team 1089 Hightstown, NJ [email protected] January 5 th 2008 Montgomery High School Skillman,
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
January 5th 2008 Montgomery High School Skillman, NJ
AgendaAgendaSensors 101Sensors 101
General PointsGeneral Points CMUCam-2CMUCam-2 Yaw Rate/GyroYaw Rate/Gyro AccelerometerAccelerometer Gear ToothGear Tooth EncodersEncoders PotentiometersPotentiometers Sonic Range FinderSonic Range Finder Other SensorsOther Sensors Sensor NavigationSensor Navigation Information ResourcesInformation Resources Vendors and SuppliersVendors and Suppliers Questions ?Questions ?
General PointsGeneral Points Sensors 101 Sensors 101
Balance your drivetrain mechanicallyBalance your drivetrain mechanically Programming TechniquesProgramming Techniques
– State MachinesState Machines– Function DrivenFunction Driven– Multiple fallback implementations for when Multiple fallback implementations for when
sensors or appendages breaksensors or appendages break Pay close attention to LIMITS when Pay close attention to LIMITS when
designing for sensorsdesigning for sensors Use RF shielded cabling/wiringUse RF shielded cabling/wiring Physical protection/project boxesPhysical protection/project boxes
CMUCam2CMUCam2SensorsSensors 101 101
What can you do with the camera?What can you do with the camera?– Track colors, e.g., illuminated targetTrack colors, e.g., illuminated target– Locate the scoring goalLocate the scoring goal– Orient the robot or a turret to the goalOrient the robot or a turret to the goal
Heading & angle or distanceHeading & angle or distance
– Drive to the goal Drive to the goal
CMUCam2 CMUCam2 SensorsSensors 101 101
CMUCam2 CameraCMUCam2 Camera– Labview / Focusing and CalibratingLabview / Focusing and Calibrating– CMUCam2 GUI / Focusing and CalibratingCMUCam2 GUI / Focusing and Calibrating– RC default camera code-Kevin WatsonRC default camera code-Kevin Watson
CMUCam2CMUCam2Kevin Watson Camera Kevin Watson Camera
CodeCode Just does the camera trackingJust does the camera tracking Load initial calibration dataLoad initial calibration data Tracking.h SettingsTracking.h Settings
Yaw Rate Gyro (ADXRS150)Yaw Rate Gyro (ADXRS150)– Measures angular rate (150Measures angular rate (150oo/sec) along /sec) along
the Z axis.the Z axis.– Supply voltage 5V.Supply voltage 5V.– Output – analog.Output – analog.
Alternative Yaw Rate Gyro (ADXRS300) Alternative Yaw Rate Gyro (ADXRS300) – Measures angular rate (300Measures angular rate (300oo/sec) along /sec) along
the Z axisthe Z axis
Yaw Rate GyroYaw Rate GyroSensors 101Sensors 101
What can you do with the gyro sensor ?What can you do with the gyro sensor ?– Application: Stability control, guidance.Application: Stability control, guidance.– Rotate robot left or right while the gyro Rotate robot left or right while the gyro
reading is less than Xreading is less than Xoo..– If robot rotates too fast (the rate of change If robot rotates too fast (the rate of change
of the gyro sensor) then reduce motor of the gyro sensor) then reduce motor speed (good in any mode).speed (good in any mode).
Dual Axis Accelerometer (ADXL 311)Dual Axis Accelerometer (ADXL 311)– Measures dynamic and static Measures dynamic and static
acceleration on both X and Y axis.acceleration on both X and Y axis.– Supply voltage 5 V.Supply voltage 5 V.– Output – analog. Bandwidth 3KHZ. Output – analog. Bandwidth 3KHZ. – Sampling frequency > 6 KHZ.Sampling frequency > 6 KHZ.
What can you do with the accelerometer?What can you do with the accelerometer?– Application: tilt or motion sensor.Application: tilt or motion sensor.– Am I standing straight? Am I standing straight?
Measure pitch and roll in degrees.Measure pitch and roll in degrees. Pitch = asin(Ax/1g); Roll asin(Ay/1g).Pitch = asin(Ax/1g); Roll asin(Ay/1g).
– Orient an arm.Orient an arm.– Collision detection.Collision detection.
Gear ToothGear Tooth Sensors 101 Sensors 101
Gear Tooth Sensors (2)Gear Tooth Sensors (2)– AT642LSH Peak Detecting Gear Tooth Sensor.AT642LSH Peak Detecting Gear Tooth Sensor.– Generates a pulse when a gear tooth is Generates a pulse when a gear tooth is
detected.detected.– Speed of the gear: pulse rate.Speed of the gear: pulse rate.– Cannot easily determine direction of the gearCannot easily determine direction of the gear– Digital Output.Digital Output.– Supply voltage: 12 V.Supply voltage: 12 V.
Gear ToothGear ToothSensors 101Sensors 101
What can you do with the gear What can you do with the gear tooth sensors?tooth sensors?– Control the speed of the wheel.Control the speed of the wheel.– Adjust for relative speed difference Adjust for relative speed difference
between wheels.between wheels.– AUTONOMOUS MODE: AUTONOMOUS MODE:
Move d feet distance.Move d feet distance. Circumference of the wheel.Circumference of the wheel. 2 * PI * R / Gear Teeth = Inches per Pulse.2 * PI * R / Gear Teeth = Inches per Pulse.
Encoders are commonly used as Encoders are commonly used as feedback devices for motor controllers.feedback devices for motor controllers.– An encoder is a sensor that uses light to An encoder is a sensor that uses light to
sense the speed and direction of a rotary sense the speed and direction of a rotary shaft. shaft.
– Encoders produce quadrature outputs which Encoders produce quadrature outputs which indicate the speed and direction of the shaft. indicate the speed and direction of the shaft.
– Inherently free from contact wear and the Inherently free from contact wear and the digital outputs are bounce less.digital outputs are bounce less.
– Provide greater accuracy and precision.Provide greater accuracy and precision.– Digital Output (2) (A & B).Digital Output (2) (A & B).– Supply Voltage 5 V.Supply Voltage 5 V.
Measures the rotation angle in terms of Measures the rotation angle in terms of electrical degrees.electrical degrees.– 00oo to 300 to 300oo-340-340oo depending on the pot. depending on the pot.– Use Linear Taper Use Linear Taper NOTNOT Audio Taper. Audio Taper.– Wire Wound, Conductive Plastic.Wire Wound, Conductive Plastic.– Limited number of revolutions.Limited number of revolutions.
Unlimited versions are available, but rare.Unlimited versions are available, but rare. Sliders are available instead of rotational.Sliders are available instead of rotational.
– 100K ohm for the OI.100K ohm for the OI.– 10K, 5K, 1K ohm for the RC.10K, 5K, 1K ohm for the RC.– Analog Output.Analog Output.– Supply Voltage 5V.Supply Voltage 5V.
What can I do with a sonic range What can I do with a sonic range finder?finder?– Measure the distance to an object.Measure the distance to an object.– Listen for approaching objects.Listen for approaching objects.
Another robot is approaching so move away.Another robot is approaching so move away.
Emit modulated infrared (IR) energy and measure Emit modulated infrared (IR) energy and measure amount of (IR) returned.amount of (IR) returned.
Range: inches to several feet.Range: inches to several feet. Led IR sensors have ranges of 3-5 inches. Led IR sensors have ranges of 3-5 inches. Problems: Most venues use halogen/tungsten Problems: Most venues use halogen/tungsten
lighting. 90% of the energy emitted is infrared lighting. 90% of the energy emitted is infrared radiation.radiation.
Light SensorsLight SensorsSensors 101Sensors 101
Red LED emits light and a phototransistor Red LED emits light and a phototransistor measures the incoming light. measures the incoming light.
What can you do with a light sensor?What can you do with a light sensor?– Recognize objects of certain colors.Recognize objects of certain colors.– Follow a line.Follow a line.
Problems: Ambient light and battery level affect Problems: Ambient light and battery level affect sensor readings. sensor readings.
Find the light.Find the light.– CMUCam2 Get_Tracking_State().CMUCam2 Get_Tracking_State().– Get direction left or right degrees (pan angle).Get direction left or right degrees (pan angle).– Get distance to the light (tilt angle and a lookup table).Get distance to the light (tilt angle and a lookup table).
Turn towards the light.Turn towards the light.– Use the gyro to turn to the matching pan angle.Use the gyro to turn to the matching pan angle.
Drive towards the light.Drive towards the light.– Encoders / Gear tooth (Counts per inch).Encoders / Gear tooth (Counts per inch).– Gyro keep driving straight (+/- a few degrees).Gyro keep driving straight (+/- a few degrees).
Fine tune.Fine tune.– Sonic Ranger creep in until inches away.Sonic Ranger creep in until inches away.
Raise the arm.Raise the arm.– Potentiometer measure the upward angle.Potentiometer measure the upward angle.
Information ResourcesInformation ResourcesSensors 101Sensors 101
ChiefDelphi – White PapersChiefDelphi – White Papers– Working the AnglesWorking the Angles
Kevin Watson FAQ’s and Sample CodeKevin Watson FAQ’s and Sample Code– http://www.kevin.org/frc/camera/http://www.kevin.org/frc/camera/– http://www.kevin.org/frc/gyro/http://www.kevin.org/frc/gyro/– http://www.kevin.org/frc/encoder/http://www.kevin.org/frc/encoder/
Vendors and SuppliersVendors and SuppliersSensors 101Sensors 101