garimella
Full Member level 5
Hi
I have a simple code to learn about PI controller. The set point is 1.0 and output is not converging. What is the problem?
I have a simple code to learn about PI controller. The set point is 1.0 and output is not converging. What is the problem?
Code C - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 int main() { /* Variables*/ double input,output,kp,error,ki,kpo,kio,T; input=1.00; kp=1; ki=0.1; output=0; T=1/100; while(1) { error=input-output; kpo=error*kp; kio=kio+(error*ki*0.01); output=kpo+kio; printf("output is %f\t%f\t%f\t%f\n",error,kpo,kio,output); } }
Last edited by a moderator: