Index: mttroot/mtt/lib/control/PPP/ppp_int_obs.m ================================================================== --- mttroot/mtt/lib/control/PPP/ppp_int_obs.m +++ mttroot/mtt/lib/control/PPP/ppp_int_obs.m @@ -1,6 +1,6 @@ -function [x_new,y_new,error] = ppp_int_obs (x,y,U,A,B,C,D,A_u,delta,L) +function [x_p,y_p,error] = ppp_int_obs (x,y,U,A,B,C,D,A_u,delta,L) ## usage: x_new = ppp_int_obs (x,y,U,A,B,C,D,A_u,delta,L) ## ## Intermittent observer for PPP ## @@ -16,13 +16,13 @@ if nargin<10 L = zeros(n_x,n_y); endif - ## Predictor - [y_p,us,x_p] = ppp_ystar (A,B,C,D,x,A_u,U,delta); + ## Corrector (on current value of output) + error = (C*x-y); + x_new = x - L*error; - ## Corrector - error = (y_p-y); - x_new = x_p - L*error; - y_new = C*x_new; + ## Predictor (predicts Delta_OL ahead) + [y_p,us,x_p] = ppp_ystar (A,B,C,D,x_new,A_u,U,delta); + endfunction