ptrbrtz/razor-9dof-ahrs — pull request #23 by psychogenic (2014-07-29 04:44:03+00:00)
Title: EEPROM-based calibration system with serial line interface

Greets!

I've been using AHRS and love it, but for the need to recompile when calibrating.

I've created this patch which enables eeprom-based sensor calibration, and also provides a means to view and set calibration values using the serial line/terminal.

All the basic calibration values are supported, though I wanted some feedback before proceeding to implemented the extended magnetometer stuff (the system currently accommodates the values, it just doesn't support setting them through the serial line yet).

Here's a sample of my interaction with the IMU through the serial Monitor (comments in [brackets]):

-------------------------------------------------------------------------------------------------------------
[Example Serial Line interaction with EEPROM calibration system]

#ch [Show calibration help]

***** Calibration Help *****
All commands prefixed with '#c' followed by:
* get or set [g/s]
* accel, magn, or gyro [a/m/g]
* coord: x,y, or z [x/y/z]
For accel and magnetometer:
* min or max [m/M]

Examples:
Get acceleration x max:	#cgaxM
Set acceleration y min:	#csaym -244.00
Set gyro z:	#csgz -39.9

Current calibration values may be dumped with #cd or #cD (includes calculated values)

#cd [Dump calibration values]

*** Current Calibration ***
- Accelerometers
x:	min: -260.000
max: 257.000
y:	min: -250.000
max: 266.000
z:	min: -284.000
max: 240.000
- Magnetometers
x:	min: -531.000
max: 700.000
y:	min: -476.000
max: 436.000
z:	min: -590.000
max: 320.000
- Gyros
x: -39.350
y: -3.580
z: 29.140

#csgz 28.666 [Set gyro z value to 28.666]

#cd [Calibration values dump]

*** Current Calibration ***
* Accelerometers
x:	min: -260.000
max: 257.000
y:	min: -250.000
max: 266.000
z:	min: -284.000
max: 240.000
* Magnetometers
x:	min: -531.000
max: 700.000
y:	min: -476.000
max: 436.000
z:	min: -590.000
max: 320.000
* Gyros
x: -39.350
y: -3.580
z: 28.666

[success!]

-------------------------------------------------------------------------------------------------------------

Please let me know what you think and if there's anything you'd need to get this pushed onto the main trunk.

Regards,
Pat Deegan http://flyingcarsandstuff.com