A couple of how-to questions on programming

Post Reply
VtLadyFlyer
Posts: 6
Joined: Thu Mar 26, 2015 7:21 pm
Country: -

A couple of how-to questions on programming

Post by VtLadyFlyer »

Hi,
I've been having fun with a Taranis plus radio connected to a quadcopter with Naza V2 flight controller. I have an S-bus connected X8R receiver using all 16 channels and a couple of Smart Port telemetry devices (voltage and GPS) connected. I also have a turnigy receiver controlled switch to turn on/off led lighting.

Using the momentary switch, SH on the taranis plus:
I've been trying to figure out how to use custom functions to program the momentary switch to alternately turn on and turn off the receiver controlled switch. Is there any way to look at the prior state of the switch and when a transition event occurs, change the state to the opposite state? So I'd like to start with the lights off, then toggle SH to turn the lights off and then toggle SH again to turn the lights off..and repeat if desired. So far I've only figured out how to turn it on for some amount of time (25s max). I know I can use a regular switch for this, but am wondering if there is a method to use the momentary switch.


On the GPS:

I have the telemetry setup to callout information based on switch settings (cell/cells and speed/altitude on different switches). My first issue is that the taranis wants to see feet for Altitude because when I play value for altitude it plays units in feet when the frsky gps outputs altitude in meters. Is there any way for me to change this so I get the correct units? Secondly, I'd love to be able to call out altitude with reference to a starting elevation. In other words, I'd like to use my starting elevation and subtract it from the GPS altitude and play that value to give me an altitude above ground level instead of above sea level.

Can I set a variable based on the starting elevation and then subtract it from the GPS value and play that?

Thank you.
Terri

User avatar
Kilrah
Posts: 11109
Joined: Sat Feb 18, 2012 6:56 pm
Country: Switzerland

Re: A couple of how-to questions on programming

Post by Kilrah »

For the first question use a "Sticky" logical switch, with SHdown as both conditions. That will be your flip-flop, then select that LS in the mixer on the appropriate channel.

Units are chosen in the radio settings.

For relative altitude just do a "Reset Telemetry" once altitude data is present and stable. GPS alt is rather imprecise so it will easily wander +/-30m.
VtLadyFlyer
Posts: 6
Joined: Thu Mar 26, 2015 7:21 pm
Country: -

Re: A couple of how-to questions on programming

Post by VtLadyFlyer »

Kilrah wrote:For the first question use a "Sticky" logical switch, with SHdown as both conditions. That will be your flip-flop, then select that LS in the mixer on the appropriate channel.

Units are chosen in the radio settings.

For relative altitude just do a "Reset Telemetry" once altitude data is present and stable. GPS alt is rather imprecise so it will easily wander +/-30m.
Thank you Kilrah, Now that I understand what it does, I understand the name. I would have recognized it if it was called set-reset or flip flop. In any case, thank you much!

On the other, I understand where units are set but I believe I worded my question poorly.
Let me start with what I am assuming and/or some facts of my location:
1) That the frsky gps sensor is outputting altitude in meters on to the smart port and the taranis just reads and re-outputs that value (independent of units), but since imperial units are set, it's just calling out feet which is inconsistent with the GPS sensors output in meters.
2) My base location is at 155 meters of elevation above sea level, or approximately 510 feet.
3) I am using play value GPS Altitude in the custom function on the taranis and it's calling out my base elevation as 165 feet.
4) because the number being played, 165, is close to my actual altitude in meters (155), I have been assuming that difference is due to a units mismatch.

My question:
1) Does opentx do conversion of the gps altitude data based on the units chosen? If it is doing a conversion, it would imply my gps altitude is off 300% which seems a long way from +-30 meters.

2) So you're saying reset telemetry will zero out the altitude at my base, so new values will only be relative? Does this only effect altitude?


Thank you,
Terri


My impression is that the Frsky gps outputs altitude in meters, and my units on the taranis are set to imperial (feet, etc). I am at approximately 155 meters of base elevation, and my frsky is calling out 167 feet (I am assuming the difference is the GPS altitude variability). Am I wrong with my statements and the elevation is just incredibly far off, as 155 meters is approximately 520 ft.
User avatar
Kilrah
Posts: 11109
Joined: Sat Feb 18, 2012 6:56 pm
Country: Switzerland

Re: A couple of how-to questions on programming

Post by Kilrah »

The GPS puts out meters, but when the radio is configured in imperial it should convert to feet. Never personally tested though.

The altitudes (both GPS and baro if the vario sensor is present) auto-zero using the first value they receive from the sensor. With the GPS the first value is typically garbage as it will take some time to stabilize after first getting signal, which is why you want to do a reset once it's stable.

The system is quite rigid at the moment, which is why we're precisely in the process of completely reworking the telemetry system for OpenTX 2.1, there every received value will have separate unit, auto-zero, precision settings etc so you can have both sea level and relative altitude simultaneously from the same sensor if desired.
VtLadyFlyer
Posts: 6
Joined: Thu Mar 26, 2015 7:21 pm
Country: -

Re: A couple of how-to questions on programming

Post by VtLadyFlyer »

Thank you again Kilrah.
I think what you're telling me is that it doesn't matter if it's wrong today because you're updating the system for 2.1. Is there any estimate on when 2.1 is available? Based on my testing so far, it would seem there is no units conversion happening from meters to feet for the frsky gps sensor when read by the taranis plus s-port with the radio units set to imperial.

For what it's worth, when the data is viewed in google earth via the companion log file viewer, Google Earth does understand what it's seeing is in meters and converts it correctly to feet (which is why I believe there's something awry in the radio software.

If I could beg one last clarification: When you say the altitudes auto-zero with the first value they receive from the sensor I'm unclear on what this means. Are you saying the radio auto-zero's them based on the first value from the sensor and then everything after that is with respect to the zero'ed point. And I assume the auto-zero isn't really automatic, that his happens only after I reset telemetry? So the first value after I reset telemetry, is used as the base-line zero point and all future values are deviations from that first value after reset.

Thanks,
Terri

User avatar
Kilrah
Posts: 11109
Joined: Sat Feb 18, 2012 6:56 pm
Country: Switzerland

Re: A couple of how-to questions on programming

Post by Kilrah »

VtLadyFlyer wrote:Based on my testing so far, it would seem there is no units conversion happening from meters to feet for the frsky gps sensor when read by the taranis plus s-port with the radio units set to imperial.
OK, then that is a bug, and if you can confirm it I'll check.
VtLadyFlyer wrote: If I could beg one last clarification: When you say the altitudes auto-zero with the first value they receive from the sensor I'm unclear on what this means. Are you saying the radio auto-zero's them based on the first value from the sensor and then everything after that is with respect to the zero'ed point.
Exact.
VtLadyFlyer wrote:And I assume the auto-zero isn't really automatic, that his happens only after I reset telemetry?
No it is done automatically but as I said due to GPS (im)precision it can take minutes between the time the first value comes and the altitude actually being somewhat correct, so the reset is required because that first value that was automatically stored was likely completely off, sometimes by thousands of meters.
VtLadyFlyer
Posts: 6
Joined: Thu Mar 26, 2015 7:21 pm
Country: -

Re: A couple of how-to questions on programming

Post by VtLadyFlyer »

Kilrah, thank you again, you're a wealth of knowledge! Now I understand what's going on and also that my results might not be valid based on the automatic zero-ing with the first sensor value. I'll have to check it again with a stable telemetry reset!

Terri

Post Reply

Return to “openTx for FrSky radios”