First to credits - Max Levine has firstly shown this method here, using 'off the shelf' resistor values, which might work, but keep on reading to find out why exact values are important.
i came out with a small rotary switch, that fits EXACTLY the space in Turnigy 9X.
it is intended for replacing the PIT TRIM knob. top left of your radio.
i calculated and found out the exact values that will give nearest PWM values to these needed by the APM to stay reliable in the middle of the position range, which means no accidental mode switching.
HOW TO GET IT ?
You can get it now - with low cost WORLDWIDE SHIPPING
please check out the 6 position mode switch for ardupilot on ebay
No more mixing and setting for 2\3 way switches of your radio !!!
No more hard-to-remember switch combinations !!
Some theory and explanation:
there are 6 slots for 6 positions.
the PWM value is detected and according to it - the position(and flight modes) are set.
these are the position SWITCHING POINT values: 1230, 1360, 1490, 1620, 1760
which means, we have to target the MIDDLE of the switching points to stay on a certain mode, with the safest margin from the switching point value.
except for the first and last positions (0&5) where we can be even safer, choosing the very first and very last value of range.
you end getting this as IDEAL pwm values for modes:
1085 (or lowest your radio will allow)
1295
1425
1555
1690
1920 (or highest your radio will allow)
Now the catch
mathematically it's easy to calculate the needed resistors, because these are steady steps, and could use the same value resistors.
BUT IN PRACTICE my testing have shown that the resistance scale is not totally linear with the pwm values.
the reason is quite simple - the radio seem to use some resistor on the incoming +5v rail to the voltage divider (the pot trim) - to limit the current going to the ADC reading chip when the pot is set to full 5v side.
thus the center of the pot (or other resistor) won't give the center of the ADC reading needed.
at least that is what i found with the Turnigy 9x which is very popular. i believe other radios are behaving similar.
This is the reason that probably different radio gear will need different resistors values,
and for the same reason I RECOMMEND THE PRODUCT FOR THE TURNIGY 9X RADIO which is the one i used to find the values. I found the best values to use are (from the GND side to 5v side) 3k9,1k3,1k3,1k3,2k2. all 1% tolerance. can't guarantee it will work at exact values with other gear.
What I've done:
since reliability can't be achieved using 'pre-calculated' values resistors,
i have done careful testings for the exact resistor values that gave the nearest possible to the ideal PWM values above.
Why get it ready made ?
- the price is really similar to ordering the parts individually with shipping costs
- I use high precision 1% resistors which are harder to find - which lead to better accuracy on the values.
- I use a switch that FITS the radio for sure. no guessing...
- it's easier, faster, and doesn't require lot of work to install.
- all switches are tested to be working and for correct PWM values
Oops!
Oops, you forgot something.