![]() |
miniFOC 1.0.3
This open-source project aims to accomplish a FOC(Field Oriented Control) scheme that is operatable with minimum costs in China.
|
this is the header file of pid.c, which defines the structure of PID algorithm and closed-loop state macro. More...
Go to the source code of this file.
Data Structures | |
struct | PID_Structure_t |
structure of PID algorithm More... | |
Macros | |
#define | TORQUE_LOOP_CONTROL 1 |
torque loop control mode More... | |
#define | SPEED_LOOP_CONTROL 2 |
speed loop control mode More... | |
#define | ANGLE_LOOP_CONTROL 3 |
angle loop control mode More... | |
Functions | |
void | pid_config (unsigned char mode) |
configure pid loop parameters More... | |
float | pid_calculate_result (PID_Structure_t *pid_handler, float collect) |
calculate result using sampling value More... | |
Variables | |
unsigned char | pid_parameter_available_flag |
flag variable for PID parameter availability More... | |
volatile unsigned char | pid_control_mode_flag |
flag variable of PID closed loop mode More... | |
volatile PID_Structure_t | speed_pid_handler |
algorithm handler of PID speed loop More... | |
volatile PID_Structure_t | angle_pid_handler |
algorithm handler of PID angle loop More... | |
this is the header file of pid.c, which defines the structure of PID algorithm and closed-loop state macro.
Definition in file pid.h.
float pid_calculate_result | ( | PID_Structure_t * | pid_handler, |
float | collect | ||
) |
calculate result using sampling value
[in] | pid_handler | PID data handler |
[in] | collect | sampled data |
calculated | output value of PID controller |
Definition at line 61 of file pid.c.
References PID_Structure_t::expect, fast_constrain, PID_Structure_t::kd, PID_Structure_t::ki, PID_Structure_t::kp, PID_Structure_t::last_error, PID_Structure_t::maximum, PID_Structure_t::minimum, PID_Structure_t::sum_maximum, and PID_Structure_t::summary.
Referenced by TIMER13_IRQHandler().
void pid_config | ( | unsigned char | mode | ) |
configure pid loop parameters
Definition at line 33 of file pid.c.
References angle_pid_handler, PID_Structure_t::kd, PID_Structure_t::ki, PID_Structure_t::kp, PID_Structure_t::maximum, PID_Structure_t::minimum, pid_control_mode_flag, speed_pid_handler, PID_Structure_t::sum_maximum, and user_memset().
Referenced by main(), and mdtp_callback_handler().
|
extern |
algorithm handler of PID angle loop
Definition at line 28 of file pid.c.
Referenced by flash_read_parameters(), flash_write_parameters(), mdtp_callback_handler(), pid_config(), report_local_variable(), and TIMER13_IRQHandler().
|
extern |
flag variable of PID closed loop mode
Definition at line 20 of file pid.c.
Referenced by main(), mdtp_callback_handler(), pid_config(), report_local_variable(), and TIMER13_IRQHandler().
|
extern |
flag variable for PID parameter availability
Definition at line 16 of file pid.c.
Referenced by flash_read_parameters(), flash_write_parameters(), mdtp_callback_handler(), and report_local_variable().
|
extern |
algorithm handler of PID speed loop
Definition at line 24 of file pid.c.
Referenced by flash_read_parameters(), flash_write_parameters(), mdtp_callback_handler(), pid_config(), report_local_variable(), and TIMER13_IRQHandler().