-
-
Notifications
You must be signed in to change notification settings - Fork 361
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Range of Spektrum Telemetry Battery Capacity Sensor #1649
Comments
Looks like some 8bit signed integer overflow. However, the values are declared according to spec (see page 14 here). |
I'm hoping the something in the AR637T telemetry will bug out similarly, as I have one of those ;) Otherwise, it will not be fun one :( |
For reference: opentx/opentx#8896 (two lots of heads are better than one!) |
@frankiearzu Do you have any thoughts on this one? |
@pfeerick: Looking at the code, it is a 16bit integer. What is strange is that the rate of change when it is negative, is much faster (i would expect the same slope on the negative side if it was a negative overflow) with a constant discharge. Will take a look at the documentation i think there is something more than just data here. Usully computing battery capacity is not that straight forward.. is a combination if instant mhA consumption and bat chemistry, there are tables for that. With the Spektrum telemetry modifications i did, now we have the hability to capture+log any RAW spektrum telemetry data using a LUA script to a file, then inject packets of that data into the running code to debug/develop locally without the phisical sensor. (thats how im debuging/fixing sensors that i don't have). @elekSENDER: if we give you a script to capture the RAW data, would you be able to run it for us and send us the data??? |
Other ticket that i am helping debug is also related to battery capacity and clening up other sensor calculations: #3368 |
The specs from Spektrum to have them handy. typedef struct |
@frankiearzu: Dont worry to much about this, I flew different headspeeds on a heli at this log and this is far away from a constant power consumption. I think the slopes on the negative side are random there.
Sure, i can try this, maybe i need some support howto use the script. |
Did a small change to the processing of the 0x34 data (Dual Flight Pack monitor). Really could not find any major problem, except that the the value should not have 1 decimal place. Make sure you delete preivous sensors, and discover new. In 2,9, the sensor is "RB1C" (RX Batt 1 Consumption), RB1A Amps, RB1T Temp. The fixes here (Other Fixes for ESC values, BEC values, etc): Compiled firmware for TX16S: (NOT FOR FLYING.. JUST TESTING) |
Unfortunately there is no change with the capacity issue and I discovered some more. I did some testing with following components:
This Energy Sensor provides to telemetry: RB1A, RB1C, RB1T For displaying reasonable values you have to set in the RADIO the ratio value in sensor settings : Following issues: screenshot with modified ratio: The "raw" value data range with ratio 0: I hope you can use this information for finding the issues. |
Something that is interesting using the "raw" values... according to the documentation, there should not have any negative values, only 0 to 32766 that uses only the lower 15bits. Documentation: For battery A, is with one decimal place, raw 32766 is displayed as 3276.6 I am wondering if the problem is in writing the LOG or in Comapanion, and not in the radio telemetry data. Is the logger and companion respecting the decimal places?? For the other issue (#2665).. I did fix the ESC VBEC since it actually needed to be multiplied by 5 to get a decent value. |
I do not think the issue is in the logging or companion, because i can see exactly these values in the live display of the transmitter. Both values: modified by ratio and unmodified (ratio=0).
Firstyful i thought this an issue in firmware of the MPM, but pascallanger rejected the issue: So i don´t know really, but if the data from the MPM is just provided to the EdgeTX so there must be anything wrong in the data processing? |
Guys, Just checking what else do i need to replicate your setup: I bought the Flight Pack Battery Energy Sensor SPMA9605. With that setup, i can get the current and chargeUsed. Im really curious why do we get that negative numbers. Hopefully will solved the problem soon! Frankie |
Hi Frankie,
yes, directly to X-BUS.
yes, exactly this one. Just for information: I wanted to be sure there are no issues with these sensors and tried the same equipment as described above with a Spektrum DX9. Results in display: no negative numbers, current up to 23A, capacity above 300mAh, temperature up to 75° Celsius. |
Finally was able to test with the real sensor. The Spektrum documentation is wrong.
Looks like the Eagle-Tree manufactured sensors really uses little-endian. I should have tried to change the little-endian before, but did not ocured to me since the documentation said big-endian. Give it a try now without using any ratio.. should work right away. Will work on finding proper names for the sensors, the ones currently used are really for the Receiver batteries, not the Flight pack batteries.. so if someone has the two sensors, it will duplicate. What i propose for naming is: |
Fix the Flight Pack sensor processing. The main problem was that we expected the data to come in big-endian encoding, but in reality, the sensor send it in little-endian. This was causing the 1st byte to change much faster, and eventually move into the negative value. Added more validations to handle little-endian values, and recognize NO-DATA scenarios
Describe the bug
I use Spektrum telemetry via a Spektrum TM1000 on a Radiomaster TX16s and on a Horus X10s with an irange4in1 multimodule.
The issue is with the battery capacity counting: it starts with 0 up to 127, the next value after 127 is -128 and it counts negative up to 0.
This repeats, i can see only values from -128 to 127 in the Radios, so its useless for a mAh-capacity warning. The log of this sensor looks like a sawtooth.
The Sensor ID is 3402, "mAh", ratio: 1.0
By the way, the same issue occurs with OTX 2.3.14 on both radios
On my request at MULTI-Module pascallanger told me:
"Multi is sending the telemetry data tax to the radio firmware to be decided there. So opentx, edgetx and erskytx are doing the decoding. Therefore if there's an issue on the values, that's where you need to open an issue. Pascal"
To Reproduce
easiest way: use a Capacity Sensor SPMA9605 on Spektrum telemetry.
Expected behavior
capacity value counting upwards continuously
Screenshots
![grafik](https://user-images.githubusercontent.com/98912034/156332086-e6999aac-44af-462c-b6f1-285546b87882.png)
General information
EdgeTX version: 2.6.0: tx16s-338d4d2, x10-338d4d2
Hardware: Radiomaster TX16s, Frsky Horus X10s + irange4in1
Radiomaster intern MPM: 1.3.3.7
Irange4in1: 1.3.3.7
The text was updated successfully, but these errors were encountered: