Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

Yaw Airspeed Scaler Different from Pitch and Roll #612

Closed
supergra opened this issue May 31, 2019 · 5 comments · Fixed by PX4/PX4-Autopilot#15256
Closed

Yaw Airspeed Scaler Different from Pitch and Roll #612

supergra opened this issue May 31, 2019 · 5 comments · Fixed by PX4/PX4-Autopilot#15256

Comments

@supergra
Copy link

supergra commented May 31, 2019

According to this controller document, all three of the attitude controllers should apply quadratic IAS scaling to the P gain, and linear TAS scaling to the FF gain.

This is reflected in both ecl_roll_controller.cpp and ecl_pitch_controller.cpp:

/* Apply PI rate controller and store non-limited output */
        _last_output = _bodyrate_setpoint * _k_ff * ctl_data.scaler +
_rate_error * _k_p * ctl_data.scaler * ctl_data.scaler
+ _integrator; //scaler is proportional to 1/airspeed

But not in ecl_yaw_controller.cpp:

        /* Apply PI rate controller and store non-limited output */
        _last_output = (_bodyrate_setpoint * _k_ff + _rate_error * _k_p + _integrator) * ctl_data.scaler *
ctl_data.scaler; //scaler is proportional to 1/airspeed

Is this a bug?

@bresch
Copy link
Member

bresch commented Jun 11, 2019

@supergra Yes, it is a mistake, I remember fixing that about a year ago on a private fork but I forgot to upstream it :|
And the second mistake is that we scale both feedforward and the controller with IAS (ctl_data.scaler = 1/IAS). That is tracked in PX4/PX4-Autopilot#11975 but I'm waiting for the new "airspeed module" to make the change.

@supergra
Copy link
Author

@bresch Is there any obstacle to upstreaming your fix for the first bug (the yaw being different)? We were considering making the change locally, but I'm curious if you are holding off because it might introduce unexpected behavior.

The second bug is likely a minor impact for most low altitude work we do, so not as concerned about that one.

@bresch
Copy link
Member

bresch commented Jun 25, 2020

@supergra No, I'm just not currently focusing on fixedwings so this wasn't a priority for me. Please if you do change it locally, upstream it as well. This could also be changed at the same time: PX4/PX4-Autopilot#15041
FYI @sfuhrer

@supergra
Copy link
Author

supergra commented Jul 4, 2020

Thanks @bresch, I will make a pull request. Suggest transferring this issue to Firmware, since fw_att_control was moved there. (I don't think I can do that myself.)

@bresch
Copy link
Member

bresch commented Jul 6, 2020

@supergra thanks a lot! I'll move the issue and review your PR asap.

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

Successfully merging a pull request may close this issue.

3 participants