inav
inav copied to clipboard
[3.0-RC1] AHI does not respect fw_level_pitch_trim
Current Behavior
If fw_level_pitch_trim is set at a certain value to maintain level flight in self level modes, the AHI will still follow the RAW sensor value. This leads to an AHI offset in level flight.
Steps to Reproduce
- Place the aircraft on the bench to set sensor value for pitch close to 0°
- watch the OSD on a monitor or goggles
- Go to PID tuning > Mechanics and set fw_level_pitch_trim to a value like 10°
- check the AHI on the fpv feed. AHI stays aligned on the crosshair
- If the plane flies now level, the AHI will be 10° below the crosshair implying a climb
- the same applies form the pitch angle value item on the OSD that also still shows the raw sensor value and not relative to fw_level_pitch_trim
Expected behavior
fw_level_pitch_trim should be considered to indicate level flight and actual pitch angle in any case.
Suggested solution(s)
respect fw_level_pitch_trim for pitch angle indication on OSD and logs.
Additional context
- FC Board name and vendor: Matek F411-WSE
- INAV version string: INAV/MATEKF411SE 3.0.0 May 15 2021 / 17:01:46 (7b6a37a3)
I propose to just add pidProfile()->fixedWingLevelTrim degrees to the pitch angle in the AHI OSD element, and perhaps also the pitch angle element.
I think that was fixed somewhere down the line.