add 4575 rc5 features to airbound-develop - #122
Conversation
- AP_Scripting: expose rate PID info to Lua via get_rate_pid_info(axis) - Adds lua_get_rate_pid_info() binding returning a table of PID fields (P, I, D, FF, target, actual, error) for roll (0), pitch (1), or yaw (2) rate controllers. Used to compute control effort (|P + D + FF|) from Lua. - Add get_attitude_control() public accessor to QuadPlane - Add despitch, roll and yaw
…ed pitch (#111) * Remove controller desaturation in control effort * Add desaturation logic for Desired servo tilt * Add logging for VH Power * Add hard limit for pitch angle setpoint * Add new parameters in default.param * Add logging for the position controller demanded pitch --------- Co-authored-by: Manuraj P M <[email protected]>
* introduced parameter LND_DET_TIM that controls how many milliseconds before disarm is detected * add disarm watchdog and disable weathervane after touchdown * Weathervane disable logic changed * expose land detection timing as params Q_LND_RELAX_MS and Q_LND_LLIM_MS --------- Co-authored-by: Stefard100 <[email protected]>
* Fix feedforward_scalar calculation when thrust angle error exceeds limits in AC_AttitudeControl.cpp
* add resume after autobailout
This reverts commit ea58cdf.
Greptile SummaryThis PR updates tailsitter recovery and control behavior. The main changes are:
Confidence Score: 4/5The autobailout recovery path and tailsitter yaw saturation path need fixes before merging.
autobailout.lua, AP_MotorsTailsitter.cpp, AC_AttitudeControl.cpp Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Autobailout update loop] --> B[Sample desired and actual pitch]
B --> C[Pitch limit exceeded]
C --> D[Switch to QLoiter]
D --> E[Check rolling avg_err and peak_ang]
E -->|Both below limits| F[Return to pre-bailout mode]
E -->|Absolute hover pitch stays high| G[Remain active in QLoiter]
H[Tailsitter motor mix] --> I[Raw pitch_thrust plus yaw_thrust]
I --> J[Servo output clipping]
I --> K[No yaw limit flag]
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
A[Autobailout update loop] --> B[Sample desired and actual pitch]
B --> C[Pitch limit exceeded]
C --> D[Switch to QLoiter]
D --> E[Check rolling avg_err and peak_ang]
E -->|Both below limits| F[Return to pre-bailout mode]
E -->|Absolute hover pitch stays high| G[Remain active in QLoiter]
H[Tailsitter motor mix] --> I[Raw pitch_thrust plus yaw_thrust]
I --> J[Servo output clipping]
I --> K[No yaw limit flag]
Reviews (1): Last reviewed commit: "Update the version to AB ArduPlane V4.5...." | Re-trigger Greptile |
| local actual_pitch_deg = actual and (actual.pitch_cd * 0.01) or 0 | ||
|
|
||
| pitch_error_buf[buf_idx] = math.abs(target_pitch_deg - actual_pitch_deg) | ||
| pitch_angle_buf[buf_idx] = math.abs(actual_pitch_deg) |
There was a problem hiding this comment.
When autobailout switches a tailsitter into QLoiter, the new resume gate stores absolute pitch in pitch_angle_buf and later requires it to stay below AUTOB_PEAK_LIM defaulting to 30 degrees. A recovered QLoiter hover is still near vertical pitch, so peak_ang can remain around 80-90 degrees and vehicle:set_mode(pre_bailout_mode) never runs.
| pitch_angle_buf[buf_idx] = math.abs(actual_pitch_deg) | |
| pitch_angle_buf[buf_idx] = math.abs(target_pitch_deg - actual_pitch_deg) |
| -- 1. SETUP PARAMETER TABLE | ||
| local KEY = 110 | ||
| assert(param:add_table(KEY, "AUTOB_", 7), "AUTOB table failed") | ||
| assert(param:add_table(KEY, "AUTOB_", 13), "AUTOB table failed") |
There was a problem hiding this comment.
Parameter Table Resize Halts Script
On an in-place script update, key 110 can already be registered with the old seven-slot AUTOB_ table. Expanding it to 13 slots makes param:add_table fail until reboot, and this assert stops the whole autobailout script, leaving the vehicle without the recovery monitor during that run.
| _tilt_left = pitch_thrust - yaw_thrust; | ||
| _tilt_right = pitch_thrust + yaw_thrust; |
There was a problem hiding this comment.
Yaw Saturation Loses Limit Flag
The reverted thrust-vectoring path now sends raw pitch_thrust ± yaw_thrust while later tailsitter output code still clips the servo commands to their range. When combined pitch and yaw demand exceeds that range, yaw authority is saturated but limit.yaw is no longer raised, so the yaw controller can keep integrating against an unavailable actuator and overshoot when the demand drops.
| _tilt_left = pitch_thrust - yaw_thrust; | |
| _tilt_right = pitch_thrust + yaw_thrust; | |
| _tilt_left = pitch_thrust - yaw_thrust; | |
| _tilt_right = pitch_thrust + yaw_thrust; | |
| if (fabsf(_tilt_left) > 1.0f || fabsf(_tilt_right) > 1.0f) { | |
| limit.yaw = true; | |
| } |
| if(_ts_enabled && !_ts_in_transition){ | ||
| Vector3f euler_sp; | ||
| _attitude_target.to_euler(euler_sp.x, euler_sp.y, euler_sp.z); | ||
| euler_sp.y = constrain_float(euler_sp.y,radians(-_att_max_pit),radians(_att_max_pit)); | ||
| _attitude_target.from_euler(euler_sp.x, euler_sp.y, euler_sp.z); | ||
| } |
There was a problem hiding this comment.
This clamp changes _attitude_target after the pitch rate target has already been produced and relaxed, but it does not adjust _ang_vel_target.y. When a VTOL caller requests pitch beyond Q_A_PIT_CLIP_MAX, feedback uses the clipped attitude while feed-forward can still use the larger unclipped pitch-rate command, producing a rate kick past the intended pitch limit.
This adds the following changes to airbound-develop
Notion page:
https://app.notion.com/p/airbound/Add-airbound-develop-4-5-7-5-rc5-features-38f21adf4be980debf79ff547fd0bd42?source=copy_link