Skip to content

CLI Mixer Setup

Petri Mattila edited this page Apr 17, 2024 · 5 revisions

❗ This page is outdated

Rotorflight Wiki is replaced by www.rotorflight.org.


Rotorflight uses an internal mixer to combine various inputs to drive the motor(s) and servos on your helicopter. It can be called by typing mixer in the Configurator's Command Line Interface (CLI).

The inputs to the mixer can be direct radio control (RC) commands, stabilized inputs from the PID controller, or the motor governor feature. Those inputs will then be scaled and directed to various outputs like servos and motors using mixer rules.

It is important to note that the mixer uses custom rules that have a rule number associated with them, and that there are a maximum of 32 mixer rules. The mixer rules are evaluated in numerical order, but since the mixer rules we use just adds the values together, the order of the rules is not important. In this case the rule number is used only to reference the rules when removing or overwriting.

You must have completed the Servo Setup before proceeding with configuring the mixer.

Mixer inputs

The mixer input min/max are for setting the range for the flight controls, i.e. maximum allowed roll/pitch/yaw/collective.

NOTE! THIS IS THE RIGHT PLACE to limit your controls!

The mixer input rate is for setting the scaling factors to match the mechanical head setup. As every rotor head is different, different scaling values are needed for each setup. For example, when the FC requests 10deg collective, the scaling must be adjusted so that the blade angle actually is 10deg. See Mixer Calibration.

Example:

# input     IN   MIN   MAX  RATE
#--------------------------------
mixer input SR  -900   900   800
mixer input SP - 900   900   800
mixer input SC -1000  1000   900
mixer input SY -1000  1000   800

Mixer commands

The mixer rule settings define how the logical flight controls (pitch, roll, etc) are translated into servo commands (and motor commands, for a driven tail). The correct rules will depend on your swashplate and tail type.

The mixer input settings define the limits and scaling factors for the inputs (flight controls).

The mixer override command is used for setup and testing purposes. The values are not stored.

Please see CLI Commands for a full reference.

Mixer rules and motors

All configurations have a main motor, so make sure to add this to the rules.

mixer rule 10 set ST M1 1000 0 

It sends ST (stabilized throttle) to motor M1, the main motor.

If you're using a motor driven tail, send SY (stabilized yaw) to M2, the tail motor.

mixer rule 11 set SY M2 1000 0 

Mixer rules and swashplate setup

Note: If your swashplate responds backwards to pitch commands you must reverse the sign of the WEIGHT parameter for rules with an SRC of SP.

120deg 3-servo CP swash

120deg_swash_plate_3_servo_config.png

# rules    i  OP SRC DST WEIGHT OFFSET MODES
#--------------------------------------------
mixer rule 0 add  SC  S1   500    0
mixer rule 1 add  SC  S2   500    0
mixer rule 2 add  SC  S3   500    0
mixer rule 3 add  SR  S2   866    0
mixer rule 4 add  SR  S3  -866    0
mixer rule 5 add  SP  S1  1000    0
mixer rule 6 add  SP  S2  -500    0
mixer rule 7 add  SP  S3  -500    0
mixer rule 8 set  SY  S4  1000    0

140deg 3-servo CP swash

# rules    i  OP SRC DST WEIGHT OFFSET MODES
#--------------------------------------------
mixer rule 0 add  SC  S1   500    0
mixer rule 1 add  SC  S2   500    0
mixer rule 2 add  SC  S3   500    0
mixer rule 3 add  SR  S2   643    0
mixer rule 4 add  SR  S3  -643    0
mixer rule 5 add  SP  S1  1000    0
mixer rule 6 add  SP  S2  -766    0
mixer rule 7 add  SP  S3  -766    0
mixer rule 8 set  SY  S4  1000    0

135deg 3-servo CP swash

# rules    i  OP SRC DST WEIGHT OFFSET MODES
#--------------------------------------------
mixer rule 0 add  SC  S1   500    0
mixer rule 1 add  SC  S2   500    0
mixer rule 2 add  SC  S3   500    0
mixer rule 3 add  SR  S2   707    0
mixer rule 4 add  SR  S3  -707    0
mixer rule 5 add  SP  S1  1000    0
mixer rule 6 add  SP  S2  -707    0
mixer rule 7 add  SP  S3  -707    0
mixer rule 8 set  SY  S4  1000    0

90deg 3-servo CP swash

90deg_swash_plate_3_servo_config.png

# rules    i  OP SRC DST WEIGHT OFFSET MODES
#--------------------------------------------
mixer rule 0 add  SC  S1   500    0
mixer rule 1 add  SC  S2   500    0
mixer rule 2 add  SC  S3   500    0
mixer rule 3 add  SR  S2  1000    0
mixer rule 4 add  SR  S3 -1000    0
mixer rule 5 add  SP  S1  1000    0
mixer rule 6 add  SP  S2 -1000    0
mixer rule 7 add  SP  S3 -1000    0
mixer rule 8 set  SY  S4  1000    0

90deg 4-servo CP swash

90deg_swash_plate_4_servo_config.png

# rules    i  OP SRC DST WEIGHT OFFSET MODES
#--------------------------------------------
mixer rule 0 add  SC  S1   500    0
mixer rule 1 add  SC  S2   500    0
mixer rule 2 add  SC  S3   500    0
mixer rule 3 add  SC  S4   500    0
mixer rule 4 add  SR  S2  1000    0
mixer rule 5 add  SR  S4 -1000    0
mixer rule 6 add  SP  S1  1000    0
mixer rule 7 add  SP  S3 -1000    0
mixer rule 8 set  SY  S5  1000    0

90deg 2-servo FP swash

90deg_swash_plate_2_servo_config.png

# rules    i  OP SRC DST WEIGHT OFFSET MODES
#--------------------------------------------
mixer rule 0 add  SP  S1  1000    0
mixer rule 1 add  SR  S2  1000    0
mixer rule 2 set  SY  S3  1000    0

45/45deg 2-servo FP swash

# rules    i  OP SRC DST WEIGHT OFFSET MODES
#--------------------------------------------
mixer rule 0 add  SP  S1   707    0
mixer rule 1 add  SP  S1   707    0
mixer rule 2 add  SR  S2   707    0
mixer rule 3 add  SR  S2  -707    0
mixer rule 4 set  SY  S3  1000    0

Mixer Input Scaling Setup Procedure

For calibrating the mixer scaling, please follow the steps below.

  1. Turn on mixer input override This will force all inputs to a constant value.

    mixer override 0

  2. Set override to 66.6% on the axis to be calibrated (pitch in the following)

    mixer override SP 666

  3. Measure the pitch blade angle.

  4. Adjust the scaling rate until blade angle is 8deg

    For example - change pitch scaling to 800:

    mixer rate SP 800

  5. Repeat for all stabilized control axis

    • ROLL (SR)
    • PITCH (SP)
    • YAW (SY)
    • COLLECTIVE (SC)
  6. Turn off mixer override

    mixer override off

  7. Save / store new settings

NOTE! Yaw axis is rather difficult to measure, so a best guess is usually enough. It's not necessary to get it spot on, unlike the other axis.

Clone this wiki locally