Send PWM for landing gear via the 7th MAIN output

We are using a Pixhawk 4 with its provided power management board to control a hexacopter. We would like to use the 7. MAIN output for sending a PWM to the landing gear (with the landing gear switch). I’m looking to somehow use this information.

I see two options:

  1. Option: Change the hexa_x.main.mix and then reflash the Pixhawk. The new hexa_x.main.mix would look like this:
R: 6x
M: 1
O:      10000  10000      0 -10000  10000
S: 0 7  10000  10000      0 -10000  10000

OR

  1. Option: Use the “mixer load” functionality in QGC by loading a custom “gear.mix”:
Z:
Z:
Z:
Z:
Z:
Z:
M: 1
O:      10000  10000      0 -10000  10000
S: 0 7  10000  10000      0 -10000  10000

Could you please let me know if any of these options would work or if I’m missing something?

So, I have tried the 2. Option with the following config file and saving the mixer under /etc/mixers with the name gear_7.main.mix.

set MIXER gear_7
set PWM_OUT 7
set PWM_DISARMED 1500
set PWM_MIN 1000
set PWM_MAX 2000
set PWM_RATE 50

I can see the output of 1000 under the servo7_raw in QGC. However, QGC gives me the following complaint and doesn’t change the value when I switch the landing gear switch.

qrc:/qml/QGroundControl/Controls/ToolStrip.qml:100:21: Unable to assign [undefined] to bool

Any help?

Have you tried assigning AUX1 or AUX2 to a radio channel and that channel to a switch?
Then connect the servo to it?

Thanks for your response. Yes, I did. I tried both the landing gear switch and the RC passthrough by setting them to the corresponding channels of my RC. I tried sending the signal to the MAIN as well as the AUX channel before. Sending it to MAIN worked, but then the motors no longer got a signal. Probably because the mixer from the SD card was conflicting with the PX4 mixer loaded for hexa_x. Since I was looking for a solution that didn’t involve flashing the Pixhawk, sending the signal to the MAIN outputs does not appear to be an option.

When I tried to get it to work for the AUX channels, I wasn’t able to get any signal on the PWM outputs. I checked “px4io monitor” in the mavlink shell and the signal shows up for the RC input and the control groups, but the PWM outputs do not change at all. I’m using a Pixhawk 4 with their development code (1.9.2dev), so I’m not sure if there is something going on with their code. I would assume that with the standard hexa_x configuration the first AUX passthrough that you can set in QGC should already show up on the AUX outputs, but it doesn’t for me.

Just wondering is there a special reason you are using an old build?

Just convenience. I was hoping to do it without flashing. I have resorted to a different option by now. Thanks for your help though!