Large quad EKF3 lane switch

I am testing a large (28" prop, ~15Kg) quad. I have everything mostly working, but during most flights I’ll get several EKF3 lane switch messages. It usually (but not always) seems to occur during moments of higher vibration. There seem to be no ill effects around the time of the switch, but I would like to know what is going on. I have also seen this message on other platforms.

https://drive.google.com/file/d/1-0NSN-Y7gNm4aCEwxNmmKSO437mTnXRT/view?usp=sharing

1 Like

You are still on ArduCopter V4.2.0-rc3 , best to update that to latest stable.

There’s slightly excessive Z axis vibrations showing via the non-damped IMU. Probably best to try and tame those Z vibes somewhat. There’s no clipping and it’s not affecting the damped IMUs.

There is some lane switches which appear to be related to differences in altitude between the two baro’s and the GPS Alt. Maybe it is due to prop wash over the baro’s??

There’s lots of
No ap_message for mavlink id (xxxx)
which I cant find the meaning of, maybe the firmware upgrade will fix it.

Apart from those, I’d try to improve the tuning somewhat, attitude control

I think your ATC_RAT_PIT_D could be up to 0.007, maybe try 0.005 first
and ATC_RAT_RLL_D could also come up to about 0.005, maybe try 0.003 first
Launch and hover for just a minute or less, land and check motor temperatures. If stability is worse just put them back of course.

Also your MOT_THST_EXPO could possibly go up to about 0.79 and this might help with the stability, but you might have to experiment a little:

  • set too high you can see instability at low throttle
  • set too low you can see instability at high throttle

Depending on which ESCs you have it might even be better at 0.5

INS_ACCEL_FILTER,10 is quite low, I would tend to keep it at default 20 and try to reduce vibrations. Maybe try to keep it above 15 anyway.

I would adjust your harmonic notch filter as follows:
INS_HNTCH_REF,0.39
INS_HNTCH_FREQ,45
INS_HNTCH_BW,22

After these changes it would be best to Autotune again if possible.
It would be good to see another .bin log if you can make improvements.

1 Like

Thanks for the thorough reply. I’ll give your suggestions a try.

MOT_THST_EXPO was calculated using thrust stand data. See here:

This aircraft does suffer from instability at low throttle, so maybe I should try lowering the EXPO. I’m using t-motor alpha ESCs.

Could you explain your rationale on the INS_HNTCH settings?

1 Like

Which Motor thrust stand was used?
Is this a T-Motor P80-X set with Alpha 80A HV ESCs and MF3016 props?

1 Like

It was that motor combo but with a rigid 30" prop from Mejzlik.

It was one of these thrust stands:

1 Like

The HNOTCH settings might not be perfect but should be close enough, it was an educated guess based on estimated motor RPM, and the fact that there’s an obvious large harmonic still visible at around 90Hz to 100Hz. A log with pre-filter data would be good.

INS_HNTCH_REF was calculated by MOT_THST_HOVER x 0.8 which is usually close enough.
The real formula is
INS_HNTCH_REF = hover_thrust * SQUAREROOT(min_freq / hover_freq)

Also I was thinking, do the firmware upgrade then retest to see if this copter is sensitive to the position. This shows up in Loiter (hovering) as instability or oscillations, switch to AltHold and the craft is steady. The position controller is chasing tiny variations in reported GPS position to the point of building up oscillations.
If you have that issue, halve the value of
PSC_VELXY_D
and if it’s still an issue, halve these too
PSC_POSXY_P
PSC_VELXY_I
PSC_VELXY_P
Do the firmware upgrade first though and see if that’s even an issue for you.

I’ve done a little more testing.

I have not updated the firmware as this requires merging in a bunch of our patches so is not trivial. I believe the AP_message thing has to do with some telemetry stream being requested from qgroundcontrol. I did dig into it once and came to the conclusion that it was just a nuisance.

I upped the D gains as recommended, and I think this helped, but was not dramatic. I upped the INS_ACCEL_FILTER to 15, not sure if these had any effect.

I did not change the INS_HNTCH settings as I thought I should first provide a set of log files with no payload as well.

Log files: All from today, really windy, 30-40kph.

167.BIN - no payload, easy grid flight. Some EKF lanes switches, but not too often.
https://drive.google.com/file/d/11y2tehl2oSHxVPr5jalJUAfvq-DTFuBQ/view?usp=sharing

169.BIN - no payload, INS_LOG_BAT_OPT=2
https://drive.google.com/file/d/1jOxhzeFNA0Ih37TIAqfcT37QmyDR2phy/view?usp=sharing

170.BIN - 10Kg payload, grid flight. very frequent lane switches. Noticed some wandering up and down on altitude as well.
https://drive.google.com/file/d/1YfTeyGAu5oz9OqNFABHjwx7qX2bTk0E9/view?usp=sharing

171.BIN - 10Kg payload, INS_LOG_BAT_OPT=2. some gently motion, but still had many lane switches
https://drive.google.com/file/d/1apJLcEmhs3dsrxdtogPn1gwptyBXgM7N/view?usp=sharing

172.BIN - 10Kg payload, taped over some vents in the aircraft fuselage to try to rule out baro issues. This had no effect.
https://drive.google.com/file/d/10MCQl4nsqeMgTC35OpECDqGcySXNXr2b/view?usp=sharing

Can I try to get to the underlying cause by disabling certain sensors? It seems to be flying really well except for the barrage of EKF messages. This aircraft is a “H” configuration with large tube for the fuselage. I have observed at high air speeds that the fuselage can pull slight a vacuum.

Please provide your thoughts.

Take a look at:

and is this the prop you are using: CFK-Propeller 30x12 Mejzlik Kohlefaser Luftschraube - MZ-Modellbau Frankfurt ?

That pull request doesn’t seem super relevant to my issue.

This is the prop I was testing with:

I’m actually using 28" propellers at the moment. However the curve I get on the motor thrust is pretty representative.

I did a few more tests yesterday, this time in calm conditions. Some comments:

The vibration was much less intense.
baro 2 had significantly more noise than baro 1 in all cases. Is this because baro 2 is not on the “damped” portion of the cube and rectifying more vibration?

From the prior tests I can see most vibration seems to be on the second harmonic. This leads me to believe blade flapping is causing this. Is this a reasonable assumption?

I can not comment on blade flapping. The notch filter can do main and second harmonic, so that will not be a problem.

Do you happen to have the T-Motor P80-X thrust data with a T-Motor MF3016 prop on a Tyto 1780 thruststand?

Sure. Here it is:

https://drive.google.com/file/d/1lecKFscfLMTI8GbmKN_0axMUTUPQ-GaQ/view?usp=sharing

1 Like

Many thanks.
Have you managed to reduce your vibrations?

I’m not sure vibration is the primary problem here. If you look at the baroX readings in the log you’ll see a huge amount of noise. This also explains why I was seeing some movement on the altitude.

I can not reproduce this level of noise with a hover in calm air, so maybe vibration is part of it? Will the MS5611 in the cube orange rectify vibration? I’m also wondering if noise is a problem, since sound is a pressure wave after all.

I have added a secondary set of vibration isolators I can bypass and also an external barometer. Need to get this tested soon.

Will you always fly with the payload, or sometimes none, or different payload for different jobs?

FFT/Harmonic notch filter values from logs:
Without payload - 70Hz, 0.2 ref
With payload - 90Hz, 0.36 ref, + 68Hz static

Leave FFT params as they are now.
I would change your HNOTCH settings as follows, and I think this would cover most cases
INS_HNTCH_MODE,4
INS_HNTCH_HMNCS,3
INS_HNTCH_REF,0.3
INS_HNTCH_FREQ,90
INS_HNTCH_BW,45
INS_HNTC2_MODE,1
INS_HNTC2_HMNCS,1
INS_HNTC2_REF,0.2
INS_HNTC2_FREQ,70
INS_HNTC2_BW,35

The X/Y axis vibrations are significant sometimes, so maybe it’s as simple as checking prop balance??

Payload will vary, usually being on the heavier side I expect.

I’ll try those notch filter setting next time I’m out testing.

I just came back from another set of test flights. This time I had an external DPS310 based baro installed.

https://drive.google.com/file/d/1fLVPkzOEQpX3XtSFi0QgXJSEu-jYZ_oZ/view?usp=sharing

The DPS310 was baro0 in this case. Compare it to the other two. I did not have a single lane switch message during this flight or the the subsequent one. Weather was calmer, but even in calm weather I would get those message fairly consistently.

Yeah I thought it must be the other baros forcing those lane switches because they were frequently spiking in opposite directions - not by a great deal but obviously enough to cause a problem.

Do you think you’ll be able to run Autotune without any payload, or maybe a small to medium dummy payload well fixed in place?
It will be interesting to see the result.
And also interesting to see the post-filter FFT/HNOTCH data.

EDIT:
Just looked at that log - what a difference that new baro makes!

And we get a totally different bunch of FFT data too :frowning:

  • 50Hz, 100Hz and 200Hz (roughly speaking)
  • and something at about 72Hz

Actually the HNOTCH settings I recommended before might still be OK,
or you go with:
INS_HNTCH_MODE,4
INS_HNTCH_HMNCS,3
INS_HNTCH_REF,0.3
INS_HNTCH_FREQ,50
INS_HNTCH_BW,25
INS_HNTC2_MODE,1
INS_HNTC2_HMNCS,1
INS_HNTC2_REF,0.2
INS_HNTC2_FREQ,74
INS_HNTC2_BW,20

I just did some test flights with the new filter settings:

Original settings:
https://drive.google.com/file/d/1CJZMbItbQe8SHpzTLtRHFMn9kXe8w40y/view?usp=sharing

New settings:
https://drive.google.com/file/d/1bCiKc0wQl-DT4h241vXNjQ1wnEuf8Yyx/view?usp=sharing

I was able to get some oscillations in loiter mode, by deliberately working against the autopilot (commanding changes in phase with the movement. It took some effort to make this happen, for “normal” flying it seemed to be fine. Is a tweak to loiter gains needed?

See near the end of the log here:
https://drive.google.com/file/d/1KDWbbtJzYTFk3ncvNN-ASmk5wiWPmM72/view?usp=sharing

There’s still some level of vibration that less than ideal, IMU3 is doing some clipping.

Attitude control is quite good, but I’d try
increasing this
ATC_ACCEL_Y_MAX,7500
to about 10000 or 14000
and (optionally) reducing these
ATC_RAT_YAW_P,1.430616
ATC_RAT_YAW_I,0.1430617
to about 0.8 and 0.08 respectively.

I’m still not totally OK with the FFT and HNOTCH settings.
I’m inclined to rework it a bit:
FFT_ENABLE,0
INS_HNTCH_MODE,1
INS_HNTCH_HMNCS,3
INS_HNTCH_REF,0.2
INS_HNTCH_FREQ,70
INS_HNTCH_BW,35
INS_HNTC2_MODE,1
INS_HNTC2_HMNCS,3
INS_HNTC2_REF,0.2
INS_HNTC2_FREQ,170
INS_HNTC2_BW,60

If you can reduce vibrations further, some of the HNOTCH/FFT weirdness might resolve itself.

You could set these to settle down the position controller
PSC_ACCZ_P,0.3
PSC_ACCZ_I,0.6
PSC_POSXY_P,0.5
PSC_VELXY_D,0.25
PSC_VELXY_I,0.5
PSC_VELXY_P,1.0

Very interested to see how that works, especially the HNOTCH/FFT stuff

Did some more testing just now. I left the filter settings the same and only changed the vibration isolation hardware.

4 different hardware configurations:
https://drive.google.com/file/d/1Y8v0Jjj21V1I-p_cHcCWPF3FFETSdXQg/view?usp=sharing
https://drive.google.com/file/d/1zA47Pe-tgLPsk1KotyfXnJagKbRAyNsD/view?usp=sharing
https://drive.google.com/file/d/1TyegVV-jnJxKb2uazjJevFnag9toGKi6/view?usp=sharing
https://drive.google.com/file/d/1FjTvV8nKY2n6RSIpGATDhvkznnBf-E_s/view?usp=sharing

Let me know which is best. I have reviewed the logs and picked my favorite.

I changed the yaw gains and PSC gains as suggested. I was even more aggressive on the controls in loiter mode, but all seemed well.

https://drive.google.com/file/d/1Zx4iImxlASysQFzZCoaHHEbGuww6_nQa/view?usp=sharing

Let me know your thoughts.

Attitude control looks really good for a large quad. There’s still some noise there because of vibrations.
I’d definitely set the HNOTCH as I suggested:
FFT_ENABLE,0
INS_HNTCH_MODE,1
INS_HNTCH_HMNCS,3
INS_HNTCH_REF,0.2
INS_HNTCH_FREQ,70
INS_HNTCH_BW,35
INS_HNTC2_MODE,1
INS_HNTC2_HMNCS,3
INS_HNTC2_REF,0.2
INS_HNTC2_FREQ,170
INS_HNTC2_BW,60