+ All Categories
Home > Documents > F.I.R.S.T Robotics Sensors 101 Michael Reffler Mentor FRC Team 1089 Hightstown, NJ...

F.I.R.S.T Robotics Sensors 101 Michael Reffler Mentor FRC Team 1089 Hightstown, NJ...

Date post: 26-Mar-2015
Category:
Upload: katelyn-orourke
View: 213 times
Download: 0 times
Share this document with a friend
Popular Tags:
27
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
Transcript
Page 1: 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,

F.I.R.S.T RoboticsF.I.R.S.T Robotics Sensors 101 Sensors 101

Michael RefflerMichael Reffler

Mentor FRC Team 1089Mentor FRC Team 1089

Hightstown, NJHightstown, NJ

[email protected]@gmail.com

January 5th 2008 Montgomery High School Skillman, NJ

Page 2: 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,

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 ?

Page 3: 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,

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

Page 4: 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,

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

Page 5: 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,

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

Page 6: 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,

CMUCam2CMUCam2Labview InterfaceLabview Interface

Camera FocusCamera Focus Load Sample ConfigurationLoad Sample Configuration Track Colors / View ResultsTrack Colors / View Results

Page 7: 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,

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

– PAN/TILT servo pwm assignmentPAN/TILT servo pwm assignment– Reversing servo directionReversing servo direction

Camera/tracking menus through Camera/tracking menus through HyperterminalHyperterminal

Camera settings stored permanently on the Camera settings stored permanently on the RCRC

Use Get_Tracking_State()Use Get_Tracking_State() Use Pan/Tilt angles for direction and distance Use Pan/Tilt angles for direction and distance

Page 8: 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,

CMUCam2CMUCam2Finding Range to the Finding Range to the

LightLight

range = Height_of_Light – Height_of_Camera / tan(tilt_angle_radians)range = Height_of_Light – Height_of_Camera / tan(tilt_angle_radians)

Page 9: 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,

Yaw Rate GyroYaw Rate GyroSensors 101Sensors 101

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

Page 10: 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,

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).

Page 11: 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,

Dual Axis AccelerometerDual Axis AccelerometerSensors 101Sensors 101

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.

Page 12: 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,

Dual Axis AccelerometerDual Axis AccelerometerSensors 101Sensors 101

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.

Page 13: 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,

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.

Page 14: 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,

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.

Page 15: 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,

Quadrature EncodersQuadrature EncodersSensors 101Sensors 101

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.

Page 16: 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,

Quadrature EncodersQuadrature EncodersSensors 101Sensors 101

What can you do with encoders?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..

Page 17: 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,

PotentiometersPotentiometersSensors 101Sensors 101

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.

Page 18: 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,

PotentiometersPotentiometersSensors 101Sensors 101

What can you do with What can you do with potentiometers?potentiometers?– Measure the angle of an elbow on an Measure the angle of an elbow on an

armarm Move the arm up or down until XMove the arm up or down until Xoo is is

reached reached

– Measure the turn of a turretMeasure the turn of a turret Turn left or right until XTurn left or right until Xoo is reached is reached

– Raise or lower a telescoping armRaise or lower a telescoping arm Move up or down until XMove up or down until Xoo is reached is reached

Page 19: 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,

Sonar/Sonic RangersSonar/Sonic RangersSensors 101Sensors 101

Emit a sound and measure the time of flight Emit a sound and measure the time of flight distance.distance.

Ranges: 6 inches – 20 feet, with a field of view of Ranges: 6 inches – 20 feet, with a field of view of approximately 30approximately 30oo..

Other versions available with smaller/narrower beam Other versions available with smaller/narrower beam widths.widths.

Analog Output ~9.8mv inchAnalog Output ~9.8mv inch Supply Voltage 3.3-5.5VSupply Voltage 3.3-5.5V

Page 20: 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,

Sonar/Sonic RangersSonar/Sonic RangersSensors 101Sensors 101

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.

Page 21: 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,

Touch/Bumper SensorsTouch/Bumper SensorsSensors 101Sensors 101

If pressure is applied to it, an electrical If pressure is applied to it, an electrical signal is generated.signal is generated.

What can you do with it?What can you do with it? – I already bumped into something. I better get I already bumped into something. I better get

back, stop, or move around it.back, stop, or move around it.

Page 22: 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,

Infrared SensorsInfrared SensorsSensors 101Sensors 101

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.

Page 23: 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,

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.

Page 24: 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,

Autonomous NavigationAutonomous NavigationSensors 101Sensors 101

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.

Page 25: 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,

Information ResourcesInformation ResourcesSensors 101Sensors 101

ChiefDelphi – White PapersChiefDelphi – White Papers– Working the AnglesWorking the Angles

http://www.chiefdelphi.com/media/papers/1755http://www.chiefdelphi.com/media/papers/1755 Sample Gyro codeSample Gyro code

– Quadrature EncodersQuadrature Encoders http://www.chiefdelphi.com/media/papers/1490http://www.chiefdelphi.com/media/papers/1490 Sample Encoder codeSample Encoder code

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/

Page 26: 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,

Vendors and SuppliersVendors and SuppliersSensors 101Sensors 101

Digi-Key ElectronicsDigi-Key Electronics– http://www.digikey.com/http://www.digikey.com/

Newark in OneNewark in One– http://www.newark.com/http://www.newark.com/

Mouser ElectronicsMouser Electronics– http://www.mouser.com/http://www.mouser.com/

Jameco ElectronicsJameco Electronics– http://www.jameco.com/http://www.jameco.com/

SparkfunSparkfun– http://www.sparkfun.com/http://www.sparkfun.com/

USDigitalUSDigital– http://www.usdigital.com/http://www.usdigital.com/

Page 27: 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,

Questions ? Answers?Questions ? Answers?Sensors 101Sensors 101

??????


Recommended