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
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.