Wrong motors mapping

I just flashed a new Kakute H7 with latest firmware and 2 motors are mapped on the same one and one of the 4 motors won’t spin. Essentially in QGC when I raise ALL slider just 3 motors spin, and when I raise each slider 2 spins the same motor.

I tested the Tekko32 ESC and works great with Betaflight so the wiring is correct but I can’ make it to work with PX4.

I would like to know where in PX4 the 4 motors are mapped for the Kakute H7?

I’m looking at the timer_config file here: PX4-Autopilot/boards/holybro/kakuteh7/src/timer_config.cpp at 937998b739b9ffa0b2dc1aba97d20096a06b45af · PX4/PX4-Autopilot · GitHub

You should QGroundControl and the Motors page to configure the mapping

I configured the motors for a quadcopter airframe, set the DShot300 protocol, assigned to each of the 4 PWM MAIN the 4 motor functions, and rebooted.

Then I tested the motors by pulling up the ALL slider in the ACTUATORS page of QGC, and only 3 motors spun: one spins much faster than the other two, and another spins twice, so it is activated using 2 different sliders during the assignment phase. Essentially, when I use each slider, 2 sliders activate the same motor, so there are a total of 3 motors spinning during the “Identify & Assign” process.

I think something is going on with mapping of the motos in PX4 for Kakute H7 FCU. Where can I verify that?

@JulianOes is the best one to ask about KakuteH7

1 Like

I tried to download the bootloader.hex from Holybro: Supported Firmware | Holybro

And make the latest firmware(1.15.4 and 1.16.0beta), but I’m looking at the same issue. One motor spins faster, and another is activated with 2 sliders during the motor assignment phase. In total, just three motors spin.

This is my Actuators tab:

Oh that doesn’t sound right. Sorry, I was out of office but back now.

Can you just confirm which Kakute H7 this is? I assume the v1.3?

I’ll try to replicate this later today or tomorrow.

The board I’m using is a Kakute H7 v1.2 + Tekko32 4in1 ESCs am32. I also tried with the BLHeli32 ESCs version but I get the same motors overlapping.
Thanks

Ok thanks. I’m trying to reproduce this on my KakuteH7 v1.3 with some 4in1 BLHeli32 ESC and I can’t see the problem. I tried both PX4 from todays main branch as well as stable/v1.15.4 flashed via QGC.

I have M1 to M4 connected, plus GND. Given the timer_config you mentioned above, I’d be very confused how you see this happen.

When you do a param show -c to check all changed params, does anything odd show up? I’m trying to make sure that it’s not some leftover flash data messing with parameters, which was only fixed with [Sponsored by CubePilot] Params in flash erase fixes by julianoes · Pull Request #24371 · PX4/PX4-Autopilot · GitHub.

And I’m testing this without bidirectional DShot because that only works for the first timer at the moment, so M1 and M2.

I’m with a Kakute H7 v1.2 + TEKKO32_4IN1_F421 am32 firmware 2.18
The process I followed to flash the FCU:

  • I used STM32 Cube Programmer to erase the full chip memory and flash the bootloader.HEX from Holybro site here: Supported Firmware | Holybro

  • Next, I used QGC to flash the firmware v1.15.4

  • Then in the Actuators tab I assigned motors protocol and reboot: set to DSHOT600 and assigning actuators to rispective functions (e.g. Main1:Motor1,…)

  • Check parameters
    NuttShell (NSH) NuttX-11.0.0
    nsh> param show -c
    Symbols: x = used, + = saved, * = unsaved
    x + CAL_GYRO0_ID [41,135] : 2162722
    x + CAL_GYRO0_PRIO [42,136] : 50
    x CAL_GYRO0_ROT [43,137] : -1
    x + CAL_GYRO0_XOFF [44,138] : 0.0028
    x + CAL_GYRO0_YOFF [45,139] : 0.0384
    x + CAL_GYRO0_ZOFF [46,140] : 0.0001
    x + PWM_MAIN_FUNC1 [621,1166] : 104
    x + PWM_MAIN_FUNC2 [622,1167] : 101
    x + PWM_MAIN_FUNC3 [623,1168] : 102
    x + PWM_MAIN_FUNC4 [624,1169] : 103
    x + PWM_MAIN_MAX1 [629,1174] : 1900
    x + PWM_MAIN_MAX2 [630,1175] : 1900
    x + PWM_MAIN_MAX3 [631,1176] : 1900
    x + PWM_MAIN_MAX4 [632,1177] : 1900
    x + PWM_MAIN_MIN1 [637,1182] : 1100
    x + PWM_MAIN_MIN2 [638,1183] : 1100
    x + PWM_MAIN_MIN3 [639,1184] : 1100
    x + PWM_MAIN_MIN4 [640,1185] : 1100
    x + PWM_MAIN_TIM0 [646,1191] : -3
    x + PWM_MAIN_TIM1 [647,1192] : -3
    884/1785 parameters used.

  • Again, just three motors spin and sliders Motor2 and Motor3 activate the same brushless. Even when in the process of assigning the motors, it spins twice the same motor.

Is there something you are doing differently? How can I check/test the motor-function mapping from the MAVLink Console in QGC?

That’s so odd.

Pretty similar to what I had configured, just different order of the motor functions.

What’s the output of dshot status?

dshot status
INFO  [dshot] Outputs initialized: yes
INFO  [dshot] Outputs used: 0xf
INFO  [dshot] Outputs on: yes
dshot: cycle: 217777 events, 4110004us elapsed, 18.87us avg, min 16us max 75us 2.411us rms
INFO  [mixer_module] Param prefix: PWM_MAIN
control latency: 217786 events, 51647482us elapsed, 237.15us avg, min 215us max 579us 42.212us rms
INFO  [mixer_module] Switched to rate_ctrl work queue
Channel Configuration:
Channel 0: func: 104, value: 0, failsafe: 0, disarmed: 0, min: 109, max: 1999
Channel 1: func: 101, value: 0, failsafe: 0, disarmed: 0, min: 109, max: 1999
Channel 2: func: 102, value: 0, failsafe: 0, disarmed: 0, min: 109, max: 1999
Channel 3: func: 103, value: 0, failsafe: 0, disarmed: 0, min: 109, max: 1999
Channel 4: func:   0, value: 0, failsafe: 0, disarmed: 0, min: 109, max: 1999
Channel 5: func:   0, value: 0, failsafe: 0, disarmed: 0, min: 109, max: 1999
Channel 6: func:   0, value: 0, failsafe: 0, disarmed: 0, min: 109, max: 1999
Channel 7: func:   0, value: 0, failsafe: 0, disarmed: 0, min: 109, max: 1999
INFO  [dshot] telemetry on: /dev/ttyS5
INFO  [dshot] Number of successful ESC frames: 35319
INFO  [dshot] Number of timeouts: 1833

Do you see anything wrong in building the firmware?

make holybro_kakuteh7
-- PX4_GIT_TAG: v1.16.0-rc1-3-g9cf3e83197
-- Found PythonInterp: /usr/bin/python3 (found suitable version "3.10.12", minimum required is "3") 
-- PX4 config file: ./PX4-Autopilot/boards/holybro/kakuteh7/default.px4board
-- PLATFORM nuttx
-- TOOLCHAIN arm-none-eabi
-- ARCHITECTURE cortex-m7
-- ROMFSROOT px4fmu_common
-- SERIAL_GPS1 /dev/ttyS3
-- SERIAL_TEL1 /dev/ttyS0
-- SERIAL_TEL2 /dev/ttyS1
-- SERIAL_RC /dev/ttyS4
-- ROOT_PATH /fs/microsd
-- PARAM_FILE /fs/mtd_params
-- PX4 config: holybro_kakuteh7_default
-- PX4 platform: nuttx
-- The CXX compiler identification is GNU 10.3.1
-- The C compiler identification is GNU 10.3.1
-- The ASM compiler identification is GNU
-- Found assembler: /usr/bin/arm-none-eabi-gcc
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/arm-none-eabi-g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/arm-none-eabi-gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Enabling double FP precision hardware instructions
-- cmake build type: MinSizeRel
-- ccache enabled (export CCACHE_DISABLE=1 to disable)
-- ROMFS: ROMFS/px4fmu_common
-- ROMFS:  Adding platforms/nuttx/init/stm32h7/rc.board_arch_defaults -> /etc/init.d/rc.board_arch_defaults
-- ROMFS:  Adding boards/holybro/kakuteh7/init/rc.board_defaults -> /etc/init.d/rc.board_defaults
-- ROMFS:  Adding boards/holybro/kakuteh7/init/rc.board_sensors -> /etc/init.d/rc.board_sensors
-- ROMFS:  Adding boards/holybro/kakuteh7/init/rc.board_extras -> /etc/init.d/rc.board_extras
-- Found GDB: /usr/bin/gdb-multiarch
-- Configuring done
-- Generating done
-- Build files have been written to: ./PX4-Autopilot/build/holybro_kakuteh7_default
[0/1192] git submodule src/modules/uxrce_dds_client/Micro-XRCE-DDS-Client
[5/1192] git submodule platforms/nuttx/NuttX/nuttx
[9/1192] git submodule src/drivers/gps/devices
[12/1192] git submodule src/modules/mavlink/mavlink
[114/1192] Generating nuttx/arch/arm/src/libarch.a
chip/stm32_gpio.c:47:11: note: '#pragma message: CONFIG_STM32H7_USE_LEGACY_PINMAP will be deprecated migrate board.h see tools/stm32_pinmap_tool.py'
   47 | #  pragma message "CONFIG_STM32H7_USE_LEGACY_PINMAP will be deprecated migrate board.h see tools/stm32_pinmap_tool.py"
      |           ^~~~~~~
[1190/1192] Linking CXX executable holybro_kakuteh7_default.elf
Memory region         Used Size  Region Size  %age Used
        ITCM_RAM:          0 GB        64 KB      0.00%
           FLASH:     1767476 B      1792 KB     96.32%
       DTCM1_RAM:          0 GB        64 KB      0.00%
       DTCM2_RAM:          0 GB        64 KB      0.00%
        AXI_SRAM:       40200 B       512 KB      7.67%
           SRAM1:          0 GB       128 KB      0.00%
           SRAM2:          0 GB       128 KB      0.00%
           SRAM3:          0 GB        32 KB      0.00%
           SRAM4:          0 GB        64 KB      0.00%
          BKPRAM:          0 GB         4 KB      0.00%
[1192/1192] Creating ./PX4-Autopilot/build/holybro_kakuteh7_default/holybro_kakuteh7_default.px4

I suspect that the version of the FCU hardware is causing this mismatch. I ordered a Kakute H7 V1.3 since V2 is hard to find.

That’s my only guess at this point. @Vincentpoont2 any hints what changed between KakuteH7v1.2 to v1.3?

@JulianOes, Could you please share the exact process and program you would use to flash the FCU from Betaflight to the latest PX4 version? Thanks

I’m just using dfu-util to flash the bootloader as documented here:

And I do the additional erase step.