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

Tuning indication on OSD(and GCS) #28831

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Yury-MonZon
Copy link

@Yury-MonZon Yury-MonZon commented Dec 9, 2024

This PR includes:

Displaying the current value of the parameter being tuned
image

When tuning knob is in the middle (note > instead of :):
image

Adding PIDFF tuning sets for FixedWing mode:

  1. D and P for Roll and Pitch (for quick post-autotune adjustments)
  2. PIDFF for Roll
  3. PIDFF for Pitch

These additions are primarily designed for tuning via FPV without requiring MAVLink modems.

I'll add PR for wiki once everything is settled, currently it is here https://github.com/Yury-MonZon/ardupilot_wiki/tree/patch-1

@andyp1per andyp1per requested a review from Hwurzburg December 9, 2024 17:49
@andyp1per
Copy link
Collaborator

Nice idea! @Hwurzburg may have an opinion

Copy link
Collaborator

@Hwurzburg Hwurzburg left a comment

Choose a reason for hiding this comment

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

Instead of flooding the GCS/OSD every loop with send_texts...only send the message when the value has changed a nontrivial amount, or, send it only once every 2-3 seconds

@Yury-MonZon
Copy link
Author

Yury-MonZon commented Dec 9, 2024

@Hwurzburg thanks!

What would be a good 'nontrivial amount'? In my opinion, 0.01 could be problematic for the D coefficient.
image

However, setting it to 0.001 might not effectively reduce spamming either.

Displaying the value every 2-3 seconds could make fine adjustments difficult when using a small knob while flying. Updating it every 100ms could be the solution since OSD runs at 10Hz.

How about using a 5% change from the previous value as the threshold?

Also, could 0.5f be too much? I think 0.3f is enough for PIDs, though I’m not sure about other possible values being processed.

For minimal spam prevention we already have this in the code
image

@Hwurzburg
Copy link
Collaborator

Hwurzburg commented Dec 9, 2024

not sure what you are talking about "0.5f"
....but 5% seems reasonable for any PID related value as a threshold to display a new message (remember OSD messages persist a while (10s is default)....and ultrafine adjustment of PIDs is a pointless exercise since noticeable changes only occur with larger changes and you need a wide margin of stability in order to prevent corner case flight points resulting in oscillations...for example, we take PIDS, to oscillation, when tuning in level flight and cut them by 1/3 to prevent instability in other flight extremes in our autotune algorithms...

preventing RC channel jitter from changing tune is different than GCS spam rate

@Yury-MonZon
Copy link
Author

"0.5f"

I meant 5 digits after the decimal.

For practical tuning - I don't have much experience here, would be glad if you can share some info or point me to some direction.

Will do 5% and 0.0001 - 4 digits after decimal, since autotune shows PIDs this way. Sounds good?

@Hwurzburg
Copy link
Collaborator

display if fabs(newvalue-oldvalue) > 0.05 * oldvalue

@Yury-MonZon Yury-MonZon requested a review from Hwurzburg December 9, 2024 20:27
@Yury-MonZon
Copy link
Author

Yury-MonZon commented Dec 9, 2024

Done. Thanks a lot!

Could you please share more practical information, such as real-life tuning procedures? We might need to add other tuning sets based on that.

@Yury-MonZon Yury-MonZon force-pushed the osd-tuning branch 3 times, most recently from ce84f11 to b0a7ea9 Compare December 9, 2024 22:58
@Hwurzburg
Copy link
Collaborator

the wiki has lots of details on tuning process for each vehicle

the TX tuning is really a bit dated and for special cases (like default pids results in an unstable vehicle...highly unlikely)....in Plane the autotune for fixed wing and quicktune for quadplanes is the easy path, Copter: Autotune, Rover:is pretty straightforward....using manual PID tuning is really beyond most users and can even be dangerous...

most users will have a lot of difficulty using manual tuning and getting good results....sometimes even having a dangerous tune on big vehicles...

@Yury-MonZon Yury-MonZon force-pushed the osd-tuning branch 2 times, most recently from 23a7418 to ba3d1df Compare December 10, 2024 22:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants