Motor mixing and why it’s important.
Not all quads are equal, literally. Some have layouts and motor locations different than others and this can mean that the stock motor mix that comes with cleanflight and baseflight isn’t always the best mix for your particular application. While the stock tuning methods using the boxed motor mixes that comes with these applications is good for most people, Some people tend to have issues with PID Tuning because their motor mix is off. These issues can become especially apparent when you begin to incorporate hex and octo layouts. The stock mix for all of these layouts assume that all of the motors are equally spaced from a center point.
As you begin to get into advanced multi rotor design, you will probably want to build a custom mix for your quad as it can make tuning a breeze, and make your quad fly much better.
Some examples of multi rotors that don’t have a symmetric design and require a custom mix are the TBS Discovery, ZMR 250, Sparrow, Sparrow Hex and the QAV250. They are not perfect X configurations.
How to figure out the motor mix
I like to use the application that was created by Iforce2D. This application works really well for setups that don’t have angled motors, And it works for most people except for people that are building tricopters. Best of all, it’s free. (thanks Hydra)
[button link=”https://www.iforce2d.net/mixercalc/” type=”big” color=”green” newwindow=”yes”] Click here to open the motor mixing calculator in a new tab.[/button]
Pretty much all that you need is a ruler to get started with your motor mix calculations. You simply have to measure the distance from one motor to another and set those constraints for each motor. Each motor should have three constraints in order for the mixing calculator to work properly.
This video shows how to use the mixing calculator:
Putting it all together:
Once you have figured out what you’re Cmix is, you’ve got to put it into your flight controller application of choice. I like to use Baseflight for my builds because that’s the official software that is supported by the Naze32 which is my go-to FC.
This is an example of the settings that I got recently from calculating the motor spacing on the Sparrow Hex.
You can see from the picture that the sparrow hex is not a conventional hexa copter and therefore requires a custom mix because the motors are not equidistant from a center point.
I ran the calculations found at the Iforce2D website and this was the result:
Granted, I did take trigonometry, and pass with flying colors, but this tool really makes all of that time spent memorizing sohcahtoa seem useless.
The next step is to import your calculations into the CLI of you flight controller software:
What we ended up with for the Sparrow hex were these values:
mixer CUSTOM
cmix 1 1.000 -0.567 1.000 1.000
cmix 2 1.000 -0.561 -0.990 1.000
cmix 3 1.000 0.583 0.987 -1.000
cmix 4 1.000 0.567 -0.989 -1.000
cmix 5 1.000 -0.835 -0.014 -1.000
cmix 6 1.000 0.813 0.005 1.000
Put these values here:
If all went well, you should see an OK for your sanity check.
Now, before you go and try to fly, make sure that your props are removed and then test the motors to make sure that you got them in the right place and right rotation. If they don’t match your cmix diagram, try again.
If you are using cleanflight, you do not have to change the word cmix to mmix. Thank goodness there is some congruency between these two platforms.
Here it is in Cleanflight:
Why this works
The way it works is, motors that are placed further away from the centre of gravity will require a greater amount of thrust to travel the same distance as a motor that has been placed near to the centre of gravity.
So if you look at a standard mix you will see this:
cmix 1 1.000 -1.000 1.000 -1.000 (Rear Right motor) cmix 2 1.000 -1.000 -1.000 1.000 (Front Right motor) cmix 3 1.000 1.000 1.000 1.000 (Rear Left motor) cmix 4 1.000 1.000 -1.000 -1.000 (Front Left motor)
Essentially what we see it that each motor is mixed with 100% of the force applied.
each motor’s individual mix can be viewed as shown:
cmix [motor number] [throttle] [roll] [pitch] [yaw]
If yaw is negative, the motor will spin clockwise.
When we modify these values, we change the amount of force that is applied to each motor.
I won’t go into more details on motor mixing in this post, Ill save it for the future.
Please subscribe to our updates to get info about future posts!
Conclusion
After running a custom mix, I was amazed to find out how much better in my Sparrow Hex flew on stock PIDS. Essentially any quadcopter or multi-rotor that has motors that are not equidistant to a center-point should have a custom mix. Try it for yourself and you’ll see!
That should do it, Go out and fly!
About the Author
Anthony Jacobs is a quadcopter enthusiast that has made it his mission to help others find valuable information about these machines. He has found that the learning curve for this hobby is extremely steep, and that you have to sort through tons of forums and blogs and websites to find the right combination of parts. There is no standard for testing of parts, and there is no real science behind what people think is good or bad. Anthony decided to build QuadQuestions so that he can give you a mind dump, and help you find the parts that work well without having to spend an eternity on the forums, or sorting through a mountain of parts.
adam.featherstone68
Hi Mate,
Just an observation, your commands are out of date, cmix is now mmix
admin
Are you sure about that? The latest version of Cleanflight wouldn’t accept mmix commands but took Cmix commands instead. Note that it says # cmix in the output.
admin
I agree, it used to be Mmix but it looks like they have changed it. Thank goodness there is finally some standardization between platforms.
adam.featherstone68
Good point, thinking about only used betaflight over last 2 months, definitely mmix in bf, thought it had been picked up from cf, was a change to stop confusion between the different mixers (it being motor mix), could have sworn I saw it in the cleanflight section of GitHub but looks like I am wrong
Villy Feltmann
and another thing is that mmix now start from version 1.1.0 with zero not one:
mmix 0 1 -1 0.752 -1
mmix 1 1 -1 -0.752 1
mmix 2 1 1 0.752 1
mmix 3 1 1 -0.752 -1
ciberdiego Gmail
Hello, i made a motor mix in cleanflight to change the config from openpilot to clean, but when i go to motors and test number 1 the motir that throttle is the back left, why???
Derrick Mitchell
I can not type these commands in correctly, I keep getting unknown commands. Help me please.
admin
What software are you using? Cleanflight? What version?
Derrick Mitchell
Betaflight on a 500 vtail. In addition to that I have tried all kinds of PID numbers but can not get it to hover at one level, it bounces.
Derrick Mitchell
Someone give me some stable PID settings for a 500 v tail. I know it has gotta be someone out there that knows.
Derrick Mitchell
Can someone help me?
admin
Derrick, there probably isn’t a formula for you that will make your V-tail fly well magically. You will have to tune it- there are plenty of pid tuning videos on the web that can help. I recommend asking your question at ask.quadquestions.com. Post photos there if your build and perhaps a video of the quad “bouncing”. Our experts can help you there.
Derrick Mitchell
Sounds like a good place to start, thank you.
ZMX Fusion X20 2300kv Motor Test and Review - Quad Questions
[…] Multi-rotor Motor Mixing and why it’s important […]