How to add X and Y control in custom airframe/mixer

Hi Riccardo, well done on setting up your custom mixer. I still don’t understand how to implement a custom mixer for a multicopter following the guidance on the px4 website. Could you please point me to an example of a mixer (preferably one with a servo) which I can use as a working example? Thank you.

EDIT:
So after a nice long chat with @RicardoM17, I have some idea of how mixing works. This is to confirm that I understood correctly and for any one in the future who stumbles on this post like I did.

So let’s take an example with the quadrotor in + configuration, where the numbering starts from the top (motor 1) then to the right (motor 2), and then the bottom (motor 3) and finally ends at the left (motor 4).

The mixer file can contain something like the following:
Motor 1

M: 3
S: 0 1 10000 10000 0 -10000 10000
S: 0 2 -10000 -10000 0 -10000 10000
S: 0 3 10000 10000 0 -10000 10000

  • here, the first line M:3 means, the motor takes in 3 inputs.
    -The next line S: simply declares a mixer. The next no. 0 implies actuator control group #0 - flight control (see Mixing and Actuators · PX4 Developer Guide).
    -the next no 1. signifies the ‘pitch’ channel,
    -the next two nos., each 10000 represent scaled values of the input (-1…1). In this case motor 1 will increase speed in order to ‘pitch up’.
    -For the last three numbers, the first is a 0, which is just an offset, the next two specify min and max output values typically -1 to +1 represented as scaled values of -10000 and 10000.

  • The second and third lines have similar values as described already. the difference is the numbers ‘2’ and ‘3’ after the actuator control group #0 specification. This stands for ‘yaw’ and ‘thrust’ respectively as also given here Mixing and Actuators · PX4 Developer Guide

It follows similar idea for the remainder of the motors.

Motor 2
M: 3
S: 0 0 -10000 -10000 0 -10000 10000
S: 0 2 10000 10000 0 -10000 10000
S: 0 3 10000 10000 0 -10000 10000

Motor 3

M: 3
S: 0 1 -10000 -10000 0 -10000 10000
S: 0 2 -10000 -10000 0 -10000 10000
S: 0 3 10000 10000 0 -10000 10000

Motor 4

M: 3
S: 0 0 10000 10000 0 -10000 10000
S: 0 2 10000 10000 0 -10000 10000
S: 0 3 10000 10000 0 -10000 10000

Hope that helps, and if anything is off, for those who are more experienced in this, kindly correct me. Thank you.