Hi everyone, I’ve been looking into the code behind specific air frame configurations, and the generated scaling values that make them “unique” to other crafts.
I stumbled upon the “multi_tables.py” script which generates the “mixer_multirotor.generated.h” file temporarily. From examining the code, I see that it generates a RollScale, pitchScale, yawScale and thrustScale for each motor on a craft, based on that motors angle from the front of the craft. I wanted to look into the numbers it generated, but I started confusing myself on what those numbers actually mean. I understand that the roll and pitch scales are generated by doing the cos of the angle (from the front of the craft), and the cos of the angle+90, but I’m confused as to why these numbers are correct.
Here’s how I’m looking at it.
I’m imagining a craft that looks like this from a top down view… (obviously not perfectly to scale as far as the angles are concerned, but it should do)
I input a craft called example_x into the “multi_tables.py script” like so,
example_x = [
[ 67.5, CCW],
[ -115, CCW],
[ -67.5, CCW],
[ -115, CCW],
]
and it generates this corresponding output to the “mixer_multirotor.generated.h” file
const MultirotorMixer::Rotor _config_example_x[] = {
{ -0.923880, 0.382683, 1.000000, 1.000000 }, #motor 1
{ 0.906308, -0.422618, 1.000000, 1.000000 }, #motor 2
{ 0.923880, 0.382683, -1.000000, 1.000000 }, #motor 3
{ -0.906308, -0.422618, -1.000000, 1.000000 }, #motor 4
};
# ^ ^ ^ ^
#RollScale, pitchScale, yawScale thrustScale
I’m confused as to why the roll scale is higher than the pitch scale. Shouldn’t it be that when the motors are interacting in a roll the forces are “further out” out from the center of gravity, and thus have more leverage to take advantage of, requiring less of a change in thrust to execute the roll?
The only thing that makes me question MY thought process, is that the “further out” roll interaction needs to lift the motors physically further than the “shorter” pitch interaction. This being because the arc-length they must travel to transfer an equal amount of propeller force inwards towards the craft is much longer than that of the the pitch.
These are my two theories on where the scaling values are coming from, my gut tells me the first one should be right, but the data seems to favor the second theory.
I’d love if someone could let me know which theory is correct, (or if they’re both wrong)!
Thanks in advance,
Vergil-SI