![]() |
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.
|
PID algorithm implementation source code. More...
Go to the source code of this file.
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 = 1 |
flag variable for PID parameter availability More... | |
volatile unsigned char | pid_control_mode_flag = 0 |
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... | |
PID algorithm implementation source code.
Definition in file pid.c.
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().
volatile PID_Structure_t angle_pid_handler |
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().
volatile unsigned char pid_control_mode_flag = 0 |
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().
unsigned char pid_parameter_available_flag = 1 |
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().
volatile PID_Structure_t speed_pid_handler |
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().