CLI Mixer Setup
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.
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
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.
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
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
.
# 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
# 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
# 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
# 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
# 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
# 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
# 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
For calibrating the mixer scaling, please follow the steps below.
-
Turn on mixer input override This will force all inputs to a constant value.
mixer override 0
-
Set override to 66.6% on the axis to be calibrated (pitch in the following)
mixer override SP 666
-
Measure the pitch blade angle.
-
Adjust the scaling rate until blade angle is 8deg
For example - change pitch scaling to 800:
mixer rate SP 800
-
Repeat for all stabilized control axis
- ROLL (SR)
- PITCH (SP)
- YAW (SY)
- COLLECTIVE (SC)
-
Turn off mixer override
mixer override off
-
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.
- Overview
- Back-up and restore
- Servo Wiring and adapter boards
- Custom Defaults
- Custom defaults remapping spreadsheet
- Receiver Setup
- Gyro & Board Orientation
- Voltage & Current Sensors
- ESC Setup
- Motor Setup
- Servos Setup
- Mixer
- Modes
- RPM Filters
- Filter Setup
- Governor Setup
- Adjustments
- Introduction
- Initial Tuning
- Governor Tuning
- Feed forward Tuning
- Tail Tuning
- Tuning on the Field with Lua Scripts
- Blackbox Logging
- Working with Blackbox Explorer
- K110 with Play F4
- Profile (Bank) switching example
- Using stability modes (6G)
- Adding OSD support for FPV Setups