Mount IMUs and cameras on foam or rubber standoffs, and filter the readings.
What the message means
Motors and wheels shake the frame. An IMU measures the shake, and a camera blurs, so the data is noisy even when the sensor is fine.
Fix it in this order
- Mount the IMU on soft standoffs, close to the centre of the robot.
- Balance wheels and check for loose parts that rattle.
- Use a low-pass filter or a complementary filter on the readings.
- Set the sensor low-pass setting if it has one.
- Mount the camera on a rigid arm with some damping.
- Compare readings with the motors off to see the vibration effect.
Why it happens
An accelerometer cannot tell the difference between motion of the robot and shaking of the frame, so vibration shows up as noise in the readings. If the sensor samples more slowly than the vibration, the shaking can also fold into lower frequencies and look like a slow, real signal, a problem called aliasing. A hardware low-pass setting on the sensor, if it has one, removes the fast part before sampling.
Soft mounts act as a mechanical filter, but a mount that is too soft lets the sensor move relative to the frame and adds its own error. Log the readings with the motors off and on to see how much comes from vibration.
If you see this, do this
| You see | Do this |
|---|---|
| Noisy only with motors on | Vibration. Damp and filter. |
| Noisy at rest | Sensor or supply noise. |
Related
Last reviewed: November 2026. These are the usual causes and the order that finds them fastest. Test on your own board; clones and cables differ.
Why this happens
An accelerometer measures acceleration of its own case. It cannot tell whether the robot is accelerating or the frame is shaking. Motors, wheels that are out of balance and loose parts all make vibration, and that is added to the signal as noise. A gyroscope has a similar problem, as it also reads the rocking of the frame.
If the sensor reads slowly compared with the vibration frequency, the fast shaking can be folded into slower values and look like a real slow movement. This is called aliasing. A low-pass setting inside the sensor, applied before sampling, removes the fast part and is more effective than filtering afterwards.
How to confirm the cause
- Log the readings with the motors off and the robot still. The spread you see is the sensor’s own noise.
- Log again with the motors running but the robot held in your hand or lifted. The extra spread is vibration.
- Check with the sensor held away from the chassis, if you can, to see if the noise falls.
- Spin each wheel by hand and listen and feel for wobble or rattle.
- Check the sensor’s settings for a digital low-pass filter and its sample rate.
Worked example
A simple first-order low-pass filter in code. With alpha = 0.2, each new reading counts for 20 percent. If the loop runs at 100 Hz (dt = 0.01 s), the cut-off is about alpha / ((1 – alpha) x 2 x pi x dt) = 0.2 / (0.8 x 0.0628), about 4 Hz. A smaller alpha filters more but adds lag.
float filtered = 0;
const float ALPHA = 0.2;
float lowPass(float raw) {
filtered = filtered + ALPHA * (raw - filtered);
return filtered;
}
// call lowPass(rawValue) once per loop at a steady rate
// first step example: raw = 1.0 gives 0 + 0.2 x (1.0 - 0) = 0.2Common mistakes
- Adding so much filtering that the robot reacts too late.
- Mounting the sensor on a flexible board that adds its own movement.
- Filtering at an uneven loop rate, which changes the cut-off.
- Mounting the sensor near the motor so that magnetic fields disturb a compass or gyro.
If this did not fix it
- Power noise from the motors reaching the sensor supply. Add capacitors and separate the supplies.
- A loose connector on the sensor, which gives spikes instead of smooth noise.
- The sensor’s range or sample rate setting, if the values clip.