Custom motor mixing calculator

I updated my motor mixing calculator to output the format expected by Ardupilot, to easily calculate the correct mixing for non-standard motor layouts:
https://www.iforce2d.net/mixercalc/

I actually did that a while ago but only just gave it a proper test yesterday:

“Non-standard” doesn’t mean you can put the motors anywhere you like, there are still these rules:

  • equal number of CW and CCW props
  • total moment arm of all motors of each rotation direction should be zero about both pitch and roll axes

… and for best results:

  • place CoG at the center of lift (average position of all motors)
  • keep rotational inertia in all axes as low as possible

The ‘moment arm’ thing might need a little more explanation. Add up the distances between each motor and the axis line (through CoG), using negative for one side and positive for the other. For example roll axis, if you have one motor on the left at 20cm away that would be -20, and two motors on the right each at 10cm away that would be 20, which totals to zero. This should be zero for all combinations, ie.
CW / roll
CCW / roll
CW / pitch
CCW / pitch

5 Likes

Hello, i have a hexa setup and i am using the same link you have mentioned.

I have tilt rotor VTOL setup, where there are 4 tilt rotors and 2 rotors near the CG for hover assistance.

The 2 rotors near the CG contributes only given 15% of the MTOW, while other four rotors shares total 85% of MTOW.

I put 6 rotors with proper direction and location, and generated a mixer file by selecting Arducopter.

source code from ardupilot ‘add_motor_raw(int8_t motor_num, float roll_fac, float pitch_fac, float yaw_fac, uint8_t testing_order, float throttle_factor)’ [line 500 in motorMatrix.cpp]

The code generate from the website:
add_motor_raw(AP_MOTORS_MOT_1, -1, 0.791, AP_MOTORS_MATRIX_YAW_FACTOR_CW, 1).

there is no throttle_factor. and how this roll (1) and pitch (0.791) are calculate?

Could you please share idea on how to add throttle_factor as the 2 rotors near CG take only 15% of MTOW?

1 Like

Thanks this is really helpful. But can you please give a hint as to how the mixer matrix roll factor and pitch factor elements are calculated. I initially thought that if I have the angle of the rotors say theta with respect to x axis of the airframe then roll factor = cos(90+ theta) and pitch factor = cos(theta) but it is not matching with populated matrix in the website. Can you please help me understand this?

@Dhruvil_Chavada The calculator does not handle props of different size. I think you can just adjust the throttle factor yourself though, if you have an estimate for the ratio of throttle that will give the same thrust for each prop type.

@sayan The roll and pitch factors will be the ratio of their distance from the CG, in their respective axis. Just reload the page so that no constraints exist, and move the motors around a bit while watching the output numbers, you can see how they adjust.

@iforce2d, Thanks for the information. But I could not fully understand this part “the ratio of their distance from the CG, in their respective axis”. Do you mean that there are separate axis(x and y) for each rotor? The ratio is the distance of the rotors with respect to x and y axis right from CG? I thought all the distance are measured with respect to CG but the x and y axis remains the same where the arrow’s direction of autopilot is the x axis and perpendicular to that is y axis.

Understood now, you are taking the projections of each motor’s distance from CG on x and y axis respectively and normalizing them with respect to the motor that has the highest effect on roll or pitch respectively.