From Rupert Young (970221.1900 UT)]

Bill Powers (970220.1445 MST)

Let's switch to using the cruise control as the example.....

dv/dt = F(t)/M, or

v(t+dt) = v(t) + F(t)*dt/M.

In the PCT model, the force would be

F(t+dt) = G*[r(t+dt) - v(t)],

Err, where did G come from ? This is gain presumably. Why did you have G as

1000 in your prog ? I notice that making g smaller slows down the response of

the controller. Is this what you mean on p276 of BCP "In order for good

feedback control to exist, this loop gain must be high" ? But why not make it

10000 ?

Hang on, couldn't these equations be made simpler/more general.

Doesn't

v(t+dt) = v(t) + dv

so

dv = F(t)*dt/M

but

F(t) = G*[r - v(t-dt)]

which is

F(t) = G*e where e is the error signal

so

dv = e*G*dt/M

but G*dt/M is a constant (k)

so

dv = k*e

or output = k*e

And this is basically all we need to work out the size of the output in each

iteration of the loop. k being the function that converts error signal to

output and is dependent upon the application.

I tried modifying the program, below, accordingly and came up with exactly the

same results. Again acceleration (dv) is limited to 2m/s.

Though as I see from the same page in BCP you say output is equal to k*e

so this is nothing new but I find the prog slightly clearer as the iterative

loop becomes independent of the output function, denoting that the behaviour

of the loop is the same no matter what the control system is.

Is this correct ?

## ยทยทยท

--

Regards,

Rupert

********************************************************

program cruise;

var u,v,f,m,g,r,t,e,dt,dv,k,max: real;

i: integer;

begin

f := 4000; {maximum force}

v := 0; {current velocity - perceptual signal}

r := 30; {meters per second - reference signal}

m:= 2000; {Kilograms - vehicle mass}

g := 1000; {Newtons per m/sec error}

dt := 0.1; {sec}

t := 0.0;

k := g*dt/m; {error to output constant}

max := dt*f/m; {maximum acceleration}

for i := 0 to round(24.0/dt) do

begin

dv := k*e;

if dv > max then dv := max;

v := v + dv;

e := r - v;

if abs((t - trunc(t+dt/10))) < 0.00001 then

begin

writeln('t = ',t:5:1,' sec e = ',e:6:2,' dv = ',dv/dt:4:3,' v = ',v:4:1,'

m/sec');

end;

t := t + dt;

end;

end.

********************************************************

dt = 0.1

t = 0.0 sec e = 30.00 dv = 0.000 v = 0.0 m/sec

t = 1.0 sec e = 28.00 dv = 2.000 v = 2.0 m/sec

t = 2.0 sec e = 26.00 dv = 2.000 v = 4.0 m/sec

t = 3.0 sec e = 24.00 dv = 2.000 v = 6.0 m/sec

t = 4.0 sec e = 22.00 dv = 2.000 v = 8.0 m/sec

t = 5.0 sec e = 20.00 dv = 2.000 v = 10.0 m/sec

t = 6.0 sec e = 18.00 dv = 2.000 v = 12.0 m/sec

t = 7.0 sec e = 16.00 dv = 2.000 v = 14.0 m/sec

t = 8.0 sec e = 14.00 dv = 2.000 v = 16.0 m/sec

t = 9.0 sec e = 12.00 dv = 2.000 v = 18.0 m/sec

t = 10.0 sec e = 10.00 dv = 2.000 v = 20.0 m/sec

t = 11.0 sec e = 8.00 dv = 2.000 v = 22.0 m/sec

t = 12.0 sec e = 6.00 dv = 2.000 v = 24.0 m/sec

t = 13.0 sec e = 4.00 dv = 2.000 v = 26.0 m/sec

t = 14.0 sec e = 2.39 dv = 1.260 v = 27.6 m/sec

t = 15.0 sec e = 1.43 dv = 0.755 v = 28.6 m/sec

t = 16.0 sec e = 0.86 dv = 0.452 v = 29.1 m/sec

t = 17.0 sec e = 0.51 dv = 0.271 v = 29.5 m/sec

t = 18.0 sec e = 0.31 dv = 0.162 v = 29.7 m/sec

t = 19.0 sec e = 0.18 dv = 0.097 v = 29.8 m/sec

t = 20.0 sec e = 0.11 dv = 0.058 v = 29.9 m/sec

t = 21.0 sec e = 0.07 dv = 0.035 v = 29.9 m/sec

t = 22.0 sec e = 0.04 dv = 0.021 v = 30.0 m/sec

t = 23.0 sec e = 0.02 dv = 0.012 v = 30.0 m/sec

t = 24.0 sec e = 0.01 dv = 0.007 v = 30.0 m/sec