What is a gyroscope? Measuring angular velocity without wheel-slip errors
Atlasbot · 18/8/2026 · 11 min read
If the accelerometer (as learned in the previous unit) answers the question of "how much tilting the robot is", then the gyroscope answers another question: "how fast the robot is rotating, about which axis" — by directly measuring angular velocity, without inference through gravity like the accelerometer.
Key concepts
Gyroscopes measure angular changes over time (in degrees/second or radians/second) around all three axes X, Y, and Z. For example, a robot rotates 90° in place in 1 second and a gyroscope on the vertical axis (usually the Z axis, called yaw) measures angular velocity of about 90°/second.
How it works
To know how many degrees the robot has rotated in total (not how fast it is rotating), the integral angular velocity over time:
current_angle = previous_angle + angular_velocity × Δt
This is why gyroscopes are particularly useful for robot odometry: they measure real rotational motion of the robot body, which is completely independent of whether the wheel makes good contact with the floor. The encoder wheel can be miscounted when the wheel slides on a smooth floor or hits a obstacle, but the gyroscope still accurately reflects how much the robot is spinning.
Because angular velocity must be integrated continuously to obtain the total angle, a tiny error in each measurement (from sensor noise) will accumulate over time — after a few minutes, the computed angle can differ considerably from reality even when the robot is completely stationary. This is called drift, an inherent limitation of low-cost MEMS gyroscopes.
Technical details
Formulas
the drift rate is an important datasheet parameter, indicating the error that accumulates over time when the gyroscope is stationary:
Accumulated_angle_error(t) ≈ Drift_rate × t
Example: a low-cost MEMS gyroscope has a drift rate of ~0.05°/second (typical before calibration)
After 60 seconds stationary: accumulated angle error ≈ 0.05 × 60 = 3°
After bias calibration (next article), drift decreases considerably but
does not reach 0 completely — this is a physical limit of low-cost MEMS sensors,
not an incorrect calibration
Parameters
| Measurement range (°/second) | Respective sensitivity (MPU6050) | Matching |
|---|---|---|
| ±250 | 131 LSB/(°/s) | Slow rotation, high precision. |
| ±1000 | 32.8 LSB/(°/s) | Normal rotating robot |
| ±2000 | 16.4 LSB/(°/s) | Fast rotation, collision |
Practical applications
This is why gyroscopes are rarely used alone for long periods of time — usually in combination with an accelerometer (no drift but noise on vibrations, previous article) or magnetometer through a Complementary/Kalman filter, or periodically "corrected" using data from another source such as LiDAR/camera in SLAM. In the real-world AMR architecture, this is exactly the mechanism of wheel-slip detection learned in the IMU paper in AMR — comparing the velocity from the encoder to the velocity deduced from the gyroscope/accelerometer to detect when the wheel no longer correctly reflects the real motion.
Practical example
def tich_phan_goc(goc_truoc, van_toc_goc, dt):
return goc_truoc + van_toc_goc * dt
goc = 0.0
dt = 0.02 # 50Hz
# Simulate rotation at 45 degrees/second for 2 seconds
van_toc_goc = 45.0 # degrees/second
for i in range(100): # 100 buoc x 0.02s = 2s
goc = tich_phan_goc(goc, van_toc_goc, dt)
print(f"Goc sau 2 giay xoay lien tuc 45 do/giay: {goc:.1f} do")
Output:
Goc sau 2 giay xoay lien tuc 45 do/giay: 90.0 do
The result matches theory (45°/s × 2s = 90°), but this is an ideal simulation
without noise. With real gyroscope data, every integration step introduces
a small error that accumulates into the drift calculated under Formulas
Common mistakes
- Finishing integral angles from gyroscopes over long periods without calibrating— as calculated in Equation (s), time-cumulative drift causes significant angular misalignment after several minutes.
- Confusing angular velocity (°/s) with absolute angle (°)— gyroscope directly measures velocity, requires new integral to angle, misreading unit leading to complete miscalculation.
- Choosing too narrow a measurement band for fast rotating robots — values beyond the band are cut/saturated, losing accuracy in time to measure the strongest rotational motion.
- Using gyroscopes alone for long-term precision directional applications— omits the combination of accelerometer/magnetometer or periodic calibration by SLAM, leading to uncontrolled accumulated bias.
Conclusion
The gyroscope gives instantaneous accurate rotation data and does not fear sliding the wheel, but it will drift on its own over long periods of time. Combining the same accelerometer is the most common way for both to offset each other's disadvantages — which is the basis of most algorithms for direction estimation in robotics [...]. The next article in the column goes to the most popular 6-axis IMU chip MPU6050 — incorporating both newly learned sensors.
Get new articles and lessons by email
When a new technical article or course module is published, Atlas Robotics sends you a short email. No spam.
Unsubscribe any time with the link in each email. See our Privacy policy.