FrskyTelemetryScript icon indicating copy to clipboard operation
FrskyTelemetryScript copied to clipboard

Horus 1.9.5: battery % by voltage issue

Open i3dm opened this issue 3 years ago • 18 comments

Horus V1.9.5: using PX4 and one power module on Power 2 of PX4. Yaapu config: dual battery config - dual with alert on B2 (didnt find any other way to work with B2 only) enable battery % by voltage: YES default voltage source: fc Battey 2 count override: 3 cells

expected behaviour: battery % changes according to pack voltage displayed. actual behaviour: battery shows 99% regardless of voltage (12.6V down to 10.0V)

i3dm avatar Feb 22 '22 21:02 i3dm

Hi, please excuse the very late reply. The battery % by voltage requires an extra lua file where you specify the discharge curve. The script looks for a file named modelname_batt.lua in the cfg directory (same place as the script config file)

the content is:


local voltageDrop = 0.6

local useCellVoltage = false;

local dischargeCurve = { 
  {3.48*12, 0}, 
  {3.51*12, 10}, 
  {3.58*12, 20}, 
  {3.66*12, 30}, 
  {3.76*12, 40},
  {3.81*21, 50},
  {3.88*12, 60},
  {3.93*12, 70},
  {4.03*12, 80},
  {4.08*12, 90},
  {4.20*12, 99},
  }

return {voltageDrop=voltageDrop,useCellVoltage=useCellVoltage,dischargeCurve=dischargeCurve}


The script uses an 11 points discharge curve mapped into the array voltageDrop acounts for under load voltage sags, adjust per your needs useCellVoltage specifies if the 11 values you enter in the array refer to cell voltage or battery voltage

yaapu avatar Mar 13 '22 09:03 yaapu

Hi, please excuse the very late reply. The battery % by voltage requires an extra lua file where you specify the discharge curve. The script looks for a file named modelname_batt.lua in the cfg directory (same place as the script config file)

the content is:

local voltageDrop = 0.6

local useCellVoltage = false;

local dischargeCurve = { 
  {3.48*12, 0}, 
  {3.51*12, 10}, 
  {3.58*12, 20}, 
  {3.66*12, 30}, 
  {3.76*12, 40},
  {3.81*21, 50},
  {3.88*12, 60},
  {3.93*12, 70},
  {4.03*12, 80},
  {4.08*12, 90},
  {4.20*12, 99},
  }

return {voltageDrop=voltageDrop,useCellVoltage=useCellVoltage,dischargeCurve=dischargeCurve}

The script uses an 11 points discharge curve mapped into the array voltageDrop acounts for under load voltage sags, adjust per your needs useCellVoltage specifies if the 11 values you enter in the array refer to cell voltage or battery voltage

thank you. why are you not including this file by default?

i3dm avatar Mar 13 '22 10:03 i3dm

good question, I guess I forgot to include it, but will asap

yaapu avatar Mar 13 '22 10:03 yaapu

i added the attached lua (zipped here) file in the CFG folder. configured bat % by voltage to YES voltage of both the pack and the lowest cell is quite low.yet still showing constant 99% any ideas? modelname_batt.zip 20220315_204131 20220315_204153

i3dm avatar Mar 15 '22 18:03 i3dm

hi, did you rename the file based on your actual model name just like the .cfg file?

yaapu avatar Mar 16 '22 07:03 yaapu

hi, did you rename the file based on your actual model name just like the .cfg file?

i forgot, thank you. will test it soon and report.

i3dm avatar Mar 16 '22 08:03 i3dm

Renamed the file, and now it shows a constant 00%. here is the final renamed lua file: s550_batt.zip

and a photo of CFG folder: image

and the widget settings and result: 20220316_132635 20220316_132620

any ideas?

i3dm avatar Mar 16 '22 11:03 i3dm

Your lua file is fine, seems like you spotted a bug in the 1.9.5 version, I tested in my dev branch and it works, here's the latest dev version for you to check SD.ZIP

yaapu avatar Mar 16 '22 11:03 yaapu

Your lua file is fine, seems like you spotted a bug in the 1.9.5 version, I tested in my dev branch and it works, here's the latest dev version for you to check SD.ZIP

may i bother you to know which files do i need to replace to install the new version without messing up my existing configuration? will just the WIDGET folder be enough?

i3dm avatar Mar 16 '22 12:03 i3dm

everything but the CFG,

yaapu avatar Mar 16 '22 13:03 yaapu

everything but the CFG,

over written all files (but the CFG) and still im getting 00%

i3dm avatar Mar 16 '22 13:03 i3dm

everything but the CFG,

over written all files (but the CFG) and still im getting 00%

any ideas?

i3dm avatar Mar 19 '22 12:03 i3dm

everything but the CFG,

Dear Yaapu. any other ideas why its not working? can you share your working configuration?

i3dm avatar Mar 24 '22 05:03 i3dm

Hello, I am having a similar issue in 1.9.6dev where the percentage displayed does not align with what I have in the cfg file for my model (using the lookup table you attached here). Per cell voltage is 4.11v but I am getting a 65% reading.

JEFlatt53 avatar Mar 28 '22 23:03 JEFlatt53

Hello, I am having a similar issue in 1.9.6dev where the percentage displayed does not align with what I have in the cfg file for my model (using the lookup table you attached here). Per cell voltage is 4.11v but I am getting a 65% reading.

It seems my issue was the voltage drop parameter. I think you can disregard this.

JEFlatt53 avatar Mar 28 '22 23:03 JEFlatt53

@yaapu can you please advise about my issue?

i3dm avatar Apr 13 '22 21:04 i3dm

Is there a possibility to enable that on Ethos too? Since there is no CFG folder i?

Nerenye avatar May 13 '22 13:05 Nerenye