AutoTune in 32inch quad result in strange PIDs, crash in next flight

UPDATE:

Finally, after repairing the damage, restoring the PIDs, adjusting some parameters and making a crude manual tune the drone is now flying well enough. I attached logs with this new tune at the end of the post.

The problem was definitely caused by an autotune with the AUTOTUNE_AGGR set way to low, that resulted in a bad tune with ridiculous low values for the PID gains. Then, me failing to recognize that the values were completely wrong and trying to fly with them, leading to the crash.

One of the parameters that I also changed for this new tune, was the MOT_THST_EXPO. At firsts this parameter had been set to 0.8, as suggested by the “Tuning Process Instructions” in the Ardupilot Wiki. This value of 0.8 is set to be a good approximation for a 30” diameter of propeller. But I was not very confident about the reliability of the parameter as the powertrain I was using is a combo motor/ESC and I was afraid that it might be compensating in some way for the exponential response of the motor thrust. So, I tested the motor/ESC in a thrust stand, collect the data and experimentally calculated the correct value.

The result was a MOT_THST_EXPO equal to 0.4, way different to the original 0.8, and also very low for almost every size of propellers, as shown in the graft of the “Tuning Process Instructions”.

In my opinion this also confirms my suspicions that the ESC was somehow compensating for the motor response.

The result of the calculations is presented below.

Capture2

At the end, I also do not know whether the effect of the adjustment of this value is appreciable or not. But the drone is flying and the mistakes are not going to be repeated hahah

LOGs: https://drive.google.com/drive/folders/12Xuvm-OGdEj-W3KmyOLHAfsQG-pTV-4F?usp=sharing

That’s interesting, which ESC’s? The Tune looks good.

It is a T-Motor combo, that comes with their “pre-made” drone chassis. The motor is a U8XL KV100 (which don’t even exist in their normal catalog). And the ESC sits below the motor in the motor mount, that is all I know about it. Little to none information is available about the combo, not even after purchasing it and asking for info.

Regarding the tune, it flies well enough, but I would like it to fly better. Also i am not use to the big size and the inertia it has.

That’s true of everything T-Motor. I did ask them if their ESC’s have a thrust linearization feature and they did reply to that saying they do not have this function. But on the other hand it has been suggested to lower MOT_THST_EXPO on certain T-Motor ESC’s and good results have been realized.

Yes, have also read posts about lowering the expo in T-Motor flame ESCs, that was the main reason why I began suspecting about mines. And in my case, based in my experimental results I can confirm that there is some sort of linearization being made in the ESC.

Hard experimental data is valuable information!

Thinking more about this it does make sense that they would have this feature for a Motor/ESC assy but that it wouldn’t necessarily make sense for a discreet ESC which could be used on a range of motors from different manufacturers. So perhaps it’s only one data point, don’t know.

1 Like

That thought also crossed my mind, and for my case, in which you have a Motor/ESC combo that is indivisible, and where is almost impossible to take it apart and use it with other different hardware, here can make a little sense. You will obtain a system with a more linear response which is always desirable. But you must tell the client!! Otherwise, as we are doing, we compensate for something that is already compensated.

And besides, as you said, compensating for an exponential response in a system that you have not fully characterized (because it is an incomplete system to which you can attach any motor) does not make any sense to me.

1 Like

@Matt_C yes the tunning results will be better because it properly “waits for level” before testing new PID values. I already oposted about that in some other threads, and gave more details why it is so.

Here is more info: https://github.com/ArduPilot/ardupilot/pull/16471

I had to manually tune a very similar (or maybe the same) copter as yours, because autotune did not produce an acceptable result. I also lowered the MOT_THST_EXPO, which gave me trouble especially during takeoff/landing.

When you use Tmotor Flame esc, the initial parameter setup script in mission planner, suggest you use the MOT_THST_EXPO to 0.20 value.

I have tested the M1200 with this value and we have perfect flight dynamics after autotune with 0.1 agrr.

nevertheless, we have talked with tmotor support service, and told us the m1200 drone have a 0,65 value of MOT_THST_EXPO value.

do you have good results with 0.4 value?

This is because the T-motor ESC’s do not have linearization as some have claimed. I inquired about this relative to all of their ESC’s and they replied that they do not. So I don’t think the blanket statement that 0.2 should be used for Flame, or any other T-Motor ESC, is supported by facts. Perhaps a certain combination of Motor and ESC would perform best at .2 but not every combination with Flame ESC’s.

I would suggest the checkbox in Mission Planners Initial Parameters Setup screen for Flame ESC’s be removed.

Hello,
Just a quick question. Could you share the a picture of the PID Values of that tune?

I would love to compare them to our 32 inch quad with Tmotor Propulsion.

Thanks in advance!

Greetings
Jan

This is our pid setup.

note: we do not setup the notch filter yet.

1 Like

Thanks for that !

We have some problems in loiter and tried to set up the notch filter.

Do you saw any problems in loiter Mode?

Greetings
Jan

We would need to see your .bin log file to help more.
Please describe your components in detail.

At low speeds in loiter mode, we dont see any problem. the main problem of the big and heavy drones, are the braking behaviour in loiter, after a long run in high speed. the recuperation and oscilations in these brakings are dangerous.

with standard speeds in loiter, about 500-700 cm/s, the drone flies perfect. there is enough speed for these drones.

therefore, we want to setup the notch filter too, to improve the global performance

Hi Shawn, Thanks for the offer! I would make a new and clean new topic with all the bin files and descriptions. For now it’s ok.

We flew a lot yesterday to set up the notch filter and the right rates with autotune (we got pretty much the same result as your pid screen). After a while of tuning the loiter behavior wasn’t getting better. We looked at the rate controllers, the vibrations, the notch filtering, but that was all pretty good, so we started tuning the loiter P values. That actually helped a lot, especially with the breaking behavior.

Thanks for the help!

Kind regards
Jan

Could you tell me the frecuencies and the setup of the notch filter to this quad?

we do not touch the P values of the loiter, only the speeds and accelerations

hello @PVR2022, I have the same problem with my heavy hexacopter, can you check this thread and check the videos? I think you are describing what im facing. How did you fix it?

https://discuss.ardupilot.org/t/min-tow-max-tow-what-unit-are-are-grams-or-kilos/

Thanks!