An idea for AP_Tuning library for transmitter tuning

Something else.

Considering that 99,9% of the time channel 1 to 4 is used to control the vehicle, it might prove dangerous to allow ch1 to ch4 to be used for parameter adjustment. I would also consider ch5 as reserved since it’s used to change flight modes.

https://github.com/tridge/ardupilot/blob/tuning-wip/libraries/AP_Tuning/AP_Tuning.cpp#L12

@tridge

ok, managed a 10 minutes break on the rain, and went outside.

It works as expected, it makes configuration quite easy.

BUT

It’s still a pain to do it.

Let me explain. One still needs a ground station available all the time to configure the parameters and worst, has to pay attention to the messages to know exactly what is being tuned.

So the effort to tune is about the same, before we would set what we wanted to tune on the gcs and do it, now we have to pay attention to what is going to be tuned and do it. Sequentially selecting the tuning parameter might also not be a good idea, because you can tune something (roll) then another (pitch) and go back to tune the previous parameter (roll). That was easy before, now it’s not.

Now back inside, with storm warnings and yellow warnings of flooding until Thursday :slight_smile:

We need an option for this function to work like it used to. This removes a feature that I used all the time.

I often leave Yaw_Rate_P set to Ch6 tuning, with a given range, permanently. This way I can adjust Yaw Rate P as I’m flying according to flight speed. Hover requires a high P, but fast flight requires lower P. This is very common with copters.

I find the new scheme confusing, maybe I will adjust if I try it. But I still need to option for fixed tuning ranges and simple operation.

@tridge

Have I seen wrong, or is this already on master ???

Only for plane, there’s a PR for Copter (#4065)

@LuisVale, in MAVProxy I’ve made it do a speech announcement of which parameter is being tuned (when you switch parameters). That isn’t in other GCS yet, but I expect they would add it if this goes into copter.
That means you don’t need to look away from the vehicle to tune all the parameters in the set.

I don’t quite understand this. Previously you couldn’t do multiple parameters in one flight at all, so I’m not sure what aspect was easy before.
I’ve also now added the ability to tune a single parameter instead of a set of parameters if you prefer that approach. The TUNE_PARM values below 100 are for single parameters. Values above 100 are for sets of parameters.
Leonard has suggested making the beeps match the index number of the parameter you are tuning. So a single beep when you start tuning the first parameter. Two beeps when you start tuning the 2nd one, etc. That would make it easier to keep track of which parameter you are up to. In practice I didn’t find that a problem as I had the GCS on a chair beside me and it was announcing the name of the parameter, but if you don’t want a GCS at all it could help.

@tridge

I like Leonard’s suggestion for the multi-beeping. Will make things easier.

On Copter it was quite easy to adjust a single parameter, land, save. Change param on the GCS, take-off, another, etc. Granted, wasn’t very convenient, but after a while it was almost second nature :slight_smile:

I think in time this new method will also be a matter of getting used.

The comments above about CHAN_MIN /MAX and preset PWM values, and also about CH1-CH5 ??

brgds

Luis

even for a single parameter I found the old method much too dangerous. If you get the MIN/MAX values wrong (eg. dropping a decimal point on a D term) then you could get yourself in serious trouble.
That is why I prefer TUNE_RANGE, as you can use the same value for all parameters.

One downside of the multiplicative scaling of TUNE_RANGE is that if the original value was zero then it will always stay at zero. So you need to set the parameter to a non-zero value to start with in order to tune it.

i’ve removed the chan1 to chan4 options from TUNE_CHAN. I’ve left in chan5 as its perfectly valid on plane and rover. The flight mode channel is settable on plane (defaults to channel 8 for historical reasons).

On the CHAN_MIN/CHAN_MAX, they are needed as we can’t use the RCn_MIN/MAX values as they may be being used for output. For example, channel6 might be flaps on a plane, and RC6_MIN/RC6_MAX controls the flaps range, so we have to have a separate MIN/MAX for the tuning channel input.

The same applies to the 1700 and 1300 thresholds for the selector, the selector may be (and commonly will be) an output channel with the MIN/MAX values setup for that output function. The choice of “above 1700” as “on” for a channel is quite common in ArduPilot.

reg. TuneRange

Yes it was, I’ve had some surprises with commas and decimal points :frowning: That’s why I suggested some months ago to have all parameters (user settable) to be on a range 0/1000 and the code would internally convert them to the appropriate values, so that the user would only see a 0/1000 value.

Then, perhaps an if for copter to remove CH5 from the options ??

Hi all,
My personal interest in improving this is because I am regularly faced with people needing help tuning large copters that they don’t want to ship out to me. Because it is so easy to make a mistake using the old method am honestly scared as I explain to them how to do a manual tune.

So I am happy with:

  • Ratio based tuning based on a setable parameter defaulting to 0.5.
  • Midpoint reset based on a short high-low
  • Next parameter based on a slow high-low
  • Reset to original tune if any mode change takes place
  • Tuning single parameters and multiple parameters

There are a couple of areas we could improve:

  • We should only be able to tune in manual modes, loiter, pos_hold, alt_hold, stabilize, acro.
  • My gut feeling is the very long high-low for saving parameters is a step too far. Maybe we should make this do the same as Auto Tune and it saves if you land and disarm with the switch high (I am not sure if the mode change should stop this).
  • ahhhhhh, that is it I think…

So it is worth pointing out that most people using Copter start with the defaults and then do an Auto Tune and never do manual tuning. However, when manual tuning is required it is often on a copter that has the potential to do serious personal and financial injury. I think coming up with something that is safer and easier to explain to someone by email is well worth the time.

I am very happy to see this happening, it will be a relief for me!!

1 Like

I found tuning in LOITER was most useful, as I could concentrate on the tune and not worry about having to keep position. Is there some reason why tuning in LOITER is a bad idea?
Tuning in LOITER is also good for tuning the VelXY and PosXY parameters.
I agree that some combinations of tuning parameters and modes make no sense. For example, tuning the rate gains in AUTO would be pretty weird, but tuning something like WP_SPEED while in AUTO may actually make sense, if only to give a useful way to control mission speed on a knob.

That would mean you would have to land in the same mode you are tuning in, otherwise it will revert. I think you should try the “long pull for save” and see how you find it. I found it good yesterday. Note that you can just switch the selector switch and leave it there to save. It will make a distinctive sound on the buzzer when it saves and while the selector switch is high all tuning is disabled, so by just putting it high and waiting a few seconds it saves and also stops more tuning from happening.
I’m certainly open to other methods of saving, but I do want to avoid the old method of fiddling with parameters in the parameter list to save. It should be possible to save with the transmitter.

Hi Tridge,
I included Loiter in the manual mode list. However, you are correct that there are parameters that we may want to tune in auto modes too so it is probably simpler to just let it happen in any mode.

On the second point the suggestion would be that you leave the switch high and disarm to save. In that case I think mode changes once the switch is high would not reset the parameters perhaps… This is just me sharing ideas, I am not sure if it is better than the long switch method.

I have put up some documentation on transmitter tuning for plane and quadplanes here:
http://ardupilot.org/plane/docs/common-transmitter-tuning.html

btw, I think the idea that this is “too complex” for our user base is not true at all. A large part of our user base manages to setup transmitter switches to get 6 modes off a 2 position and 3 position switch. Many people in our user base learn to fly copters or helis in acro mode. People learn to fly with flaps, spoilerons, landing gear, dual rates, emergency stop, parachutes, camera gimbal controls and many other complex features.
There will be large parts of our user base that don’t need or want this. There will also be large numbers of users where this will be a huge improvement over what they can do now.

Not wanting to stir the subject further, but the majority of current users that set up the 6 positions resort to Youtube and forae. The same for the other items.

The smoother the curve of introduction to ArduPilot, the larger adoption we’ll have.

I would agree but Tridge is right, if we go with the old method (the tuning knob version in Copter) for quad planes it will take forever to tune and I think that alot dont use it - they’d rather use a poorly tuned quad or quad plane. On my old quad with a 800 size autotune just never worked, I started on the manual tuning but quickly changed frames. Autotune worked well on the 650 replacement. I agree that some do have a genuine need for it to stay the old way. Now I’m not sure that the method Tridge has is the answer, I think its better than before and until something better comes along is good enough. Either a parameter to select the method or as a separate build, this would mean MP would need to interpret both ways.

I’ve used the new method from @tridge, and considering that it’s new and one must get used to it, it might become easier, but all the reporting/notification stuff must be very clear.

It might become an acquired taste :slight_smile: :smile:

@LuisVale, the GCS announcements certainly do help. I’ve asked MichaelO to add them to MP.
Just to be clear though, this tuning method is not for new users. It is not a replacement for autotune, and should not prevent us improving autotune (especially adding position hold for autotune). It is for situations which autotune cannot handle, such as very large frames, vehicles with short hover times and anything else where autotune just isn’t suitable.
For quadplanes it will be the only method of tuning, at least for now.