**4. Simulation-based controller design**

#### **4.1. Control scheme**

As shown in **Figure 5**, in the CMAC plus PD control scheme, the PD controller is used to train the weights of the CMAC at the early stage of control. The output *un* of the CMAC and the output *up* of the PD controller are integrated as the control command *u* to track the desired input command. Once the system is running, the PD controller will play a main role at the beginning. As the weights are tuned by *up* , *un* will increase to become the main control command. The fast learning speed prompts the leading role of control to switch from the PD controller to the CMAC.

CMAC employs the supervisory learning algorithm. At the end of each control step *k*, the controller calculates the corresponding output *un* (*k*), compares it with total control output *u*(*k*), amends the weights and enters into learning process to make error small between the total control output and the output of the CMAC. That means the total control output will be finally generated by the CMAC only via its learning strategy.

The control law can be described as

$$\begin{cases} \mu(k) = \mu\_{\nkern 1.5mu\text{-}c}(k) + \mu\_{p}(k) \\ \mu\_{\nkern 1.5mu\text{-}c}(k) = \sum\_{i=1}^{c} \pi \mu\_{\nkern 1.5mu\text{-}c} \\ \mu\_{p}(k) = k\_{p} e(k) + k\_{D} \frac{e(k) - e(k-1)}{t\_{\text{.}}} \end{cases} \tag{27}$$

**4.2. Simulations**

**Figure 6.** Output of the controller.

Voltage(v)

<sup>8</sup> x 10-3

sion is given as *r*(*t*) =  − 10*t*, where *t* is from 0 to 20 s.

Output Up of PD controller

<sup>0</sup> <sup>2</sup> <sup>4</sup> <sup>6</sup> <sup>8</sup> <sup>10</sup> <sup>12</sup> <sup>14</sup> <sup>16</sup> <sup>18</sup> <sup>20</sup> <sup>0</sup>

Time(s)

**Figure 5.** CMAC feedforward plus PD feedback control block diagram.

Choose the identified model (26) as the simulation plant to tune the controller and verify its performance. The force control is aimed at tracking a ramp command, of which the expres-

A CMAC-Based Systematic Design Approach of an Adaptive Embedded Control Force Loading…

http://dx.doi.org/10.5772/intechopen.71420

265

The CMAC plus PD controller is tuned and trained by simulations. **Figure 6** demonstrates that the PD controller plays a main role of control at the beginning. Then the control effect of the CMAC will gradually increase via learning from the output of the PD controller. Owing to the help of the CMAC, control performances are better than those of the only PD controller. Overshoots are reduced dramatically and control actions are speeded up while choosing the ramp signal as an input. **Figure 7(a)** shows an overview of control performances

(a) Output *up* of PD (b) Output *un* of CMAC

0.5

1

1.5

Voltage(v)

2

2.5

<sup>0</sup> <sup>2</sup> <sup>4</sup> <sup>6</sup> <sup>8</sup> <sup>10</sup> <sup>12</sup> <sup>14</sup> <sup>16</sup> <sup>18</sup> <sup>20</sup> <sup>0</sup>

Output Un of CMAC controller

Time(s)

where *wi* are weights of the CMAC, *ai* are binary vectors, *un* (*k*) is output of the CMAC, *uP*(*k*) is output of the PD controller, *kP* and *kD* are gains, *t s* is the sampling time and *e* is the error between *y* and *r*.

And the learning function of the CMAC is given as

$$\begin{aligned} \text{In of the CMAC is given as} \\ \begin{cases} E(k) = \frac{1}{2} \{ u(k) - u\_n(k) \}^2 \frac{a\_i}{c} \\ \Delta w(k) = \eta \frac{u(k) - u\_n(k)}{c} a\_i = \eta \frac{u\_p(k)}{c} a\_i \\ w(k) = w(k-1) + \Delta w(k) + \alpha(w(k) - w(k-1)) \end{cases} \end{aligned} \tag{28}$$

where *E* is the adjusting index, *η* is the learning speed and *η* ∈ (0, 1), *α* is the inertial variable and *α* ∈ (0, 1) and *c* is the generalizing parameter.

Once the system starts running, the controller initializes *w* = 0, then we have *un*  = 0 and *u* = *uP* at the beginning. At the early stage, the system is mainly controlled by the PD controller. As the CMAC is learning, error *e* will decreases, which makes *un* (*k*) increase to become the main control command. Although the CMAC is trained by the output of the PD controller, the output of the CMAC is not a simple imitation of the output of the PD controller. The PD controller helps the CMAC to improve its performances, restrain disturbance and enhance stability of the closed-loop system. If the PD controller works alone, control performances are determined by the gain *kP* to a great extent. If the CMAC and PD controller work together, control performances will be independent of *kP*, which is flexible in a rational span.

A CMAC-Based Systematic Design Approach of an Adaptive Embedded Control Force Loading… http://dx.doi.org/10.5772/intechopen.71420 265

**Figure 5.** CMAC feedforward plus PD feedback control block diagram.

#### **4.2. Simulations**

**4. Simulation-based controller design**

the weights of the CMAC at the early stage of control. The output *un*

, *un*

finally generated by the CMAC only via its learning strategy.

⎧ ⎪ ⎨ ⎪ ⎩

*uP*

*u*(*k*) = *un*

(*k*) = ∑ *i*=1 *c wi ai* 

<sup>2</sup> (*u*(*k*) <sup>−</sup> *un*

 *w*(*k*) <sup>=</sup> *<sup>η</sup> u*(*k*) − *un* (*k*) \_\_\_\_\_\_\_\_ *<sup>c</sup> ai* <sup>=</sup> *<sup>η</sup>*

Once the system starts running, the controller initializes *w* = 0, then we have *un*

control performances will be independent of *kP*, which is flexible in a rational span.

As the CMAC is learning, error *e* will decreases, which makes *un*

controller calculates the corresponding output *un*

are weights of the CMAC, *ai*

is output of the PD controller, *kP* and *kD* are gains, *t*

And the learning function of the CMAC is given as

⎧ ⎪ ⎨ ⎪ ⎩

and *α* ∈ (0, 1) and *c* is the generalizing parameter.

*E*(*k*) = \_\_1

As shown in **Figure 5**, in the CMAC plus PD control scheme, the PD controller is used to train

 of the PD controller are integrated as the control command *u* to track the desired input command. Once the system is running, the PD controller will play a main role at the beginning. As

ing speed prompts the leading role of control to switch from the PD controller to the CMAC.

CMAC employs the supervisory learning algorithm. At the end of each control step *k*, the

*u*(*k*), amends the weights and enters into learning process to make error small between the total control output and the output of the CMAC. That means the total control output will be

> (*k*) + *uP* (*k*)

are binary vectors, *un*

(*k*))<sup>2</sup> *<sup>a</sup>* \_\_*i c*

*w*(*k*) = *w*(*k* − 1) + *w*(*k*) + *α*(*w*(*k*) − *w*(*k* − 1))

where *E* is the adjusting index, *η* is the learning speed and *η* ∈ (0, 1), *α* is the inertial variable

at the beginning. At the early stage, the system is mainly controlled by the PD controller.

main control command. Although the CMAC is trained by the output of the PD controller, the output of the CMAC is not a simple imitation of the output of the PD controller. The PD controller helps the CMAC to improve its performances, restrain disturbance and enhance stability of the closed-loop system. If the PD controller works alone, control performances are determined by the gain *kP* to a great extent. If the CMAC and PD controller work together,

*s*

*uP* (*k*) \_\_\_\_ *<sup>c</sup> ai*

*<sup>e</sup>*(*k*) <sup>−</sup> *<sup>e</sup>*(*<sup>k</sup>* <sup>−</sup> <sup>1</sup>) \_\_\_\_\_\_\_\_\_ *<sup>t</sup> s*

*un*

(*k*) = *kPe*(*k*) + *kD*

will increase to become the main control command. The fast learn-

of the CMAC and the output

(27)

(28)

 = 0 and *u* = *uP*

(*k*) increase to become the

(*k*), compares it with total control output

(*k*) is output of the CMAC, *uP*(*k*)

is the sampling time and *e* is the error

**4.1. Control scheme**

264 Adaptive Robust Control Systems

the weights are tuned by *up*

The control law can be described as

*up*

where *wi*

between *y* and *r*.

Choose the identified model (26) as the simulation plant to tune the controller and verify its performance. The force control is aimed at tracking a ramp command, of which the expression is given as *r*(*t*) =  − 10*t*, where *t* is from 0 to 20 s.

The CMAC plus PD controller is tuned and trained by simulations. **Figure 6** demonstrates that the PD controller plays a main role of control at the beginning. Then the control effect of the CMAC will gradually increase via learning from the output of the PD controller. Owing to the help of the CMAC, control performances are better than those of the only PD controller. Overshoots are reduced dramatically and control actions are speeded up while choosing the ramp signal as an input. **Figure 7(a)** shows an overview of control performances

(a) Output *up* of PD (b) Output *un* of CMAC

**Figure 6.** Output of the controller.

**5. Embedded system-based experiments**

trol system. The control step size is set as 50 ms.

through ADC to the microcontroller.

**Figure 9.** Actual force tracking control diagram.

For verifying the controller's adaption to modeling error in the real-time control experiments, we implement above control law in C language and download compiled files into the embedded system. The central processing unit is an ARM7-based processor LPC2294. The LPC2294 is a 32-bit reduced instruction set computer (RISC) processor with low power consumption and high performance. Although there is no Float Point Unit (FPU) in this processor, the 70 million instructions per second (MIPS) processing speed makes it ideal for the real-time con-

A CMAC-Based Systematic Design Approach of an Adaptive Embedded Control Force Loading…

http://dx.doi.org/10.5772/intechopen.71420

267

The actual force tracking control diagram is shown in **Figure 9**. The force is applied to the glass sheet specimen by a loader which is connected to a linear motor actuator through a steel bar. A three point bending test is utilized under this configuration. The load force followed a ramp function with time as the independent variable. The slope of the ramp function can be programmed through the LCD touch screen. The force range can be from 0 to 300 lbs. Displacement of the motor, which also reflected the deformation of the glass sheet specimen, is recorded during the test. The signal flow of the control system is as follows. The DAC generates the control outputs as a voltage signal, which is amplified by a power amplifier and exerted on the linear motor. The linear motor then transforms the voltage signal into rotation, and generates linear displacements. The force sensor and conditioner measure the displacements and generates charges, which are transformed back to a voltage signal and fed back

**5.1. Experiments**

**Figure 7.** Simulation results.

from 0 to 20 s. **Figure 7(b)** is an enlarged view of control performances from 19 to 20s. It can be seen that the system output well tracks the input command. **Figure 8** further exhibits the superiority of the CMAC: the tracking errors are tiny, mostly between −0.2 and 0.2 lbs. Since there exists a modeling error between identified system and actual controlled plant, the controller's performances will be further validated in the real material-strength testing experiments.

**Figure 8.** Tracking error.
