New Products Flash Sale
Fig Newton's blog View Details
Posted by Fig Newton | Nov 17, 2015 @ 10:58 PM | 1,047 Views
Building on my GPS heading Lua script for OpenTX, I upgraded to version 2.1.x. With the new telemetry settings in place I had to rewrite the bit of the script that gets the sensor values. Since I was in there the conversation came up in the glider forum about calculating LD. For those like me who couldn't remember what it was, it's the glide ratio. Distance/Drop. I realized that this was something that I was mostly gathering up with the gps heading portion of the script. Add in the ability to pull the altitude from a vario sensor and away I went. Here is the new script. I am officially calling it a beta test at this point as I have flown with it, examined the logs and am still trying to decide how to set up the script for best performance. I have put in a couple of variables that you can use to tune the script for your particular application. I will list them below and describe their function. I have added in some goodies like full logging which you can toggle on and off.

As the previous version of the script this goes on your sd card in the /SCRIPTS/MIXES folder. You will then need to go into each model you want to set this script up for and load it on the Custom Scripts page in the radio. Don't forget to read the settings from the Radio to store them in CompanionTX. You can also run the script in the emulator under Companion if you want.

SamplDelay - Since the script runs continuously and is called in a particularly quick manner ( maybe 60 times per second,...Continue Reading
Posted by Fig Newton | Oct 23, 2015 @ 05:14 PM | 1,710 Views
Important Note from Wayne at Aloft Hobbies (See post 26. I will update as we hear more.):
"There is some sort of issue with the Linker and Sbus right now. We are working with the OpenTX team to attempt to resolve the issue ASAP. Our ground testing never showed any issues, but flight testing it giving different results. For now we suggest using the D4R-II with the Linker.
-Wayne "

I would like to point out that if you are using a trainer cable like I am there is no issue with trainer mode. - Fig Newton.

Here is my setup for the Trainer Quick Takeback mode(OpenTX 2.1.3 compatible):


CH15 (Optional)
TR1 Weight(+100%)

CH 16
Ele Weight(+100%) NoTrim
+= TR3 Weight(-100%) NoTrim
+= Ail Weight(+100%) NoTrim
+= TR2 Weight(-100%) NoTrim

Logical Switches

L1 Edge(SH↓, [0:0])
L2 |CH16| > 20
L3 ( GV1 ~ 20 ) AND !L4
L4 ( TR1 ~ 0 ) AND !L3

Special Functions

SF1 L1 - Adjust GV1(Value 20)
SF2 L2 - Adjust GV1(Value 0)
SF3 L3 - Trainer(0)
SF4 L3 - Play Track(trainon)
SF5 !L3 - Play Track(trainoff )
SF6 L4 - Adjust GV1(Value 0)

GV1 is used to set Trainer mode. If it's set to 0, then trainer mode is off. If it's set to 20 then trainer mode is on.

L1 - SH↓l sets GV1 to 20 using SF1. This then triggers the logical switch L3 to true. That in turn triggers SF3 to turn on trainer mode, and SF4 to announce trainer mode is on. At that point any input from the student radio aileron or elevator input is mixed in to channel 16, and...Continue Reading
Posted by Fig Newton | Oct 20, 2015 @ 11:09 PM | 1,599 Views
First off I want to make sure everyone keeps their expectations low for this script. This is going to be the Yugo(tm) of DLG setups and Lua scripts. Also of note, this is not necessarily a package deal, the script can be run without the model I set up, and you can run the model without the script. I am just putting them together here as a package deal. I have purchased a UMX Whipit DLG. I am using a Taranis transmitter and an OrangeRX Spektrum module so it was simple enough to bind to this model and have my Whipit in the air in about 2 mins. Keep in mind I am not an experienced DLG flyer/user/owner so at first I was just tossing it in the air and trying to keep it from hitting the ground.

As time went on I set up a little extra down elevator and right rudder for my launches. I decided to use the throttle as my trigger for launching. I set up a curve that is at -100 (throttle full down) until you raise the throttle to about -35 and then it goes full throttle the rest of the throw. This was merely so that I could set up a switch that says when the throttle is at 100 start the timer. When the plane is thrown the throttle stays up and as it reaches peak altitude you drop the throttle back to the bottom and the extra input is removed. You then fly the plane and as the flight ends, flip SH↓ as I will explain further. It's as simple as that. Wash, rinse, repeat.

I used timer1 as a counter for how long the battery has been plugged in. I switch SA↑ to turn on...Continue Reading
Posted by Fig Newton | Jun 07, 2014 @ 01:27 AM | 6,791 Views
Version 1.3 - Fixed issue in averaging calculation.
Version 1.4 - Added in array to allow you to select multiple locations that get averaged. Fixed averaging again. See my notes in the replies below.
Version 1.5 - OpenTX 2.0.7+. Somewhere between 2.0.5 and 2.0.7 the constant name for pilot latitude and longitude changed. This version fixes the script to use the new values and not throw an error. I will leave v1.4 up since if you are running an older firmware you will have to use that version.

This Lua script will calculate the GPS heading your plane is flying and give the following outputs:

PHDG - GPS Heading.
Hout - Bearing of the plane from the pilot (start) location. If you fly due north, this should say 0.
Hbak - Bearing for the plane to return to the pilot (start) location. This would be the heading you want to fly if you needed to get ome.
Lon - Latest Longitude reading (rounded for display).
Lat - Latest Latitude reading (rounded for display).
Timr - The sample timer. Every time this timer cycles the location is read.

Keep in mind this is still in development. I was able to do some rather crude tests using hardcoded variables, and also by running up and down my driveway with a radian glider in the middle of the night. So far so good. Another variable here is how well the GPS locks in. I noticed just sitting still the heading was wandering but I believe that's due to some gps drifting.

I set the sample time to an input variable so that you can go...Continue Reading
Posted by Fig Newton | Jun 05, 2014 @ 02:51 PM | 3,899 Views

Written by Fig Newton.

I was working on the trainer settings the other day and had an idea for a game using the lua scripts. Depending on who uses this and how, it could also (potentially) be used to help build skills. The concept here is that you link up a trainer radio and put a plane in the air. The person with the master radio flies the plane. The trainee tries to mimic the controls that the master is using to fly the plane. If the trainee moves the stick too far, it's out of bounds and a sound can be played on the master radio. Depending on the way you set it up, you can have different beeps for Aileron out of bounds, Elevator out of bounds, or both out of bounds at the same time. You could also place the activation of the sounds on a switch so that it isn't beeping when you don't have a trainee attached or say they fall asleep on you from excitement.

At no point does any of the input affect real flight of the plane, and nothing is touched as far as trainer mode, etc. This should be completely safe and harmless. Not sure how much fun this will turn out to be, but I bet there could be some competitions involving a beer (purchased after flying) wagered here and there.

Here are the settings for Inputs:
Aileron: Set this to your Aileron input source.
Trainr Ail: Set this to TRx for aileron input. On my radio TR2 was aileron input from the trainer radio.
Elevator: Set this to your Elevator input source.
Trainr Elevator: Set this to your TRx for elevator input....Continue Reading
Posted by Fig Newton | Jun 02, 2014 @ 12:09 AM | 2,663 Views
Here is my setup for this (firmware v2940 compatible):

CH 16
(+100%) Ele No Trim No DR/Expo
(-100%) PPM3 No Trim
(+100%) Ail No Trim No DR/Expo
(-100%) PPM2 No Trim

Custom Switches
CS1 |a|>x CH16 20
CS2 a~x GV1 20 And !CS3
CS3 a~x PPM1 0 And !CS2

Custom Functions
CF1 SH↓l Adjust GV1 Value 20 ON
CF2 CS1 Adjust GV1 Value 0 ON
CF3 CS2 Trainer 0 ON
CF4 CS2 Play Track trainon 0 ---
CF5 !CS2 Play Track trainoff 0 ---
CF6 CS3 Adjust GV1 Value 0 ON

So GV1 is used to set Trainer mode. If it's set to 0, then trainer mode is off. If it's set to 20 then trainer mode is on.

CF 1 - SH↓l sets GV1 to 20. This then triggers the custom switch CST to true. That in turn triggers CF3 to turn on trainer mode, and CF4 to announce trainer mode is on. At that point any input from the student radio aileron or elevator input is mixed in to channel 16, and then subtracted back out using the -100% corresponding PPM value. This channel should stay at 0 until either the aileron or elevator are pushed on the Taranis. At that point (stick is moved on the trainer radio) the elevator and/or aileron value is added or subtracted from CH16, but since there will not be a corresponding PPM value it will move CH16 up or down.

Custom switch CS1 will then be triggered when the value goes over or below by 20. I used a value of 20 here because the lower the number the more sensitive the trigger is. I didn't want it too sensitive. At this point when CS1 is...Continue Reading