Skip to content

IMU Configuration

Brokemia edited this page Sep 2, 2023 · 2 revisions

IMU Manual

The IMU can be communicated with over serial.

All commands end in *XX where XX is a checksum of the command (you can leave this as literally XX to not have a checksum).

With the current settings, the IMU will automatically output data at a fixed rate in the format: $VNQMR,Quat0,Quat1,Quat2,Quat3,MagX,MagY,MagZ,AccelX,AccelY,AccelZ,GyroX,GyroY,GyroZ*XX This contains the calculated attitude as a quaternion, the magnetometer reading (Gauss), the acceleration reading (m/s^2), and the angular velocity from the gyro (rad/s)

General Commands:

  • $VNWRG,YY,VALUES*XX - Write VALUES to register YY
  • $VNRRG,YY*XX - Read register YY
  • $VNWNV*57 - Write settings values to permanent memory (allowing them to persist after a reboot)
  • $VNRST*4D - Reset the imu. I believe this is almost the same and disconnecting and reconnecting the wire to the IMU

I believe our IMU settings are currently default (could be wrong), but the following commands were used in the past to change them.

Some specific examples that have been useful in the past:

  • $VNWRG,26,1,0.0003818,-0.0003559,-0.0003818,0.0703492,-0.9975224,0.0003559,-0.9975224,-0.0703493*XX - Set the reference frame to some matrix (note, must run $VNWNV and $VNRST after this before changes take effect)
  • $VNWRG,84,-1,0,0,0,-1,0,0,0,-1,0,0,0*XX - Set the gyro compensation. Our gyro values were negative, who knows why. This is a dumb way to fix it but it works.
  • $VNWRG,07,5*XX - Turns down the rate that the current readings are automatically output. MAKE SURE TO REVERT THIS AFTER SETTING IT ($VNWRG,07,40*XX)
Clone this wiki locally