ImuCalibration/Gyroscopes

== Turntable Procedure ==
=== Hardware ===
== Pictures ==
File:Turntable rig.JPG|Turntable rig
Image:IMU_cradle_view_1.0.JPG|IMU cradle view 1.0
Image:IMU_cradle_view_1.1.JPG|IMU cradle view 1.1
Image:encoder_mount_base.JPG|Encoder mount base
Image:Olimex_lpc_H2148.JPG|Olimex LPC H2148
Image:rotary_encoder.JPG|Omron rotary encoder
== Components ==
* audio-technica AT-LP120_USB Direct Drive Professional Turntable
* Olimex LPC H2148
* Omron rotary encoder
* Lisa/L+IMU, Xbee 2.4Ghz modem set, fibreglass mounting plates and general wiring components
* Encoder mount hoop - engineering shop?
== Wiring ==
Encoder to LPC
* Black (common) to EXT2 GND
* Red 5~12 VDC to EXT2 Vin(5v)
* White OUTA to EXT1 PO.22
LPC to LPC 
* EXT2 3.3v to EXT1 PO.22 (pull up resistor)
=== Software === 
== LPC Code Modifications ==
In case of USB 2.0 A-B cable operation, ~/conf/airframes/Poine/turntable.xml has to be amended, as follows, and saved as ~/turntable_dev_usb.xml:
A new turntable session has to be added to ~/conf/control_panel.xml:
A new aircraft (A/C) named "TT" has to be built using the paparazzi centre:
== IMU Code Modifications ==
Similar files have to be created for the IMU cradle unit: 
The airframe is a standard rotorcraft file with the appropriate IMU defined. 
== Encoder Code Modifications ==
Line 43 in ~/sw/airborne/firmwares/motor_bench/main_turntable.c has to be amended to reflect the encoder's factory pulses per revolution (P/R) setting from default "#define NB_STEP 256". The encoder above has a factory resolution set at "300" (P/R). The resolution setting has to reflect turntable velocity message outputs of ~200deg/s (3.49065rad/s) and ~270deg/s (4.71239rad/s) for 33rpm and 45rpm respectively. 
=== Calibration Session ===
== Data Collection Setup ==
In Paparazzi Centre:
* Build A/C "TT" using "main" target and the USB A-B lead detached from PC.
* Attach USB A-B lead to both LPC & PC and upload code.
* Start "Flight with USB-serial_TT modem" "Session".
* Open default "Message" box and "Real-time Plotter" from the "Tools" menu. Choose "IMU_TURNTABLE" readout.
* Switch to A/C "TTIMU" in same "Paparazzi Centre" window. Build and upload code.
* Start "Flight USB-serial_TT @57600" "Session".
* In original "GCS" window change "Telemetry" to "raw_sensors".
* Open a new "Message" box and choose "IMU_GYRO_RAW" readout.
* Arrange placement of IMU cradle, for the chosen axis (p, q, r), on the side which reports the highest or positive reading.
* Start turntable @ 33rpm and drag "IMU_TURNTABLE" data from "Message" box to "Real-time Plotter".
* Restart "Server" 1 second before a full minute readout and record for four minutes.
* Halt "Data Link" for both A/Cs "TT" and "TTIMU" and change turntable speed to 45rpm. 
* Restart - click both "Data Link" boxes and record for a further four minutes. 
* Stop "Server".
== Data Analysis ==
* The captured turntable velocity and gyro axis data can be found date and time stamped at:
* Right click the file and open with "LibreOfficeCalc". Click column D and elect "Sort Ascending".
* Choose "Extend selection" box. Note the time stamps of the IMU_TURNTABLE outlier data in column A. 
* Insert them in the search box of a separate open editor version of the log file and delete the offending prints.
* Save the file and run the following:
* These accompanying plots are also generated:
Category:User_Documentation