I’ve recently been thinking about how to improve transmitter based tuning for both copter and quadplane. The quadplane code now supports similar transmitter tuning to copter, which uses TUNE_CHAN, TUNE_PARM, TUNE_LOW and TUNE_HIGH to control tuning of a single parameter.
It works, but it really is quite tedious and is also quite error prone. If when changing parameters you get the range wrong it can be disastrous.
What I’d like to do is have a much faster and less error prone transmitter tuning interface that allows a pilot to tune multiple parameters in one flight.
What I have come up with so far is a method that relies on the user using two switches on their transmitter. One switch would need to be a 3 position switch, and the other a 2 position switch. The ideal setup would be for the 2 position switch to be spring loaded (like a typical trainer switch).
The parameters to control tuning would be:
- TUNE_CHAN1: the 3 position switch channel
- TUNE_CHAN2: the 2 position switch channel
- TUNE_PARMSET: the set of parameters to be tuned
- TUNE_CHANGE: the rate at which the parameter changes (default 1.1 for 10% changes)
The TUNE_PARMSET chooses a set of parameters to tune. While tuning the user can cycle between the individual parameters within the set. TUNE_PARMSET would be an enum, with typical parameter sets for “roll and pitch rate tuning” which would be 4 parameters (RATE_RLL_D, RATE_RLL_PI, RATE_PIT_D, RATE_PIT_PI).
When the TUNE_CHAN1 switch is in the middle position then briefly raising TUNE_CHAN2 would cycle to the next parameter to be tuned in the param set. So if you are currently tuning RATE_RLL_D and you cycle to the next one then you’ll start tuning RATE_RLL_PI. Using a spring loaded switch for TUNE_CHAN2 would make this particularly easy. If you cycle past the end of the list then it goes back to the beginning of the list.
When TUNE_CHAN1 is in the lower position you would be lowering the current tuning parameter. Pulling on TUNE_CHAN2 in that case would lower the current parameter by a factor of TUNE_CHANGE (10% by default).
When TUNE_CHAN1 is in the upper position you would be raising the current tuning parameter. Pulling on TUNE_CHAN2 in that case would raise the current parameter by a factor of TUNE_CHANGE (10% by default).
A “long pull” on TUNE_CHAN2 (defined as more than 3 seconds) would save the current parameter value. That gives a way to save without mucking about in the GCS.
So the process for tuning a multicopter or quadplane would be:
- set the parameter set to what you want to tune (eg. roll and pitch gains)
- takeoff with TUNE_CHAN1 in the middle position
- switch TUNE_CHAN1 to the upper position
- pull on TUNE_CHAN2 a few times. Each pull will raise that parameter by 10%
- when the vehicle starts to oscillate then switch TUNE_CHAN1 to the lower position and do 4 quick pulls on TUNE_CHAN2 to lower the gain by around 50%
- if you are happy with the new value for that parameter then save by pulling on TUNE_CHAN2 for 3 seconds
- switch TUNE_CHAN1 to the middle position and pull on TUNE_CHAN2 to change to the next parameter in the set
- continuing tuning with the next parameter
I envisage implementing this as an AP_Tuning library with callbacks for setting the parameters, and a static const table of parameter sets passed into the constructor.
Comments welcome!