00001 #ifndef __PID_H__ 00002 #define __PID_H__ 00003 00004 #include <linux/aquosa/qmgr_base.h> 00005 00016 typedef struct pid_params_struct { 00017 qmgr_ctrl_params_t base; 00018 qres_time_t target_se; //< Scheduling error value around which system is stabilized 00019 double z1, z2; //< Poles of the linearized controller 00020 } pid_params_t; 00021 00022 typedef struct pid_struct { 00023 qmgr_ctrl_t base; 00024 double z1, z2; //< Poles of the linearized controller 00025 qres_time_t target_se; //< Scheduling error value around which system is stabilized 00026 double alpha1, beta1; //< Parameters used for linear feedback control when eps < 0 00027 double alpha2, beta2; //< Parameters used for linear feedback control when eps >= 0 00028 qres_time_t eps_prev; //< Scheduling error at previous step 00029 double u_prev; //< Value of u at previous step 00030 } pid_ctrl_t; 00031 00033 qos_rv pid_register(void); 00034 00036 qos_rv pid_init(void *self, void *self_params); 00037 00039 qos_rv pid_final(qmgr_ctrl_t *ctrl); 00040 00042 qos_bw_t pid_fb_func(qmgr_ctrl_t *ctrl, qres_time_t sched_err); 00043 00046 #endif