Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions docs/Mixer.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@ Each servo mixing rule has the following parameters:
| 20 | RC channel 14 | Raw RC channel 14 |
| 21 | RC channel 15 | Raw RC channel 15 |
| 22 | RC channel 16 | Raw RC channel 16 |
| 23 | Stabilized ROLL+ | Clipped between 0 and 1000 |
| 24 | Stabilized ROLL- | Clipped between -1000 and 0 |
| 25 | Stabilized PITCH+ | Clipped between 0 and 1000 |
| 26 | Stabilized PITCH- | Clipped between -1000 and 0 |
| 27 | Stabilized YAW+ | Clipped between 0 and 1000 |
| 28 | Stabilized YAW- | Clipped between -1000 and 0 |


The `smix reset` command removes all the existing motor mixing rules.
Expand Down
7 changes: 7 additions & 0 deletions src/main/flight/servos.c
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,13 @@ void servoMixer(float dT)
}
}

input[INPUT_STABILIZED_ROLL_PLUS] = constrain(input[INPUT_STABILIZED_ROLL], 0, 1000);
input[INPUT_STABILIZED_ROLL_MINUS] = constrain(input[INPUT_STABILIZED_ROLL], -1000, 0);
input[INPUT_STABILIZED_PITCH_PLUS] = constrain(input[INPUT_STABILIZED_PITCH], 0, 1000);
input[INPUT_STABILIZED_PITCH_MINUS] = constrain(input[INPUT_STABILIZED_PITCH], -1000, 0);
input[INPUT_STABILIZED_YAW_PLUS] = constrain(input[INPUT_STABILIZED_YAW], 0, 1000);
input[INPUT_STABILIZED_YAW_MINUS] = constrain(input[INPUT_STABILIZED_YAW], -1000, 0);

input[INPUT_FEATURE_FLAPS] = FLIGHT_MODE(FLAPERON) ? servoConfig()->flaperon_throw_offset : 0;

if (IS_RC_MODE_ACTIVE(BOXCAMSTAB)) {
Expand Down
54 changes: 30 additions & 24 deletions src/main/flight/servos.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,30 +23,36 @@

// These must be consecutive
typedef enum {
INPUT_STABILIZED_ROLL = 0,
INPUT_STABILIZED_PITCH = 1,
INPUT_STABILIZED_YAW = 2,
INPUT_STABILIZED_THROTTLE = 3,
INPUT_RC_ROLL = 4,
INPUT_RC_PITCH = 5,
INPUT_RC_YAW = 6,
INPUT_RC_THROTTLE = 7,
INPUT_RC_CH5 = 8,
INPUT_RC_CH6 = 9,
INPUT_RC_CH7 = 10,
INPUT_RC_CH8 = 11,
INPUT_GIMBAL_PITCH = 12,
INPUT_GIMBAL_ROLL = 13,
INPUT_FEATURE_FLAPS = 14,
INPUT_RC_CH9 = 15,
INPUT_RC_CH10 = 16,
INPUT_RC_CH11 = 17,
INPUT_RC_CH12 = 18,
INPUT_RC_CH13 = 19,
INPUT_RC_CH14 = 20,
INPUT_RC_CH15 = 21,
INPUT_RC_CH16 = 22,

INPUT_STABILIZED_ROLL = 0,
INPUT_STABILIZED_PITCH = 1,
INPUT_STABILIZED_YAW = 2,
INPUT_STABILIZED_THROTTLE = 3,
INPUT_RC_ROLL = 4,
INPUT_RC_PITCH = 5,
INPUT_RC_YAW = 6,
INPUT_RC_THROTTLE = 7,
INPUT_RC_CH5 = 8,
INPUT_RC_CH6 = 9,
INPUT_RC_CH7 = 10,
INPUT_RC_CH8 = 11,
INPUT_GIMBAL_PITCH = 12,
INPUT_GIMBAL_ROLL = 13,
INPUT_FEATURE_FLAPS = 14,
INPUT_RC_CH9 = 15,
INPUT_RC_CH10 = 16,
INPUT_RC_CH11 = 17,
INPUT_RC_CH12 = 18,
INPUT_RC_CH13 = 19,
INPUT_RC_CH14 = 20,
INPUT_RC_CH15 = 21,
INPUT_RC_CH16 = 22,
INPUT_STABILIZED_ROLL_PLUS = 23,
INPUT_STABILIZED_ROLL_MINUS = 24,
INPUT_STABILIZED_PITCH_PLUS = 25,
INPUT_STABILIZED_PITCH_MINUS = 26,
INPUT_STABILIZED_YAW_PLUS = 27,
INPUT_STABILIZED_YAW_MINUS = 28,

INPUT_SOURCE_COUNT
} inputSource_e;

Expand Down