Tony Stark / BLDC_V2_JYB

Dependencies:   mbed-dev-f303 FastPWM3

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers current_controller_config.h Source File

current_controller_config.h

00001 #ifndef CURRENT_CONTROLLER_CONFIG_H
00002 #define CURRENT_CONTROLLER_CONFIG_H
00003 
00004 // Current controller///
00005 #define K_D .05f                    // Loop gain,  Volts/Amp
00006 #define K_Q .05f                    // Loop gain,  Volts/Amp
00007 //#define K_SCALE 0.0001f             // K_loop/Loop BW (Hz) 0.0042
00008 #define K_SCALE 0.00165f
00009 // #define K_SCALE 0.0008
00010 //#define K_SCALE 0.0004
00011 #define KI_D 0.0255f                // PI zero, in radians per sample
00012 #define KI_Q 0.0255f                // PI zero, in radians per sample
00013 #define V_BUS 24.0f                 // Volts
00014 #define OVERMODULATION 1.2f         // 1.0 = no overmodulation
00015 
00016 #define D_INT_LIM V_BUS/(K_D*KI_D)  // Amps*samples
00017 #define Q_INT_LIM V_BUS/(K_Q*KI_Q)  // Amps*samples
00018 
00019 #define I_MAX 40.0f
00020 
00021 //Observer//
00022 #define DT 0.000025f
00023 #define K_O 0.02f
00024 
00025 
00026 
00027 
00028 #endif