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

Analytic Tune: Add more predictive capability #227

Merged
merged 15 commits into from
Jan 2, 2025

Conversation

bnsgeyer
Copy link
Contributor

This PR contains the additional calculations to determine predicted attitude Disturbance Rejection Bandwidth, attitude control with no feedforward path, and attitude stability (broken loop). A calculation was also added for attitude control without feedforward path.
This is all available to be plotted. just need to add the plotting options.
I think the attitude control with and without feedforward should be set based on the SID axis. SID axes 1,2, and 3 would use the calculated and predicted attitude control with feedforward. SID axes 4, 5 and 6 would use the calculated and predicted attitude control with no feedforward.

The predicted DRB and predicted stability should be available to display with any SID axis selected.

The calculated DRB is only available when SID Axes 4, 5, and 6 are selected.

@IamPete1 and @lthall I think these are the maths you need to put the rest of the tool together. Let me know if you need anything.

@bnsgeyer
Copy link
Contributor Author

@IamPete1 Added a lot of other stuff to make this more usable.
Added selections for each of the plots (i.e. DRB, rate stability, attitude stability ...)
Added a table of the System ID runs contained in the BIN file and made them selectable which modifies the time and axis
Only have the appropriate calculated freq responses for the SID axis that was run. (i.e if the Input roll (SID_AXIS 1) was used then the calculated frequency response for the DRB would not be plotted)

Additional things that are desired
-the stability plots contain the predicted system stability but that is plotted under calculated in the rate and attitude stability plots. So I think they need new labels for the series. or maybe we add them all to one selection which would be stability plots. @lthall what do you think?
-Leonard and I would like vertical lines to show at the 0 db gain and 180 deg phase crossings to make it easier to determine phase and gain margin.
-fix the unwrap feature

Copy link

@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.

Tested and it looks really good!

@bnsgeyer
Copy link
Contributor Author

bnsgeyer commented Jan 1, 2025

@IamPete1 dont merge this yet. I have some required changes before it is ready.
1 add control system stability plot.
2 correct yaw axis so it shows the Pilot_yaw_rate_tc param and uses it for calculations
3 add banner that notifies users that the parameters aren’t changed with the SysID run. Meaning that if they changed one of the params between sysid runs then it wouldn’t show or use the changed param value in the calculations.

@IamPete1 IamPete1 force-pushed the pr-analytictune-add-drb branch from d906ad6 to da04709 Compare January 2, 2025 16:54
@IamPete1 IamPete1 merged commit 8939565 into ArduPilot:main Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants