A First Course in FUZZY and NEURAL CONTROL

(singke) #1
6.4. EXAMPLE: TEMPERATURE CONTROL 209

We are now in a position to test the performance of the neural network to provide
ON/OFF control in a closed-loop configuration. To test this performance, we
generate an arbitrary testing function as shown below.


w=16*pi;
time=0;
for i=1:100,
p2(i)=16*(exp(-time))*sin(w*time);
time=time+0.1;
end

We can then simulate the network response using the followingMatlabcom-
mand and obtain a plot of the testing function in relation to the trained function.
Figure 6.7 illustrates the trained and test results.


y2 = sim(net,p2)
plot(p,t,ígoí,p2,y2,íb*í);

Figure 6.7. Simulated ON/OFF for a test function

6.4.2 Simulating PI control with a neural network


We now extend the previous example to include proportional and integral control
functions. Once again, we generate an exponentially damped sinusoid pattern
vectorp(i),i=1, 50. Note that this pattern vector is assumed to represent
the error between a reference and the actual output of the plant. A damped
sinusoidal response is typical of plant behavior for which a controller needs to be
designed. As before, we use the followingMatlabcode to generate the pattern
vectorp(i).


w=2*pi;
time=0;
for i=1:50,
p(i)=(exp(-time))*sin(w*time);
Free download pdf