mstrens / oXs_on_RP2040

version of openXsensor to be used on raspberry pi pico RP2040 (more protocols, more functionalities)
84 stars 22 forks source link

OXS with ESC #116

Closed Klippeneck closed 9 months ago

Klippeneck commented 9 months ago

Hello Mstrens, Firstly, many thanks for your great work. I have already set up 3 sensors with Vario and GPS, they all work perfectly. Now I am trying to integrate a Hobbywing Fly Fun V5 ESC into a vario. Unfortunately I can't get any telemetry data from the ESC on the transmitter. The sensor only registers with vario and altitude. Is the attached configuration correct? I use Jeti. Version = 2.9.18 Function GPIO Change entering XXX=yyy (yyy=255 to disable) Primary channels input = 5 (PRI = 5, 9, 21, 25) Secondary channels input = 255 (SEC = 1, 13, 17, 29) Telemetry . . . . . . . . = 255 (TLM = 0, 1, 2, ..., 29) GPS Rx . . . . . . . . . = 255 (GPS_RX = 0, 1, 2, ..., 29) GPS Tx . . . . . . . . . = 255 (GPS_TX = 0, 1, 2, ..., 29) Sbus OUT . . . . . . . . = 255 (SBUS_OUT= 0, 1, 2, ..., 29) RPM . . . . . . . . . . = 255 (RPM = 0, 1, 2, ..., 29) SDA (I2C sensors) . . . . = 2 (SDA = 2, 6, 10, 14, 18, 22, 26) SCL (I2C sensors) . . . . = 3 (SCL = 3, 7, 11, 15, 19, 23, 27) PWM Channels 1, 2, 3 ,4 = 255 255 255 255 (C1 / C16= 0, 1, 2, ..., 15) PWM Channels 5, 6, 7 ,8 = 255 255 255 255 PWM Channels 9,10,11,12 = 255 255 255 255 PWM Channels 13,14,15,16 = 255 255 255 255 Voltage 1, 2, 3, 4 = 255 255 255 255 (V1 / V4 = 26, 27, 28, 29) RGB led . . . . . . . . . = 16 (RGB = 0, 1, 2, ..., 29) Logger . . . . . . . . . = 255 (LOG = 0, 1, 2, ..., 29) ESC . . . . . . . . . . . = 1 (ESC_PIN= 0, 1, 2, ..., 29)

Esc type is HW4 (Hobbywing V4)

Protocol is Jeti (Exbus) CRSF baudrate = 420000 Logger baudrate = 115200 PWM is generated at = 50 Hz Voltage parameters: Scales : 1.000000 , 1.000000 , 1.000000 , 1.000000 Offsets: 0.000000 , 0.000000 , 0.000000 , 0.000000 No temperature sensors are connected on V3 and V4 RPM multiplier = 1.000000 Baro sensor is detected using MS5611 Sensitivity min = 100 (at 100) , max = 300 (at 1000) Hysteresis = 5 Acc/Gyro is not detected Airspeed sensor is not detected No Vspeed compensation channel defined; oXs uses default settings First analog to digital sensor is not detected Second analog to digital sensor is not detected Foreseen GPS type is Ublox (configured by oXs) :GPS is not (yet) detected Led color is normal (not inverted) Failsafe type is HOLD

Gyro is not configured

No sequencers are defined

Config parameters are OK Press ? + Enter to get help about the commands

Satcomix commented 9 months ago

You wrote: Note: best is to discuss gyro in a specific issue. ;-))

Klippeneck commented 9 months ago

Hello, SW 2.10.2 has solved the problem with the missing initialisation. Vario, altitude, voltage, temperatures and consumption seem plausible. Current is constantly at 0 A although consumption is counting up. The LED on the RP flashes red when the sensor is connected to the receiver, green on the terminal programme (Arduino). Jürgen

Satcomix commented 9 months ago

Hello Jürgen, So voltage, current and capacity now appear on your handset display? Current is constant 0A but the capacity counts up? Normaly it stays at 0mAh by 0A I don't understand the next statement. The LED on the RP flashes red when the sensor is connected to the receiver, green on the terminal program (Arduino). The ESC V5 must be connected to the oXs board at ESC_PIN= and the oXs board is connected to the receiver via TLM= or PRI=(FBUS). The board flashes green when the receiver is connected, blue by failsafe receiver off, red by an error or false config. The board is connected to the Arduino terminal via USB. greetings, Torsten

Klippeneck commented 9 months ago

Hello Torsten, Yes, voltage, current, 2 temperatures (BEC temperature and FET temperature) and the capacity are displayed on the transmitter. The current is constantly at zero even when the motor is running with the LS, but the capacity counts up. The other values are OK. When configuring the terminal programme via USB, the LED flashes green; if I connect the sensor to the receiver (EX bus input), the LED flashes red. The ESC to sensor connection is as you have described. PRI goes to EX bus input receiver. Jürgen 11:18:13.582 -> processing cmd 11:18:13.582 -> 11:18:13.582 -> Version = 2.10.2 11:18:13.582 -> Function GPIO Change entering XXX=yyy (yyy=255 to disable) 11:18:13.582 -> Primary channels input = 5 (PRI = 5, 9, 21, 25) 11:18:13.582 -> Secondary channels input = 255 (SEC = 1, 13, 17, 29) 11:18:13.582 -> Telemetry . . . . . . . . = 255 (TLM = 0, 1, 2, ..., 29) 11:18:13.582 -> GPS Rx . . . . . . . . . = 255 (GPS_RX = 0, 1, 2, ..., 29) 11:18:13.582 -> GPS Tx . . . . . . . . . = 255 (GPS_TX = 0, 1, 2, ..., 29) 11:18:13.582 -> Sbus OUT . . . . . . . . = 255 (SBUS_OUT= 0, 1, 2, ..., 29) 11:18:13.582 -> RPM . . . . . . . . . . = 255 (RPM = 0, 1, 2, ..., 29) 11:18:13.582 -> SDA (I2C sensors) . . . . = 2 (SDA = 2, 6, 10, 14, 18, 22, 26) 11:18:13.582 -> SCL (I2C sensors) . . . . = 3 (SCL = 3, 7, 11, 15, 19, 23, 27) 11:18:13.582 -> PWM Channels 1, 2, 3 ,4 = 255 255 255 255 (C1 / C16= 0, 1, 2, ..., 15) 11:18:13.582 -> PWM Channels 5, 6, 7 ,8 = 255 255 255 255 11:18:13.582 -> PWM Channels 9,10,11,12 = 255 255 255 255 11:18:13.582 -> PWM Channels 13,14,15,16 = 255 255 255 255 11:18:13.582 -> Voltage 1, 2, 3, 4 = 255 255 255 255 (V1 / V4 = 26, 27, 28, 29) 11:18:13.582 -> RGB led . . . . . . . . . = 16 (RGB = 0, 1, 2, ..., 29) 11:18:13.582 -> Logger . . . . . . . . . = 255 (LOG = 0, 1, 2, ..., 29) 11:18:13.582 -> ESC . . . . . . . . . . . = 1 (ESC_PIN= 0, 1, 2, ..., 29) Esc type is HW4 (Hobbywing V4) 11:18:13.582 -> 11:18:13.582 -> Protocol is Jeti (Exbus) 11:18:13.582 -> CRSF baudrate = 420000 11:18:13.582 -> Logger baudrate = 115200 11:18:13.582 -> PWM is generated at = 50 Hz 11:18:13.582 -> Voltage parameters: 11:18:13.582 -> Scales : 13.100000 , 12.400000 , 1.000000 , 1.000000 11:18:13.582 -> Offsets: 0.000000 , 0.000000 , 0.000000 , 0.000000 11:18:13.582 -> No temperature sensors are connected on V3 and V4 11:18:13.582 -> RPM multiplier = 1.000000 11:18:13.582 -> Baro sensor is detected using MS5611 11:18:13.582 -> Sensitivity min = 100 (at 100) , max = 300 (at 1000) 11:18:13.582 -> Hysteresis = 5 11:18:13.582 -> Airspeed sensor is not detected 11:18:13.582 -> No Vspeed compensation channel defined; oXs uses default settings 11:18:13.582 -> First analog to digital sensor is not detected 11:18:13.582 -> Second analog to digital sensor is not detected 11:18:13.582 -> Foreseen GPS type is Ublox (configured by oXs) :GPS is not (yet) detected 11:18:13.582 -> Led color is normal (not inverted) 11:18:13.582 -> Failsafe type is HOLD 11:18:13.582 -> Acc/Gyro is not detected 11:18:13.582 -> 11:18:13.582 -> Gyro is not configured 11:18:13.582 -> 11:18:13.582 -> No sequencers are defined 11:18:13.582 -> Error in parameters: gyro vertical orientation (0) is not valid 11:18:13.582 -> 11:18:13.582 -> Config parameters are OK 11:18:13.582 -> Press ? + Enter to get help about the commands

Satcomix commented 9 months ago

Hello Jürgen, I think you have to invert RGB LED=I, because at USB without Receiver connected normally it flashes red, and with Receiver connected it flashes green. Greetings, Torsten

mstrens commented 9 months ago

For Hobbywing, I used the code find on the web. In order to reject dummy values received from time to time, this code has a check to avoid sending the current when it exceed some max value. This max value can be defined in the config.h file. It was set on 250.0. I expect it was 250A. In fact oXs should normally set this value in mA (using scaleVolt2). I put on github a version 2.10.3 that set the max value to 250000. I hope this can fix the issue.

Satcomix commented 9 months ago

Version 2.10.3 works with FBUS and HW V4 All telemetry data are sent and displayed.

Klippeneck commented 9 months ago

Hello Mstrens, Power is now displayed with 2.10.3, change was successful. Next I will determine the scale factors for Hobbywing FLY Fun 80A V5 and then go into flight testing. Many thanks for your great work. Juergen

mstrens commented 9 months ago

Seems to be OK

Klippeneck commented 9 months ago

Hello Mstrens, In my test setup, I switch the motor via a three-step switch on the transmitter, OFF, approx. 50% and full throttle. the displayed current value remains at approx. 4.5A, regardless of the throttle position. Measured with a shunt, it is approx. 10A at 50% and 22A at full throttle. This means that I cannot determine a current coefficient. Next I will carry out tests with a motor with a higher current consumption (approx. 50A). I have to wait for the result of this test, then I will report again. Greetings Jürgen

mstrens commented 9 months ago

It is not normal that current does not change between 50% and 100% throttle. Perhaps that the value is not transmitted anymore at 100%. You can probably see it the value is not transmitted anymore on the handset (e.g. in openTX the screen to discover the sensors shows blinking "*" when a new value is received).

There are some checks in the code for ESC HW4 that avoid (in theory) sending wrong data. if (throttle > 1024 || pwm > 1024 || rpm > 200000 || escRxBuffer[11] & 0xF0 ||\ escRxBuffer[13] & 0xF0 || escRxBuffer[15] & 0xF0 || escRxBuffer[17] & 0xF0 || escRxBuffer[1] == 0x9B)

Perhaps I have to put some debug msg again to see to display the raw values provided by the ESC.

Klippeneck commented 9 months ago

Hello Mstrens, was able to make further tests with the ESC. Old setup with FLY FUN 80A, controlled with three-step switch on the transmitter. First attempt with Scale2 factor 90, then the current is correct at full throttle, 40A. At 50% 33A are displayed, real at the shunt 1O A. Second test with the same V2 factor and smaller motor. At 100% 38A, target is 20A, at 50% 33A, target 8A. Offset2 is always 0. The remaining telemetry values of the ESC are correct. There must be a bug in the current display. Jürgen

mstrens commented 9 months ago

Can you try version 2.10.11. In this version, I display (on the pc) the raw values received from the ESC. Can you capture those values for different levels of current. Please provide those captures and say what is the "real" current for each capture.

Klippeneck commented 9 months ago

Hello Mstrens, I have carried out the test, here is the result: 13:15:11.007 -> processing cmd 13:15:11.007 -> 13:15:11.007 -> Version = 2.10.11 13:15:11.007 -> Function GPIO Change entering XXX=yyy (yyy=255 to disable) 13:15:11.007 -> Primary channels input = 5 (PRI = 5, 9, 21, 25) 13:15:11.007 -> Secondary channels input = 255 (SEC = 1, 13, 17, 29) 13:15:11.007 -> Telemetry . . . . . . . . = 255 (TLM = 0, 1, 2, ..., 29) 13:15:11.007 -> GPS Rx . . . . . . . . . = 255 (GPS_RX = 0, 1, 2, ..., 29) 13:15:11.007 -> GPS Tx . . . . . . . . . = 255 (GPS_TX = 0, 1, 2, ..., 29) 13:15:11.007 -> Sbus OUT . . . . . . . . = 255 (SBUS_OUT= 0, 1, 2, ..., 29) 13:15:11.007 -> RPM . . . . . . . . . . = 255 (RPM = 0, 1, 2, ..., 29) 13:15:11.007 -> SDA (I2C sensors) . . . . = 2 (SDA = 2, 6, 10, 14, 18, 22, 26) 13:15:11.007 -> SCL (I2C sensors) . . . . = 3 (SCL = 3, 7, 11, 15, 19, 23, 27) 13:15:11.007 -> PWM Channels 1, 2, 3 ,4 = 255 255 255 255 (C1 / C16= 0, 1, 2, ..., 15) 13:15:11.007 -> PWM Channels 5, 6, 7 ,8 = 255 255 255 255 13:15:11.007 -> PWM Channels 9,10,11,12 = 255 255 255 255 13:15:11.007 -> PWM Channels 13,14,15,16 = 255 255 255 255 13:15:11.007 -> Voltage 1, 2, 3, 4 = 255 255 255 255 (V1 / V4 = 26, 27, 28, 29) 13:15:11.007 -> RGB led . . . . . . . . . = 16 (RGB = 0, 1, 2, ..., 29) 13:15:11.007 -> Logger . . . . . . . . . = 255 (LOG = 0, 1, 2, ..., 29) 13:15:11.007 -> ESC . . . . . . . . . . . = 1 (ESC_PIN= 0, 1, 2, ..., 29) Esc type is HW4 (Hobbywing V4) 13:15:11.007 -> 13:15:11.007 -> Protocol is Jeti (Exbus) 13:15:11.007 -> CRSF baudrate = 420000 13:15:11.007 -> Logger baudrate = 115200 13:15:11.007 -> PWM is generated at = 50 Hz 13:15:11.007 -> Voltage parameters: 13:15:11.007 -> Scales : 12.700000 , 90.000000 , 1.000000 , 1.000000 13:15:11.007 -> Offsets: 0.000000 , 0.000000 , 0.000000 , 0.000000 13:15:11.007 -> No temperature sensors are connected on V3 and V4 13:15:11.007 -> RPM multiplier = 1.000000 13:15:11.007 -> Baro sensor is detected using MS5611 13:15:11.007 -> Sensitivity min = 100 (at 100) , max = 300 (at 1000) 13:15:11.007 -> Hysteresis = 5 13:15:11.007 -> Airspeed sensor is not detected 13:15:11.007 -> No Vspeed compensation channel defined; oXs uses default settings 13:15:11.007 -> First analog to digital sensor is not detected 13:15:11.007 -> Second analog to digital sensor is not detected 13:15:11.007 -> Foreseen GPS type is Ublox (configured by oXs) :GPS is not (yet) detected 13:15:11.007 -> Led color is inverted 13:15:11.007 -> Failsafe type is HOLD 13:15:11.007 -> Acc/Gyro is not detected 13:15:11.007 -> 13:15:11.007 -> Gyro is not configured 13:15:11.007 -> 13:15:11.007 -> No sequencers are defined 13:15:11.007 -> Error in parameters: gyro vertical orientation (0) is not valid 13:15:11.007 -> 13:15:11.007 -> Config parameters are OK 13:15:11.007 -> Press ? + Enter to get help about the commands 13:18:18.899 -> Esc throttle=0 pwm=50 Volt=1511 current=0 consumed=0 temp1=3474 temp2=3504 13:18:19.273 -> Esc throttle=0 pwm=50 Volt=1518 current=0 consumed=0 temp1=3486 temp2=3503 13:18:19.695 -> Esc throttle=0 pwm=50 Volt=1512 current=0 consumed=0 temp1=3475 temp2=3502 13:18:20.070 -> Esc throttle=0 pwm=50 Volt=1518 current=0 consumed=0 temp1=3482 temp2=3501 13:18:20.492 -> Esc throttle=0 pwm=50 Volt=1518 current=0 consumed=0 temp1=3479 temp2=3501 13:18:20.867 -> Esc throttle=0 pwm=50 Volt=1520 current=0 consumed=0 temp1=3474 temp2=3503 13:18:21.289 -> Esc throttle=0 pwm=50 Volt=1513 current=0 consumed=0 temp1=3480 temp2=3503 13:18:21.710 -> Esc throttle=0 pwm=50 Volt=1519 current=0 consumed=0 temp1=3479 temp2=3500 13:18:22.085 -> Esc throttle=0 pwm=50 Volt=1517 current=0 consumed=0 temp1=3478 temp2=3502 13:18:22.507 -> Esc throttle=0 pwm=50 Volt=1511 current=0 consumed=0 temp1=3474 temp2=3502 13:18:23.116 -> Esc throttle=499 pwm=302 Volt=1516 current=359 consumed=5 temp1=3484 temp2=3502 13:18:23.304 -> Esc throttle=499 pwm=499 Volt=1469 current=391 consumed=7 temp1=3477 temp2=3501 13:18:23.491 -> Esc throttle=499 pwm=499 Volt=1487 current=389 consumed=9 temp1=3475 temp2=3500 13:18:23.679 -> Esc throttle=499 pwm=499 Volt=1477 current=391 consumed=11 temp1=3470 temp2=3501 13:18:23.913 -> Esc throttle=499 pwm=499 Volt=1484 current=395 consumed=13 temp1=3475 temp2=3502 13:18:24.100 -> Esc throttle=499 pwm=499 Volt=1483 current=390 consumed=15 temp1=3472 temp2=3501 13:18:24.288 -> Esc throttle=499 pwm=499 Volt=1478 current=387 consumed=17 temp1=3467 temp2=3501 13:18:24.475 -> Esc throttle=500 pwm=500 Volt=1473 current=392 consumed=19 temp1=3463 temp2=3500 13:18:24.710 -> Esc throttle=499 pwm=499 Volt=1481 current=390 consumed=21 temp1=3464 temp2=3500 13:18:24.897 -> Esc throttle=499 pwm=499 Volt=1483 current=390 consumed=23 temp1=3458 temp2=3501 13:18:25.085 -> Esc throttle=499 pwm=499 Volt=1480 current=390 consumed=24 temp1=3462 temp2=3498 13:18:25.319 -> Esc throttle=499 pwm=499 Volt=1480 current=387 consumed=26 temp1=3460 temp2=3501 13:18:25.506 -> Esc throttle=499 pwm=499 Volt=1474 current=388 consumed=28 temp1=3451 temp2=3500 13:18:25.694 -> Esc throttle=1000 pwm=841 Volt=1386 current=499 consumed=31 temp1=3452 temp2=3500 13:18:25.881 -> Esc throttle=1000 pwm=1000 Volt=1361 current=516 consumed=33 temp1=3440 temp2=3499 13:18:26.116 -> Esc throttle=1000 pwm=1000 Volt=1362 current=507 consumed=36 temp1=3446 temp2=3497 13:18:26.303 -> Esc throttle=1000 pwm=1000 Volt=1355 current=508 consumed=39 temp1=3438 temp2=3500 13:18:26.491 -> Esc throttle=1000 pwm=1000 Volt=1357 current=510 consumed=41 temp1=3437 temp2=3498 13:18:26.678 -> Esc throttle=1000 pwm=1000 Volt=1355 current=507 consumed=44 temp1=3435 temp2=3500 13:18:26.912 -> Esc throttle=1000 pwm=1000 Volt=1350 current=509 consumed=46 temp1=3436 temp2=3499

Klippeneck commented 9 months ago

Target at 50% 8.5A Target at 100 % 40A

mstrens commented 9 months ago

It is strange: the values given by the ESC does not give the expected ratio. 100% => ESC=about 510 50% => ESC=about 390 So 390 / 510 = about 75% . This is very different from 8.5 / 40 A = about 21% The issue is not in oXs but in the ESC or in the measurements you are doing.

Mike-HRC commented 9 months ago

How much are you loading up teh ESC / Motor - when I have used current sensors before they struggle to work reliably unless there is a decent level of current - simply using a motor without a load on it didn't work well. This was mainly on helis, and they woul dstruggle to give reliable readings unless there blades had some pitch on them to give lift.

No idea if thisis what you are seeing, but I thought that I'd mention it..

Klippeneck commented 9 months ago

Hello Mstrens, the same test setup (motor, propeller and ESC) gives correct values with the dgat Arduino msrc, so it almost can't be the ESC. I have made 2 attempts, the first with OXS, the second with Arduino from dgat. See below for results. I can't explain the differences. Juergen
RP2040_ESC_test1 RP2040_ESC_test2

mstrens commented 9 months ago

OK. I check the code again from msrc. I am using the same logic. in msrc, current = (currentRaw - rawCurrentOffset_) ESCHW4_V_REF / (ESCHW4_AMPGAIN ESCHW4_DIFFAMP_SHUNT ESCHW4_ADC_RES); If you use the parameters in msrc for a funfly 80a, then the (raw current - offset) value is multiplied by 3.3/(12.40.25*4096/1000) = 0.25989 to get the number of Amp With the values you noticed it is about (40-8.5)/(510-390)=0.2625 (difference probably due to approximative values I used). As oXs calculates in mA (and not in amp), scaleVolt2 should be 259.89 (using the msrc parameters)

msrc also apply an offset to the raw value. In msrc , the way the offset is defined seems me very strange. I think it is the first raw current that is greater than 0 that is provided by the ESC. This is strange because it seems me that this value depends on the way you apply throttle. If you use the stick, the first value will probably be quite low (e.g when stick is at 20 or 30%) but when you apply throttle with a switch, then the first value will probably be higher (e.g if you switch request 50%).

oXs uses a fixed offset that has to be defined by the user. That seems me better.

Knowing the scaleVolt2 (assuming 259.89 from msrc), it is possible to calculate the offset to apply to get e.g. 40A when ESC gives a raw value of 510. In oXs we have : current = (raw value scale) - offset So (in mA) 40000 = 510259.89 - offset So offset = 510*259.89 - 40000 = 132545 - 40000 = 92545

With those parameters, at 50% you should get: 390*259.89 - 92545 = 8814 mA

You say that you get 8.5A. The difference is not big.

If you can make more precise measurements of the real Amp and at the same time display the raw value, then it would be possible to recalculate scaleVolt2 and offset2.

I expect that with those parameters, you will get the expected currents.

Satcomix commented 9 months ago

Hello everyone, I believe the behavior of the measured values ​​is normal for Hobbywing ESC V4/V5 (small deviation). What I noticed is that there is no OFFSET entered, just SCALE. I don't know if it helps, but there is a calculator for SCALE and OFFSET as an .xls file.

https://www.dropbox.com/scl/fi/yocl8uhg0z4swgcdbgvdr/HobbyWing-correction-calculator.xlsx?dl=0&rlkey=kxq1phzf6kgqql1umpbkbd6xk

HobbyWing correction calculator.xlsx

I think it is from MSH Electronics: https://www.msh-electronics.com/forum/support/inaccurate-mah-readings-hobbywing-160a/ Greeting, Torsten

mstrens commented 9 months ago

I do not think you can use the calculator above.

So I suggest to use the calculation method I already explained for any kind of voltage/current/temp and that is based on at least 2 measurements.
I think I already provided an xls chart with the formula in a post (not 100% sure) .

Satcomix commented 9 months ago

I do not think you can use the calculator above.

* offset is not applied in the same way in oXs and msrc

* oXs calculates in mA while msrc in A

* I think that calculator use a parameter that is valid only for one type of Hobbywing ESC.

So I suggest to use the calculation method I already explained for any kind of voltage/current/temp and that is based on at least 2 measurements. I think I already provided an xls chart with the formula in a post (not 100% sure) .

Hello Mstrens, I thought it would help. You have often posted the type of calculation on RCG or GH. But I haven't seen an xls file from you yet. greetings, Torsten

mstrens commented 9 months ago

I will add one in the next version (in doc folder). Here already a file I just made. Calculate_scale_and_offset.xlsx

Klippeneck commented 9 months ago

Hello Mstrens, after a few tests I have managed to determine the offset and scale for the Hobbywing FunFly V5/ 80A. The following values are to be used: Scale1 12.84, Offset 0 Scale2 256, Offset 90000 This means that the transmitted telemetry values are correct within the limits set by the ESC expected accuracy. Greetings Jürgen

Satcomix commented 8 months ago

Hello Mstrens, I'm currently doing some testing with version 2.11.6-test and FBUS Protocol and HW ESC V4 I noticed that the ESC data is no longer prioritized before V1 to V4 as well as TEMP1 and 2. With version 2.11.1 I had commented out the messages for V1 and V2 (//) and was able to see the ESC data on the handset display, also for example with some HobbyWing ESCs that only send data when RPM >0 and i get no "Sensor Lost" when i set V1 and V2 active. You commented out (param.cpp) all values ​​in version 2.11.6, but the ESC values ​​are no longer displayed prioritized when V1 to V4 are activated. regards, Torsten

mstrens commented 8 months ago

Sending the same telemetry data simultaneously from 2 sources has no sense. So, first I did not allowed to define pins for V1, V2, RPM, Temp1, Temp2 when ESC pin was defined. This was done with some checks in param.cpp Second someone asked to be able to discard current/capacity from ESC and to give priority to current/capacity based on V2. I implemented this removing the check on V2 pin and I discarded current/capacity from ESC when V2 pin is defined. Third, I understood that there was the same request for other fields and so I applied the "V2" change to other fields too.

Is this not what was expected?

Satcomix commented 8 months ago

Sending the same telemetry data simultaneously from 2 sources has no sense. So, first I did not allowed to define pins for V1, V2, RPM, Temp1, Temp2 when ESC pin was defined. This was done with some checks in param.cpp Second someone asked to be able to discard current/capacity from ESC and to give priority to current/capacity based on V2. I implemented this removing the check on V2 pin and I discarded current/capacity from ESC when V2 pin is defined. Third, I understood that there was the same request for other fields and so I applied the "V2" change to other fields too.

Is this not what was expected?

Good morning Mstrens, But that was desired, including by me. But in version 2.11.1 V2 was commented out in param.cpp (I believe in the RCG for Carsonpoland). I created my own build where V1 and V2 were also commented out. If there is voltage at GPio26, this will also be shown on the display. But when the ESC was in operation, the voltage from the ESC was displayed. He doesn't do that anymore. If V1 is activated, only the V1 voltage from the GPio26 is displayed, but no longer its internal telemetry voltage when the ESC is running. I just tested again with version 2.11.6, strange. only V1 voltage, no ESC voltage. Only ESC voltage if V1 is deactivated.

Satcomix commented 8 months ago

FYI: Why did I find this setting with the prioritization of the ESC data over the V1 to V4 data so interesting? I help in several German forums and explain how the oXs_RP2040 works with all its setting options. These are now quite a few functions and settings that have been added from Ver 0.3.0 to 2.11.6. While implementing the HW V4 ESC, I became aware of some ESCs that only send data when RPM>0. I then used V1 and V2 as active dummies. They not only send a 0 when the motor is not turning, but I also simulated the exact voltage with a potentiometer on V1 at idle. This meant that sensor loss didn't always occur when the engine wasn't turning. With version 2.11.6 I was hoping that this would now work with all functions from V1 to V4, RPM and TEMP=2.

mstrens commented 8 months ago

Sorry but I do not understand what you are expecting.

You said that some lines where commented in param.cpp. I presume you refer to those e.g. those lines: //if ( (config.pinEsc != 255) && (config.pinVolt[1]!=255)) { // printf("Error in parameters: When gpio is defined for ESC, gpio for current = Volt2 (V2) must be undefined (=255)\n"); // configIsValid=false; //}

Those lines where initially present because they did not allowed to have a config with 2 pins defined simultaneously for Volt2 and for ESC.

Please note that when I put those lines as comment, I also made other changes in order to avoid transmitting e.g. Volt2 from 2 sources (voltage.cpp and ESC.cpp):

This is the way I manage the priority between voltage and ESC sources. It is related to the setup of the parameters but not on the fact that the ESC provides or not some data frames.

Satcomix commented 8 months ago

Hello Mstrens, As I already wrote, I was looking for a solution for special HW ESC V4/5, to prioritize certain ESC or ADC values ​​and, if necessary, to set active dummy values. I created a build from version 2.11.1 that transfers all values ​​to the person in question, even if RPM<1, so that no sensor lost sounds. Thank you very much for your effort. Greeting, Torsten

Satcomix commented 8 months ago

Can you test 2.10.2. I tried to activate pullup only after a delay of 3 sec. So the first bytes read by oXs would probably be wrong but after 3 sec, it should be OK.

Hello Mstrens, I would like to slightly adjust the time to initialize the ESC. Where can I find the 3 seconds you mentioned? I only find this command in esc.cpp.

define ESC_HOBBYV4_MIN_FREE_TIME_US 8000.

Time between 2 periods = 4 sec. Is it this attitude? regards, Torsten

mstrens commented 8 months ago

in esc.cpp there is : if (config.escType == HW4) { if ((pullupHW == false) and (millisRp() > 3000)) { gpio_pull_up(config.pinEsc); pullupHW = true; } }

Satcomix commented 8 months ago

in esc.cpp there is : if (config.escType == HW4) { if ((pullupHW == false) and (millisRp() > 3000)) { gpio_pull_up(config.pinEsc); pullupHW = true; } }

I found it in void handleEsc(){ Thank you very much. regards, Torsten