Understanding PX4 mixing

Greetings. I apologize for the long question. I am trying to learn how create mixer files that work with px4. So as a first step I wanted to create a mixer for a simple quadrotor.
I calculated the mapping, M, transforming the motor thrusts,fi, into collective thrust, f, and torque, u, (using the east,north,up frame) as:
[f; u]=M*[f1;f2;f3;f4], M=[1,1,1,1;
lx,-lx,lx,-lx;
-lx,lx,lx,-lx;
-ct,-ct,ct,ct]
I tried to use this together with https://dev.px4.io/v1.9.0/en/concept/mixing.html to design the mixer however I could not achieve stable flight. Not even close.
I also tried to use M^{-1}, calculate f_i i=1,…,4 and then send the commands directly to each actuator by creating a mixer that feeds each actuator with a specific signal only. This showed some promise however the results were not good enough. So through this process I saw that there is a number of things that I could not understand how they work in px4:

  1. The body fixed frame in px4 is the east,north,up (ENU) or the north,west,down (NWD)? In the modules I see that a roll-pitch-yaw sequence is used thus implying that the NWD frame is used. Is this true or are there some instances that the ENU frame is used also?
  2. Since the propeller spinning direction is predetermined in px4, what do I do with the last row of the mapping M above.
  3. Also I am a bit confused on how the mixer takes into account the fact that the motors spin only towards a specific direction and also the distance of the motor from the CM. How do I pass this information using the building blocks of a mixer file:

M: 1
S: 0 3 10000 10000 0 0 10000

for example above I assumed that the the value of the 7th column should be zero since the motor doesn’t spin backwards. However I was not successful to build a mixer using summing blocks.
The same holds if I tried to interpret the yaw command using the summing block. I do not know how to include the ct information:

S: 0 2 10000 10000 0 -10000 10000

  1. Do I need to find an idle spinning velocity and use that in the

option in order for the negative commands to work?
5. Also I have seen the multirotor mixer definitions

R:

and observed that there is a mixer library that generates automatically the mixer files however I could not find any documentation on how to do this. I also noticed that the arm lenght of each vehicle is included in the definition however I could not find the generated mixer files that would allow me to study and learn how to create my own.
6. Finally are there any tutorials or documentation on mixer creation or automatic definition (other than https://dev.px4.io/v1.9.0/en/concept/mixing.html)?
I would like to start slow and create a mixer for a simple quad however the end goal is using vast px4 capabilities for a more complicated vehicle. #general #random (edited)

@bkueng Do you think that you could advise here? Note, I already pointed @ramp to the current version of the docs.

Very good question.
Here: How to replace mc_att/rate_control and other modules for quadrocopter?
my question is also about understanding of how the mixer working. I would like to know the formula of transformations from actuators values to the motor PWM values.
Thanks.

This looks like another case of the missing .toml mixer geometry documentation.
@ramp essentially there are mixer geometry files in src/lib/mixer/MultirotorMixer/geometries from where the mixer matrix is generated. This is then used in the mixer file with R: <geometry>.

Thank you very much for replying. The current documentation implies that control allocation is done using mixer files exclusively. However I now understand that geometry files are an important step in the process and they are used together with the mixer files like @bkueng explained. Following the steps as explained in the following slide (recommended by @jlecoeur) :

I was able to create a quadrotor mixer file correctly and have stable flight.
Thanks @bkueng @jlecoeur

Will this work for a a decacopter (10 motors fixed in space)?