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

Support per-motor throttle-based harmonic notch #26674

Merged
merged 2 commits into from
Aug 7, 2024

Conversation

andyp1per
Copy link
Collaborator

@andyp1per andyp1per commented Apr 2, 2024

To enable set the mult-source bit in INS_HNTCx_OPTS and use the throttle notch

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.

This all looks right to me.

libraries/AP_Motors/AP_MotorsMatrix.cpp Outdated Show resolved Hide resolved
@andyp1per
Copy link
Collaborator Author

Flight tested on a quad with ESC telemetry. First notch uses ESC telemetry, second notch uses throttle - both multi-source, outcome seems really pretty good:

image

@andyp1per
Copy link
Collaborator Author

I've added this to DevCall so that @IamPete1 and @lthall can duke it out.

Copy link
Member

@IamPete1 IamPete1 left a comment

Choose a reason for hiding this comment

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

I really think this should be useing the _actuator value and removing the thrust linearisation with the actuator_to_thrust method.

See discussion: #26674 (comment)

@IamPete1
Copy link
Member

I have done the change over to use _actuator here: https://github.com/IamPete1/ardupilot/tree/actuator_throttle_notch

This is the key commit: IamPete1@c70db86

@tridge
Copy link
Contributor

tridge commented Apr 29, 2024

@andyp1per nice work! I'd love to see some test logs

tridge
tridge previously requested changes Apr 29, 2024
Copy link
Contributor

@tridge tridge left a comment

Choose a reason for hiding this comment

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

i think we need a pre-arm check for the ratio of bw to freq for multi-source
we could have a notch filter option to disable the check

@tridge
Copy link
Contributor

tridge commented Apr 30, 2024

@andyp1per @lthall maybe we should pre-arm warn if you have multi-source and bw > 0.75*freq/nsources ? we could have a INS_HNTCH_OPTS bit to disable this check

@andyp1per
Copy link
Collaborator Author

@andyp1per @lthall maybe we should pre-arm warn if you have multi-source and bw > 0.75*freq/nsources ? we could have a INS_HNTCH_OPTS bit to disable this check

We don't currently do this for ESC notches and I am currently against it. Please can we move the discussion of that to a separate PR so that we can have a good discussion and not hold this PR up?

@tridge
Copy link
Contributor

tridge commented May 2, 2024

We don't currently do this for ESC notches and I am currently against it. Please can we move the discussion of that to a separate PR so that we can have a good discussion and not hold this PR up?

this PR (which I love btw!) will make this situation a lot more common. We need to fix it before we merge this PR. If we defer this test we'll never put it in and we'll get crashes

@andyp1per andyp1per force-pushed the pr-thr-notch-multi branch from 2ee5c9a to f3671f2 Compare May 15, 2024 14:00
@andyp1per andyp1per requested review from IamPete1 and tridge May 15, 2024 15:57
@andyp1per
Copy link
Collaborator Author

i think we need a pre-arm check for the ratio of bw to freq for multi-source we could have a notch filter option to disable the check

This has been split out into #27068

@Hwurzburg Hwurzburg added the WikiNeeded needs wiki update label May 15, 2024
Copy link
Member

@IamPete1 IamPete1 left a comment

Choose a reason for hiding this comment

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

LGTM

@tridge
Copy link
Contributor

tridge commented May 26, 2024

@andyp1per I put some logs here for a hexa that has ESC telemetry:
https://drive.google.com/drive/folders/1fveumuzs7zw7zCqw7jKLHqiaXxx3k5nC?usp=drive_link
I used a small lua script to allow switching between the ESC notch and the per-motor throttle notch:
#27163
the match is OK for some motors, less good for others. Here is motor3 for example:
image
and motor6 is good too:
image
motor5 is less good:
image
this is all from 1.BIN, which was the last flight we did (microSD swap before this flight)
we couldn't try the octo as it has an orangeplus on it, so no bdshot for 8 motors

@andyp1per
Copy link
Collaborator Author

andyp1per commented Jun 29, 2024

I had a look at the BobaHex logs using this. Unfortunately the ref was slightly wrong leading to about a 15Hz separation between the actual motor frequency and the frequency being used by the throttle notch. This has the effect of effectively doubling the bandwidth being used leading to better noise attenuation than would have otherwise be attained using the ESC notch only with a relatively narrow bandwidth (Q=6.2). I'm not sure this proves much other than flying with wider notches is ok. My goto notch width is Q=5 which is not far away so really need an octo test with narrower notch to see the differences.

image

image

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.

This really should go in.

@tridge tridge removed the DevCallEU label Aug 7, 2024
@tridge tridge dismissed their stale review August 7, 2024 08:36

given up on pre-arm :-)

@tridge tridge merged commit a974f3f into ArduPilot:master Aug 7, 2024
91 checks passed
@andyp1per andyp1per deleted the pr-thr-notch-multi branch August 7, 2024 08:47
@andyp1per
Copy link
Collaborator Author

Thanks @tridge !

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.

7 participants