Skip to content
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

Add ADC_ADS1115_EN Parameter to FMUv6x Default Build #21443

Closed
wants to merge 2 commits into from

Conversation

vincentpoont2
Copy link
Member

@vincentpoont2 vincentpoont2 commented Apr 6, 2023

Adding ADC_ADS1115 Parameter to FMUv6x Default Build to allow FMUv6X user to use ADS1115 with Analog Power Modules.

Solved Problem

This change will show ADC_ADS1115_EN parameter in FMUv6X default build. Many users would like to use their Analog Power module with FMUv6X FC. This parameter can enable ADC_ADS1115 driver.

Issue reported here: #21318

Adding ADC_ADS1115 Parameter to FMUv6x Default Build to allow FMUv6X user to use ADS1115 with Analog Power Modules.
@vincentpoont2
Copy link
Member Author

@mrpollo Is it possible to get this to the 1.14 release?

@mrpollo mrpollo added Drivers 🔧 Sensors, Actuators, etc Manufacturer: holybro labels Apr 6, 2023
@mrpollo
Copy link
Contributor

mrpollo commented Apr 6, 2023

I tested on a Holybro Pixhawk 6X, the ads1115 module is present but is not starting, is this the expected behavior @vincentpoont2?

MAVLink Shell:

nsh> dmesg
HW arch: PX4_FMU_V6X
HW type: V6X000004
HW version: 0x000
HW revision: 0x004
PX4 git-hash: b000abac4af36733df930d43f3d76028111ec7ca
PX4 version: 1.14.0 0 (17694720)
PX4 git-branch: vincentpoont2-patch-5
OS: NuttX
OS version: Release 11.0.0 (184549631)
OS git-hash: 3f77354c0dc88793a47ff3b57595195ab45f7ba9
Build datetime: Apr  6 2023 09:17:34
Build uri: localhost
Build variant: default
Toolchain: GNU GCC, 9.3.1 20200408 (release)
PX4GUID: 0006000000003734363733305119003c001c
MCU: STM32H7[4|5]xxx, rev. V
INFO  [param] selected parameter default file /fs/mtd_params
INFO  [param] importing from '/fs/mtd_params'
INFO  [parameters] BSON document size 924 bytes, decoded 924 bytes (INT32:15, FLOAT:27)
INFO  [param] selected parameter backup file /fs/microsd/parameters_backup.bson
Board architecture defaults: /etc/init.d/rc.board_arch_defaults
Board defaults: /etc/init.d/rc.board_defaults
Loading airframe: /etc/init.d/airframes/4001_quad_x
INFO  [dataman] data manager file '/fs/microsd/dataman' size is 62560 bytes
INFO  [px4io] IO FW CRC match
Board sensors: /etc/init.d/rc.board_sensors
INFO  [ina226] Failed to init INA226 on bus 1, but will try again periodically.
ina226 #0 on I2C bus 1 (external) address 0x41
INFO  [ina226] Failed to init INA226 on bus 2, but will try again periodically.
ina226 #1 on I2C bus 2 (external) address 0x41
icm20649 #0 on SPI bus 3 rotation 6
icm42688p #0 on SPI bus 2 rotation 6
icm42670p #0 on SPI bus 1 rotation 10
bmm150 #0 on I2C bus 4 (external) address 0x10 rotation 6
WARN  [SPI_I2C] ist8310: no instance started (no device on bus?)
bmp388 #0 on I2C bus 4 (external) address 0x77
bmp388 #1 on I2C bus 2 (external) address 0x76
WARN  [SPI_I2C] ms5611: no instance started (no device on bus?)
ekf2 [721:237]
Starting Main GPS on /dev/ttyS0
Starting MAVLink on /dev/ttyS6
INFO  [mavlink] mode: Normal, data rate: 1200 B/s on /dev/ttyS6 @ 57600B
Starting MAVLink on ethernet
INFO  [mavlink] mode: Normal, data rate: 100000 B/s on udp port 14550 remote port 14550
INFO  [rc_input] valid device required
ERROR [rc_input] Task start failed (-1)
INFO  [logger] logger started (mode=all)
INFO  [uavcan] Node ID 1, bitrate 1000000

NuttShell (NSH) NuttX-11.0.0
nsh> WARN  [mavlink] no broadcasting address found
WARN  [health_and_arming_checks] Preflight Fail: Crash dumps present on SD, vehicle needs service
WARN  [health_and_arming_checks] Preflight Fail: Crash dumps present on SD, vehicle needs service
ERROR [flight_mode_manager] Failsafe task activated
WARN  [health_and_arming_checks] Preflight Fail: Crash dumps present on SD, vehicle needs service
WARN  [health_and_arming_checks] Preflight Fail: Crash dumps present on SD, vehicle needs service
nsh> ads1115 status
INFO  [SPI_I2C] Not running
nsh> ads1115

@davids5
Copy link
Member

davids5 commented Apr 6, 2023

Parameter?

davids5
davids5 previously approved these changes Apr 6, 2023
@vincentpoont2
Copy link
Member Author

I tested on a Holybro Pixhawk 6X, the ads1115 module is present but is not starting, is this the expected behavior @vincentpoont2?

MAVLink Shell:

nsh> dmesg
HW arch: PX4_FMU_V6X
HW type: V6X000004
HW version: 0x000
HW revision: 0x004
PX4 git-hash: b000abac4af36733df930d43f3d76028111ec7ca
PX4 version: 1.14.0 0 (17694720)
PX4 git-branch: vincentpoont2-patch-5
OS: NuttX
OS version: Release 11.0.0 (184549631)
OS git-hash: 3f77354c0dc88793a47ff3b57595195ab45f7ba9
Build datetime: Apr  6 2023 09:17:34
Build uri: localhost
Build variant: default
Toolchain: GNU GCC, 9.3.1 20200408 (release)
PX4GUID: 0006000000003734363733305119003c001c
MCU: STM32H7[4|5]xxx, rev. V
INFO  [param] selected parameter default file /fs/mtd_params
INFO  [param] importing from '/fs/mtd_params'
INFO  [parameters] BSON document size 924 bytes, decoded 924 bytes (INT32:15, FLOAT:27)
INFO  [param] selected parameter backup file /fs/microsd/parameters_backup.bson
Board architecture defaults: /etc/init.d/rc.board_arch_defaults
Board defaults: /etc/init.d/rc.board_defaults
Loading airframe: /etc/init.d/airframes/4001_quad_x
INFO  [dataman] data manager file '/fs/microsd/dataman' size is 62560 bytes
INFO  [px4io] IO FW CRC match
Board sensors: /etc/init.d/rc.board_sensors
INFO  [ina226] Failed to init INA226 on bus 1, but will try again periodically.
ina226 #0 on I2C bus 1 (external) address 0x41
INFO  [ina226] Failed to init INA226 on bus 2, but will try again periodically.
ina226 #1 on I2C bus 2 (external) address 0x41
icm20649 #0 on SPI bus 3 rotation 6
icm42688p #0 on SPI bus 2 rotation 6
icm42670p #0 on SPI bus 1 rotation 10
bmm150 #0 on I2C bus 4 (external) address 0x10 rotation 6
WARN  [SPI_I2C] ist8310: no instance started (no device on bus?)
bmp388 #0 on I2C bus 4 (external) address 0x77
bmp388 #1 on I2C bus 2 (external) address 0x76
WARN  [SPI_I2C] ms5611: no instance started (no device on bus?)
ekf2 [721:237]
Starting Main GPS on /dev/ttyS0
Starting MAVLink on /dev/ttyS6
INFO  [mavlink] mode: Normal, data rate: 1200 B/s on /dev/ttyS6 @ 57600B
Starting MAVLink on ethernet
INFO  [mavlink] mode: Normal, data rate: 100000 B/s on udp port 14550 remote port 14550
INFO  [rc_input] valid device required
ERROR [rc_input] Task start failed (-1)
INFO  [logger] logger started (mode=all)
INFO  [uavcan] Node ID 1, bitrate 1000000

NuttShell (NSH) NuttX-11.0.0
nsh> WARN  [mavlink] no broadcasting address found
WARN  [health_and_arming_checks] Preflight Fail: Crash dumps present on SD, vehicle needs service
WARN  [health_and_arming_checks] Preflight Fail: Crash dumps present on SD, vehicle needs service
ERROR [flight_mode_manager] Failsafe task activated
WARN  [health_and_arming_checks] Preflight Fail: Crash dumps present on SD, vehicle needs service
WARN  [health_and_arming_checks] Preflight Fail: Crash dumps present on SD, vehicle needs service
nsh> ads1115 status
INFO  [SPI_I2C] Not running
nsh> ads1115

Is it because ADC_ADS1115_EN parameter has be enabled first?

@vincentpoont2
Copy link
Member Author

@davids5 these Bat1_ parameters seems to be missing on fmuv6x, any idea what's the reason and if we can show these on fmuv6x? 1680848994756.jpg

julianoes
julianoes previously approved these changes Apr 10, 2023
@vincentpoont2
Copy link
Member Author

@davids5 these Bat1_ parameters seems to be missing on fmuv6x, any idea what's the reason and if we can show these on fmuv6x? 1680848994756.jpg

@julianoes @dagar any idea why aren't there showing up? This parameters are also needed to setup ADS1115.

This is required to process data from the ADS1115 ADC and enables the
params BATx_I_CHANNEL and BATx_V_CHANNEL.

Testing is required whether this actually works on Pixhawk 6X though.

Signed-off-by: Julian Oes <julian@oes.ch>
@julianoes julianoes dismissed stale reviews from davids5 and themself via bf0c973 April 17, 2023 00:04
@julianoes
Copy link
Contributor

@vincentpoont2 I've added commit which also adds the battery_status module. This brings the channel parameters back that you asked for.

However, I don't have an ADS1115 module, so I could not test this. I don't know if it would actually work or if it conflicts with the digital INA power modules.

Could you test this on your side? And if you get conflicts, maybe consider disabling the SENS_INAxxx_EN params.

@vincentpoont2
Copy link
Member Author

@julianoes @mrpollo Tested on Pixhawk 6X and ADS1115, please Merge.

@julianoes
Copy link
Contributor

@dagar any objections?

@vincentpoont2
Copy link
Member Author

@julianoes can we merge this for 1.14?

@vincentpoont2
Copy link
Member Author

FMUv6x Flight controller do not have an internal analog to digital converter. User often need to use ADS1115 when using a analog PM. This should be enable so user can easily enabled/disabled using the ADC_ADS1115_EN parameter

https://docs.px4.io/main/en/modules/modules_driver.html#ads1115

@mrpollo mrpollo mentioned this pull request Jul 3, 2023
@mrpollo
Copy link
Contributor

mrpollo commented Jul 3, 2023

Closed in favor of #21792

@mrpollo mrpollo closed this Jul 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants