[Hans Blom, 970324e]

The "time line" of what happens when in the MCT controller is maybe

best explained by the program code, which I will annotate.

begin

{initializations}

t := 0.0; {initial time is called t=0}

u := 0.0; {no actuator action yet}

repeat {at time increments of size dt}

display reference-x, x, v, d-estimate, and u of current time t;

r := reference (t+dt); {specify desired x(t+dt)}

control; {controller computes u(t)}

{"immediately" after x(t) and v(t) have been observed and the

references for x(t+dt) and v(t+dt) have been defined, u(t) is

computed and applied to the actuator; at this time we know u(t)

and we can predict the values of the next next observations

x(t+dt) and v(t+dt); we compute only the prediction x(t+dt)}

p := x + v*dt + 0.5 * (u + d) * (dt*dt) / J;

{at this point, we "wait" for the next iteration: time shifts by dt

here; then we perform our observations of x and v}

t:= t+dt; observe;

{at this point, knowing the observation of x, we can compare it to

its predicted value p and use the difference to update the

estimate of the disturbance}

d := d + 2.0 * J * (x-p) / (dt*dt)

{at this time we can display the new values again}

until t > 9.0

end.

Greetings,

Hans