» S

Motor Mixing Table Setup

QGroundControl for AQ (v1.2.0 and up) comes with a number of pre-defined mixing tables for various frame types.  But, there are no limits on how to configure the motors on an AutoQuad.  AQ will control any motor output you want — you just have to mix it on the right channel, with the correct direction and amount of output per axis.  The pre-defined mixes should serve as-is in most cases, but you always have the option to customize the outputs for your particular application.


Choosing which ports to use

AQ-frame-octo-plus Whether you choose a pre-defined or a custom mix, you also get to decide which ports you want your motors plugged into.  This is a departure from “typical” multicopter flight controllers which pre-define the ports used for various frame setups.  Usually you will want to choose the ports closest to your motors, to reduce cabling and possible interference, but you’re free to choose any ports you want.  That is why in AQ frame diagrams you will not see port numbers on the motors, but just letters instead to show the intended order of the motors.  The port numbering is up to you.

Note: If you are planning to control gimbal servos/motors from the AQ, you must be more selective in your port choices.  Please refer to more information on PWM frequencies . The QGC UI (v1.2.0+) will also validate that you do not have conflicting port selections.

Standard mixing setup

AQ-ports-config Motor output is configured on the Mixing & Output tab of QGroundControl for AQ.  To use one of the pre-defined frame types, simply make sure the Predefined radio button is selected and choose a frame type from the Frame Type options box below that.  You can leave the port numbers as they are, or customize them as you see fit.  Use the pictures for reference.  Although you can customize the numbers in each of the other columns, you probably don’t want to until you have a solid understanding of the mixing theory, and a good reason to adjust the outputs (more on this below).

If you want to define your own mix for a new type of frame, simply choose the Custom option, and then select the number of motors you need.  The rest of the setup is essentially the same.  You don’t get any frame image in the diagram, but you can load your own using the icon_folder_image button (ideally your image should be, or scale to, 200x200px, and have a transparent background).

Use the  icon_disk and icon_folder_table buttons to save and load configurations to/from your local file system.  Use the big Transmit to AQ button at the bottom so save your changes to AutoQuad (when connected).  If you want your changes saved to non-volatile memory on the AQ (to survive a restart), be sure to answer “Yes” to the resulting prompt.

Now simply connect your ESC signal inputs to the ports you set up for each motor, and be sure to set proper rotation direction for the motor/prop, as defined in the Yaw column and corresponding diagram.

Please note: When you connect to the AQ for the first time after starting QGC, it will load whatever configuration is currently on-board.  If you have made changes to the mixing table (or anything else), you will loose them unless they are saved to a file.  After the initial connection, the settings are only re-loaded when you hit one of the parameter Reload buttons elsewhere in the QGC UI.

Also: The provided frame diagrams will NOT update themselves to your configuration… for example if you reverse the yaw in your setup, or choose to follow a different motor order, the diagram will then be wrong.  Better to use a custom config in these cases to avoid confusion.

Motor mixing theory

The following sections will attempt to explain how to customize the mixing setup and why you might want to.  This may be a bit confusing at first, so look through the examples here and the mixing tables provided with QGC.  The arrows and +/- signs in the frame reference diagram are explained here.

What do those Throttle/Pitch/Roll/Yaw numbers in the table mean?  They correspond to the percentage of output given to that motor for each of the movement planes/axes.  The +/- part determines the direction of movement that motor influences (left/right/CW/CCW… more on that later). The absolute number, 0-100, corresponds to the percentage of the total given command for that particular control direction, which is decided by the internal AQ calculations.

So for example, say the AQ thinks it needs to give X amount of power to the pitch axis in order to move in a certain direction (or maintain a level attitude).  It will then try to distribute that X amount to each motor, as defined in the mixing table for the pitch axis.  If a motor is configured with a “100” for the pitch value, then 100% of the desired power will be applied to that motor to speed it up.  If zero is configured, then no pitch control would be applied at all.  (Ignore for now the mathematical conundrum that some motors have negative values… that is explained in more detail later.)

It is important to understand that the AQ has other controls to avoid saturation of the motors, mostly via PID settings and some internal checks.  So configuring a motor for “100%” doesn’t mean that 100% of all available power is sent to that motor.  With correct PID settings, the AQ takes care of proper overall power distribution (within physical limits, of course).

You might also ask why would we need more than 100% power per direction of movement?  To get there quicker, of course!  The more total power applied to the movement direction, the quicker the desired attitude is achieved.  More power also means better ability to fight wind and turbulence, or to recover from difficult situations.  Of course in some cases you may not need or want that power… read on.

Balancing your movements

Which brings us to WHY you might want to change the mixing table from just having +/-100 on each control. This varies depending on which control direction we’re talking about:

  • Throttle – There is probably no reason to reduce this from 100% unless you have a very overpowered setup, or have a frame where some motors need to provide less lift than others.  At any rate, you want to make sure these are evenly distributed across all motors, so the multicopter doesn’t lean violently when throttle is applied.  Note that the Throttle channel only takes positive values, since there’s no such thing as “negative” throttle (until we develop collective pitch control, perhaps 🙂 ).
  • Pitch and RollAQ-frame-hexa-x These are the most commonly adjusted values.  The reason is simple (sort of!)… the AQ has only one set of PID controls for both the roll and pitch axes.  As mentioned before, PID settings are important for overall power distribution.  Since we only have one set of these important controls, we need to ensure that the overall power available to the pitch and roll axes is equalized.  For example in a Hexa X setup, you have 3 motors per side affecting roll movement, but only 2 motors affecting pitch movement.  So, we can use the mixing table to limit the output to some motors in order to help make the roll and pitch rates more even, which in turn will help the PID settings do their job properly (actual example follows).
  • YawAQ-frame-octo-square-plus Again, there isn’t often much reason to change yaw output amounts.  But again the point here is to equalize the amount of power/torque in each control direction (clockwise and counter-clockwise).  If for example your CW props are bigger/steeper than your CCW props (for some strange reason), you would need to reduce their output, or your multi will yaw unevenly (and will struggle to maintain heading).  Or, consider the frame at right.  Since the outer motors have a larger influence on yaw than the inner motors, you would, theoretically, need to figure out how much less power they need than the inner motors.

Controlling movement direction

AQ-motor-mix-setup-reference-quad   The positive vs. negative signs simply control direction of movement.  For roll and pitch, imagine the multicopter divided into 4 quadrants, each having a + or – for both pitch and roll axes.  For yaw, it’s simply + for CCW, and – for CW rotation. Refer to the setup diagram on the left to determine which sign corresponds to which direction.

aq-quad-mixOn the right is the the simple mixing table for this quad.  In the diagram you can see that motors A and B lie in the “+” pitch direction, so in the mix table their numbers are positive.  On the other hand, the C and D motors lie in the “-” pitch direction, so their numbers are negative.  For Roll, A and D lie in the positive direction, while B and C are in the negative.  Since A and C rotate CW, they have negative yaw, while B and D have positive numbers.  Simple, right?

One more important thing about pitch, roll, and yaw, direction.  You want the totals of those columns to add up to zero.  Otherwise you will most likely have a serious imbalance problem.  The QGC UI keeps a running total of the columns for you, and warns you if you they are not correct.  When the AQ boots it will also issue a warning message if it detects an imbalance.  However, neither will prevent you from actually flying with an imbalanced setup if you really want to!

Putting it all together (practical examples)

Hexa X

AQ-motor-mix-setup-reference-hexaOK, let’s take a closer look at that Hexa X mix as an example.  We have 2 motors per side on the pitch axis, and 3 per side on the roll axis.  If we set them all to 100%, the multicopter will roll faster than it can pitch.  This might work OK in some situations, but it’s probably not ideal.

aq-hexa-x-mixTo balance the axes movement rates, we simply reduce the output of some of the roll motors.  There are many ways to achieve this, but the simplest is to reduce the roll output to A, B, D, and E by 50%.  Now we have 200% total output in each direction on roll as well as pitch axes.

Hexa H

AQ-motor-mix-setup-reference-hexa-h aq-hexa-h-mixHere’s another interesting example where we need to adjust the yaw balance as well. You can see this example is essentially the same as the Hexa X, above, but the F and C motors are much closer to the center of the frame than the other 4.  If you give all the motors 100% yaw influence, whenever you yaw, the hexa will want to roll to one direction or the other.  For example if you yaw to the left, CCW, B, D, and F motors will speed up, while the other slow down.  Now you have 2 motors on long arms trying to roll the hexa to the left, and only one motor on a short arm to counteract that movement.  Obviously, not so good.  The answer, of course, is to reduce the yaw output of the outer motors so they don’t throw the hexa off balance every time you yaw.

Further reading

Motor mixing is not always a simple subject and much discussion has surrounded it.  Some people have found it easier or more intuitive to tune an AQ’s performance by using the mixing table settings.  Generally it has been found that unless you have one of the conditions described above, it is better to use as much output per motor as possible.  There are exceptions to this rule, for example some very light or overpowered multicopters might need to lower some outputs to prevent over-control.  One interesting set of findings has been published by team member Angel (afernan) in this document, following a lengthy diagnostic process described in this forum thread.  As always, use your best judgement, and experiment carefully!

This page was created on 17-Jun-12 by MaxP. Last modified on 10-Oct-14 by MaxP.