Automatic MOT_THST_EXPO estimation lua script

Looking forward to the update! I have a hex I’m tuning up using KDEcan ESCs and am curious what sort of results I’ll get.

Hello everyone, we’ve tried the current script with our big copter:

  • Octo (X8)
  • approx 25kg takeoff-weight
  • U8II 100kV integrated motor combinations
  • 28.2x9.2 folding props

The script settled on 0.7 for expo from 0.79 after a few minutes of flight.
I can share the log privately, if desired.

I’d like to request a build for CubeOrangePlus with KDEcan. @Yuri_Rage @tridge can you help? Thanks!

Dear @tridge , i’ve been following this post since you started with the script and i would first of all like to say thank you for all your amazing work on the code.
I had not found any time till now on my test frames and i will start trying the script and also provide results, but i have a couple of questions that have been created by reading the whole chat.
Since the Voltage shag of a battery seems to be important and having mot_options set to 1 can create errors in the result, would also Min/MAX payload weight on the test cause something similar? Or am i thinking about it completely wrong? Because based on weight, the same powertrain would create different sample accel and velocity as also the time V crosses Zero would be different.
In case i am not wrong, would adding extra params to the expo such as the accel that we have for P/R/Y that you can use like (ATC_ACCEL_T_MAX(atc-accel-p-max) x (min_TOW / max_TOW)) would help it create even better results?

Ready to test board cuav x7pro
can you explain how to build the firmware ?
and the latest expo lua script thankh

@tridge is my question above valid??

@tridge Did you ever get back around to updating this?

According to @Leonardthall and the math, MOT_THST_EXPO is only half of the truth.
What people really need is a (MOT_SPIN_MIN, MOT_THST_EXPO) parameter pair.
And MOT_SPIN_MIN is missing from the spreadsheet.

1 Like

I am not sure exactly what you are referring to but I will try to clarify this.

The expo curve moves between a y = x straight line to a y = x^2 line based on the expo value.

The idealised propeller model and motor model produces a y = x^2 thrust curve but in real systems this curve is flattened out due to the various losses in the system.

When we use this thrust in a multirotor we can’t use the zero thrust point because this requires the propellers to stop spinning and esc’s don’t like trying to start again from zero rpm under load. So we set the minimum rpm and minimum static thrust using the MOT_SPIN_MIN parameter. This keeps our motors and esc’s spinning safely at our lowest thrust level.

So now the expo fitting line must match the thrust curve from some higher thrust point that the system will treat as zero thrust.

As we increase the MOT_SPIN_MIN parameter to increase the lowest point on the curve, the curve becomes closer and closer to a straight line. This means that the expo used to fit to this curve becomes closer and closer to zero (y=x).

So to get expo correct we need to move the MOT_SPIN_MIN to (0,0) before fitting the expo. If we increase our MOT_SPIN_MIN the expo will need to reduce a little to match.

Keep in mind that while our expo formulation has a very solid theoretical justification based on ideal propeller model, the real world is much more complicated. For example coax propellers increase losses and tend to drop the expo. Smaller propellers distort under load and appear to move to a lower effective pitch, flattening out the upper thrust curve. Then we start thinking about how this curve starts changing with negative inflow at high speed and … well it gets hard to know where to start.

  • Get your expo close but don’t get too hung up on getting it perfect. (we hope an approach similar to the one above will get “close enough”)
  • Get your frame built well and propellers aligned properly.
  • Set your MOT_SPIN_MIN carefully to ensure you get good low thrust but without stalling the esc’s under load.
  • Make sure your battery voltage range is setup in the MOT parameters.
  • Take your time to read, understand and follow the tuning instructions.
3 Likes

Yes, that is what I meant. They are connected and relate to each other.

Playing with the spreadsheet, I could see that a certain value of MOT_THST_EXPO (call it x_1) would match the curve. Now changing MOT_SPIN_MIN, the x_1 MOT_THST_EXPO no longer fits the curve like before. But By adjusting it, I can make it match again. Basically both values are connected and should be treated as such.

Or am I missing something? All that I am pleading here is to add MOT_SPIN_MIN to the spreadsheet.

That is correct. As you adjust the amount of curve you are fitting to using the MOT_SPIN_MIN, the curvature, defined by MOT_THST_EXPO, changes.

I think you have it all correct.

Hi @tridge, @Leonardthall,

Was this idea scraped or just put on hold?

It would be an amazing feature to have and I really hope you find the time to keep developing it. I absolutely think this has a place alongside autotune in a future release of arducopter!

@PVR2022, did you ever run the script on the T-motor arm set machines? I’ve been trying out values of 0.65-0.4 but never 0.2-0.3.

Thanks!

No, at the moment we set Mot_expo to 0.2 at starting point.
we dont test the estimation lua script.

therefore, if we use tmotor alpha/flame esc on large drone frame (greater 22inch prop) with 0.2 mot expo value works very well.

we will test the estimation lua script to verify that 0.2 its a good point.
largest values of mot expo with these ESC are known for some issues therefore mission planner make the initial parameter setup special for these esc and setup to 0.2

1 Like

Statements like this tend to self reinforce based on anecdotal evidence alone, with no real engineering support or evidence, until someone puts it into mission planner or adds it to a wiki. Then everybody is happy and starts blaming the problems they are having on the next thing. Sometimes years later someone actually does the engineering and finds it was wrong then everybody says “why was this the official instruction”.

I will summarise the current state of understanding about expo (thrust linearisation).

  1. We can only determine the expo based on a static thrust measurement. We have not been able to successfully make informative measurements in flight yet. However, we are hopeful that we may be able to do this.
  2. A perfect expo calculated based on measured static thrust results does not mean this is the best expo over the whole flight envelope. This is a very difficult thing to quantify.
  3. Static thrust measurements of a single propeller are not valid for a coaxial setup. You would need to measure the static thrust of the coaxial arrangement.
  4. When I wrote the thrust linearisation code originally I was able to get thrust curves of something like 50 propellers and I used this to provide an estimation of expo vs diameter. I have no way of verifying the data or the way it was collected. I consider that data only a little better than anecdotal evidence.

I have some wishy washy feelings too. I suspect but can’t prove:

  1. Highly loaded propellers will benefit from lower expo.
  2. Flexible propellers tend to reduce pitch under load and benefit from lower expo. (this appears to cause a two part curve, a high expo for the first 30% and an almost linear expo after that)
  3. Stiffer props will maintain pitch under load and benefit from higher expo.
  4. Higher and Lower expo means less than ± 0.2
  5. I have never seen an expo based on measurements, on a normal propeller of less than 0.5.
  6. The expo is rarely the problem people are having trouble getting a good tune.

I just wanted to make it clear that this is an area that can still benefit from a lot of testing. Don’t just believe what you see on the internet as the most accurate answer is still “I don’t really know”.

2 Likes

Thanks!

@PVR2022
@Leonardthall

I plan on doing some further testing of the thrust expo during ascends and descends. It would be great if T-motor helped more regarding their ESCs…

I’m glad to hear that it’s not abandoned of deemed impossible. The theory regarding flexing props is also interesting. I myself use polymer props. I have a set of carbon-fiber but they generate more vibrations. Probably more than they necessary du to poor design on my part.

By further testing. Is there any specific tests you need of that could help this go forward? I’m currently re purposing some parts to make a really lightweight machine. Max maxTOW would be around 6kg and minTOW could be as low as 2kg with battery and all. That could really operate throughout the entire throttle range of the ESC and motor.

Please let me know your results too, I keep track of any expo results I can find so I can improve the Initial Parameters calculator.
I’ve got a slightly updated formula in my own spreadsheet, which gives a slightly lower expo that the old Initial Parameters formula, but more data will be good before making further changes.

@tridge thanks for the work on this! Ran it on an “fpv” style quad with a Matek H743 stack and it performed beautifully.

Initially I tried to use the .apj for the matek fc from one of your earlier posts but it didnt work. Ended up using the one from @Yuri_Rage google drive. Interestingly it changed a few of my serial settings. Not sure why.

Anyways, once I sorted that out, went out in the yard and performed the test. Worked great on some motors I didnt have a chance to mount to a thrust stand. Thanks again!!

Can you please send me the .bin log and your copter details (prop size, motors and anything else you can think of), along with the thrust expo estimation.

I gather this data to see if our formulas need updating - and YES the Initial Parameters in MissionPlanner does need an update but I’ve been avoiding it :frowning:

I’ll get a whole bunch of different quads and props compiled.

Only issue I’m having is that the lua seems a bit CPU intensive. Depending on whether or not I’m running a telem radio or just an rc input, I don’t always see the CPU warning message if I don’t have a GCS so running the script is kind of hit or miss.

I’m running everything on Matek H7’s, but I find I have to turn off a number of things before I can even get the script to run without the CPU error.

@tridge Is it possible to use on tailsitter as well?