Index: mttroot/mtt/lib/control/PPP/ppp_lin_run.m ================================================================== --- mttroot/mtt/lib/control/PPP/ppp_lin_run.m +++ mttroot/mtt/lib/control/PPP/ppp_lin_run.m @@ -146,11 +146,12 @@ p_o.x_0 = zeros(n_x,1); endif if !struct_contains(p_o,"method") ##p_o.method = "continuous"; - p_o.method = "intermittent"; + ##p_o.method = "intermittent"; + p_o.method = "remote"; endif ## Check w. [n_w,m_w] = size(w); @@ -222,10 +223,13 @@ [L, M, P, obs_poles] = dlqe(Ad,G,C,sigma_x,Sigma); else L = zeros(n_x,n_y); obs_poles = eig(Ad); endif + elseif strcmp(p_o.method, "remote") + L = zeros(n_x,n_y); + obs_poles = []; else error(sprintf("Observer method ""%s"" unknown", p_o.method)); endif ## Display the poles @@ -265,11 +269,16 @@ x = xsi(:,p_c.N); # Current state (for next time) ti = [(i-1)*p_c.N:i*p_c.N-1]*dt; y_i = yi(1); # Current output t_i = ti(1); else # The real thing - [t_i,y_i,u_i] = ppp_put_get(U); # Generic interface to real-time + if strcmp(p_o.method, "remote") + [t_i,y_i,X] = ppp_put_get_X(U); # Remote-state interface + u_i = X(3); # Integrated control is third state + else + [t_i,y_i,u_i] = ppp_put_get(U); # Generic interface to real-time + endif endif ## Observer if strcmp(p_o.method, "intermittent") [x_est y_est y_new, e_est] = ppp_int_obs \ @@ -281,10 +290,14 @@ (x_est,yi(:,k),Ui,A,B,C,D,p_c.A_u,dt,L); Ui = A_ud'*Ui; y_e = [y_e; y_new']; e_e = [e_e; e_est']; endfor + elseif strcmp(p_o.method, "remote") + ## predict from remote state (with zero L) + [x_est y_est y_new e_est] = ppp_int_obs \ + (X,y_i,U,A,B,C,D,p_c.A_u,p_c.delta_ol,L); endif ##Control if ( (p_c.Tau_u==[])&&(p_c.Tau_y==[]) ) U = K_w*w - K_x*x_est;