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

Copter: guided: set_angle call init_z_controller when changing from thrust to climb rate control to avoid flow of control error #28129

Merged

Conversation

IamPete1
Copy link
Member

@IamPete1 IamPete1 commented Sep 17, 2024

We init the Z controller when we fist enter the angle sub mode of guided. However if you send throttle commands the Z controller is not used, if you then change to sending climb rate commands while remaining in angle sub mode you trigger this flow of control error in the pos controller:

// Check for z_controller time out
if (!is_active_z()) {
init_z_controller();
if (has_good_timing()) {
// call internal error because initialisation has not been done
INTERNAL_ERROR(AP_InternalError::error_t::flow_of_control);
}
}
_last_update_z_ticks = AP::scheduler().ticks32();

extract from #28110

@IamPete1 IamPete1 force-pushed the copter_angle_guided_flow_of_control branch 2 times, most recently from 6b37828 to c1576ef Compare September 21, 2024 10:33
@rmackay9
Copy link
Contributor

I think this is very likely correct

Copy link
Contributor

@lthall lthall left a comment

Choose a reason for hiding this comment

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

Nice Catch

Copy link
Contributor

@rmackay9 rmackay9 left a comment

Choose a reason for hiding this comment

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

Thanks for this. The extra spaces above and below could be removed but in general it's OK to merge, thanks!

…om thrust to climb rate control to avoid flow of control error
@IamPete1 IamPete1 force-pushed the copter_angle_guided_flow_of_control branch from c1576ef to cd5238b Compare September 24, 2024 00:22
@IamPete1
Copy link
Member Author

Thanks for this. The extra spaces above and below could be removed but in general it's OK to merge, thanks!

Spaces removed.

@peterbarker peterbarker merged commit a4753f3 into ArduPilot:master Sep 24, 2024
75 checks passed
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.

4 participants