Heading RCADev

 

HOME

PHANTOM UAV

VACUUM FORMING

OpenTX

CONTACT ME

 

 

Previous Page – App Note 23

Next Page – App Note 25

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.

Purchasing the Switch

I bought my switch from here.

http://www.helibatics.com/frsky-6-position-encoder-mode-flap-switch/

Installation

A description of installing the 6 position switch is here.

https://www.youtube.com/watch?v=Ts0EzeJsoNc

 

 

 

 

After installation and calibration, the switch positions have these values and numbers.

(It would have been nicer if the order was reversed but that is the way it is!)

Set Up the Six Position Switch As An APM Mode Switch

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.

 

Channel Number

 

Weight

 

Source

 

Curve

 

Trim

 

Switch

Delay /

Slow

Mix Name

CH8

100

S3

CV1

 

---

0.3 (Delay Up)

AutoMod

 

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.

 

 

 

 

 

 

These are the required APM flight mode numbers and names.

 

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.

 

S3 Switch

Value

APM Flight

Mode Number

Mode

Name

PWM Mode

Range (uS)

PWM Value

Channel

%

-100

1

RTL

0 – 1230

1178

-63

-60

2

Auto

1231 - 1360

1306

-38

-20

3

Loiter

1367 – 1490

1434

-13

+20

4

FBWA

1491 – 1620

1566

+13

+60

5

Training

1621 – 1749

1695

+38

+100

6

Manual

1750 +

1822

+63

 

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.

 

Audio Files

Create these audio files and transfer them to the SD card folder SOUNDS / en.

 

APM Mode No.

APM

Mode

 

Description

Audio File

Name

 

Audio Message

1

RTL

Return to launching place

modrtl.wav

Return to launch mode

2

Auto

Execute list commands

modauto

Auto mode

3

Loiter

Circle while holding altitude

modloitr.wav

Loiter mode

4

FBWA

Sticks centred = level flight

modfbwa.wav

Fly by wire mode

5

Training

Not stabilized, roll and pitch

limited

modtrain.wav

Training mode

6

Manual

No flight assistance

modman.wav

Manual mode

 

These special functions play the audio files. For this example, SF5 through SF10 are used.

 

Function Number

Source

Function

Parameter 1

Parameter 2

Check Box

SF5

S31

Play Track

modrtl

 

1x

SF6

S32

Play Track

modauto

 

1x

SF7

S33

Play Track

modloitr

 

1x

SF8

S34

Play Track

modfbwa

 

1x

SF9

S35

Play Track

modtrain

 

1x

SF10

S36

Play Track

modman

 

1x

 

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.

 

Phantom Divide

 

Previous Page – App Note 23

Next Page – App Note 25

 

Footer RCADev