NOTE: This is a wiki post, so feel free to make additions or leave a comment if you find any mistakes. For example videos or screenshots would be helpful. if anyone could provide those, that would be great!
When do you need an IMU calibration?
This is most commonly done when initially setting up a board for the first time, though you can re-do individual steps are required in the future. For example, if you want to “re-level” your board (maybe you got new rails or repositioned your controller), you can just re-do the IMU Orientation step. Or if you’re concerned the Gyro or Accel calibrations aren’t accurate, those can be re-done individually as well.
It’s important to make any of these IMU changes using the Wizard instead of manually! When using the wizard, changes made from one step will adjust all values to accommodate, allowing for example the re-calibration of Orientation without needing to recalibrate Gyro or Accel.
Lastly, if you are facing massive behavioral issues with your IMU, I would recommend reading the default values for IMU, Writing, and following this guide from scratch. You can write these default values on Desktop from the Circle-A icon on the right sidebar followed by the Down-A icon to Write, or on Mobile from App CFG, selecting the ...
button in the bottom right, selecting Read Default Values
, and tapping Write
.
What you need
- Controller with VESC 6.00 Firmware or Newer Installed
- VESC Tool 6.02 or Newer
The whole process consists of three parts: A) IMU Wizard; B) Manual Adjustments; and C) Verifying your Calibration in RT Data
A) IMU Wizard
-
Prop the board such that it lays still in the orientation you would like to be considered “level.” A milk crate or similar container may be handy here.
-
If you already have Float Package installed, it’s best to disable this, as activating the sensors mid-calibration can have hectic results. This can be done by navigating to
Float CFG -> Specs
, flipping theDisable Float Package
toggle, and hitting Write. -
Go to the
Start
tab on mobile, orWelcome & Wizards
on desktop, and selectSetup IMU
. -
IMU Configurator:
-
IMU Detected:
should say true. If not the case, hit “Search for IMU” (This may take a few tries sometimes. If it never succeeds, don’t stress it, this is just for the IMU Sample Rate which we can set manually later) -
In
IMU Profile Selector
chooseBalance Skateboard
-
If IMU was detected properly, the Frequency at the bottom should read as the correct sample rate for your IMU. For example, LFoc v3.1 (LSM6DS3) should read 832Hz (Again, can be set manually later if need be).
-
The other values should appear set as follows:
AHRS: Mahony, Acc Decay 0.020, Mahony KP 2.0, Accel Z Filter 1.0, Gyro Filter 0.0
-
If all values check out, select
Save
-
-
Gyroscope Calibration:
- Make sure board is completely still, and isn’t moved or bumped
- Wait for the readings on all axes to stabilize within +/- 0.01 or so, with no values constantly drifting in one direction.
- Once stabilized, select
Save
.
-
Orientation Calibration (Save Accelerometer for last):
-
Roll Offset: Wait for the reading to stabilize within +/- 0.01 or so, with no values constantly drifting in one direction. Once stabilized, select
Save
. -
Pitch Offset: Wait for the reading to stabilize within +/- 0.01 or so, with no values constantly drifting in one direction. Once stabilized, select
Save
. -
Yaw Offset: Lift the NOSE of the board up 45 degrees. Assuming you have yet to calibrate your IMU, this value should stabilize to a multiple of 90 (-90, 0, 90, 180) depending on your controller/IMU orientation. Once stabilized to a multiple of 90, select
Save
.- Assuming no present IMU Yaw value (the offset shown is relative to current value), the Yaw value for LFoc v3.1 in a Flowglider box is 90º.
- If just re-leveling your board, IMU Yaw can be skipped entirely once Roll and Pitch are saved
- If your controller is mounted in a slanted/diagonal orientation, a Yaw value that isn’t a multiple of 90 may be necessary. Having this measurement on hand for reference may be useful.
-
-
Accelerometer Calibration:
-
This one is a bit confusing explained over text, I recommend checking out @SurfDado’s video on this. If you prefer the text guide, carry on.
- NOTE: The orientations mentioned for each Accel axis are assuming you have your orientation properly calibrated. If these orientations don’t clearly raise the offset near 1.0, you may need to re-do Orientation Calibration.
-
Accel X: Gradually prop the board up vertically on its nose, you should see the reading begin to climb towards 1.0. Once the reading stabilizes (be patient), slowly shift the board back and forth, trying to find the max possible value. Once you find a point where the value decreases in each direction, gently set the board down (to avoid the value spiking) and select
Save
.- NOTE: You are simply looking for the max stable value. It’s okay if this is above or below 1.0, that’s the point of calibrating. Do not specifically aim for it to read 1.0 and save.
- Do NOT jerk the board, as this can cause the value to spike. If the max value spikes due to this at any point, select
Clear Max
and start again.
-
Accel Y: Follow the same process, this time with the max being found when the board is resting on its left side rail (power button side down for most setups, except the FloatWheel ADV which has the power button on the right side rail). Once the value stabilizes and you find a point where the value decreases in each direction you tip the board, select
Save
. -
Accel Z: Follow the same process, this time with the max being found when the board is brought to level on the ground, as if it was engaged (no crate/container since you need to tilt it back and forth). Once the value stabilizes and you find a point where the value decreases in each direction you tip the board, select
Save
.
-
-
Now that the IMU Wizard is completed, hit cancel to exit the IMU Wizard.
B) Manual Adjustments
-
App CFG -> IMU
:Sample Rate: If you failed to detect IMU during the IMU Configurator step of the wizard, you may need to set this manually. The value this should be depends on the sample rate of the IMU being used. Set this to the appropriate value and hit
Write
(Bottom of screen on Mobile, or on right sidebar [Down-A icon] for Desktop).- For LFoc V3.1 (LSM6DS3), we recommend using 832Hz. For Floatwheel (BMI160), this should be 800Hz.
-
Float CFG -> Specs
:Loop Hertz: This parameter should match what you set for your Sample Rate in
App CFG -> IMU
. The default is set to 832Hz, so if you’re running a controller with an LSM6DS3 IMU such as the Little FOCer v3.1, you can just leave this as default. If not, set it to the appropriate value and hitWrite
at the bottom of the screen.- NOTE: If you set your Sample Rate to a lower frequency for one reason or another, such as to 416Hz, this should be multiplied so that the value set as Loop Hertz is in the 800-1000Hz range (i.e. Sample Rate of 416Hz, Loop Hertz of 832Hz) to ensure good performance.
C) Verifying Calibration in RT Data
-
We must first navigate to the proper RT Data screen, depending on your platform:
- Desktop: Navigate to
Data Analysis → IMU Data
on the left sidebar, and stay on theRoll/Pitch/Yaw
tab. Then, enable the IMU toggle on the right sidebar to allow IMU Data to be read in real time. The graph should populate (NOTE: May glitch out if also on VESC Tool Mobile’s RT Data screen). - Mobile: Navigate to the
RT Data
tab at the top of your screen, then scroll down to the screen with a 3D model of a box and IMU values listed up top.
- Desktop: Navigate to
-
Set the board in it’s tail down resting position, with the nose pointed up. The Roll reading should be near 0, and the Pitch reading should be around positive 20-30 degrees, NOT negative.
- If Pitch is negative, or Pitch and Roll seem inverted, a mistake was made in the Orientation calibration. If so, feel free to re-do this step individually.
- If Pitch and Roll seem nonsensical and/or moving the board around doesn’t appear correct, you may have made a mistake in Gyro and/or Accel calibration. If so, I would recommend setting all Gyro and Accel values at the bottom of
App CFG -> IMU
to 0’s (defaults), hitWrite
, and re-do the Gyro and Accel steps of the IMU Wizard.
D) Before you do first test ride…
-
Re-enable the Float Package by flipping the toggle under
Float CFG -> Specs
and hittingWrite
. -
Go to
AppUI > Controls
(If on Desktop, can be found underWelcome & Wizards
) and use theMovement Control
slider to test Motor Direction. The wheel should spin forwards for moving the slider right, and backwards for left. If this is inverted, theInvert Motor Direction
toggle underMotor CFG -> General -> General
should be flipped from the current position, and hitWrite
(Bottom of screen on Mobile, or on right sidebar [Down-M icon] for Desktop). -
If you’ve verified everything so far in this guide, it should be safe to ride. However, I would first test by hand with the motor free-spinning, either in the air or on a crate. Once this looks good (confirm motor direction, try to stabilize in center), then test by hand on the ground (preferably outside in open area). And once this looks good and it’s clearly self-balancing, you should be clear to ride!
-
Last but certainly not least, BACKUP YOUR CONFIGS! If you have confirmed the board is ridable, now is the time to backup your configs to ensure you have a fallback in case anything happens in the future, such as accidentally poorly re-calibrating.
-
Desktop: From the top menu bar, navigate to
ConfBackup -> Backup Configuration
and Save. You can also save your App and Motor configurations as XML files underFile -> Save Motor/App Configuration XML as...
-
Mobile: Navigate to the
Start
tab, and simply tap the largeBackup Config
button, confirming your backup on the popup window that comes up.
-