OpenTX - Application Note 24
Six Position Switch Installation and APM Application
Install a six position switch as S3 analogue input. Use it to set the mode of an APM autopilot. Use audio files to announce the switch positions.
When installed and connected to the spare analogue input S3, the six position switch provides six different anlogue values of 100, -60, -20, +20, +60 and +100. These values are then translated to PWM (Pulse Width Modulation) values of a channel that set the modes of an APM autopilot. This translation is done in the Mixer using a curve. When a new mode is selected, it is announced using special functions and audio files.
I bought my switch from here.
A description of installing the 6 position switch is here.
The six position switch is used to set the mode of an APM autopilot. This is done very simply on the Mixer screen by converting the six position switch values to the mode values using a curve CV1.
The wiring diagram is here. Receiver channel eight controls the mode.
The mixer line of channel eight is as follows.
A delay up of 0.3 seconds is used so that the switch can move across modes quickly without implementing the selected mode until the switch is in position for at least 0.3 second.
Curve CV1 creates a PWM signal for each desired flight mode that falls in the middle of each of the flight mode ranges. This table maps the S3 switch values to the flight mode values.
The Curve that maps the values of each switch position to the required % values is here.
Check the PWM values
Check the PWM values on the Taranis Servos screen. On the screen, use the - pushbutton to highlight CH6. Turn S3 to each of the 6 positions and confirm the channel value, displayed on the top line of the screen, is approximately the value shown in the PWM Value column in the table above.
Create these audio files and transfer them to the SD card folder SOUNDS / en.
These special functions play the audio files. For this example, SF5 through SF10 are used.
Check that the audio files work by switching S3 to positions one through six. Ensure the correct audio file is announced at each position. Switch quickly across several positions. Ensure that only the final mode announcement is made and not the intervening announcements.