iNavFlight / inav

INAV: Navigation-enabled flight control software
https://inavflight.github.io
GNU General Public License v3.0
3.18k stars 1.49k forks source link

No Current Reading on Matek H743 WLITE #8986

Closed jasc76 closed 1 year ago

jasc76 commented 1 year ago

Current Behavior

No Current reading with ADC on Matek H743 wlite

Steps to Reproduce

Set to ADC -> current is 0 regardless of scale Set to ESC -> current gets displayed but with wrong Set to ADC -> current is 0 again

voltage sensing works

Expected behavior

Current gets displayed

Suggested solution(s)

Maybe PIN declaration for ADC is off. Manual says current sense is PIN 11

target.h:

define ADC_CHANNEL_1_PIN PC0 //ADC123 VBAT1

define ADC_CHANNEL_2_PIN PC1 //ADC123 CURR1

define ADC_CHANNEL_3_PIN PC5 //ADC12 RSSI

define ADC_CHANNEL_4_PIN PC4 //ADC12 AirS

define ADC_CHANNEL_5_PIN PA4 //ADC12 VB2

define ADC_CHANNEL_6_PIN PA7 //ADC12 CU2

Additional context


version

INAV/MATEKH743 6.0.0 Mar 22 2023 / 10:48:04 (084101ac)

GCC-10.2.1 20201103 (release)

status

INAV/MATEKH743 6.0.0 Mar 22 2023 / 10:48:04 (084101ac) GCC-10.2.1 20201103 (release) System Uptime: 45 seconds Current Time: 2041-06-28T02:04:00.000+01:00 Voltage: 0.00V (1S battery - NOT PRESENT) CPU Clock=480MHz, GYRO=ICM42605, ACC=ICM42605, BARO=SPL06 STM32 system clocks: SYSCLK = 480 MHz HCLK = 240 MHz PCLK1 = 120 MHz PCLK2 = 120 MHz Sensor status: GYRO=OK, ACC=OK, MAG=NONE, BARO=OK, RANGEFINDER=NONE, OPFLOW=NONE, GPS=OK ESC Temperature(s): Motor Count = 1 ESC 0: 0°C, SD card: Manufacturer 0x3, 15558144kB, 01/2005, v8.0, 'SC16G' Filesystem: Fatal - no FAT MBR partitions Stack size: 6144, Stack address: 0x20020000, Heap available: 1716 I2C Errors: 50, config size: 9067, max available config: 131072 ADC channel usage: BATTERY : configured = ADC 1, used = ADC 1 RSSI : configured = ADC 3, used = none CURRENT : configured = ADC 2, used = ADC 2 AIRSPEED : configured = ADC 4, used = none System load: 1, cycle time: 1002, PID rate: 998, RX rate: 9, System rate: 9 Arming disabled flags: NAV RX CLI OSD: MSP DisplayPort: DJI Compatability mode [30 x 16] VTX: not detected

mmosca commented 1 year ago

Just tested on mine, and it is reading correctly, so the target pin definition is correct..

Both current sensor and voltage are set to ADC. I did have to calibrate the current sensor scale, but closely tracks the current displayed in my power supply.

My current scale is set to 86, but you should try to calibrate to your needs. Matek's website sugesting using 150 for current scale and 2100 for voltage scale.

DzikuVx commented 1 year ago

I can also confirm what current is correctly measured on my hardware