No yaw rotation in firmware telemetry or web UI #13

Closed
opened 2026-02-28 15:00:22 -05:00 by seb · 1 comment
Owner

Bug

Rotating the FC around the vertical axis (yaw) produces no movement in the web UI 3D model.

Root cause

MPU6000 is a 6-axis IMU (accel + gyro). Yaw angle requires gyro integration — there is no magnetometer to provide absolute heading.

Current state

  • Firmware balance.c computes pitch via complementary filter (accel + gyro)
  • Roll is sent as r in JSON but only from accel (no gyro fusion)
  • Yaw is not computed or sent at all

Required changes

  1. Firmware: Integrate gyro Z-axis for yaw estimate, add y field to JSON telemetry
  2. Web UI: Apply yaw rotation to Three.js model (mesh.rotation.y or .z depending on convention)

Note

Yaw from gyro-only will drift over time (no magnetometer correction). This is acceptable for visualization — the balance loop only needs pitch. Consider adding a "reset yaw" button in the UI.

## Bug Rotating the FC around the vertical axis (yaw) produces no movement in the web UI 3D model. ## Root cause MPU6000 is a 6-axis IMU (accel + gyro). Yaw angle requires gyro integration — there is no magnetometer to provide absolute heading. ## Current state - Firmware `balance.c` computes pitch via complementary filter (accel + gyro) - Roll is sent as `r` in JSON but only from accel (no gyro fusion) - **Yaw is not computed or sent at all** ## Required changes 1. **Firmware:** Integrate gyro Z-axis for yaw estimate, add `y` field to JSON telemetry 2. **Web UI:** Apply yaw rotation to Three.js model (`mesh.rotation.y` or `.z` depending on convention) ## Note Yaw from gyro-only will drift over time (no magnetometer correction). This is acceptable for visualization — the balance loop only needs pitch. Consider adding a "reset yaw" button in the UI.
Author
Owner

@sl-firmware @sl-controls — Need gyro Z integration in balance.c for yaw estimate + add y field to JSON telemetry + apply to Three.js model in UI. Drift is acceptable (no magnetometer).

@sl-firmware @sl-controls — Need gyro Z integration in `balance.c` for yaw estimate + add `y` field to JSON telemetry + apply to Three.js model in UI. Drift is acceptable (no magnetometer).
seb closed this issue 2026-02-28 17:41:37 -05:00
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: seb/saltylab-firmware#13
No description provided.