90 likes | 549 Views
Accelerometers and Gyros. Timothy Friez Class # 3 1/29/08. Accelerometer. The Dual-Axis Accelerometer (DAA) measures both vibration and gravity. It should be connected to two of the RC analog inputs. One to measure X-axis acceleration and one to measure Y-axis acceleration.
E N D
Accelerometers and Gyros Timothy Friez Class # 3 1/29/08
Accelerometer The Dual-Axis Accelerometer (DAA) measures both vibration and gravity. It should be connected to two of the RC analog inputs. One to measure X-axis acceleration and one to measure Y-axis acceleration.
Using Accelerometer with ROBOTC • Connect to two analog inputs (analog inputs 2 and 3 on our robot) • Set “Motors and Sensor Setup” to Accelerometer.
Using Accelerometer with ROBOTC • Access values with • SensorValue[x_axis] • SensorValue[y_axis] • Values will range from -200 to 200 • Scale is 100ths of a “G” • So a value of 153 would be 1.53Gs • Sensor will be at rest at or near zero.
Gyro Sensor The Yaw Rate Gyro sensor is used to determine rotation. The output labeled “T” is for “Twist” or rotational velocity. The output labeled “R” is “Relative Temperature”. 80 degrees/sec resolution
How to use gyro with ROBOTC Connect to one analog input – “twist” only (analog input 1 on our robot) Set “Motors and Sensor Setup” to Accelerometer.
Access using the command: SensorValue[gyro] Sensor will give back results in tenths of a degree. A reading of 900 is actually 90.0 degrees The sensor is automatically zeroed at the start of your program. How to use gyro with ROBOTC