• Home
  • Textbooks
  • Fuzzy Logic with Engineering Applications
  • Fuzzy Control Systems

Fuzzy Logic with Engineering Applications

Timothy Ross

Chapter 13

Fuzzy Control Systems - all with Video Answers

Educators


Chapter Questions

Problem 1

The interior temperature of an electrically heated oven is to be controlled by varying the heat input, $u$, to the jacket. The oven is shown in Fig. P13.1 $a$. Let the heat capacities of the oven interior and of the jacket be $c_1$ and $c_2$, respectively. Let the interior and the exterior jacket surface areas be $a_1$ and $a_2$, respectively. Let the radiation coefficients of the interior and exterior jacket surfaces be $r_1$ and $r_2$, respectively. Assume that there is uniform and instantaneous distribution of temperature throughout, and the rate of loss of heat is proportional to area and the excess of temperature over that of the surroundings. If the external temperature is $T_0$, the jacket temperature is $T_1$, and the oven interior temperature is $T_2$, then we have

$$
\begin{aligned}
& c_1 \dot{T}_1=-a_2 r_2\left(T_1-T_0\right)-a_1 r_1\left(T_1-T_2\right)+u \\
& c_2 \dot{T}_2=a_1 r_1\left(T_1-T_2\right)
\end{aligned}
$$
Let the state variables be the excess of temperature over the exterior, i.e., $x_1=T_1-T_0$ and $x_2=T_2-T_0$. With these substituted into the preceding equations we find that they can be written as

$$
\dot{x}_1=-\frac{\left(a_2 r_2+a_1 r_1\right)}{c_1} \cdot x_1+\frac{a_1 r_1}{c_1} \cdot x_2+\frac{1}{c_1} \cdot u
$$

and

$$
\dot{x}_2=\frac{a_1 r_1}{c_2} \cdot x_1-\frac{a_1 r_1}{c_2} \cdot x_2
$$

Assuming that

$$
\frac{a_2 r_2}{c_1}=\frac{a_1 r_1}{c_1}=\frac{a_1 r_1}{c_2}=\frac{1}{c_1}=1
$$

we have

$$
\dot{x}_1(t)=-2 x_1(t)+x_2(t)+u(t)
$$
and

$$
\dot{x}_2(t)=x_1(t)-x_2(t)
$$

and

$$
\dot{x}_i(t+1)=x_i(t)+\alpha \dot{x}_i(t), \quad i=1,2
$$

Let $\alpha=1 / 10$.
The membership functions for each of $x_1, x_2$, and $u$, each given on the same universe, are shown in Fig. P13.1 b. For each of the variables, membership functions are taken to be low (L), medium (M), and high (H) temperatures.
Using the accompanying FAM table, conduct a graphical simulation of this control problem. The entries in the table are the control actions ( $u$ ). Conduct at least four simulation cycles similar to Example 13.2. Use initial conditions of $x_1(0)=80^{\circ}$, and $x_2(0)=85^{\circ}$.

Check back soon!
04:09

Problem 2

Conduct a simulation of an automobile cruise control system. The input variables are speed and angle of inclination of the road, and the output variable is the throttle position. Let speed $=0$ to $100(\mathrm{mph})$, incline $=-10^{\circ}$ to $+10^{\circ}$, and throttle position $=0$ to 10 . The dynamics of the system are given by the following:

$$
\begin{aligned}
T & =k_1 v+\theta k_2+m \dot{v} \\
\dot{v} & =v(n+1)-v(n) \\
T(n) & =k_1 v(n)+\theta(n) k_2+m\left(v_{n+1}-v_n\right) \\
v_{n+1} & =\left(1-\frac{k_1}{m}\right) v(n)+T(n)-\frac{k_2}{m} \theta(n) \\
v_{n+1} & =k_a v(n)+\left[1-k_b\right]\left[\begin{array}{c}
T(n) \\
\theta(n)
\end{array}\right]
\end{aligned}
$$
where

$$
\begin{aligned}
T & =\text { throttle position } \\
k_1 & =\text { viscous friction } \\
v & =\text { speed } \\
\theta & =\text { angle of incline } \\
k_2 & =m g \sin \theta \\
\dot{v} & =\text { acceleration } \\
m & =\text { mass } \\
k_a & =1-\frac{k_1}{m} \text { and } k_b=\frac{k_2}{m}
\end{aligned}
$$

Assign $k_1 / m=k_2 / m=0.1$. The membership function for speed is determined by the cruise control setting, which we will assume to be 50 mph . The membership functions are shown in Fig. P13.2.

Charles Kirschbaum
Charles Kirschbaum
Numerade Educator

Problem 3

A printer drum is driven by a brushless DC motor. The moment of inertia of the drum is $J=0.00185 \mathrm{kgm}^2$. The motor resistance is $R=1.12 \Omega$. The torque constant for the motor is $K_{\mathrm{T}}=0.0363 \mathrm{Nm} / A$. The back EMF constant is $k=0.0363 \mathrm{~V} /(\mathrm{rad} / \mathrm{s})$. The equation of the system is

$$
J \ddot{\theta}=\frac{K_{\mathrm{T}}(V-\dot{\theta} k)}{R}
$$

where $\frac{(V-\dot{\theta} k)}{R} I=$ motor current
$\theta=$ rotational angle
$V=$ motor control voltage
The state variables are $x_1=\theta$ and $x_2=\dot{\theta}$. Also

$$
\ddot{\theta}=\frac{K_{\mathrm{T}}}{J R} V-\frac{K_{\mathrm{T}} k}{J R} \dot{\theta}
$$

Now

$$
x_2=\dot{x}_1
$$

Therefore,

$$
\dot{x}_2=\frac{K_{\mathrm{T}}}{J R} V-\frac{K_{\mathrm{T}} k}{J R} x_2
$$

Substituting in the values of the constants, we find

$$
\dot{x}_2+0.64 x_2=17.5 \mathrm{~V}
$$

The resulting difference equations will be

$$
\begin{aligned}
& x_1(k+1)=x_2(k)+x_1(k) \\
& x_2(k+1)=17.5 V(k)+0.36 x_2(k)
\end{aligned}
$$

The motor can be controlled to run at constant speed or in the position mode. The membership functions for $x_1, x_2$, and $V$ are shown in Fig. P13.3. The rule-based system is summarized in the following FAM table:
Using the initial conditions of $x_1=7.5^{\circ}$ and $x_2=-150 \mathrm{rad} / \mathrm{s}$ and the difference equations, conduct at least four graphical simulation cycles.

Check back soon!

Problem 4

The basic mechanical system behind clocks that are enclosed in glass domes is the torsional pendulum. The general equation that describes the torsional pendulum is

$$
J \frac{\mathrm{d}^2 \theta(t)}{\mathrm{d} t^2}=\tau(t)-B \frac{\mathrm{d} \theta(t)}{\mathrm{d} t}-k \theta(t)
$$

The moment of inertia of the pendulum bob is represented by $J$, the elasticity of the brass suspension strip is represented by $k$, and the friction between the bob and the air is represented by $B$. The controlling torque $\tau(t)$ is applied at the bob. When this device is used in clocks the actual torque is not applied at the bob but is applied through a complex mechanism at the main spring. The foregoing differential equation is the sum of the torques of the pendulum bob. The numerical values are $J=1 \mathrm{kgm}^2, k=5 \mathrm{Nm} / \mathrm{rad}$, and $B=2 \mathrm{Nms} / \mathrm{rad}$.
The final differential equation with the foregoing constants incorporated is given by

$$
\frac{\mathrm{d}^2 \theta(t)}{\mathrm{d} t^2}+2 \frac{\mathrm{d} \theta(t)}{\mathrm{d} t}+5 \theta(t)=\tau(t)
$$

The state variables are

$$
\begin{aligned}
& x_1=\theta(t) \text { and } x_2(t)=\dot{\theta}(t) \\
& \dot{x}_1=\dot{\theta}(t) \text { and } \dot{x}_2(t)=\ddot{\theta}(t)
\end{aligned}
$$

Rewriting the differential equation using state variables, we have

$$
\begin{aligned}
& \dot{x}_2(t)=\tau(t)-2 x_2(t)-5 x_1(t) \\
& \dot{x}_1(t)=x_2(t)
\end{aligned}
$$

Using these equations,

$$
\begin{aligned}
& \dot{x}_1(t)=x_1(k+1)-x_1(k) \\
& \dot{x}_2(t)=x_2(k+1)-x_2(k)
\end{aligned}
$$

in Eqs. (P13.4.1) and (P13.4.2), and rewriting the equations in terms of $\theta$ and $\dot{\theta}$ in matrix form, we have

$$
\left[\begin{array}{c}
\theta(k+1) \\
\dot{\theta}(k+1)
\end{array}\right]=\left[\begin{array}{c}
\theta(k)+\dot{\theta}(k) \\
-5 \theta(k)-\dot{\theta}(k)
\end{array}\right]+\left[\begin{array}{c}
0 \\
\tau(k)
\end{array}\right]
$$

The membership values for $\theta, \dot{\theta}$, and $\tau$ are shown in Fig. P13.4. The rules for the control system are summarized in the accompanying FAM table.
The initial conditions are given as

$$
\begin{aligned}
& \theta(0)=0.7^{\circ} \\
& \dot{\theta}(0)=-0.2 \mathrm{rad} / \mathrm{s}
\end{aligned}
$$

Conduct a graphical simulation for the control system.

Check back soon!
View

Problem 5

On the electrical circuit shown in Fig. P13.5a it is desired to control the output current at inductor $L_2$ by using a variable voltage source, $V$. By using Kirchhoff's voltage law, the differential equation for loop 1 is given in terms of the state variables as

$$
\frac{\mathrm{d} L_1(t)}{\mathrm{d} t}=-2 L_1(t)+2 L_2(t)+2 V(t)
$$
and that for loop 2 is

$$
\frac{\mathrm{d} L_2(t)}{\mathrm{d} t}=0.5 L_1(t)-2 L_2(t)
$$

Converting the system of differential equations into a system of difference equations, we get

$$
\begin{aligned}
& L_1(k+1)=-L_1(k)+2 L_2(k)+2 V(k) \\
& L_2(k+1)=0.5 L_1(k)-L_2(k)
\end{aligned}
$$

Rewriting the equations in matrix form, we get

$$
\left[\begin{array}{l}
L_1(k+1) \\
L_2(k+1)
\end{array}\right]=\left[\begin{array}{c}
-L_1(k)+2 L_2(k) \\
0.5 L_1(k)-L_2(k)
\end{array}\right]+\left[\begin{array}{c}
2 V(k) \\
0
\end{array}\right]
$$
The membership functions are given in Fig. P13.5b and the rules are presented in this table:
The initial conditions are $L_1(0)=1 \mathrm{H}$ and $L_2(0)=-1 \mathrm{H}$. Conduct a simulation of the system.

Lainey Roebuck
Lainey Roebuck
Numerade Educator

Problem 6

We have a cylindrical tank with cross-sectional area, $A_c$. Liquid flows in at a rate $F_i$ and liquid flows out at a constant rate $F_0$. We want to control the tank liquid level $h$ using a level controller to change the liquid level set height $h_{\mathrm{s}}$. The available tank liquid height is $H_{\mathrm{T}}$. The flow rate in the tank $\left(F_1\right)$ is proportional to the percentage that the value is opened. We call this set flow into the tank $F_{\mathrm{sa}}$.

$$
\begin{aligned}
& F_{\mathrm{i}}-F_{\mathrm{o}}=A_{\mathrm{c}} \frac{\mathrm{d} h}{\mathrm{~d} t} \\
& \frac{\mathrm{d} h}{\mathrm{~d} t}=\frac{F_{\mathrm{i}}-F_{\mathrm{o}}}{A_{\mathrm{c}}}
\end{aligned}
$$

The difference between the liquid-level setpoint and the actual tank liquid level is

$$
e=h-h_{\mathrm{s}}
$$

and the percentage difference is

$$
e=\frac{h-h_5}{h}
$$

The percentage difference is used to govern the flow into the system with the following rules:

$$
\begin{aligned}
& \text { If } e=0 \% \text { then } \Delta F_1=0 \\
& \text { If } e>10 \% \text { then } \Delta F_{\mathrm{i}}=4 \% \\
& \text { If } e<-10 \% \text { then } \Delta F_1=-4 \%
\end{aligned}
$$
The percentage change in flow into the system $\left(\Delta F_i\right)$ is

$$
\Delta F_1 \%=\frac{F_{\text {is }}-F_{\mathrm{i}}}{F_{\text {is }}}
$$

The initial values are

$$
\begin{aligned}
F_{\mathrm{is}} & =0.3 \mathrm{~m}^3 / \mathrm{s} \\
F_{\mathrm{is}} & =0.3 \mathrm{~m}^3 / \mathrm{s} \\
H_{\mathrm{T}} & =2 \mathrm{~m} \\
A_{\mathrm{c}} & =3 \mathrm{~m}^2 \\
h_{\mathrm{s}} & =1 \mathrm{~m}
\end{aligned}
$$

At $t=0$ the disturbance in the inlet flow is

$$
\begin{aligned}
F_1 & =0.4 \mathrm{~m}^3 / \mathrm{s} \\
F_{\mathrm{o}} & =0.3 \mathrm{~m}^3 / \mathrm{s} \\
e & =0
\end{aligned}
$$

At $t=0.5 \mathrm{~s} \Delta h=(0.4-0.3) / 3=0.03 \mathrm{~m}$; thus $h=1.03 \mathrm{~m}$ and $e=(1.03-1) / 1=3 \%$.
We now make use of the fuzzy controller. The single-input membership function is as shown in Fig. P13.6a:
while the output membership function is as shown in Fig. P13.6b:
Using a weighted average defuzzification, conduct a three-cycle simulation of this system.

Check back soon!

Problem 7

The transport of toxic chemicals in water principally depends on two phenomena: advection and dispersion. In advection, the mathematical expression for time-variable diffusion is a partial differential equation accounting for concentration difference in space and time, which is derived from Fick's first law:

$$
\begin{aligned}
& J=-D A \cdot \frac{\Delta C}{\Delta x} \\
& V \cdot \frac{\Delta C}{\Delta t}=-D A \cdot \frac{\Delta C}{\Delta x} \quad \text { and } \quad V=A \cdot \Delta \alpha \\
& \frac{\Delta C}{\Delta t}=-D \cdot \frac{\Delta C}{\Delta x \Delta x} \quad \Rightarrow \quad \frac{\Delta C}{\partial t}=-D \frac{\partial^{\top} C}{\partial x^2}
\end{aligned}
$$

where $\quad J=$ the mass flux rate due to molecular diffusion, $\mathrm{mg} / \mathrm{s}$
$D=$ the molecular diffusion coefficient, $\mathrm{cm}^2 / \mathrm{s}$
$A=$ the area of the cross section, $\mathrm{cm}^2$

$$
\begin{aligned}
& \frac{\Delta C}{\Delta t}=\text { the concentration gradient in time, } \mathrm{mg} / \mathrm{cm}^3 / \mathrm{s} \\
& \Delta x=\text { movement distance, } \mathrm{cm}
\end{aligned}
$$

So if we want to control $\Delta C / \Delta t$, we can set a control with the following inputs:

$$
\begin{aligned}
& W_1=C\left(\text { concentration, } \mathrm{mg} / \mathrm{cm}^3 \mathrm{~cm}\right) \\
& W_2=\frac{\Delta C}{\Delta x}\left(\text { concentration gradient in space, } \mathrm{mg} / \mathrm{cm}^3 \mathrm{~s}\right)
\end{aligned}
$$

and the output: $\Delta C / \Delta t=\alpha$. So

$$
\frac{\mathrm{d} W_1}{\mathrm{~d} x}=W_2 \text { and } \frac{\mathrm{d} W_2}{\mathrm{~d} x}=-\alpha \quad\left(\text { if } D=1.0 \mathrm{~cm}^2 / \mathrm{s}\right)
$$

Therefore

$$
W_1(k+1)=W_1(k)+W_2(k) \quad \text { and } \quad W_2(k+1)=W_2(k)-\alpha(k)
$$

For this problem, we assume

$$
\begin{aligned}
& 0 \leq W_1 \leq 2000 \mathrm{mg} / \mathrm{cm}^3 \\
& -400 \leq W_2 \leq 0 \mathrm{mg} / \mathrm{cm}^3 \\
& 0 \leq \alpha \leq 80 \mathrm{mg} / \mathrm{cm}^3
\end{aligned}
$$

( $W_2$ is negative because flow direction is from high concentration to low concentration). Step 1: Partition $W_1$ to zero (PZ), low (PL), high (PH) (Fig. P13.7a).

Check back soon!

Problem 8

GIS (Global Information System) is a powerful tool in environmental modeling. It integrates geographical information with data stored in databases. The main issue in using GIS is selecting the appropriate spatial resolution. If the spatial resolution selected is low, then the mapping tool cannot fully represent the true topography. On the other hand, if the spatial resolution selected is too high, then the database size will be larger than necessary, thus increasing storage requirement and processing speed.
Two parameters can be used in a fuzzy control system to govern the GIS. The first one is the digital elevation (DE) value. This value is the difference between the highest and lowest elevation in a certain geographical area. The second parameter is the area of coverage (AC). The update equation is defined as follows:

$$
\mathrm{DE}_{\mathrm{new}}=\frac{\mathrm{SR}^2}{\mathrm{AC}} \mathrm{DE}_{\mathrm{old}}+\mathrm{DE}_{\mathrm{old}}
$$

In the above equation SR represents spatial resolution (meters).
The first input is DE and can be either \{small, medium, large\} (in meters) as shown in Fig. P13.8a, the second input is AC and can be either \{small, medium, large\} (in meters ${ }^2$ ) as shown in P13.8b, and SR is the output, which can either be \{increase (I), decrease (D)\} as seen in Fig. P13.8c and the FAM table.

Check back soon!

Problem 9

A businessman employs five people: one engineer to do his SPC work and four woodcarvers. The woodcarvers sit by the side of the road and carve figures of small animals for tourists. For the purposes of this problem each figure is equally hard to carve. The tourist picks the type of figure and the type of wood that the figure is to be carved from. There are several types of wood with ratings of 0 for very soft to 10 for very hard. The tourist pays a price for the carving based upon the number of flaws in the final product. The businessman wants to be able to keep track of the quality of the work, but knows that number of flaws alone is not a good metric. The number of flaws per worker per day is a function of the hardness of the wood and the number of carvings each worker has to do each day. The businessman decides to use the fuzzy "type of day" approach discussed in this chapter for his SPC work. He develops rules of the form

If the wood hardness is . . . and the number of carvings is . . . and the number of flaws is ...
Then the type of day is ....
The input membership functions are described by the following triangular fuzzy numbers:
Wood hardness: Soft $(0.0,0.0,10.0)$; Hard $(0.0,10.0,10.0)$
Number of carvings: Small $(0.0,0.0,5.0)$; Medium ( $0.0,5.0,10.0)$; Large ( $5.0,10.0,10.0)$
Number of flaws: Small ( $0.0,0.0,50.0$ ); Medium ( $0.0,50.0,100.0)$; Large $(50.0,100.0,100.0)$

The output membership functions are the day types Good, Fair, OK, Bad, and Terrible, and are exactly the same as those shown in the body of the text.

There are 18 rules and they are given in Table P13.9a.
The businessman uses $\bar{X}-R$ charts to gain information about the quality of his product. For these charts he computes a type of day for each worker, each day, using his fuzzy rule-based system. He then uses the four type of day readings to compute his set average and set range. He does this for about 20 working days and then computes his grand average, average range, and control limits. Since he is paying his woodcarvers the minimum wage, there is quite a bit of turnover. For this reason he keeps his $R$ charts to see if a statistical difference between workers develops. He also keeps the $\bar{X}$ charts to see if the average type of day is changing with any statistical significance over a period of time. Since the turnover rate is high, he does not know his carver's names. They are just called A, B, C, and D. One other thing that the businessman is looking for is: Has there been an out-of-control situation during the last control period? He makes his carvers work out of doors, because it attracts tourists. But the number of flaws in the carvings also influence the price of the carvings and his profit.

The 20 day period has ended and the SPC engineer has nearly completed the analysis. There was some bad weather during this period and the businessman wants to know if there was a statistically significant effect on the quality of work, or on the type of day. Unfortunately, his engineer left work early before the calculation was completed. Table P13.9b lists the partially completed work of the SPC engineer.

Day 20 was nearly completed but not quite. Worker A had a type of day of 0.45 , worker B had a type of day of 0.45 , and worker C had a type of day of 0.43 . The type of day calculation was not finished for worker D. Worker D had the following statistics: the number of carvings was 5 , the total number of flaws was 35 , and the average wood hardness for these wood carvings for the day was 8 .

Assume that you are the businessman. Finish the calculations by computing the following:
(a) The type of day for worker D.
(b) The set average and set range for day 20 .
(c) The grand average, the average range, and all of the control limits for the $20 \bar{X}$ and $R$ values.
(d) Determine from the $\bar{X}$ chart if the system was ever "out of control",
(e) Is there anything in the $R$ chart that would indicate a significant difference between the workers at any time?

Check back soon!

Problem 10

In this problem we have a hot liquid that is a product stream coming from a poorly mixed stirred tank reactor. The reaction is exothermic so that the fluid leaving the reactor can get very hot. This fluid is cooled with cooling water flowing through a counter-current heat exchanger, with the hot fluid on the shell side. The situation is depicted in Fig. P13.10. The hot fluid temperature needs to be maintained at about $110^{\circ} \mathrm{F}$, because it is used in another process. There is some leeway. The process that is accepting the new hot fluid can easily handle a fluctuation of $\pm 5^{\circ} \mathrm{F}$. Differences much larger than this start to become a problem. The cooling water comes from a cooling tower where the temperature of the cold water is maintained at $85^{\circ} \mathrm{F}$. Since this temperature is constant, the only way of controlling the hot fluid temperature is to allow more or less cooling water to flow through the heat exchanger. The flow is controlled by opening and closing a control valve. The amount of flow through the valve is relative to the valve stem position. A stem position of 1 represents fully opened and a position of 0 equals fully closed. The system is controlled using an SISO fuzzy control system. The fuzzy rules for the system are of the form:

If the $\Delta T$ is ... Then the valve fractional change is . . . .
where $\Delta T$ is $T-T_{\mathrm{s}}$, or the current hot fluid temperature minus the setpoint temperature.
The valve fractional change, $f$, is a fraction defined by the output membership functions of a Range. If the fraction, $f$, is greater than 0 , the Range is defined as "full open'" (1.0) minus the current valve position. If $f$ is less than 0 , the Range is defined as the current valve position. The control action described by the fuzzy controller is:

New valve position $=$ old valve position $+f *$ Range
The fuzzy rules are given in Table P13.10.
There are five input membership functions for $\Delta T$. Since they are not all triangles, we will give the $(x, y)$ coordinates rather than the TFNs:
- Large negative: $(-20.0,1.0)(-15.0,1.0)(-10.0,0.0)$
- Small negative: $(-15.0,0.0)(-10.0,1.0)(-5.0,0.0)$
- Zero: $(-10.0,0.0)(-5.0,1.0)(+5.0,1.0)(+10.0,0.0)-$ note the dead band
- Small positive: $(+5.0,0.0)(+10.0,1.0)(+15.0,0.0)$
- Large positive: $(+10.0,0.0)(+15.0,1.0)(+20.0,1.0)$

There are five output membership functions for valve fractional change. Since they are all triangles, we will give their TFNs:
- Large negative: $(-1.5,-1.0,-0.5)$
- Small negative: $(-1.0,-0.5,0.0)$
- Zero: $(-0.5,0.0,0.5)$
- Small positive: $(0.0,0.5,1.0)$
- Large positive: $(0.5,1.0,1.5)$
Assuming that the current valve position is 0.6 calculate the following:
(a) If the hot fluid temperature suddenly increases to $113^{\circ} \mathrm{F}$, what is the new valve position recommended by the fuzzy controller?
(b) If the hot fluid temperature suddenly rises to $122^{\circ} \mathrm{F}$, what is the new valve position recommended by the fuzzy controller?
(c) If the hot fluid temperature suddenly drops to $98^{\circ} \mathrm{F}$, what would be the new valve position recommended by the fuzzy controller?

Check back soon!