bitdump / BLHeli

BLHeli for brushless ESC firmware
GNU General Public License v3.0
1.97k stars 1.09k forks source link

BLHeli32.62 - ESC Telemetry doesn't work after enabling signal line RPM telemetry #336

Closed Balint134 closed 5 years ago

Balint134 commented 5 years ago

I've installed the latest 32.62 test version to try out signal line RPM telemetry. That part is working fine although telemetry coming from the telemetry line is all messed up. Connecting the battery reads 13-15A prior to arming and pretty much all the other telemetries are skewed and jumping around.

Disabling Signal line RPM telemetry fixes the problem, in fact telemetry line is stable until the FC sends the DSHOT command to enable signal line telemetry. The FC is able to decode telemetry packages and CRC check passes, so I assume the data coming from the ESCs are bogus to begin with.

I'm using Holybro Tekko32 F3 ESCs

sskaug commented 5 years ago

Thank you for reporting. I'll look into it.

sskaug commented 5 years ago

So I've found the issue. In order to save DMA BW, the ADC DMA is turned off while doing the signal line DMA. And in this disabling/enabling of the ADC, the sequency of the ADC samples is screwed up (for the GD32F350, not for the STM32F051 - their ADCs are different). I'll fix this - will be a couple of weeks before I have time

Balint134 commented 5 years ago

@sskaug Thanks for looking at it and ack back. I'll wait for the fix :)

sskaug commented 5 years ago

This issue is now understood and a fix is implemented. But before releasing code I'd like to understand what happens in issue #337.

sskaug commented 5 years ago

New test code Rev32.6.3 is now uploaded on github and available in the Android app.

Balint134 commented 5 years ago

@sskaug I've flashed my ESCs to this version. Current measurement stopped working altogether, it reads 0A. When connecting the battery I see a momentary surge reported but after that no readings at all.

sskaug commented 5 years ago

I can not reproduce this here. I use Rev32.63 Furling32 code with rev h bootloader. I get good current readings in BF: image Bidirectional Dshot enabled (set dshot_burst=off and set dshot_bidir=on and set motor_poles=14). Dshot1200 at 8k/8k.

Strangely I get some rough motor running if I set it to 8k/2k, coupled with BF hanging and not responding to throttle anymore...

Balint134 commented 5 years ago

Rough motors come from the timing difference between Gyro and PID loop. When enabling dshot_bidir BF enables RPM filter which requires the Gyro and PID sampling to be the same.

Here's what I see: esc_sensor_off

This screenshot is with a fresh firmware, everything is default and motors are not running. Both Current and Voltage metering is off.

I see similar figures when enabling dshot_bidir and turning of dshot_burst.

Balint134 commented 5 years ago

For our records, here's the same screenshot with the same BF firmware and settings as above, flashed back to 32.6

esc_sensor_ok

sskaug commented 5 years ago

Tried another ESC now, and I can reproduce a similar issue. I'll dig into it.

sskaug commented 5 years ago

@SwankyPantie Ok, so I believe I have found the root cause. I have published a 32.6.4 version of the Furling32 code on github. I see no problems in my testing here. Could you please test it?

Balint134 commented 5 years ago

@sskaug I've tested 32.6.4 and ESC telemetry seems to be working again.

esc_sensor_ok

It is not visible on this screenshot but Voltage telemetry works as well. Thanks for fixing it!

sskaug commented 5 years ago

Great. Thank you for reporting and testing!