ED Tracker 2.9 (Friday 13th)

Thought it worth a fresh post, and after much beer...

https://reprapdad.wordpress.com/201...ched-2-9-and-updated-invensensemotionlibrary/

I've had a fight with github but hopefully it's all in the right place!

UI, sketches AND InvensenseMotionDriver Arduino library updated to you'll need to copy that across under <arduino ide>/library or <your docs>/arduino/library whichever you use.

New UI requires latest calibration sketch or tracker sketch to be loaded or it won't find the tracker (it pings each active com port with a message and expects an 'hello' back)

Let me know if anything is broken, e.g. "I get ****** error because you missed out **** you blithering fool" or some such :)

Note about auto-centring /spring back. Do spend a few moments playing with this (linear mode works best at the moment). Look ahead and 'recentre' the tracker. Now if you look slightly left or right and keep still it will spring back.

Now look up and then slightly to one side. It doesn't spring back. Slowly lower you gaze and when your near level it will spring back. You can get to know where the 'letterbox' zone if for spring back and use it to quickly fix any small drift. It's adjusting all the time so helps stabilise drift during normal play.

I find I don't have to recentre at all during play but you mileage may vary.

Cheers,

Rob
 
Cable finally arrived, and I figured why not go with the most current version and see what happens. Unfortunately this happens:

Code:
Arduino: 1.5.6-r2 (Windows 7), Board: "Arduino Micro"

Build options changed, rebuilding all

Using library Wire in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\Wire (legacy)

Using library EEPROM in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\EEPROM (legacy)



C:\Program Files (x86)\Arduino\hardware\tools\avr\bin\avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -MMD -mmcu=atmega32u4 -DF_CPU=16000000L -DARDUINO=156 -DARDUINO_AVR_MICRO -DARDUINO_ARCH_AVR -DUSB_VID=0x2341 -DUSB_PID=0x8037 -DUSB_MANUFACTURER= -DUSB_PRODUCT="Arduino Micro" -IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino -IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\micro -IC:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\Wire -IC:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\EEPROM C:\Users\ABC\AppData\Local\Temp\build1907665633437069881.tmp\EDTrackerIICalibrate.cpp -o C:\Users\ABC\AppData\Local\Temp\build1907665633437069881.tmp\EDTrackerIICalibrate.cpp.o 

EDTrackerIICalibrate.ino: In function 'void setup()':
EDTrackerIICalibrate.ino:139: error: 'mpu_set_dmp_state' was not declared in this scope
EDTrackerIICalibrate.ino:141: error: 'mpu_read_6050_accel_bias' was not declared in this scope
EDTrackerIICalibrate.ino: In function 'void loop()':
EDTrackerIICalibrate.ino:185: error: 'dmp_read_fifo' was not declared in this scope
EDTrackerIICalibrate.ino:188: error: 'Quaternion' was not declared in this scope
EDTrackerIICalibrate.ino:188: error: expected `;' before 'q'
EDTrackerIICalibrate.ino:194: error: 'q' was not declared in this scope
EDTrackerIICalibrate.ino:220: error: 'mpu_get_temperature' was not declared in this scope
EDTrackerIICalibrate.ino: In function 'void initialize_mpu()':
EDTrackerIICalibrate.ino:326: error: 'mpu_init' was not declared in this scope
EDTrackerIICalibrate.ino:328: error: 'INV_XYZ_GYRO' was not declared in this scope
EDTrackerIICalibrate.ino:328: error: 'INV_XYZ_ACCEL' was not declared in this scope
EDTrackerIICalibrate.ino:328: error: 'mpu_set_sensors' was not declared in this scope
EDTrackerIICalibrate.ino:330: error: 'mpu_set_gyro_fsr' was not declared in this scope
EDTrackerIICalibrate.ino:331: error: 'mpu_set_accel_fsr' was not declared in this scope
EDTrackerIICalibrate.ino:334: error: 'mpu_configure_fifo' was not declared in this scope
EDTrackerIICalibrate.ino:335: error: 'mpu_set_sample_rate' was not declared in this scope
EDTrackerIICalibrate.ino:337: error: 'dmp_load_motion_driver_firmware' was not declared in this scope
EDTrackerIICalibrate.ino:339: error: 'dmp_set_orientation' was not declared in this scope
EDTrackerIICalibrate.ino:341: error: 'dmp_register_tap_cb' was not declared in this scope
EDTrackerIICalibrate.ino:343: error: 'DMP_FEATURE_6X_LP_QUAT' was not declared in this scope
EDTrackerIICalibrate.ino:343: error: 'DMP_FEATURE_SEND_RAW_ACCEL' was not declared in this scope
EDTrackerIICalibrate.ino:344: error: 'DMP_FEATURE_SEND_RAW_GYRO' was not declared in this scope
EDTrackerIICalibrate.ino:346: error: 'DMP_FEATURE_TAP' was not declared in this scope
EDTrackerIICalibrate.ino:348: error: 'dmp_enable_feature' was not declared in this scope
EDTrackerIICalibrate.ino:349: error: 'dmp_set_fifo_rate' was not declared in this scope
EDTrackerIICalibrate.ino: In function 'void update_bias()':
EDTrackerIICalibrate.ino:386: error: 'mpu_set_gyro_bias_reg' was not declared in this scope
EDTrackerIICalibrate.ino:387: error: 'mpu_set_accel_bias_6050_reg' was not declared in this scope
EDTrackerIICalibrate.ino:399: error: 'dmp_read_fifo' was not declared in this scope
EDTrackerIICalibrate.ino: In function 'void loadBiases()':
EDTrackerIICalibrate.ino:476: error: 'mpu_set_accel_bias_6050_reg' was not declared in this scope
EDTrackerIICalibrate.ino:484: error: 'mpu_set_gyro_bias_reg' was not declared in this scope
EDTrackerIICalibrate.ino: In function 'void flipBias()':
EDTrackerIICalibrate.ino:497: error: 'mpu_set_gyro_bias_reg' was not declared in this scope
EDTrackerIICalibrate.ino:502: error: 'mpu_get_accel_sens' was not declared in this scope
EDTrackerIICalibrate.ino:515: error: 'mpu_get_gyro_sens' was not declared in this scope
EDTrackerIICalibrate.ino:526: error: 'dmp_set_gyro_bias' was not declared in this scope

I followed the instructions in the "EDTrackerII - Software Install & Flashing Guide" on brumster's site.



PS: Here's a tree view of all files and folders in My Documents\Arduino:

DUG1Xxd.png
 
Last edited:
The InvensenseMotionDriver directory should be inside you libraries directory along side the I2CDev directory.

I am using my custom board as it is a lot easier!
 
Thank you very much. Figures I took "unpack" too literal. Typical pebkac.



Corrected the InvensenseMotionDriver folder and added I2Cdev, so the \My Documents\Arduino\ folder now looks like this:
NDQ8GrX.png

The Arduino IDE however is still throwing error messages:
Code:
C:\Users\ABC\AppData\Local\Temp\build1627756284507562570.tmp\InvensenseMotionDriver\arduino_shim.cpp.o: In function `shim_i2c_read':
C:\Users\ABC\Documents\Arduino\libraries\InvensenseMotionDriver/arduino_shim.cpp:38: undefined reference to `I2Cdev::readTimeout'
C:\Users\ABC\Documents\Arduino\libraries\InvensenseMotionDriver/arduino_shim.cpp:38: undefined reference to `I2Cdev::readTimeout'
C:\Users\ABC\Documents\Arduino\libraries\InvensenseMotionDriver/arduino_shim.cpp:38: undefined reference to `I2Cdev::readBytes(unsigned char, unsigned char, unsigned char, unsigned char*, unsigned int)'
C:\Users\ABC\AppData\Local\Temp\build1627756284507562570.tmp\InvensenseMotionDriver\arduino_shim.cpp.o: In function `shim_i2c_write':
C:\Users\ABC\Documents\Arduino\libraries\InvensenseMotionDriver/arduino_shim.cpp:19: undefined reference to `I2Cdev::writeBytes(unsigned char, unsigned char, unsigned char, unsigned char*)'
 
Thank you very much. Figures I took "unpack" too literal. Typical pebkac.



Corrected the InvensenseMotionDriver folder and added I2Cdev, so the \My Documents\Arduino\ folder now looks like this:
NDQ8GrX.png

The Arduino IDE however is still throwing error messages:
Code:
C:\Users\ABC\AppData\Local\Temp\build1627756284507562570.tmp\InvensenseMotionDriver\arduino_shim.cpp.o: In function `shim_i2c_read':
C:\Users\ABC\Documents\Arduino\libraries\InvensenseMotionDriver/arduino_shim.cpp:38: undefined reference to `I2Cdev::readTimeout'
C:\Users\ABC\Documents\Arduino\libraries\InvensenseMotionDriver/arduino_shim.cpp:38: undefined reference to `I2Cdev::readTimeout'
C:\Users\ABC\Documents\Arduino\libraries\InvensenseMotionDriver/arduino_shim.cpp:38: undefined reference to `I2Cdev::readBytes(unsigned char, unsigned char, unsigned char, unsigned char*, unsigned int)'
C:\Users\ABC\AppData\Local\Temp\build1627756284507562570.tmp\InvensenseMotionDriver\arduino_shim.cpp.o: In function `shim_i2c_write':
C:\Users\ABC\Documents\Arduino\libraries\InvensenseMotionDriver/arduino_shim.cpp:19: undefined reference to `I2Cdev::writeBytes(unsigned char, unsigned char, unsigned char, unsigned char*)'


Your I2CDev looks a bit messed up, get the proper one from https://github.com/jrowberg/i2cdevlib/tree/master/Arduino

You could avoid all this hacking around and get my custom board which you simply unpack to Documents\Arduino\Hardware\ from https://drive.google.com/#folders/0B6J4eiqUG9zySTIwWTdTcDJ0ZU0 (for ArduinoIDE 1.5.6r2)
 
Oh boy. Shame on me...

Had put in I2Cdev from the MSP430 folder when it should have been from the Arduino folder in the first place.
 
Tried the version from yesterday. The numbers do look better than before though I still get that strange flip within about 30 minutes.

Interestingly after that happens you can only look up and down, looking sideways does not work anymore, the head will not rotate.

Here's a screen

Flipya.jpg

I can recreate this at will, and it will always flip a 180.
 
Tried the version from yesterday. The numbers do look better than before though I still get that strange flip within about 30 minutes. ...
I can recreate this at will, and it will always flip a 180.

Those gyro bias values look huge. Typically I get double digits.

Can you load the calibration sketch, run the UI and take a screenshot before hitting 9 and afterwards ?

Cheers,

Rob
 
Got it working, but I had to plug it into a different USB port. I remember now having had an issue with my dad's bike computer that can be programmed via USB. It was also a COM via USB device that absolutely did not work on any of the USB3 ports, but plugging it into a USB2 port it sprang to life as if nothing ever happened.

Short story: If people are having difficulties getting their EDTracker to work, you might have to test several USB ports and try again, including the flashing. After flashing is done and your unit is set up, you should be able to use a different USB port again.
 
I just fixed it on my side. Basically what I did was to erase everything in EEPROM with this here:

Code:
#include <EEPROM.h>

void setup()
{
  // write a 0 to all 512 bytes of the EEPROM
  for (int i = 0; i < 512; i++)
    EEPROM.write(i, 0);
   
  // turn the LED on when we're done
  digitalWrite(13, HIGH);
}

void loop()
{
}

After that it looks like this:

140614-after-F9_after-EEPROM-clear.jpg

It seems that some previous versions of EDTracker (v1 or v2) did have some issue in how the Bias is stored.
 
Tried the version from yesterday. The numbers do look better than before though I still get that strange flip within about 30 minutes.

Interestingly after that happens you can only look up and down, looking sideways does not work anymore, the head will not rotate.

I get this too I have 2 now 6050 and 9150, 9150 works better but it still flips after 30mins maybe towards an hour, if I recenter it just reverses it, it mostly happens when I look left and then it flips then recenter look right full flip. I checked it in the devices properties and it does it there, I know just un-plugging it fixes but is it a bug with the software hardware or windows?

I used the latest sketch I got from last night
 
Well have to say that the numbers are looking better for sure on this update. But also have found the perfect locking mechanism using a USB stick and X55 throttle :D

WP_20140614_16_17_32_Raw.jpg
 
Have let it sit there and let it figure out the drift compensation for like one and a half hours, and I still see it yawing slowly into both directions, depending on what appears to be temperature. It was moving slightly to the right when temperature was around 51 (what unit? Doesn't seem to be Fahrenheit). Since a couple of minutes temperatures seem to have gone up. The temperature reads now almost 54, and the head is slowly turning to the left.

That observation sparked the following experiment: How slowly can I turn my head? Can't keep up with the drift of the EDTracker regarding slowness. I'm much quicker.

Idea: Put in a minimum degree per second threshold the EDTracker has to achieve before movement is passed onto the joystick axes, like 2 to 3 degree per minute.
 
Won't the very slow return to a 'zero' position achieve the same thing?

Incidentally, I've run multiple data grabs logging the drift over 8 hours or so: the units wander up and down around a reasonably predictable constant (as set by careful calibration*). And that's when the unit is completely stationary - throw some head movement in and it can soon wander off further.

I don't think it's possible to get a 'correct' figure for permanent drift control, and some kind of imperceptible gradual centering is fairly inevitable.

*I got the best results by basically ignoring the first hour of data from the device, logging the x-axis position, pasting it into Excel and letting it fit a linear trend line.
 
Last edited:
Great work Pocketmoon, :)

I've been pretty happy with version 2 so far but gonna give this a try. What were the changes you made? I notice temperature is now a feature on the UI.
 
thanks rob am following your instructions now, thought I would have another as I think I missed off that new sketch you did.

will let you know how I get on
 
Back
Top Bottom