**3. Mathematical modelling and transfer function of agent-based control system for sets of 'clustered' controller agents**

This section explores the techniques around the modelling and detailed design for the agent-based control system development. The mathematical theory involve multiple modelling techniques, while the decomposition of the control system is the shows the dynamic behaviour of all these modelling techniques. The idea synthesis and process model for an agent's collaboration and communication concepts was adopted from other scholars in the field of control. The development of an open architecture (OA) based intelligent fuzzy-PID; require the processing of the input signal variables (balise signal) going through the fuzzification with linguistic membership generation does not require a precise mathematical representation of the process. The train controller agent provides robust control and stability for the brake traction via rail controller agent within a range of operating parameter changes.

The closed-loop transfer function can be derived as shown in **Figure 2**, as a function of the fuzzy-PID controller gains as follows:

$$\mathbf{C}(\mathbf{s}) = \mathbf{G}\_3 \mathbf{D}\_\mathbf{s} + \mathbf{G}\_2 \mathbf{G}\_3 \mathbf{G}\_1 \left[ \mathbf{G}\_{\overline{f}\overline{f}} \mathbf{R}\_\mathbf{s} + \mathbf{G}\_{\overline{f}\overline{b}} \mathbf{G}\_\mathbf{c} \right] \tag{1}$$

$$C(s) = G\_3 D\_\iota + G\_2 G\_3 G\_4 G\_1 \left\{ \left[ G\_{\widetilde{f}\widetilde{f}} R\_\iota + G\_{\widetilde{f}\widetilde{b}} [R\_\iota - H C\_\mathcal{S}] \right] \right\} \tag{2}$$

Solving Eq. (2) for C(s), we get;

**Figure 2.** *Fuzzy-PID controller implementation design for train controller agent.*

$$\rm C(s) + G\_2G\_3G\_4G\_1HC\_s = G\_3D\_s + G\_2G\_3G\_4G\_1 \left(G\_{f\overline{f}} + G\_{f\overline{b}}\right) \tag{3}$$

Hence,

$$\text{C(s)} = \frac{\text{G}\_3\text{D}\_s + \text{G}\_2\text{G}\_3\text{G}\_4\text{G}\_1\text{(G}\_{\widetilde{\mathcal{F}}} + \text{G}\_{\widetilde{\mathcal{D}}}\text{)}\text{R}\_s}{\text{1} + \text{G}\_2\text{G}\_3\text{G}\_4\text{G}\_1} \tag{4}$$

indexes are [�*Mp*, + *Mp*], [0,*Ts*]. The linguistic terms are categorised into nine, which relates to error in speed of the train: small 1 (smal1), small 2 (smal2), small 3 (smal3), large 1 (lar1), large 2 (lar2), large 3 (lar3), zero (ze), positive 1 (pos1), and positive 2 (pos2) as presented in **Figure 3**. Similarly, the error is the change of the speed (Δe) and is presented as the fuzzy set {positive small (posmall), positive medium (posmed), zero (ze), positive (pos) and positive big (posbig)} over the interval from �10 to 10 *V*. Finally, the output signal is the fuzzy set {zero, positive small, positive medium, positive, positive big} over the interval of 0–24 *V*. The fuzzy controller has the knowledge base for a rule base and membership functions with linguistic terms in a triangular-shape. The derivation of the mathematical control equation extracted from the work of [46]; known as a method used in deriving a fuzzy model for a nonlinear system. There is an impossible nonlinear equation of motion enables by parallel distributed control, the derivation of the controller may assume a *scalar nonlinear functions Z*(*x*), modelled in the *domain X*, where *bm = min* (z) and *bM* = *max* (*z*). Then, two fuzzy sets *P*<sup>1</sup> and *P*<sup>2</sup> created as

*Agent-Based Control System as a Tool towards Industry 4.0: Directed Communication Graph…*

(*z*) and *U*<sup>2</sup>

bM � bm (10)

ð Þ *bM* � *bm* (11)

ð Þ*<sup>z</sup>* bm <sup>þ</sup> *<sup>U</sup>*<sup>2</sup>

<sup>2</sup> þ ð Þ 1 þ cos 2 *x*<sup>1</sup> *U* (12)

<sup>2</sup>*, Z*<sup>3</sup> ¼ 1 þ cos 2*<sup>x</sup>*<sup>1</sup> (13)

(*z*), then the fuzzy

ð Þ*z* bM

*Xx triangular membership functions* characterize by *U*<sup>1</sup>

*U*1 ð Þ¼ *z*

*U*2

<sup>2</sup> <sup>¼</sup> *<sup>x</sup>*<sup>1</sup> � *<sup>x</sup>*<sup>2</sup>

*<sup>Z</sup>*<sup>1</sup> <sup>¼</sup> *<sup>x</sup>*1*, Z*<sup>2</sup> <sup>¼</sup> *<sup>x</sup>*<sup>2</sup>

where *<sup>Z</sup>* represented exactly on the *<sup>X</sup>*-axis as *<sup>Z</sup>* <sup>¼</sup> *<sup>U</sup>*<sup>1</sup>

*x*\_

bm � Z

ð Þ¼ *<sup>z</sup>* ð Þ *<sup>Z</sup>* � *bm*

This model a nonlinear dynamic system used as a weighted average of linear

This system can be verify as an open-loop unstable (reference), defined as:

*Fuzzy-PID controller spreadsheet rules for the membership fuzzy and simulation structure containing input*

<sup>1</sup> ¼ *x*1*x*<sup>2</sup>

language for control rules will be represented as:

*DOI: http://dx.doi.org/10.5772/intechopen.87180*

systems, with the mathematical models: *x*\_

**Figure 3.**

**233**

*interfaces; rule block and output interface.*

Note that Eq. (4) gives the response C(s) when both reference input R(s) and disturbance input D(s) are present.

To find transfer function C(s)/R(s), we let D(s) = 0 in Eq. (4). Then we obtain

$$\frac{C(s)}{R(s)} = \frac{G\_2 G\_3 G\_4 G\_1 \left(G\_{\overline{f}\overline{f}} + G\_{\overline{f}\overline{b}}\right)}{1 + G\_2 G\_3 G\_4 G\_1} \tag{5}$$

Similarly, to obtain transfer function C(s)/D(s), we let R(s) = 0 in Eq. (1). Then C(s)/D(s) given by

$$\frac{C(s)}{D(s)} = \frac{G\_4}{1 + G\_2 G\_3 G\_4 G\_1 H} \tag{6}$$

#### **3.1 Fuzzy-PI-D controller as subset of train controller agent**

The maximum input of three-input fuzzy controller (*Z*1-feedforward, *Z*2 feedback and *Z*3-setpoint) and two-output, which is the correction factor of PID controller (max overshoot *Mp* and adjustment time,*Ts*), adopted from the work of [46] is as follows:

$$K\_p = K\_p + \Delta K\_p = K\_p(1 + Z1) \tag{7}$$

$$K\_i = K\_i + \Delta K\_i = K\_i(1 + \mathbf{Z}2) \tag{8}$$

$$K\_d = K\_d + \Delta\,K\_d = K\_d(1 + Z\mathfrak{Z})\tag{9}$$

*ΔKp*, *Δ Ki*, *Δ Kd* is the increment of *Kp*, *Ki*, *Kd:*

The physical domain setting for *Mp* and *Ts* is expected to generate the PID control system parameter set as *Kp* = 1, *Ki* = *Kd* = 0, the dynamic performance *Agent-Based Control System as a Tool towards Industry 4.0: Directed Communication Graph… DOI: http://dx.doi.org/10.5772/intechopen.87180*

indexes are [�*Mp*, + *Mp*], [0,*Ts*]. The linguistic terms are categorised into nine, which relates to error in speed of the train: small 1 (smal1), small 2 (smal2), small 3 (smal3), large 1 (lar1), large 2 (lar2), large 3 (lar3), zero (ze), positive 1 (pos1), and positive 2 (pos2) as presented in **Figure 3**. Similarly, the error is the change of the speed (Δe) and is presented as the fuzzy set {positive small (posmall), positive medium (posmed), zero (ze), positive (pos) and positive big (posbig)} over the interval from �10 to 10 *V*. Finally, the output signal is the fuzzy set {zero, positive small, positive medium, positive, positive big} over the interval of 0–24 *V*. The fuzzy controller has the knowledge base for a rule base and membership functions with linguistic terms in a triangular-shape. The derivation of the mathematical control equation extracted from the work of [46]; known as a method used in deriving a fuzzy model for a nonlinear system. There is an impossible nonlinear equation of motion enables by parallel distributed control, the derivation of the controller may assume a *scalar nonlinear functions Z*(*x*), modelled in the *domain X*, where *bm = min* (z) and *bM* = *max* (*z*). Then, two fuzzy sets *P*<sup>1</sup> and *P*<sup>2</sup> created as *Xx triangular membership functions* characterize by *U*<sup>1</sup> (*z*) and *U*<sup>2</sup> (*z*), then the fuzzy language for control rules will be represented as:

$$U^1(\mathbf{z}) = \frac{\mathbf{b}\mathbf{m} - \mathbf{Z}}{\mathbf{b}\mathbf{M} - \mathbf{b}\mathbf{m}}\tag{10}$$

$$U^2(z) = \frac{(Z - bm)}{(bM - bm)}\tag{11}$$

where *<sup>Z</sup>* represented exactly on the *<sup>X</sup>*-axis as *<sup>Z</sup>* <sup>¼</sup> *<sup>U</sup>*<sup>1</sup> ð Þ*<sup>z</sup>* bm <sup>þ</sup> *<sup>U</sup>*<sup>2</sup> ð Þ*z* bM This model a nonlinear dynamic system used as a weighted average of linear systems, with the mathematical models: *x*\_ <sup>1</sup> ¼ *x*1*x*<sup>2</sup>

$$\dot{\varkappa\_2} = \varkappa\_1 - \varkappa\_2^2 + (1 + \cos 2\varkappa\_1)U \tag{12}$$

This system can be verify as an open-loop unstable (reference), defined as:

$$Z\_1 = \varkappa\_1, Z\_2 = \varkappa\_2^2, Z\_3 = 1 + \cos 2\_{\varkappa\_1} \tag{13}$$

#### **Figure 3.**

*Fuzzy-PID controller spreadsheet rules for the membership fuzzy and simulation structure containing input interfaces; rule block and output interface.*

*C s*ðÞþ *G*2*G*3*G*4*G*1*HCs* ¼ *G*3*Ds* þ *G*2*G*3*G*4*G*<sup>1</sup> *Gff* þ *Gfb*

*C s*ðÞ¼ *<sup>G</sup>*3*Ds* <sup>þ</sup> *<sup>G</sup>*2*G*3*G*4*G*<sup>1</sup> *Gff* <sup>þ</sup> *Gfb*

Note that Eq. (4) gives the response C(s) when both reference input R(s) and

To find transfer function C(s)/R(s), we let D(s) = 0 in Eq. (4). Then we obtain

*R s*ð Þ <sup>¼</sup> *<sup>G</sup>*2*G*3*G*4*G*<sup>1</sup> *Gff* <sup>þ</sup> *Gfb*

*D s*ð Þ <sup>¼</sup> *<sup>G</sup>*<sup>4</sup>

The maximum input of three-input fuzzy controller (*Z*1-feedforward, *Z*2 feedback and *Z*3-setpoint) and two-output, which is the correction factor of PID controller (max overshoot *Mp* and adjustment time,*Ts*), adopted from the work

The physical domain setting for *Mp* and *Ts* is expected to generate the PID control system parameter set as *Kp* = 1, *Ki* = *Kd* = 0, the dynamic performance

1 þ *G*2*G*3*G*4*G*<sup>1</sup>

1 þ *G*2*G*3*G*4*G*<sup>1</sup>

Similarly, to obtain transfer function C(s)/D(s), we let R(s) = 0 in Eq. (1). Then

*Rs*

<sup>1</sup> <sup>þ</sup> *<sup>G</sup>*2*G*3*G*4*G*1*<sup>H</sup>* (6)

*Kp* ¼ *Kp* þ *Δ Kp* ¼ *Kp*ð Þ 1 þ Z1 (7) *Ki* ¼ *Ki* þ *ΔKi* ¼ *Ki*ð Þ 1 þ Z2 (8) *Kd* ¼ *Kd* þ *Δ Kd* ¼ *Kd*ð Þ 1 þ Z3 (9)

Hence,

*Control Theory in Engineering*

**Figure 2.**

C(s)/D(s) given by

of [46] is as follows:

**232**

disturbance input D(s) are present.

*C s*ð Þ

*Fuzzy-PID controller implementation design for train controller agent.*

*C s*ð Þ

**3.1 Fuzzy-PI-D controller as subset of train controller agent**

*ΔKp*, *Δ Ki*, *Δ Kd* is the increment of *Kp*, *Ki*, *Kd:*

(3)

(4)

(5)

In deriving a Takagi-Sugeno fuzzy system, it is assume that the bounded domain *X* is define by *x*<sup>1</sup> ∈½ � �10*;* 10 and *x*<sup>2</sup> ∈½ � �10*;* 10 where *x*<sup>1</sup> *and x*<sup>2</sup> is the T-S fuzzy system behaviour as exact duplicates in the equation in the domain. Then, the min *Z*<sup>1</sup> ¼ *b*1*<sup>m</sup>* ¼ �10*,* max *Z*<sup>1</sup> ¼ *b*1*<sup>m</sup>* ¼ 10*,* min *Z*<sup>2</sup> ¼ *b*2*<sup>m</sup>* ¼ 0*,* max *Z*<sup>2</sup> ¼ *b*2*<sup>m</sup>* ¼ 20*,* min *Z*<sup>3</sup> ¼ *b*3*<sup>m</sup>* ¼ 1*,* max *Z*<sup>3</sup> ¼ *b*3*<sup>m</sup>* ¼ 10*,*for *Z*1*, Z*2*,* and *Z*3*,* 11 yields

Then the above Eqs. (12) and (13) rewritten as:

$$
\begin{bmatrix} \dot{\mathbf{x}}\_1 \\ \dot{\mathbf{x}}\_2 \end{bmatrix} = \begin{bmatrix} \mathbf{0} & Z\_1 \\ \mathbf{1} & -Z\_2 \end{bmatrix} \begin{bmatrix} \mathbf{x}\_1 \\ \mathbf{x}\_2 \end{bmatrix} + \begin{bmatrix} \mathbf{0} \\ Z\_3 \end{bmatrix} U \tag{14}
$$

*The resultant equation for* Train controller agent *is the dynamic mass regarded as G*2.

<sup>2</sup> *Jm* þ

*ng* is the gear ratio, n is the gear efficiency, *r*<sup>0</sup> is the nominal rolling radius of the

*rr* is the radius of rotor shaft, l is the total of the traction system set, *Jw* is the total

*Mstc* ¼ *Mpass* þ *Mvb* þ nm 2ð *Mw* þ *Mx* þ *Mbr*Þ þ ð*Mb*<sup>1</sup> þ *Mb*<sup>2</sup> þ *Mb*3Þ þ *Mmotor* þ *Mg*

*Mpass* is the passenger mass, *Mw* is the mass of the single wheel, *Mx* is the axle mass, *Mbr* is the mass of the brake system, *Mb*1, *Mb*2, *Mb*<sup>3</sup> are bogie masses, *Mmotor* is

Rolling resistance created by the movement of rotating parts of the train, originated from the frictional torques such as rotor, bearing torques, axles, brake pads, gear teeth friction, etc. The mathematical expression of the rolling resistance

*K*<sup>0</sup> ¼ *MstcaRolling* þ n*:*m*:bRolling*

*K*<sup>1</sup> ¼ *Mstc, CRolling , aRolling, bRolling , CRolling* are running parameters, respectively. The movement of the railway vehicle takes place against the airflow, and the force that the air applies to the train affects the longitudinal movement of the train. The aerodynamic force is due to the common effects of the pressure difference between the front and the rear of the train. Air separation results in vortex formation behind the vehicle and the surface roughness of the vehicle body related with the skin friction. The parametric relationship of the aerodynamic resistance force

1 ð Þ 1 þ *y* 2 *r*2 0

<sup>2</sup> *Mr*ð Þ *rr* <sup>2</sup>

*FRolling* ¼ *K*<sup>0</sup> þ *K*1V (18)

*<sup>ρ</sup>airCdAvV*<sup>2</sup> <sup>¼</sup> *<sup>K</sup>*2*V*<sup>2</sup> (19)

), *Cd* is an aerodynamic drag coefficient, Av is

(20)

<sup>1</sup>þ*G*2*G*3*G*4*G*<sup>1</sup> as Train controller Agent equation is thus

*Jw* þ *Mstc* (16)

<sup>0</sup>*nm*

*l, Mr* is the motor mass,

(17)

*g* ð Þ 1 � *y*

*Agent-Based Control System as a Tool towards Industry 4.0: Directed Communication Graph…*

*<sup>G</sup>*<sup>2</sup> <sup>¼</sup> *Mdynamic* <sup>¼</sup> *nn*<sup>2</sup>

sum of the right and left wheel inertia and implies as *Jw* <sup>¼</sup> *Mwr*<sup>2</sup>

the total mass of the traction motor. *Mg* is denoted the gearbox mass.

*<sup>G</sup>*<sup>3</sup> <sup>¼</sup> *Faero* <sup>¼</sup> <sup>1</sup>

g is the gravitational constant, *Qg* is the gradient.

*R s*ð Þ <sup>¼</sup> *<sup>G</sup>*2*G*3*G*4*G*1ð Þ *Gff* <sup>þ</sup>*Gfb*

2

the frontal section of the train. These parameters represent a single parameter known as *K*2. A gradient force acts on the opposite direction to the movement of the train moving upwards on a road with slope. The gradient force is constant under the constant slope condition. Eq. (20) represents the mathematical form of the gradient

*G*<sup>4</sup> ¼ *Fgradient*<sup>¼</sup> þ *=* � *G*2g *a* tan *Qg*

wheel, *Jm* is the total motor *Kgm*<sup>2</sup> implies as *Jm* <sup>¼</sup> <sup>1</sup>

*DOI: http://dx.doi.org/10.5772/intechopen.87180*

shown in Eq. (18).

shown in the Eq. (19).

Recall Eq. (5)*, C s*ð Þ

force.

**235**

where, *ρair* is the air density (kg m3

where

$$\mathbf{G}\_{\mathbf{l}} = \mathbf{G}\_{\mathbf{l}\mathbf{l}-\mathbf{D}} \left( \mathbf{G}\_{\mathbf{f}\mathbf{f}} + \mathbf{G}\_{\mathbf{f}\mathbf{b}} \right) = \mathbf{K}\_p \left( \mathbf{1} + \frac{\mathbf{1}}{T\mathbf{i}\_l} \right) \left( \begin{vmatrix} \mathbf{x}\_1\\ \mathbf{x}\_2 \end{vmatrix} = \begin{bmatrix} \mathbf{0} & Z\_1\\ \mathbf{1} & -Z\_2 \end{bmatrix} \begin{bmatrix} \mathbf{x}\_1\\ \mathbf{x}\_2 \end{bmatrix} + \begin{bmatrix} \mathbf{0} \\ Z\_3 \end{bmatrix} U \right) \tag{15}$$

#### *3.1.1 Simulation results for fuzzy-PI-D controller*

This section presents a simulation example to show an application of the proposed fuzzy-PI-D controller spreadsheet rules for the membership fuzzy and simulation structure containing Input interfaces; rule block and output interface and its satisfactory performance (**Figure 4**).
