8 #define REGULATION_TYPE_SYMMETRIC 11 #define TE_LOOP_MIN_VALUE 50 // Minimum period for any loop [us]. 12 #define TE_LOOP_MAX_VALUE 65534 // Maximum period for any loop [us]. 14 #define TE_CURRENT_LOOP_DEFAULT_VAL 50 // Current control loop period [us] (max 2^16-1) (default value at reset). 15 #define TE_CONTROL_LOOP_DEFAULT_VAL 350 // Main control loop period [us] (max 2^16-1) (default value at reset). 16 #define TE_DATA_LOOP_DEFAULT_VAL 1000 // Data loop period [us] (max 2^16-1) (default value at reset). 19 #define KP_CURRENT_DEFAULT_VAL 200.0f 20 #define KI_CURRENT_DEFAULT_VAL 500000.0f 21 #define KD_CURRENT_DEFAULT_VAL 0.0f 22 #define FF_CURRENT_DEFAULT_VAL MOTOR_RESISTANCE 23 #define CURRENT_INTEGRATOR_SAT_DEFAULT_VAL 10.0f 24 #define CURRENT_LOOP_PWM_MAX_DUTY_CYCLE 0.98f // Max PWM value (normalized) duty cycle (less than 1 to ensure bootstrap capacitor charging) 27 #define KP_POSITION_DEFAULT_VAL 0.01f 28 #define KI_POSITION_DEFAULT_VAL 0.0f 29 #define KD_POSITION_DEFAULT_VAL 0.0f 30 #define POSITION_INTEGRATOR_SAT_DEFAULT_VAL 0.01f 33 #define ENCODER_FILT_TAU_DEFAULT_VAL 0.999f 36 #define FILTER_TYPE_NONE 0 37 #define FILTER_TYPE_FIRST_ORDER 1 38 #define FILTER_TYPE_RUNNING_MEAN 2 void ctrl_StartCurrentLoop(void)
Start the current regulation.
Definition: controller.c:63
void ctrl_Init(void)
Initialize the position and current controllers.
Definition: controller.c:31