program vaja2c " Kaskadna regulacija z motnjo " glavni regulator CONSTANT Kp=4.965 , Ki=0.239, Kd=28.414 Tt=0.1*Kd/Kp " referenca r = 0 " motnja z = step(t, 3.0) e = r - h3 Es=INTEG(e,0) Udp=INTEG(Ud,0) Ud=e*Kd/Tt - Udp/Tt U=Kp*e+Ki*Es+Ud " def. drugega procesa h3 = integ(h3d, 0) h3d = fim - 20.0/100.0*h3 fim = integ(fimd, 0) fimd = fi1*2.0/100.0 - 1.0/100.0*h3 " prvi proces constant kp1 = 2.0 fi1 = z + fi1i fi1i = integ(fi1d, 0) fi1d = -1.0/5.*fi1 + 1.0/10.0*e2*kp1 e2 = u - fi1 " priprava za opt. krit=INTEG(t*ABS(e),0) " sim. constant Tkon=50 cinterval ci=0.1 termt (t.gt.Tkon) prepar z, h3 output 10, z, h3 end