From af2a575460c8bb7c699c56a3ddd1886d453e96b6 Mon Sep 17 00:00:00 2001 From: borisbstyle Date: Fri, 28 Oct 2016 16:21:03 +0200 Subject: [PATCH] Document 3D for DSHOT and special values --- src/main/flight/mixer.c | 4 ++-- src/main/flight/mixer.h | 22 ++++++++++++++++++++-- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/src/main/flight/mixer.c b/src/main/flight/mixer.c index a4e5ec37ef..aea7b68adc 100755 --- a/src/main/flight/mixer.c +++ b/src/main/flight/mixer.c @@ -256,8 +256,8 @@ void initEscEndpoints(void) { disarmMotorOutput = DSHOT_DISARM_COMMAND; minMotorOutputNormal = DSHOT_MIN_THROTTLE + motorConfig->digitalIdleOffset; maxMotorOutputNormal = DSHOT_MAX_THROTTLE; - deadbandMotor3dHigh = DSHOT_3D_DEADBAND_HIGH; - deadbandMotor3dLow = DSHOT_3D_DEADBAND_LOW; + deadbandMotor3dHigh = DSHOT_3D_MIN_NEGATIVE; // TODO - Not working yet !! Mixer requires some throttle rescaling changes + deadbandMotor3dLow = DSHOT_3D_MAX_POSITIVE; // TODO - Not working yet !! Mixer requires some throttle rescaling changes } else #endif { diff --git a/src/main/flight/mixer.h b/src/main/flight/mixer.h index 8798361050..b329128b80 100644 --- a/src/main/flight/mixer.h +++ b/src/main/flight/mixer.h @@ -21,12 +21,30 @@ #define QUAD_MOTOR_COUNT 4 +/* + DshotSettingRequest (KISS24). Spin direction, 3d and save Settings reqire 10 requests.. and the TLM Byte must always be high if 1-47 are used to send settings + 0 = stop + 1-5: beep + 6: ESC info request (FW Version and SN sent over the tlm wire) + 7: spin direction 1 + 8: spin direction 2 + 9: 3d mode off + 10: 3d mode on + 11: ESC settings request (saved settings over the TLM wire) + 12: save Settings + + 3D Mode: + 0 = stop + 48 (low) - 1047 (high) -> positive direction + 1048 (low) - 2047 (high) -> negative direction +*/ + // Digital protocol has fixed values #define DSHOT_DISARM_COMMAND 0 #define DSHOT_MIN_THROTTLE 48 #define DSHOT_MAX_THROTTLE 2047 -#define DSHOT_3D_DEADBAND_LOW 900 // TODO - not agreed yet -#define DSHOT_3D_DEADBAND_HIGH 1100 // TODO - not agreed yet +#define DSHOT_3D_MAX_POSITIVE 1047 // TODO - Not working yet!! Mixer requires some throttle rescaling changes +#define DSHOT_3D_MIN_NEGATIVE 1048// TODO - Not working yet!! Mixer requires some throttle rescaling changes // Note: this is called MultiType/MULTITYPE_* in baseflight. typedef enum mixerMode