This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

数字电源pid算法,



PID_s.l2et = PID_s.let;   //PID_s.l2e为上上次误差
PID_s.let = PID_s.e ;      //PID_s.let 为上次误差
PID_s.et = Error0;          //PID_s.et为当前误差
P = PID_s.et - PID_s.let;
I = Ki * PID_s.et;
D = Kd * (PID_s.et - (PID_s.let*2) + PID_s.l2et);

PID_Sf =(P + I + D)*Kp;

PIDOut= (int)PID_Sf;

 date =470+  PIDOut;//date为占空值,470为初值

 

该算法主要用来改变占空值,从而保持恒压输出