A First Course in FUZZY and NEURAL CONTROL

(singke) #1
2.1. INTRODUCTORY EXAMPLES: PENDULUM PROBLEMS 25

b = 0.1;
i = 0.006;
g = 9.8;
l = 0.3;
r = (M+m)(i+mll)-(ml)(ml);
numplant = [ml/q 0];
denplant = [1 b
(i+ml^2)/q -(M+m)mgl/q -bmg*l/q];
The coefficients of the numerator and denominator polynomial from the
Matlaboutput can be translated to the following plant transfer function:


Gp(s)=

4. 5455

s^3 +0. 1818 s^2 āˆ’ 31. 1818 sāˆ’ 4. 4545

=

Np(s)
Dp(s)

The open-loop response of this transfer function can be simulated inMatlab
using the following code:
t = 0:0.01:5;
impulse(numplant,denplant,t)
axis([0 0.9 0 60]);
The plot shown in Figure 2.5 clearly indicates the unstable nature of the
plant in an open-loop setup.


Figure 2.5. Unstable plant

We can now extend theMatlabscriptfile to include computation of the
state-space model. The necessary code is as follows:
p = i(M+m)+Mmll;
A = [0 1 0 0;
0 -(i+mll)b/p (mmgll)/p 0;
0001;
0 -(m
lb)/p mgl(M+m)/p 0]
B=[0;
(i+mll)/p;
0;
m*l/p]

Free download pdf