lyraKenza
Electrical
- Feb 15, 2017
- 3
Hello,
I have a process which has Hsys= k/s(1+Ts)
I designed a Pid controller for this process. I have to used space state representation of my system for simulation.
xdot=(I+ Te*A)*xk+ Te*B*uk
yk=C*xk // yk=Ysys
I want to proceed in the same way for pid controller to be able to see, at each time, the output of my pid; ypid= u_sys=uk
I don't know where I have a mistake, cause in the simulation I get wrong things...
x1= integral(e)
x2=e = x1dot
x3= edot= x2dot
e= r-Ysys
e= r- k*u/s(1+Ts)
It will give me: edot*(1+T*s)=-k*u
edot + T*edot.dot = -k*u
edot.dot=-k*u/T - edot/T
edot.dot=-k*u/T - x3/T
I will then have: matrix A for pid system:
Apid=([0 1 0],[0 0 1 ],[0 0 -1/T])
Bpid= ([0 0 -k/T].transpose()
Cpid=([Ki, Kp, Kd)])
Anyone know what I did wrong ? or if there a simple way to do ?
I have a process which has Hsys= k/s(1+Ts)
I designed a Pid controller for this process. I have to used space state representation of my system for simulation.
xdot=(I+ Te*A)*xk+ Te*B*uk
yk=C*xk // yk=Ysys
I want to proceed in the same way for pid controller to be able to see, at each time, the output of my pid; ypid= u_sys=uk
I don't know where I have a mistake, cause in the simulation I get wrong things...
x1= integral(e)
x2=e = x1dot
x3= edot= x2dot
e= r-Ysys
e= r- k*u/s(1+Ts)
It will give me: edot*(1+T*s)=-k*u
edot + T*edot.dot = -k*u
edot.dot=-k*u/T - edot/T
edot.dot=-k*u/T - x3/T
I will then have: matrix A for pid system:
Apid=([0 1 0],[0 0 1 ],[0 0 -1/T])
Bpid= ([0 0 -k/T].transpose()
Cpid=([Ki, Kp, Kd)])
Anyone know what I did wrong ? or if there a simple way to do ?