Skip to content
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

VTOL QuadChute Maximum roll and pitch angles #6665

Merged
merged 8 commits into from Mar 2, 2017
Merged

Conversation

sanderux
Copy link
Member

Addresses #6661

This triggers quadchute on maximum roll and pitch angles to prevent stalling or actuation problems like reversed ailerons/elevons

@sanderux
Copy link
Member Author

Ref #6660

@@ -562,6 +564,14 @@ VtolAttitudeControl::parameters_update()
param_get(_params_handles.fw_min_alt, &v);
_params.fw_min_alt = v;

/* maximum pitch angle (QuadChute) */
param_get(_params_handles.fw_qc_max_pitch, &l);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

copy directly to &_params.fw_qc_max_pitch

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reverted, doesn't work

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Type mismatch

Copy link
Member

@dagar dagar Feb 26, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The parameter is an int, but you the param_get (mem)copied it into a float.

if (_params->fw_qc_max_roll > 0
&& _armed->armed && !_land_detected->landed) {

if (math::degrees(euler.phi()) < -_params->fw_qc_max_roll
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check abs

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean?

* @max 180
* @group VTOL Attitude Control
*/
PARAM_DEFINE_INT32(VT_FW_QC_P, 55);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Disable by default

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@dagar
Copy link
Member

dagar commented Feb 25, 2017

Needs a few small changes. What about tailsitters? Is the attitude always relative to the MC frame and then rotated for FW? I've never used one.

Thoughts for a more general solution longer term.

  • expose controller status like fw_pos_ctrl_status (https://github.com/PX4/Firmware/blob/master/msg/fw_pos_ctrl_status.msg) and either explicitly check relevant error and controller flag (eg alt error and flag_control_altitude_enabled) or have the controller expose something like a health flag
  • likewise for attitude controllers. Turn mc_att_ctrl_status into a more general attitude controller status message for logging integrators and controller health
  • shouldn't trigger within already defined controller values (max roll, etc)
  • handle failsafe triggering in commander or another module and make the trigger action selectable
  • actions could be RTL, LAND, etc

@sanderux
Copy link
Member Author

Needs a few small changes. What about tailsitters? Is the attitude always relative to the MC frame and then rotated for FW? I've never used one.

@Tumbili can you answer this? i'm not sure
@LorenzMeier do we still have a functional tailsitter in SITL?

@AndreasAntener
Copy link
Member

Regarding the parameters and @dagar 's comment: instead of adding separate angle parameters I would instead only add a margin parameter (in degrees) and add that on top of the largest angles already set for FW (take the ones for manual).

Re tailsitter: there is rotation code used in FW pos control to rotate the attitude (search for tailsitter) which could be copied. Make sure this check gets excluded during tailsitter transitions. Or leave it for tailsitters at the moment.

@sanderux
Copy link
Member Author

sanderux commented Feb 25, 2017

@AndreasAntener is that FW_P_LIM_MIN FW_P_LIM_MAX and FW_R_LIM ?
And would that be one param defining both roll and pitch excess or separately?
And if separately, should it distinguish between pitch up and down?

@dagar
Copy link
Member

dagar commented Feb 25, 2017

If the check was in the FW attitude controller we'd get the rotation for free.

@sanderux
Copy link
Member Author

sanderux commented Feb 25, 2017

Rebased to include tecs integrator resets
I will give it a flight test and then i think it's good to go

@sanderux
Copy link
Member Author

sanderux commented Mar 1, 2017

Test flown, no regression.
http://logs.uaventure.com/view/t293nDhydn76rU94mnoZRL (high wind)

@sanderux
Copy link
Member Author

sanderux commented Mar 1, 2017

@dagar this seems ready to merge, all your comments are addressed. can you approve?

@dagar
Copy link
Member

dagar commented Mar 2, 2017

Any reason why QC min alt is a float, but these new QC params are ints?

@dagar
Copy link
Member

dagar commented Mar 2, 2017

Sidenote - log looks good. I think a quick improvement would be adding FW_PSP_OFF to the transitions. Front transition ramp up to PSP_OFF, and back transition could just maintain to better hold altitude.

@sanderux
Copy link
Member Author

sanderux commented Mar 2, 2017

@dagar

Any reason why QC min alt is a float, but these new QC params are ints?

Consistency, all altitude params are float (perhaps smaller vehicles use half meter), all degree params are int.

Sidenote - log looks good. I think a quick improvement would be adding FW_PSP_OFF to the transitions. Front transition ramp up to PSP_OFF, and back transition could just maintain to better hold altitude.

Funny, that was exactly what i was thinking when i looked at the altitude. indeed the FW_PSP_OFF should be taken into account. perhaps mostly during back transition as in the first stage of the fron transition it might pull the vehicle backwards.

@dagar
Copy link
Member

dagar commented Mar 2, 2017

This looks good for now, and would have likely saved at least a couple airframes on my end. Let's just try to keep in mind a more general solution closer to the controllers in the future.

@dagar dagar merged commit 9ef87f1 into master Mar 2, 2017
@dagar dagar deleted the vtol_quadchute_max_angle branch March 2, 2017 15:34
@dagar
Copy link
Member

dagar commented Mar 2, 2017

@sanderux for FW_PSP_OFF #6709

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants