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

AP_Mount: Siyi gets rate map, PI control, accel limit #27342

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rmackay9
Copy link
Contributor

@rmackay9 rmackay9 commented Jun 20, 2024

This improves the Siyi gimbal control inspired by the work done in the MAVProxy Siyi module:

  • Rate mapping table compensates for the non-linear rate response of the gimbal
  • Angle controller is enhanced in these ways
    • P controller is extended to a PI controller to reduce long term error
    • Rate targets are acceleration limited to reduce impossibly fast changes and thus reduce overshoot
    • I-term build up is avoided by using limit flags
  • Debug logging of angle and rate has been added to somewhat ease support if this doesn't go well. This debugging is off by default

This has been tested on a Siyi A8 and some screen shots are shown below

Desired vs Actual Pitch Angle
image

Desired vs Actual Yaw Angle
image

Desired vs Actual Pitch Rate
image

Desired vs Actual Yaw Rate
image

@rmackay9
Copy link
Contributor Author

Hi @timtuxworth,

I wonder if you'd be able to help me test this? I've bench tested with an A8 and I can bench test with a Z10 as well but a flight test is slightly more difficult for me.

No pressure of course but if you can help, just ping me with your autopilot and I'll create a binary. Discord also works of course.

@timtuxworth
Copy link
Contributor

Hi Randy - I currently have the A8 Mini installed on an EDU-650 with a Cube Red. I'd likely be able to test it on the weekend.

@rmackay9
Copy link
Contributor Author

rmackay9 commented Jun 26, 2024

Hi @timtuxworth,

Thanks very much!

Here is a binary for the CubeRedPrimary based on this branch. https://www.dropbox.com/scl/fi/k7f1yxtqa7y50ebtdu256/copter-460-siyiPI-cuberedprimary-27Jun2024.zip?rlkey=ae1mfjr1ybq3n5njpcad43lug&dl=0

I've rebased this branch on master as well.

@timtuxworth
Copy link
Contributor

timtuxworth commented Jun 29, 2024

I tried testing this but found that this firmware seems to break NET_Px_PROTOCOL access to the A8 Mini. I have my gimbal connected to the FC via ethernet. The symptom is that it reports "Mount: not Healthy"

I proved this by flashing back to 4.5.0 beta 3 which worked.
I just put 4.5.4 stable on, which also works, the FC can communicate with the Gimbal using stable, but with this PR it reports "Mount: not Healthy".

@rmackay9
Copy link
Contributor Author

Hi @timtuxworth,

Now that we've resolved the networking issue, I wonder if you'd be willing to test this change again? I've put a new CubeRedPrimary binary here which is this PR rebased on master
https://www.dropbox.com/scl/fi/l0apmxdhfom4ksen95rx3/copter-460-siyiPI-cuberedprimary-17Jul2024.zip?rlkey=1xajqqvzd0wa6njyajcuki9nk&dl=0

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.

3 participants