Gimbal: add pitch stabilization and asymmetrical pitch ranges#25899
Gimbal: add pitch stabilization and asymmetrical pitch ranges#25899
Conversation
🔎 FLASH Analysispx4_fmu-v5x [Total VM Diff: 1160 byte (0.06 %)]px4_fmu-v6x [Total VM Diff: 1152 byte (0.06 %)]Updated: 2026-01-15T17:43:13 |
c867739 to
b9adbc4
Compare
sfuhrer
left a comment
There was a problem hiding this comment.
Moving from the "range" to "min/max" makes sense for pitch makes total sense, though I wonder if for roll and yaw you would ever need it? If you think it's highly unlikely that it will ever be needed then I'd prefer to keep "range" for roll and yaw, for simplicity's sake and contain the flash increase.
If the flash is still over-flowing on v6s after a rebase on latest main, I would disable CONFIG_MODULES_TEMPERATURE_COMPENSATION in the v6s default build. Other v6 boards already have it disabled, with modern IMUs it's generally not required anymore.
Thanks for the review. Good point, I think roll is very unlikely, but yaw could possibly have a blind zone. There is no actual use case at the moment so I reverted both yaw and roll. |
551897a to
0fa7b76
Compare
sfuhrer
left a comment
There was a problem hiding this comment.
I only have comments for definitions/comments to avoid confusions later on.
0538366 to
1e409b0
Compare
Is this still the case? Or did you figure this out? Let's get it sorted. |
The image clicking works now: ✔️
Also tested to connect an RC to use as gimbal controls, works to send rate inputs ✔️
Note for future: Reason for 90 deg offset between The report of the angles in QGC is just different, and can surpass 360 deg. @dakejahl Do you know where those angles are calculated?
|
1e409b0 to
70c359f
Compare
julianoes
left a comment
There was a problem hiding this comment.
See inline comment regarding the enum.
sfuhrer
left a comment
There was a problem hiding this comment.
Okay to merge from my side, all my comments are addressed and it was flight tested.
Squash merge or clean up commits.
The requested change (for a clean up) would include an additional feature (separate roll stabilization) and should thus be done in a follow up PR.
b8441a4 to
53f58cf
Compare
|
@perrrre we need to free up 300 bytes |
53f58cf to
2901d86
Compare
Signed-off-by: Silvan <silvan@auterion.com>



Solved Problem
When using an asymmetrical angular range angle setpoints are wrong. Additionally adding 1-axis gimbal stabilization for pitch.
Solution
MNT_RANGE_PITCHtoMNT_MAX_PITCHandMNT_MIN_PITCHto account for asymmetrical angular ranges on the pitch axisMNT_OFF_ROLL/MNT_OFF_PITCH/MNT_OFF_YAWasPWM_CENTtakes care of offsetsTest coverage
make px4_sitl gz_x500_gimbal,but I had to revert_q_gimbal = q_FLU_to_FRD * q_gimbal_FLU * q_FLU_to_FRD.inversed();to see that the simulation still works with QGC. This PR changed the gimbal attitude.