Go to the source code of this file.
Data Structures | |
| struct | mcl_offline_param_detection_result_t |
| Results of offline parameter testing. More... | |
| struct | mcl_clc_coeff_cfg_t |
| 3p-3z Coefficients for 3p-3z controllers More... | |
| struct | mcl_control_pid_cfg_t |
| Configuration data for pid. More... | |
| struct | mcl_control_pid_t |
| pid running data More... | |
| struct | mcl_control_dead_area_pwm_offset_t |
| Used to compensate for pwm dead zones, Duty cycle ratio, between 0 and 1. More... | |
| struct | mcl_control_dead_area_compensation_cfg_t |
| DeadAera Compensation Configuration. More... | |
| struct | mcl_control_dead_area_compensation_t |
| DeadAera Compensation data. More... | |
| struct | mcl_control_smc_cfg_t |
| Sensorless smc configuration. More... | |
| struct | mcl_control_smc_t |
| Sensorless smc structure. More... | |
| struct | mcl_control_offline_param_detection_cfg_t |
| Offline Detection Configuration. More... | |
| struct | mcl_control_offline_param_detection_t |
| Offline Detection Data. More... | |
| struct | mcl_control_svpwm_duty_t |
| pwm duty cycle More... | |
| struct | mcl_control_method_t |
| Supported control algorithms. More... | |
| struct | mcl_control_callback_t |
| callback function More... | |
| struct | mcl_control_cfg_t |
| Control Function Configuration. More... | |
| struct | mcl_control_t |
| Control function running data. More... | |
Enumerations | |
| enum | mcl_control_status_t { control_status_null = 0 , control_status_init = 1 , control_status_run = 2 , control_status_fail = 3 } |
| Control Module Status. More... | |
| enum | mcl_svpwm_sector_t { svpwm_sector1 = 1 , svpwm_sector2 = 2 , svpwm_sector3 = 3 , svpwm_sector4 = 4 , svpwm_sector5 = 5 , svpwm_sector6 = 6 } |
| Six sectors of svpwm. More... | |
Functions | |
| hpm_mcl_stat_t | hpm_mcl_control_init (mcl_control_t *control, mcl_control_cfg_t *cfg) |
| Initialise the operating data for the control function. More... | |
| hpm_mcl_stat_t | hpm_mcl_pid_to_3p3z (mcl_control_pid_cfg_t *cfg_pid, mcl_clc_coeff_cfg_t *cfg_3p3z) |
| Convert a 3p3z controller to a pid controller. More... | |
| hpm_mcl_stat_t | hpm_mcl_delta_pid (float setpoint, float feedback, mcl_control_pid_t *pid_x, float *output) |
| hpm_mcl_stat_t | hpm_mcl_position_pid (float setpoint, float feedback, mcl_control_pid_t *pid_x, float *output) |
| Calculate the output of a Positional PID controller. More... | |
| enum mcl_control_status_t |
| enum mcl_svpwm_sector_t |
| hpm_mcl_stat_t hpm_mcl_control_init | ( | mcl_control_t * | control, |
| mcl_control_cfg_t * | cfg | ||
| ) |
Initialise the operating data for the control function.
| control | mcl_control_t |
| cfg | mcl_control_cfg_t |
Data initialisation
function initialisation
| hpm_mcl_stat_t hpm_mcl_delta_pid | ( | float | setpoint, |
| float | feedback, | ||
| mcl_control_pid_t * | pid_x, | ||
| float * | output | ||
| ) |
Calculates the output of a Delta PID controller.
This function implements a Delta PID (Proportional-Integral-Derivative) controller calculation to determine the controller's output value based on the setpoint and feedback values. The PID controller adjusts the output value using proportional (P), integral (I), and derivative (D) terms to minimize the error between the setpoint and feedback values.
| setpoint | The desired output value of the system. |
| feedback | The actual output value of the system. |
| pid_x | Pointer to the PID controller structure containing the configuration and state. |
| output | Pointer to store the calculated controller output value. |
Note:
mcl_control_pid_t is properly initialized.| hpm_mcl_stat_t hpm_mcl_pid_to_3p3z | ( | mcl_control_pid_cfg_t * | cfg_pid, |
| mcl_clc_coeff_cfg_t * | cfg_3p3z | ||
| ) |
Convert a 3p3z controller to a pid controller.
| pid | mcl_control_pid_cfg_t |
| p3z3 | mcl_clc_coeff_cfg_t |
The relationship between the 3p3z coefficients and the P, I, and D gains of the basic PID is obtained by the standard discrete transform method, and the final result given here. Principle View Knowledge Base.
| hpm_mcl_stat_t hpm_mcl_position_pid | ( | float | setpoint, |
| float | feedback, | ||
| mcl_control_pid_t * | pid_x, | ||
| float * | output | ||
| ) |
Calculate the output of a Positional PID controller.
This function implements a typical PID (Proportional-Integral-Derivative) controller to compute the control signal based on the setpoint and feedback. The PID controller optimizes the control process by adjusting three parameters: proportional gain (KP), integral gain (KI), and derivative gain (KD). The proportional term responds quickly to the error, the integral term eliminates steady-state error, and the derivative term predicts and reduces overshoot.
| setpoint | The setpoint, i.e., the desired output value |
| feedback | The feedback signal, representing the actual output value |
| pid_x | Pointer to the PID controller structure, containing the configuration and state |
| output | Pointer to the output control signal |