Transcript pptx
Gyroscopes, Accelerometers, and IMUs Jack Knudson, Jawad Nasser, and Mike Carrothers 1 Example: Wii Remotes Want to track position and orientation Useful for various things, particularly for bowling In-game character follows hand movement Can throw the bowling ball at certain speeds Can even add spin Accelerometers+Gyroscopes are perfect for this http://images.amazon.com/images/G/01/videogames/detail-page/WiiRemote4.jpg https://www.youtube.com/watch?v=U8L2OPgBIgY 2 Gyroscopes 3 What are Gyroscopes? Sensors that detect changes in angular velocity/rotational motion and changes in orientation Angular velocity is measured in degrees per second (°/s, dps) or revolutions per second (RPS) Has various other names: gyro sensors, gyrometers, angular rate sensors, angular velocity sensors, or just gyros 4 Example Applications http://www5.epsondevice.com/en/information/technical_info/gyro 5 Wii Remote: Gyroscope Can track orientation and turns really well This includes how fast you turn your hand Can’t track linear motions at all Note: Basic wii remotes actually don’t have gyroscopes They use the IR sensor to approximate orientation Fails when remote isn’t facing tv (say when swinging remote behind you) 6 How Do Gyroscopes Work? Here’s a link for more info on the more physical aspects of how it works: http://www5.epsondevice.com/en/information/technical_info/gyro/ Images from https://learn.sparkfun.com/tutorials/gyroscope/how-a-gyro-works 7 Types: Analog vs Digital Analog Represent velocity by varying voltage (usually in mV per °/s) Usually less expensive and sometimes more accurate than digital Requires an ADC Digital Often communicates via SPI or I2C interfaces I2C gyros typically have a limitation of max sample rate of 400Hz Typically more expensive but tends to have other features included 8 Gyroscope Specifications Axes Measured Range Sensitivity Error/Bias 9 https://www.sparkfun.com/pages/accel_gyro_guide Axes Measured Axes sometimes labeled as x/y/z, sometimes as roll/pitch/yaw Many gyros only measure one or two axes Double check what you’re buying matches what you need http://mobiledevdesign.com/sitefiles/mobiledevdesign.com/files/archive/mobiledevdesign.com/images /0715MDDtechfeature-Fig1.jpg 10 Range Ex: 20, 100, 500, 2000 °/s Represents maximum angular velocity can read Careful- higher range means lower resolution/precision Pick what suits your situation best Lower (20 or 100 °/s) for slower rotating objects Wii remote or hand-based controllers: 130-200 °/s works well Higher ranges (500 or 2000 °/s) for faster rotating objects A frisbee rotates very fast- often 6.5+ rps or 2340+°/s 11 Sensitivity Ex: 2.1 mv/°/s, 9.0 mv/°/s Measured in mv per °/s Ex: 9 mv/°/s means if the gyroscope outputs 1mv, the object rotated 9 °/s Closely related to range Typical inverse relationship- higher range means lower sensitivity and lower resolution Need to keep in mind for desired resolution and ADC setup https://cdn.sparkfun.com/assets/7/f/0/9/7/5112dacbce395f1c26000000.jpg 12 Error/Bias Usually has some error or bias Can be seen via observing output while keeping gyro still Need to calibrate for these typically low values Translates to handling in software Temperature greatly affects the bias Try to calibrate in temperatures similar to realistic temperatures for use Gyroscopes typically include a temperature sensor Can use temperature to be careful of changing gyroscope bias 13 Accelerometers 14 What’s an accelerometer? A MEMS device used to measure static or dynamic linear translational forces A potentially *cheap way to get Shock detection (dynamic) Inclination/tilt detection with respect to gravity (static) *depending on what sort of precision/durability/etc is needed adafruit.com developer.apple.com 15 How does an accelerometer work? How they work is largely unimportant (to us) In a nutshell: Kinetic forces induce voltages in a piezoelectric crystal Kinetic forces change capacitance by physically moving an electro mechanical capacitor These changes in output/capacitance are output as digital or analog values For the curious: http://www.sensorwiki.org/doku.php/sensors/accelerometer http://www.pcb.com/techsupport/tech_accel http://engineering-sciences.uniroma2.it/MENU/DOWNLOAD/TESI/2013/2013_tesi%20NISTICO%20Andrea.pdf www.analog.com www.pcb.com 16 Wiimote example Bowling How fast am I tossing the ball? http://purenintendo.com/ Where am I in the course of my toss? What’s the orientation w.r.t gravity when I release? All of these can be measured (more or less) with an accelerometer This still isn’t enough! http://paulbourke.net/ 17 Important considerations when using an accelerometer Many of the same considerations as the gyroscope Analog Signal may require filtering depending on application Can be fed into A2D Digital Pulsewidth modulation vs serial bus interface Degrees of freedom/axes Some accelerometers only have x & y acceleration 18 The MMA8451 8 bucks on a handy Adafruit breakout Features 14-bit resolution, +-2, 4, 8 g’s I2C interface for reading acceleration data & configuring accelerometer settings Two configurable interrupt pins Can trigger on data ready, motion/freefall, tap (pulse), orientation change, etc. etc. High-pass filters for tap/freefall Low-pass filters for tilt, orientation change 19 Inertial Measurement Unit (IMU) 20 What is an IMU? A device that measures linear acceleration and angular velocity using accelerometers and gyroscopes Sometimes also measures magnetic field using magnetometers https://forums.oculus.com/viewtopic.php?t=886 21 Why use an IMU? ● ● If using only an accelerometer or gyroscope is not good enough for your needs Example: Wii Remote ○ Gyro: Good for angular rotation, bad for linear acceleration ○ Accelerometer: Good for linear acceleration/tilt, bad for angular rotation ○ Why not use both and get the best of both worlds for determining controller orientation and movement? http://troikatronix.com/support/kb/using-wii-remote-with-isadora-mac/ http://www.analog.com/media/en/technical-documentation/white-papers/The_Five_Motion_Senses.pdf 22 Degrees of Freedom (DOF) http://www.roadtovr.com/introduction-positional-tracking-degrees-freedom-dof/ 23 Features/Advantages of using an IMU Small, light, cheap (~$20-80 for decent MEMS IMU) Many options for all your applications Ability for measurements in 2-9 DOF (based on application needs) Magnetometer (if available) can provide 3 additional measurements, commonly used for measuring the Earth’s magnetic field to detect magnetic north Additional variety of ranges and interfacing options Examples found here: https://www.sparkfun.com/pages/accel_gyro_guide 24 Disadvantages/Limitations of IMUs IMUs cannot perform general position tracking by itself! Errors still occur and build up over time Integrating twice from acceleration to velocity and velocity to position leads to quadratic accumulation of drift Need to introduce some kind of external input that can provide an absolute reference for the IMU (GPS, encoder, IR sensor) 25 Examples of IMU Limitations and Workarounds Oculus Rift IMU failing to achieve position tracking https://www.youtube.com/watch?v=_q_8d0E3tDk Position tracking succeeding due to user-imposed restraints https://www.youtube.com/watch?v=SI1w9uaBw6Q 26 Adafruit 9-DOF IMU Breakout Accelerometer: 3-axis, +/-2g, +/-4g, +/-8g, +/- 16g Gyroscope: 3-axis, +/-250, +/-500, +/-2,000 deg/sec Magnetometer: 3-axis, +/-1.3 to +/-8.1 gauss Interfacing: I2C Bonus Features: Low power mode, programmable interrupt generators, temperature sensor, axis turn-on/off, sampling rate options Cost: $19.95 Weight: 2.8g https://www.adafruit.com/products/1714 27 IMU I2C Interfacing ● ● ● ● Accelerometer addr: 0011001b Gyro addr: 1101011b Magnetometer addr: 0011110b Add ‘1’ onto slave address for reads, add ‘0’ for writes ● SUB is register address, used for setting control bits and reading sensor data https://www.adafruit.com/datasheets/LSM303DLHC.PDF (accel/magnetometer spec sheet), https://www.adafruit.com/datasheets/L3GD20H.pdf (gyro spec sheet) 28 References SparkFun Accel/Gyro/IMU Quick Guide: https://www.sparkfun.com/pages/accel_gyro_guide SensorWiki Gyroscope (great for accelerometers as well) Guide to gyro and accelerometer with Arduino including Kalman filtering Kalman filtering is a great idea for dealing with bias and drift Gyroscopes SparkFun’s Gyro Focused Guide (really good overview) FutureElectronics’s Gyro Sensor Intro Epson’s Gyro “How They Work” Sabran Colibrys’ Applications & Types of Gyros (great to look over at least once) 29 Thank you! Questions? 30