Rc2: Inconsistent values between MOT_THST_HOVER and PWM output

Hi Randy,

what’s the intended value range of CTUN.ThO/ThH and MOT_THST_HOVER, respectively? I just did a quick test flight with rc2 and an experimental drive setup. CTUN.ThH seems to converge against 0.27. Does this mean that ArduCopter thinks it is hovering at a 27% power setting? This seems to be completely unreasonable for my setup - a quick look on the RCOUs also shows, that the motors are running in the 1550…1650 PWM range during hover. This is also the value that I would expect by considering the weight of the copters and the thrust numbers measurerd on the bench with these drives. ESCs are calibrated to my RC PWM range of 1000…2000 (verified by digital scope).

@hornetwl,
yes the range is 0~1 although it’s actually a “thrust” value not a pwm value. So a couple of things are happening which can make it appear too low:

  • MOT_SPIN_MIN (default is 0.15, replaces THR_MIN) chops off the bottom of the pwm range. So if the ESC run from 1000 ~ 2000 then the first 150 are considered as producing no thrust. So 1150 would be expressed as a thrust of 0.
  • MOT_THST_EXPO scales the “thrust” to a pwm value. http://ardupilot.org/copter/docs/motor-thrust-scaling.html
  • MOT_SPIN_MAX (default is 0.95) this chops off the top of the pwm range. I don’t think this contributes to the thrust value appearing low though.

Now it’s possible we have something wrong although we’ve done lots of testing, I think if you remove the motor thrust scaling (set MOT_THST_EXPO to 1) and then remove the mot-spin-min and mot-spin-max you’ll see the numbers you expect for thrust.
Another high level test that would be interesting would be to weigh the copter and find what thrust level it’s flying at. Then double the weight of the vehicle and see if the thrust required to hover also doubles (it should I think but I think it might not).

I’m happy to drag in Leonard on this who is really the one who designed the thrust curve to get his input if we need more.

P.S. nice to see you’re very comfortable with the dataflash logs!
P.P.S. like mentioned above, we really should open new topics I think.

Randy, thanks for the detailed explanation. My quadcopter had a weight of about 3.7 kg in the cited flight. The drive setup (ESC, motor, prop and battery as flown) has been selected and measured on the bench to deliver about 2kg of max. thrust (it’s an endurance setup, not a racer). Even when considering the MOT_THST_HOVER as a thrust, the value of 0.27 still sounds strange - I would still expect a value above or close to 0.5 here. I will do a test flight with THST_EXPO=1, SPIN_MIN=0 and SPIN_MAX=1 and report back.

I do not really like the idea to add another 4kg of weight - that would put extreme stress on the motors and ESCs and I only have that one set so far. One thing that I could easily do: put one motor back on the test bench and measure the real thrust values for a couple of PWM steps. Maybe I will do this tonight.

I have set MOT_THST_EXPO=1, MOT_SPIN_MIN=0 and MOT_SPIN_MAX=1. Additionally, I set MOT_PWM_MIN to 1000, MOT_PWM_MAX to 2000 and did a fresh ESC calibration. During the calibration I sampled the PWM output with the scope - the output PWM range was exactly 1000-2000 as expected.

Here is what happened:

  1. Surprisingly, the motors did not spin after arming. MOT_SPIN_ARM was set to 0.1. I verified with the scope and a servo tester that the motors begin to spin at PWM=1040.
  2. flight was uneventful and stable.
  3. MOT_THST_HOVER slightly increased to 0.282 - no significant change though.
  4. Log reveals that the real throttle output (CTUN.ThO) in Stabilize mode is in the same range when hovering.

Mine is a hexa with ~ 1.5Kg of thrust on each motor. Total AUW of ~4.1Kg. Before the changes in the code, my thr_mid was set at 440, which, by ecalc ( and my math also) is something close to the range that I was expecting. Now I have it around 0.3, lower than I thought that it would be. However it is flying OK and I can see that my throttle mid position is hovering well in stabilize, so no worries when changing to manual modes.

I’ve just accept it as 0.3 because even if the scale isn’t close to pwm range to rover ( 1550 ) expected, it is coherent with its internal math, whatever it is.

My MOT_SPIN_ARM is 0.035, they start spinning at 0.03, I’ve set MOT_SPIN_MIN=0.1. Should i bring it more close to 0.035?

If you need any further data to investigate it, please let me know!

hornetwl,
re the motors not spinning, the reason is MOT_SPIN_MIN is set lower than MOT_SPIN_ARM. So on Copter-3.3 this would be like setting THR_MIN to 0 and MOT_SPIN_ARMED to 100. I guess we could add a pre-arm check to ensure people don’t set the parameter incorrectly… or perhaps a comment in the parameter description to say mot-spin-arm should always be lower than mot-spin-min.

Ok. My expectation would be that MOT_SPIN_ARM would have priority over MOT_SPIN_MIN, while the last one would only limit the allowed range during stabilized flight. However, this is probably not a very relevant problem in daily use and could be easily resolved by a word in the documentation of the MOT_SPIN_MIN param.

In between I have found out that the MOT_THST_EXPO should be set to 0, not 1, to get a linear response. Doing that, MOT_THST_HOVER moves into a reasonable range. Some thrust measurements with 15inch props have shown that a the best approximation of thrust to PWM mapping is with an expo value around 0.4. BTW, MOT_SPIN_MAX btw. should be set to 1.0 with properly calibrated Hobbywing XRotor ESCs, as there is throttle response even in the latest microseconds of the range. Maybe the ESC does some capping interally and never ever allows real 100%PWM output.