ArduCopter control issue: constant "lean" or drift while trying to reach a stabilized hover

We are designing a custom drone for a senior design project, and we are having extremely erratic but reproducible “lean” after takeoff. We arm the drone, try to lift into a hover, and the drone seems to move on its own in a new direction each time. I’m attaching a Dropbox folder that has all of our specifications, some flight logs, photos of our drone, and videos of what we’re seeing. https://www.dropbox.com/scl/fo/tskfc2itsozapq51in3ie/AAR7syeNdIuogj5E4ipvnbg?rlkey=2u51wwvq2n9953ouizt8qgwwa&st=fset4t06&dl=0

Symptoms: New drift direction on each test flight. It’s typically a slight drift, but I haven’t been able to balance it with the TX. On the first flight, it seems to Roll uncontrollably. On our second flight, it was Pitch forward. We moved back to a tethered hover in a garage and could feel Pitch forward and Yaw left. It never seems consistent, even if we reboot at perfect level or try to force a lean direction by giving a bad level.

Troubleshooting: We have verified motor orientation, motor assignment, and did an initial PID tuning pass with this https://discuss.ardupilot.org/t/initial-parameters-calculator-plugin/56909/61 initial parameters spreadsheet from xfacta. I have a lot more details about what we have tried and our tuning logs in the Box folder, along with photos and videos, and I’m happy to share anything else that could be helpful.

If you have any suggestions on possible causes, things we could try to diagnose, or see a glaring issue, we would really appreciate the help. This is our first drone, and the custom design is not treating us well so far.

The Dropbox directory you linked contains a docx file, multiple videos and photos, and one parameter dump - but no dataflash logs. They end in *.bin usually. And logs are a primary means to get any help.

From the parameter dump, I see that hardly any tuning has been done, even these ubiquitous default D values of 0.0036 are still in place. What you describe can be everything, from lack of control to severe overweight and output saturation, but without actual logs I cannot say much.

Sorry, I just added the logs. We have not done much tuning because the guide we’ve been reading ( Initial Tuning Flight — Copter documentation ) describes a stable hover to start the tuning process, and we have not been able to get that from the initial tune.

From what I see, the machine has very tough time dealing with something on the yaw side of things.

Here is the discrepancy in actual vs desired roll, pitch and yaw. R and P were not quite great in the beginning, but they started to go off cliff at about 01:45 into the log when the discrepancy in Y went up to 45 degrees.

The motor outputs were not saturated per se, but we clearly see that there are two high-PWM and two low-PWM outputs. By consulting the frame type and servo output mapping, the ones that are high are forward left and aft right motors. This, again, is a severe yaw imbalance.

The difference between the groups is around 200 PWM, which is the same as MOT_YAW_HEADROOM. This is the reserved amount of output differentials that yaw can take.

I might not be remembering the logic right, but either saturation in this dimension, or large actual-desired deviation in yaw can cause all sorts of control issues in other axes.

So the first and foremost, fix your hardware. Quite likely, you have a lot of parasitic yaw moment from motor arms not straight vertical, more precisely - not straight vertical and not in the correct way. Once this gets fixed, you’ll likely be able to hover.

And only then follow the methodic configurator.

1 Like

Reset all parameters to their default values and start over using AMC.

Hardware should be fixed first! :stuck_out_tongue:

1 Like

Max, do you see what could be causing the parasitic yaw from the pictures in the Dropbox? We have verified that our motors are almost entirely vertical (slight 1-3 degree from vertical, but symmetric). It is currently configured as a V-type frame, but we have gotten some feedback that it should be X-type. Could that cause the yaw you mentioned? Our other prime suspect is a poorly functioning motor that could be bringing up torque and causing that imbalance.

1-3 degrees seems a lot. Sine of 3 degrees is about 0.052. You have up to 5% of throttle from each motor contributing to yaw in uncontrolled directions. With most of the yaw moment of inertia in the center and relatively lightweight propellers, I think it’s quite a contributing factor.

It might be not just how straight the mounts are, but also what amount of play and in which direction they allow. I’m not quite getting how the rear arms are attached, for instance. As another wild random observer hypothesis, it may also be that the arms somehow bind under the initial lift-off load in some almost random declination, depending on the conditions of lift-off, and then contribute to yaw in a random fashion until landing.

As for X versus V frames, I don’t see this as a problem. Based on AP_MotorsMatrix.cpp, they only differ in that forward motors are configured to have a 0.8x of the yaw contribution compared to the rear motors. Which of these two is a better approximation for your machine, depends on where the CG actually is, and to the best of my knowledge does not contribute anything to your current issues. (Ideally, you can set the correct contributions using Lua to get the most of the machine, but it should not lose control in such a way with either X or V).

About faulty motors, I am not sure I can imagine a situation when one motor fails in the way that produces this behavior, and one does not hear/feel it straight away. My conjecture would be that if this happened, you would have seen one-sided effects, but you don’t seem to.

1 Like

Thank you very much for the help, we will keep looking into this and let you know what we come away with. We did have a breakthrough after you explained the motor vertical–the back motors are held in place with a detent, but then lock against the frame with thrust is applied. That means they have a little bit of play, so it could be completely possible that the motors are angled even more than 1-3 degrees while in flight. We are bolting them in place instead of using the detents as a check.

Thank you again!

We changed a dozen things, but I do think the arms having some jitter/off-vertical was the biggest issue.We have a stable hover now! Thank you for the help!

1 Like