精密温度控制(参数自适应PID算法)

数字PID基础控制算法

/* Layer specfication -------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
-- 
--  Proportional   u(t) = Kp * e(t)
--  Integral       u(t) = Ki * ∫[e(t)*dT]
--  Derivative     u(t) = Kd * de(t)/dt
-- 
    位置式PID输出量
    Uk = Kp * e(t) + Ki * Integral{e(t)*dt} + Kd * de(t)/dt
    增量式PID输出量
    Uk = Kp * [e(t)-e(t0)] + Ki * e(t) + Kd * [e(t)-2*e(t0)+e(t1)]
--  
--  
             [ [email protected] / [email protected] ]                      \
             [ PID Algorithm ]                                            \
                                                                          \
                               ==>P =====>                                \
                              |           |                               \
             Ui ===> SIGMA ======>I =====> SIGMA ===> Process ===> Uk     \
                   + | -      |           |                      |        \
                     |         ==>D =====>                       |        \
                     |                                           |        \
                     <===========================================<        \

-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------*/
/* Layer specfication -------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
--
-- [email protected]
-- 328535231
-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------*/
#include "..\TKIT_Header\TKIT_common.h"
#if TKIT_PID_CNT

//PID 示意说明
extern char PID_SpecString[];

//PID控制对象
typedef struct __PID__
{
    //经典PID 输入
    float   kp,ki,kd;
    float   Ui_Set;
    float   ek0,ek1,ek_sum;
    float   UkMin,UkMax;
    BOOLEAN KiSumSuspend;
    float   Uk,Uk_delta;
    float   Uk_Kp,Uk_Ki,Uk_Kd;

    //自适应参数/////////////////////
    float   PredFactor;
    float   PredOut;
    float   PredOutEk;

    /////////////////////////////////
}PIDCtrl;
#endif //TKIT_PID_CNT

 

温度控制精度±0.1

 

 

你可能感兴趣的:(精密温度控制(参数自适应PID算法))