-
Notifications
You must be signed in to change notification settings - Fork 13.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed-wing pitch and roll offset clean up #16792
Conversation
8a036f4
to
2054b12
Compare
@@ -1838,17 +1836,14 @@ FixedwingPositionControl::tecs_update_pitch_throttle(const hrt_abstime &now, flo | |||
|
|||
if (_vehicle_status.engine_failure) { | |||
/* Force the slow downwards spiral */ | |||
pitch_min_rad = M_DEG_TO_RAD_F * -1.0f; | |||
pitch_max_rad = M_DEG_TO_RAD_F * 5.0f; | |||
pitch_min_rad = radians(-1.0f); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note, we should revisit engine failure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you know of anybody that uses it actually?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did a few years ago. I'd bet people don't even know it exists.
Thanks for finally taking care of this @sfuhrer. FYI @Antiheavy, no more takeoff pitch via mission item (fat finger friendly). |
While we're on the subject, has anyone ever actually use FW_RSP_OFF or was it added for "consistency"? It might be better to purge it. |
Purge it! |
Thanks @silvan and @dagar Never used roll offset and don't really see a use. Tested in SITL - a few things. It doesn't cause the plane to flip if it gets above 20º pitch up but its not exactly working. It is still speeding up to ~trim speed before pitching up - I even set rwto_airspd_scl to 100 just to be sure. Secondly you have to have the mission planning pitch set to 0 (when planning a mission) or QGC gets mad and spits out some errors (probably the intention). On QGC 4.1.1 release when I initiate the mission I get an "unable to start mission, vehicle rejected arming" but it still arms and flies it. When I switch to QGC 4.0.11 it doesn't do that and just flies the mission. In both cases though it still speeds up to around trim speed before pitching up but this is good that there is not more looping on takeoff. Lastly, so how do we control the desired pitch now on takeoff? Is that RWTO_max_pitch now? On sitl having that set to 20 gives me a pitch sp of ~14º on takeoff. |
hoooray!
I've never heard of anyone using this. I supposed I can imagine some "creative" aircraft designs that might have a use for something like this, but seems unlikely. There are already other (more preferred) ways to account for flight controller mounting angles, right? |
What is the benefit of not defining "zero pitch" as zero pitch angle of the autopilot? This way you can directly check the logs and set parameters based on the vehicle_attitude without subtracting/adding any offset |
That's how it looks atm. Having never before used FWRTO I actually don't know what exactly to expect, but it seems to set the pitch setpoint correctly to the takeoff sp (FW_TKO_PITCH_MIN, in this case 15°) after reaching 130% of FW_AIRSP_MIN (1.3*10=13m/s). I don't know though why the pitch then doesn't follow the setpoint..
Yes that's the intention - #11845 (comment)
Can confirm, have the same behavior on latest QGC, doesn't seem to happen always though.
Mainly FW_TKO_PITCH_MIN no? Can you share some plots - as in my case it set the pitch setpoint to what I specified there. |
Will provide some plots shortly. Going to take another pass at this. |
@CarlOlsson Yes, I agree. I think the pitch angle reference should be the output of the estimator. For VTOL this will most likely coincide with the motor plane. @sfuhrer Let me know what you think, maybe there is something we are missing here. |
The question is how you mount the autopilot in the body, resp. what you define as your level horizon. For a MC/VTOL there can be no question: level horizon has to be set such that without wind, the drone stays stationary. For FW I just don't see what the analogy would be, and thus proposed the "parallel to the wing". Wikipedia defines it as "xb axis - positive out the nose of the aircraft in the plane of symmetry of the aircraft" - that may be even simpler to be used as a definition. |
2054b12
to
a29161c
Compare
Agree on purging it - see a29161c2d5aa533eb4a4acb73a90fe4dbbb10b80 |
- remove mavlink mechanism for setting minimum pitch
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
a29161c
to
43cba8e
Compare
CI is failing - probably real! |
- this mission rejection was only added recently in #16792 - causing QGC compatibility issues mavlink/qgroundcontrol#9464
Replaces #11845.
Describe problem solved by this pull request
Describe your solution
The following parameters are now all referring to the same "absolute" pitch angle.
FW_P_LIM_MIN (no change for AUTO and LOITER, other modes: now absolute, before PSP_OFF was added to min after TECS)
FW_P_LIM_MAX (no change for AUTO and LOITER, other modes: now absolute, before PSP_OFF was added to max after TECS)
FW_TKO_PITCH_MIN (new param)
FW_LND_FL_PMIN (now absolute, before PSP_OFF was added after TECS)
FW_LND_FL_PMAX (now absolute, before PSP_OFF was added after TECS)
FW_MAN_P_MAX (no difference, pitch_sp = manual_input * FW_MAN_P_MAX + PSP_OFF, constrained to +/-FW_MAN_P_MAX)
"Absolute" pitch is defined as
FW_PSP_OFF is the pitch angle required for level flight at trim airspeed. TECS gets the absolute pitch minus the offset, and also all the min/max parameters are used inside TECS are offset by the offset prior passing them into TECS.
Describe possible alternatives
Pass the absolute pitch angle into TECS, together with the offset parameter, and initialize the pitch (output) at the offset value.
Test data / coverage
SITL tested with VTOLs and Plane.