I tried to stay away from 3.4.x for a while (had no time to troubleshoot) due to some uncommanded yaw/roll issues I started to have, which were not present on 3.3.3. Reading over the changelogs, I knew it was inevitable to upgrade.
New EFK innovations are present from 3.4.x, so I know the new algorithms are detecting something wrong (or some default parameters are not getting along with my build).
I take off in STAB, and it hovers fine for some seconds. Then I can notice it’s auto-yawing, like trying to calibrate something (small yaw corrections to either side). Some seconds later it develops a Roll tendency, like if he has already trimmed to compensate for a “stable horizon”, and drifts to a side (I need to keep the stick on the opposite side to compensate)
I land. Take off, tendency remains until I reboot the board.
If you were using telemetry and a ground station, I suppose the virtual horizon would have been rolled with respect to reality after you landed. Did you land and takeoff from a flat spot? One can see the roll reference is near 0 at takeoff and over -5 deg at landing.
The 3.4.4 flight was made indoors, I usually test my builds in my living room (my wife approves). That’s why they are short flights; I always like to have “zero wind” conditions (lot of drafts though).
My floors are pretty much close to 0 degrees, that’s the weird thing, the FC gets dis-configured on air, and when I land I see on MP that the Artificial Horizon is tilted. Magnetometer calibrations were made using a level, same procedure I used with 3.3.3 and I never had this kind of hiccups.
Maybe a auto-tune is mandatory with 3.4.4 due to the nature of my frame?
I have seen the horizon reference move around indoors with more recent firmware. Even in Stab. I’m not sure how it works, but the gps velocity (or position?) disagrees with the accelerometer derived velocities, somehow that gets into the attitude control.
You can see the position innovation grew in the last half of that flight.
Tried an outdoor test and it was horrible. Was gusting a little bit and the quad wanted to crash bad. Seems like a PID issue combined with something else. The PID conversion is just not happening (tried several times from 3.3.3 to 3.4.4 and 3.5RC1, and default PIDs are loaded).
I’ve seen Randy talk about multiplying by 0.7 for tri-copters and 27% for other frames (non X) and 10% less for X (Rate), so I took my PIDs from 3.3.3, left Stab Roll and Yaw the same; reduced by 10% Rate Roll/Pitch (i.e. ATC_RAT_RLL_P, was 0.1530276, now is 0.1377248).
The “twitching” seemed to go away (need further testing), but the Bank/Roll tendency continues.
Just sitting by itself (Disarmed), on a flat surface (Accel/compass calibrations were made several times) develops some roll.
Saw some “EKF primary changed:1” error appear too. There’s certainly something that this FC is not liking.
I’ve had a quick look at your log and found the following:
The GPS speed noise GPA.SAcc is too high to pass pre-flight checks, so the EKF never uses GPS. This means it does not do correct compensation for manoeuvre accelerations that can casue the horizon to lean over time
The EKF tuning parameter EK2_NOAID_M_NSE provided to tune the attitude correction when not using GPS is not being used internally. I will submit a fix for this.
In the short term you should fix your GPS so that the log of speed accuracy reported by the GPS GPA.SAcc plot is below 1.0 and preferably below 0.5. Currently it is 1.0 to 2.0.
You can also try setting EK2_MAG_CAL = 4 which will make the EKF use a different method of processing magnetometer data that also helps with roll and pitch estimation. This helps if the magnetometer data is good quality and the magnetic field is constant (not flying low over reinforced concrete floors, etc).
Paul’s going to come up with a fix for the EK2_NOAID_M_NSE parameter and we will release that with AC3.5.0-rc6 in about a week. So once that version is ready you might want to switch over to that. Until then, I think you might as well test with AC3.5.0-rc5.
Re “fixing”, I think Paul is suggesting it would be good to fly somewhere where there’s better GPS reception. If you think you’ve already been doing that, perhaps try removing possible sources of interference. GoPros and FPV video systems can sometimes produce a lot of interference so, for now, try removing those.
By the way, it looks like you’ve got an external GPS and compass which is a good thing but if you’re using an external GPS/compass I don’t think you should need to do the motor-compass compensation so might as well turn that off (set COMPASS_MOTCT = 0). This is not likely to resolve any issues but it’s just something I noticed while looking at your parameters.
In case it’s helpful while testing, you can turn off the GPS completely by setting GPS_TYPE = 0.
Thanks for your quick reply Randy (and Priseborough), I really appreciate you looking into this.
I’m currently running AC3.5RC5, same results (Copter flies like a beauty with AC3.3.3 as stated before, anything higher will trigger the behavior).
I thought it was better for the board to have 2 working compass, so they would help on its estimations. All FPV TXs and gimbal (even telemetry, mostly), is OFF while I’m troubleshooting. I start to add load to the build step by step.
Again, this behavior is in manual mode (stabilize), I’m not using any automated/GPS assisted modes. This is being performed indoors (as I always do with my beta builds). I did a test outdoor with a whole bunch of satellites in view, I will try this again.
So to resume:
If I flash AC3.3.3, quad flies a perfect hover (no HW added, same payload). I flash it to AC3.4 (or higher, including AC3.5RC05), quad starts to develop roll.
Mag has been always been external, if I select both Compasses, I would get BAD COMPASS HEALTH, and I would have to deselect the internal PX4 Compass. (Onboard Compass Calibration would not complete)
If I disconnect the external compass with AC3.5RC05, there’s no roll.
Maybe my PX4 board is not compatible with higher versions?
As soon as I get home I’ll start making some tests to get you guys informed. Once again, thanks for your inputs.
I’ve made several flights on my roof with no success. I made a video showing the behavior as well. (too bad the throttle quadrant is not visible, but I use MODE2 and I don’t even touch yaw) I disconnected the ext. compass, same behavior.
https://youtu.be/_9vveWjSHW4 (last part of the uploaded BIN) Loss of altitude was due to excessive batt discharge, I know, I shouldn’t let the cells drop that much. They are set now in a safe 3.7ish storage charge.
I’m starting to suspect I have a faulty board. I have just plugged the FC to my PC, and just sitting there, the ADI develops roll to the right, which is exactly the same what happens when it’s airborne.