dgatf / msrc

Multi Sensor for RC with RP2040 - FrSky D, SmartPort, XBUS, SRXL, IBUS, SBUS, Multiplex Sensor Bus, Jeti Ex Bus, Hitec
GNU General Public License v3.0
169 stars 42 forks source link

Analog current sensor offset issue #128

Closed tontonlex closed 3 months ago

tontonlex commented 3 months ago

Hello, I try tu use msrc with a analog current sensor (ACS758LCB-100B) This one is bidirectionnal, so this sensor 0A Vout is about half VCC input.

Auto offset and manual offset seem not work. With 22mV/A and 1.7 manual offset, I get about 74A on debug and on my futaba transmitter. So about the same when offset is set to 0.

I see there was a fix 14th april 2024 (https://github.com/dgatf/msrc/commit/0897e295cf3523399ecce1c198035c669d1af7fe) so I try build firmware, but the problem keep the same.

Does anyone have a solution to this problem ?

derFliegendeHamburger commented 3 months ago

I have an old arduino based version modified to work with zero midpoint for one analog sensor. Cannot help with modern mcu

dgatf commented 3 months ago

There were some issues with current and auto offset. Auto offset and manual offset should be ok now. Binary updated.

With auto offset, wait 10 seconds, then msrc will offset current to zero.

Fixed with 2158586

tontonlex commented 3 months ago

Auto offset and manual offset works as expected now, but in debug mode only. Auto Offset voltage is well mesured, I have theses values in debug :

Current (98): Curr -0.18 Cons 98.65 Volt 1.65 VoltOffs 1.66 Multip 45.00

But on SBUS2 value is still wrong, I still have 74A with auto offset, with manual offset I get zero (I dont try to start motor, measure stay to zero). It's maybe caused by the way how futaba interpret values. The first values (when auto offset is calculated) are keeped. It can be a problem when max motor current is below this false measure. It shoud be better if value stay 0A during autooffset calculation.

At least it seem working with manual offset. I will try further later.

dgatf commented 3 months ago

Current is zero until auto offset (if auto offset is enabled). Commit cf730bc

Binary updated