Is possible to swap motor PWM outputs in software rather than physically switching motor servo inputs?
For instance, motor 1 output is mapped to motor 3 on my quad_x. Can I, in software (at compile time or as a configuration parameter), map motor 1 signal to motor 3’s PWM output pin and visa versa?
If it isn’t currently possible, I’ll just rewire the motor outputs correctly - I am mostly asking out of curiosity.
- Using px4fmu-v3
- Configured OUTPUT_MODE to
fmu (rather than the default OUTPUT_MODE
The only place in the code that I’ve found where I can change the motor output pin is in the
src/drivers/boards/px4fmu-v2/board_config.h file. @dagar Is the only option for swapping motor output pins if I modify the following configuration (
/* User GPIOs
* GPIO0-5 are the PWM servo outputs.
#define GPIO_GPIO0_INPUT (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTE|GPIO_PIN14)
#define GPIO_GPIO1_INPUT (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTE|GPIO_PIN13)
#define GPIO_GPIO2_INPUT (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTE|GPIO_PIN11)
#define GPIO_GPIO3_INPUT (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTE|GPIO_PIN9)
I.e. if I swap
GPIO_PIN11 and recompile, will the motor output for motor 1 and motor 3 be swapped? If so, is this the only method for swapping motor outputs in software?
I don’t think I’m following. Why is this necessary? Hacking the mixer would be slightly easier.
One of the solutions is written here: Change motor layout for quad