Heading RCADev

 

HOME

PHANTOM UAV

VACUUM FORMING

OpenTX

CONTACT ME

 

Previous Page – App Note 27

Next Page – App Note 29

OpenTX - Application Note 28

airfield Boundary Warnings Using a GPS

Use a FrSky GPS sensor to create warnings when an aircraft is close to or breaching an airfield boundary. An announcement is also used to advise when the aircraft is clear of trees for landing.

 

This is the VARMS gliding club airfield in Melbourne, Australia. The ‘X’ indicates the location of the flight box where pilots stand.

 

Five announcements are required as follows.

 

1. Line 1 is on the north boundary. Flying north of this line is prohibited. A boundary breach  announcement is required when the aircraft is north of this line and east of line 5.

 

2. Line 2 is 20m south of the north boundary. A warning announcement is required when the aircraft is north of this line and east of line 5.

 

3. South of line 3 there is a line of trees and when approaching the airstrip from the south it is required to know when the aircraft has cleared the trees so it can descend to land. An announcement is required when the aircraft is south of line 3.

 

4. An announcement is required when the aircraft is north of line 3.

 

5. Line 4 is the east boundary. A warning  announcement is required when the aircraft is east of line 4

 

Line 1 has latitude of -37.8797342.

Line 2 has latitude of -37.8799208.

Line 3 has latitude of -37.8825158.

Line 4 has longitude of 145.209315.

Line 5 has longitude of 145.207248.

These values were found by carrying the aircraft fitted with a GPS module to each location and reading the Taranis telemetry display GPS coordinates and converting them to decimal degrees. Latitudes south of the equator are negative in the Taranis.

 

 

The following components are required to create the announcements.

1. FrSky GPS module. Refer to Application Note 8 for more details.

2. Install OpenTX version with LUA scripts enabled.

3. A Lua script to create variables that describe the aircrafts position relative to the boundaries..

4. Some logical switches to create triggers at the boundaries..

5. Some special functions that play audio files when the triggers become active.

6. Some audio files that describe each boundary event.

7. Use switch SE to enable and disable the audio files.

8. Some more audio files that describe when the boundary announcements are enabled and disabled.

Install OpenTX Version with LUA Enabled

To use LUA scripts, a version of OpenTX with the lua option selected must be transferred to the Taranis radio.

Download OpenTX with LUA Enabled

To do this, first open Companion, select ‘Settings’ and tick the ‘lua’ box, as shown here and then close this window.

 

 

Now click on the ‘Download’ icon to display the ‘Downloads’ window.

Note that the firmware name includes ‘lua’.

 

Click ‘Download FW’. Select a folder to store it and click ‘Save’

Install Downloaded Firmware in the Taranis

To transfer the new version of firmware to the Taranis, first turn on the Taranis in BootLoader mode. Connect the USB cable from the Taranis to the PC. In Companion, select ‘Read/Write’ then ‘Write Firmware To Radio’. Choose the saved file then click ‘Write to TX’.

The progress is shown with a bar graph. This only takes a couple of seconds. When finished, the Taranis is ready for the next step.

Lua Script to Detect Boundary Events

The lua program is called ‘varmsbdr.lua’. This is a model lua script, created using Microsoft Notepad and transferred to the Taranis SD card folder SCRIPTS/MIXES. To activate this program on the Taranis, first select the model that has the GPS module fitted, and display the Custom Scripts screen. Select LUA1, for this example, and press ENTER. The LUA1 screen is displayed. To select the required file, press ENTER to display a list of lua files. Select ‘varmsbdr’ and press ENTER. The LUA1 screen then displays the script name, the Inputs list on the left and the Outputs list on the right. There are no inputs to this program so the Inputs list is blank. The Ouptuts list shows the variable names that will be used to trigger the audio announcements. The lua program continuously reads the longitude and latitude data in the Taranis radio that is received from the GPS module in the aircraft and sets the value of these variables vbn1, vbn2, vbn3 and vbn4.

 

The variables can have the following values.

 

Value

Description

-100

GPS not locked on to satellites

0

Not active

100

Active

 

Download a copy of the lua file ‘varmsbdr.luahere.

For more information about Lua scripts on OpenTX, see

    http://open-txu.org/home/grad-school/lua/beginning-model-scripting/

Logical Switches to Trigger Boundary Events

On the Taranis Logical Switches screen, the following logical switches are required. Note that the switches are only enabled by switch SE in the middle or down positions, not up.

 

Logical Switch

Function

V1

V2

AND Switch

Duration

Delay

LS1

a>x

vbn1

0

!SE↑

---

---

LS2

a>x

vbn2

0

!SE↑

---

---

LS3

a>x

vbn3

0

!SE↑

---

---

LS4

a>x

vbn4

0

!SE↑

---

---

Special Functions to Play Audio Files

The audio files required for each boundary event are as follows.

 

Message

File Name

“North boundary breach.”

vbdry1.wav

“North boundary warning.”

vbdry2.wav

“South of south boundary”

vbdry7.wav

“North of south boundary.”

vbdry3.wav

“East boundary warning”

vbdry4.wav

 

(vbdry7 is out of order because this was a very useful afterthought.)

The audio files required to describe when boundary announcements are enabled and disabled are as follows.

 

Message

File Name

“Boundary alarms disabled.”

vbdry5.wav

“Boundary alarms enabled.”

vbdry6.wav

 

To create audio files, refer to Application Note 4.

 

On the Taranis Special Functions screen, the following special functions are required to play the audio files.

 

Function Number

Source

Function

Parameter 1

Parameter 2

Check Box

SF1

L1

Play Track

vbdry1

1x

SF2

L2

Play Track

vbdry2

 

1x

SF3

!L3

Play Track

vbdry7

 

1x

SF4

L3

Play Track

vbdry3

 

1x

SF5

L4

Play Track

vbdry4

 

1x

SF6

SE

Play Track

vbdry5

 

1x

SF7

!SE

Play Track

vbdry6

 

1x

Check That It Works

At the airfield, turn on the transmitter and the aircraft.

On the Taranis, display the ‘varmsbdrlua script screen. While waiting for the GPS to lock, vbn1, vbn2, vbn3 and vbn4 have values of -100.

When the GPS has locked, carry the aircraft and the transmitter to each of the boundaries and check the following.

 vbn1 = 0 when south of line 1 and 100 when north of line 1.

 vbn2 = 0 when south of line 2 and 100 when north of line 2.

 vbn3 = 0 when south of line 3 and 100 when north of line 3.

 vbn4 = 0 when west of line 4 and 100 when east of line 4.

With switch SE in the middle position, check that the correct message is announced when each boundary is crossed.

With switch SE in the up position, check that the messages are disabled when each boundary is crossed.

Now it is ready to fly!

Application note

The standard FrSky GPS sends position coordinates to the Taranis at a relatively slow rate. This means that there is a significant delay of several seconds between the time the aircraft crosses a boundary and when the Taranis announces it. For fast moving aircraft, this translates to big distances over the boundaries. The GPS module can be modified to update faster.

GPS Modification – Update 10 Times a Second

The FrSky GPS module software can be modified to update ten times per second. This makes this boundary alarm application work much much better. The boundary crossing messages happen almost immediately after crossing a boundary. This GPS software modification is well worth the effort. Details are here.

http://dsbeach.github.io/FrSkyGPS_10Hz_firmware/

 

Thanks to Danny who found this site and updated my GPS for me.

 

Phantom Divide

 

Previous Page – App Note 27

Next Page – App Note 29

 

Footer RCADev