An Open Source Frsky Telemetry Script for the Horus X10,X12 and Taranis X9D,X9E and QX7 radios

Cool. This is what I do in my own custom script. So this should work great! I’ll report back.

Great job.

If I have a MLVSS, can I output on the 2nd screen each cell voltage !? Got some older packs that need asessment now-and-then…

Cheers,
Para.

This actually is a very good idea, I’ll try it myself!
All you have to do is manually define the cell sensors

Hi @ThePara,
I tried with a 4s battery, your idea works great :slight_smile:

image

or using a bigger font for the “font size” attribute

image

this is the config file

----------------------------------------
-- custom sensors configuration file
----------------------------------------
local sensors = {
  -- Sensor 1
[1]=  {
    "Celm",   -- label
    "Celm",     -- OpenTX sensor name
    2,          -- precision: number of decimals 0,1,2
    "Vmin",         -- label for unit of measure
    1,          -- multiplier if < 1 than divides
    "-",        -- "+" track max values, "-" track min values with
    1,          -- font size 1=small, 2=big
    3.65,        -- warning level (nil is do not use feature)
    3.30,        -- critical level (nil is do not use feature)
  },

  -- Sensor 2
[2]=  {
    "Celd",   -- label
    "Celd",     -- OpenTX sensor name
    2,          -- precision: number of decimals 0,1,2
    "Vdelta",         -- label for unit of measure
    1,          -- multiplier if < 1 than divides
    "+",        -- "+" track max values, "-" track min values with
    1,          -- font size 1=small, 2=big
    0.2,        -- warning level (nil is do not use feature)
    0.4,        -- critical level (nil is do not use feature)
  },

  -- Sensor 3
[3]=  {
    "Cel1",   -- label
    "Cel1",     -- OpenTX sensor name
    2,          -- precision: number of decimals 0,1,2
    "V1",         -- label for unit of measure
    1,          -- multiplier if < 1 than divides
    "-",        -- "+" track max values, "-" track min values with
    1,          -- font size 1=small, 2=big
    3.65,        -- warning level (nil is do not use feature)
    3.30,        -- critical level (nil is do not use feature)
  },

  -- Sensor 4
[4]=  {
    "Cel2",   -- label
    "Cel2",     -- OpenTX sensor name
    2,          -- precision: number of decimals 0,1,2
    "V2",         -- label for unit of measure
    1,          -- multiplier if < 1 than divides
    "-",        -- "+" track max values, "-" track min values with
    1,          -- font size 1=small, 2=big
    3.65,        -- warning level (nil is do not use feature)
    3.30,        -- critical level (nil is do not use feature)
  },

  -- Sensor 5
[5]=  {
    "Cel3",   -- label
    "Cel3",     -- OpenTX sensor name
    2,          -- precision: number of decimals 0,1,2
    "V3",         -- label for unit of measure
    1,          -- multiplier if < 1 than divides
    "-",        -- "+" track max values, "-" track min values with
    1,          -- font size 1=small, 2=big
    3.65,        -- warning level (nil is do not use feature)
    3.30,        -- critical level (nil is do not use feature)
  },

  -- Sensor 6
[6]=  {
    "Cel4",   -- label
    "Cel4",     -- OpenTX sensor name
    2,          -- precision: number of decimals 0,1,2
    "V4",         -- label for unit of measure
    1,          -- multiplier if < 1 than divides
    "-",        -- "+" track max values, "-" track min values with
    1,          -- font size 1=small, 2=big
    3.65,        -- warning level (nil is do not use feature)
    3.30,        -- critical level (nil is do not use feature)
  },
}
------------------------------------------------------
-- the script can optionally look up values here
-- for each sensor and display the corresponding text instead
-- as an example to associate a lookup table to sensor 3 declare it like
--
--local lookups = {
-- [3] = {
--     [-10] = "ERR",
--     [0] = "OK",
--     [10] = "CRIT",
--   }
-- }
-- this would display the sensor value except when the value corresponds to one
-- of entered above
-- 
local lookups = {
}

collectgarbage()

return {
  sensors=sensors,lookups=lookups
}

I had to create these sensors after discovering the Cels one

Got the sensors showing values, modified the script for 6S and saved as 6S_batt.lua
Do I load it as 2nd telemetry screen ? And where do I need to modify script to show CURR instead of HDOP in top left corner, to be able to asess voltage sag per cell at a single glance ?

Cheers,
Para.

No, go the script menu screen, exit and look at the .cfg file the script creates in the /model folder
The sensor file needs to be placed in the same folder and named like the cfg file but with _sensors.lua

If your cfg file is modelname.cfg your sensor file should be modelname_sensors.lua

You can’t unless you change source code and recompile, btw current is 3rd line on the right 142Amps in the screenshots

@yaapu Well, Alex it looks like everything works. I have to figure out my FrSky sensors yet. But with the engine idling I get rpm reading. My engine temp and OAT sensors work (have been changed to F instead of C, but have to change the label yet).

Everything on the ArduPilot side appears to work fine, including the Dreaded Bad Logging :sunglasses:

100_0080

You will notice I have the improved fonts in my radio, which makes the display look a lot nicer.

BTW, is there a way to display four digits on the krpm? I’m gonna put a multiplier in there for headspeed instead of engine rpm and want it to display all four digits. I’m guessing there’s a multiplier in the script someplace (I haven’t looked at the code yet).

I don’t know what the 0.00V is on the top left yet.

I have a generator on this helicopter so it draws zero amps from the battery when the engine is running. So the amp-hours don’t mean much. What are the three values on the HUD? The left must the VSI, the right must be altitude AGL, which I changed to feet in the sensors. Is the bottom one Ground Speed? I usually select kts for that. And I’d like feet/min on the VSI, but all these things use m/s or (ArduPilot’s kinda dumb system) kts if you select to use kts in the GCS :unamused:

It got close to dark here so couldn’t actually fly this yet to try it out in the air.

I see you have everything working for 4s, does 6s work alright too? What about multiple instances of the M/FVLSS sensor for 12s?

Just throwing out ideas. I often have dual 6s batteries on-board my aircraft.

After getting everything configured it works fine on a ground test. I set the speed to knots and VSI to ft/min, etc. in the config menu. And manually edited the models config for the display I wanted, including even the governor status.

Pretty impressive, actually.

100_0081

1 Like

Hi Chris,
this is great news, really glad this solution fits your use cases!

I see you figured out pretty much everything, including the unit of measure menu settings.

Chris the font you have is slightly bigger and some of the alignments fail, where did you get it, I’d like to do some testing on my own?

Hi Nathan,
In the “custom 6 sensors grid”, well 6 is less than 12 and right now there would be no room for all 12 cells but
a 6s setup should display fine, I tried it in companion

As for 12s setup, the script should be able to detect it and display it on screen as avg cell + aggregate voltage( if autodetection fails you can still force cell count from the config menu), it has been tested with a power monitor, so with voltage monitoring from the FC.

I do not support FLVSS chained in series for 12s individual cell monitoring, the script would probably freak out and identify the setup as having dual parallel battery :slight_smile:
Did you try this setup with my script?

I fixed the alignment issues, now should be ok even with your larger font

It is in the compile options for OpenTx It is called sqt5font:

Screenshot%20from%202019-03-16%2010-22-22

Screenshot%20from%202019-03-16%2010-27-39

Very easy to set up, the integration of the FrSky sensors with the ArduPilot FrSky passthru is perfect.

ok, I’ll try it, I’m afraid that as an extra option it will eat some memory from the lua runtime, I’ll check it myself, thanks!

Thanks Chris, let me know how it feels in the field!

Alex

I’ll reply to myself, looks like the sq5font option does not touch the lua subsystem available memory. good.

I hover tested the script. But I get a constant warning about Reset ignored while armed (63x).

Can’t figure out where that’s coming from.

100_0083

The script uses timer 3 to expose flight time to OpenTx.
I also monitor timer 3 resets and ignore them while motors are armed.

Are you by any chance resetting timer 3 on your OpenTX setup?

Ah, yes. I use that for the runup timer. But that is no longer actually used in the code I’m flying after I wrote the ArduPilot internal governor and made a bunch of changes in the RSC.

Easy to fix. Thanks!

1 Like