MPU-6050 Warm Up and DMP Yaw Drift

The MPU-6050  needs to warm up for 10-15 minutes before the gyro/accelerometer outputs really settle down.  This can be a right pain if you’ve spend time carefully calibrating your EDTracker only for it to drift for 10 minutes when you first plug it in, like this (temperature in red, yaw drift in blue):

bad

The next sketch release will take a ‘no motion’ snapshot when the tracker is first plugged in, recording the initial temperature and yaw drift. It will then interpolate drift compensation between the initial value required and the stored value as the tracker warms up.  So how does it look ? Awesome!

good

It isn’t perfect as the tracker doesn’t store the temperature at which the main drift compensation was saved. So I’ve estimated 28 degrees in the test sketch which look like it’s a couple of degrees out.  Will need a minor update the the UI to store the drift compensation temperature into EEPROM.

New UI and sketches available …. soon.

Advertisements

STM32F3 – The Mothership

A cool thing – an ARM Cortex 5 based dev board loaded with sensors, including magnetometer, gyro and accelerometer all for around £10! Bargain.

May be a bit big to strap to your head though…

Processing bugs

Seems there’s a bug in Processing whereby if you export a program the serial port libs don’t work and the app hangs. Sucks. Workaround is to install Processing itself and the required library (toxiclibs) and then build/run the EDTRacker UI from scratch.

On a positive note I think I’ve found a way of using the horribly noisy magnetometer on the MPU-9150 for zero drift use.  Having the auto-drift compensation in the existing V2.9 sketch means there’s only marginal benefit paying more for the  MPU9150.

Also had a quick blast with Rise Of Flight and rFactor2 both which support head look joystick bindings and therefore support EDTRacker 🙂   Rise Of Flight  is very pretty.  Now if I can find my old Falcon 4 DVD…

Workaround

 

Download and install  Processing from https://processing.org/download/?processing

Download toxiclibs library from http://hg.postspectacular.com/toxiclibs/downloads/toxiclibs-complete-0020.zip

Unzip these under <my docs>/Processing/libraries

MyDocs->Processing->libraries ->toxiclibs_p5 etc

Create a new folder:  <my docs>/Processing/EDTrackerUtil

Copy the source files from the github zip (https://github.com/pocketmoon/EDTracker2/archive/master.zip )   to the new EDTrackerUtil folder above

i.e the files in the zip in folder  EDTracker2-master\UI\source

Open EDTrackerUtil.pde in Processing hit Run |>

 

I’ve had enough of Processing now.  It’s very quick for prototyping but sucks for  creating applications that will run for everyone.  UI will now be .Net  or perhaps Unity

 

 

 

 

 

 

New UI, Calibration (2.2) and Tracker Sketched (2.9) and updated InvensenseMotionDriver Library

[edit] 15/06  Fixed flip/180 degree issue.  Add ability to set bias to factory vaues.

[edit] 22:37 Github being a pain but should be good to go now!

[edit] 21:00 ish Github updating within the hour with new code so check back soon…

There is an updated UI, Calibration sketch, Tracker sketch and arduino InvensenseMotionDriver Library.

https://github.com/pocketmoon/EDTracker2

Changes:
More robust. Smart scan of com ports for ED Tracker (see note above).

  • A Larger window ‘cos we’re showing more stuff
  • All RAW Gyro and Accel values are now show
  • Enable Accel bias values to be calculated individually.
  • Added temperature to graph – make sure the sensor has ‘warmed up’ before bias calcs.

 

Image

N.B Lated UI works with latest calibration sketch (2.2 or better) and latest tracker sketch (2.9 or later) only.

Calibration

Pre-requisites

  • Latest sketches copied under <you docs>/Arduino/
  • Latest InvensenseMotionDriver library copied to <arduino ide>/library/
  • Latest UI folder placed somwhere
  • Load the EDTrackerIICalibration sketch to the EDTracker using the Arduino IDE

Steps to calculate bias values:

  1.  Ensure sensor is a flat and as still as possible
  2.  Wait for sensor to warm up (temperature shown on red line – can take 10 mins or more)
  3.  Hit 9 and wait 5 second or so for calibration to finish
  4.  Repeat step 3 until all Raw Gyro values are 0.
  5.  Hit x to select Accel X Axis only
  6.  Hit 9 to recalibrate. Repeat until reading +/- single digits. value will vary quickly but should be between -10 & 10)
  7.  Hit y and Repeat steps 5 to 6 for the y axis
  8.  Hit z and repeat but aim for 16380 +/- 10
  9.  Q to quit.

 

Tracker Final Setup

Image

  • Load the EDTrackerII sketch to the ED Tracker using the Arduino IDE
  • Put it on top of your head

Final Setup Steps

  1. Run the UI
  2. Move your head to check that the tracker is active.
  3. Hit 5 to set the orientation correctly – head should mirror you movements
  4. Hit 6 to select and save either Linear or Exponential response mappings.
  5. Hit 3 to recenter the head
  6. Wait a few minutes
  7. Hit 8 to save yaw Drift Compensation
  8. Repeat steps 5 to 7 if needed (drift should be less than +/- 1.0)
  9. Q to quit

 

Play Elite Dangerous!!