Commit 42669d9
Fix gyroscopic precession sign: roll term, not pitch
The propeller gyroscopic torque had the wrong sign on the ROLL axis (row 0 of
torque_inertia), in both dynamics (numeric) and symbolic_dynamics.
The gyroscopic torque is -ω × h with net rotor angular momentum h = h_z·ẑ,
giving (-q·h_z, +p·h_z, 0): the roll and pitch rows must have OPPOSITE signs.
The subtlety is that S = Σ mixing_matrix[-1]·ω_rotor uses the yaw-torque-direction
row, i.e. the NEGATIVE of the physical spin, so h_z = -prop_inertia·S. Hence:
roll (x) = -q·h_z = +prop_inertia·ang_vel[1]·S (code had a leading '-', the bug)
pitch (y) = +p·h_z = -prop_inertia·ang_vel[0]·S (code was already correct)
The z (spin-up/down reaction) row is already correct, and is in fact what pins
the convention: it is consistent only with spin = -mixing_matrix[-1].
Verified against -ω × h to machine precision on all axes; numeric == symbolic
still holds for ang_vel_dot. Only matters for non-negligible prop_inertia /
larger quads during yaw-type maneuvers; negligible for a Crazyflie.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent d60abc7 commit 42669d9
1 file changed
Lines changed: 13 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
142 | 150 | | |
143 | 151 | | |
144 | | - | |
| 152 | + | |
145 | 153 | | |
146 | 154 | | |
147 | 155 | | |
| |||
260 | 268 | | |
261 | 269 | | |
262 | 270 | | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
263 | 274 | | |
264 | | - | |
| 275 | + | |
265 | 276 | | |
266 | 277 | | |
267 | 278 | | |
| |||
0 commit comments