Determining MOT_THST_EXPO in-flight using lua scripts

Hey there,

I am currently setting up a 25 kg quadcopter using T-Motor P80III KV100 Motors with Alpha 80A ESCs and 30" props. I used the test data provided by T-Motor (P80Ⅲ Pin KV100_P Type_Motors_Multirotor_T-MOTOR Store-Official Store for T-motor drone motor,ESC,Propeller) to calculate the expo curve parameter MOT_THST_EXPO, which resulted in a value of 0.5, and the copter is flying ok. Though, I would like to determine the parameter experimentally to improve the flight performance. Unfortunately, my motor test stand cannot be used for props that large. Therefore, my idea is to determine the parameter in-flight by setting iteratively higher throttle values and measuring the resulting vertical accelerations, which can then be used to calculate the thrust force. Has anyone already tried something similar? What are your experiences and were the experiments successful? I also thought about automating the data gathering process using lua scripts. Do you think that would be possible?

2 Likes

Your MOT_THST_EXPO sounds about right. We’ve had so much conflicting information about the T-Motor ESCs, and I can be guilty of spreading the dodgy information too.

  • Flame ESCs apparently needing very low expo - or not depending on who you talk to at T-Motor or which of their sales brochures you read
  • Alpha ESCs being more normal and probably being able to use our conventionally calculated expo

With these larger aircraft it can be important to get MOT_THST_EXPO correct, and something like changing props (brand or size) could be an issue.

An In-Flight MOT_THST_EXPO calculator would be a useful feature if you can do it, especially for larger props and motors where MOT_THST_EXPO is almost impossible to test on the bench.
This is Leonards rule of thumb:

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

See if you can talk to @Leonardthall about this, I find he’s already thought of all these good ideas and probably experimented with it.
You might want some strategy of increasing MOT_THST_EXPO and throttle progressively or in steps until there’s no appreciable difference in {whatever you decide to measure}, then back it off a bit. Then test with progressively lower throttle and further reduce MOT_THST_EXPO if necessary.
The low throttle region will be the riskiest part to test, where instability can easily get out of control, or the ground can get too close too fast.
EDIT: my first guess at a test method could be very wrong, but we get the idea

1 Like

Yea, so have I. Everyone get’s their information from a different source at T-Motor I suspect. It seems like a simple enough question “thrust linearization in the factory firmware or not”? But a clear answer seems to be elusive so far.

And you have to wonder when some of the most expensive ESCs on the market come with what amounts to a small sales brochure lacking real specs and pretending to be a manual.

I thought of doing this too and I think it is a good idea. When I was designing the expo implementation I thought we may eventually have an autotune step that did what you are suggesting. My thought was we could do multiple thrust tests from a stationary hover. After each test we would return to the original height and repeat the test. To do this well we would need to do low thrust tests as well as high thrust tests. So some of these tests would cause the aircraft to drop while others it would climb.

The problems I saw with this are:

  • the test would take a long time and the battery voltage would change a lot.
  • each tests needs to be done from a stationary hover or the change in inflow velocity would invalidate the data.
  • the aircraft to be reasonably well tuned or oscillation or attitude control problems would mess up the measurements.
  • these tests won’t show up problems with dead zones at the top and bottom of the throttle range as well as a static thrust test will.
  • crashes happen…

Now we have lua scripting and guided prototyping this is potentially simpler. I haven’t had the time to come back and play with this unfortunately.

The other aspect of this that sits in the back of my mind is vertical thrust isn’t the only way to skin this cat. I wonder if we can extract the expo from dynamic roll or pitch input. Maybe a sinusoidal or square attitude command with an increasing magnitude could be used to get the data required to predict the correct expo.

There may also be opportunities to measure power draw of the system to predict the overall efficiency at different loads. As the expo is generally modelling the efficiency of the propeller and thrust system vs a perfect propeller this may be a viable approach.

So I see lots of opportunities here to help the community with this problem but I have not had the time to work through the various models and math to see what is most attractive and then do the real life measurements.

4 Likes

Thanks for your input! I actually left the parameter at 0.5 and tuned the pids, now the copter is flying pretty good. I think I was lucky to actually have test data provided by T-Motor on their website to calculate the parameter.

These are good points, especially the issue that the attitude controller needs to be tuned in advance. Wouldn’t a new value for MOT_THST_HOVER then require a new tune of the controller?

That is process that I had in mind. I’ll try lua scripting it in SITL first and then testing it on a smaller copter when I find the time.

1 Like

If the take off weight of the aircraft is the same as when it was tuned you can calculate the new hover throttle and scale the PID’s based on the change in expo.