Hi all,
New to the PX4 software stack, been trying to get it running on a Pixhawk 2.1 cube black. Ultimately I need to use all 14 channels for servo PWM outputs, but for now just focusing on getting a single channel to move.
I am building a custom image based on V1.11.1, with just custom airframe and mixer files built in (added to ROMFS before build). The airframe calls init.d/rc.mc_defaults and all I’m trying to achieve at this point is having the throttle output (a servo) react to changes in the throttle stick on my RC.
I have an FrSky Taranis-plus RC with X8R receiver connected to RCin, piping the channels over SBus to the Pixhawk. I have set up my RC channels through QGC, and have verified in both QGC and by observing the appropriate uorb topic that my RC inputs are properly detected.
I have verified that I can directly command the servo (MAIN CH1) using ‘pwm test …’
I am able to ARM/DISARM just fine, and have disabled the safety switch / pre-arm functionality entirely.
I have also verified that the attitude and rate controller modules are running as expected, and the uorb topic actuator_controls is updated in response to changes in my RC inputs. However, monitoring actuator_outputs shows they remain fixed.
This suggests to me that there is something wrong with my mixer, but I cannot figure out what exactly is going on. Here is my (main) mixer file – again, I’m only focused on the throttle (channel 1) outputs at the moment.
Throttle
-----------------
M: 1
O: 10000 10000 0 -10000 10000
S: 0 1 0 10000 0 -10000 10000
EjectorFrPitchDown
--------------
M: 1
O: -10000 -10000 0 -10000 10000
S: 0 0 20000 0 10000 -10000 10000
EjectorFrRollRight
-------------
M: 1
O: -10000 -10000 0 -10000 10000
S: 0 0 20000 0 10000 -10000 10000
EjectorRrRollRight
------------
M: 1
O: 10000 10000 0 -10000 10000
S: 0 0 10000 10000 0 -10000 10000
EjectorRrPitchUp
------------
M: 1
O: 10000 10000 0 -10000 10000
S: 0 0 10000 10000 0 -10000 10000
EjectorRrRollLeft
------------
M: 1
O: 10000 10000 0 -10000 10000
S: 0 0 10000 10000 0 -10000 10000
EjectorFrRollLeft
------------
M: 1
O: 10000 10000 0 -10000 10000
S: 0 0 10000 10000 0 -10000 10000
CSurfFrPitch
------------
M: 1
O: 10000 10000 0 -10000 10000
S: 0 0 10000 10000 0 -10000 10000
And here is my airframe file:
#!nsh
#
# @name Foobar
#
# @type Custom
# @class Custom
#
# @output MAIN1 T3 - Throttle
# @output MAIN2 B1 - EjectorFrPitchDown
# @output MAIN3 B2 - EjectorFrRollRight
# @output MAIN4 B3 - EjectorRrRollRight
# @output MAIN5 B4 - EjectorRrPitchUp
# @output MAIN6 B5 - EjectorRrRollLeft
# @output MAIN7 B6 - EjectorFrRollLeft
# @output MAIN8 G1 - CSurfFrPitch
#
# @output AUX1 G2 - CSurfRrPitch
# @output AUX2 S2 - CSurfFrRt
# @output AUX3 S4 - CSurfFrLt
# @output AUX4 S6 - CSurfRrRt
# @output AUX5 S8 - CSurfRrLt
# @output AUX6 K3 - Kill
#
# @maintainer Alex Volkov <volkov@motivo.com>
#
sh /etc/init.d/rc.mc_defaults
set MAV_TYPE 2
set MIXER foobar
set PWM_OUT 12345678
set MIXER_AUX foobar_aux
set PWM_AUX_OUT 123456
set PWM_RATE 100
set PWM_AUX_RATE 100
Been trying to figure this out for a few days now but just can’t seem to get it. Does anyone have any suggestions? Am I missing something obvious?