**6. The cascaded SISO outer-loop design for the camera movement adjustment control system**

As introduced in Section 4.1, we use the Image Based Visual Stereo (IBVS) as the framework for cascaded control design of both the visual and the manipulation system. The inner-loop is the joint control loop, as discussed previously. In the IBVS, an outer feedback control is designed in addition to the inner feedback control so that the 2D visual features can be compared and matched. Therefore, a camera model is required in the feedback loop to map the joint angles to the object visual features (e.g., 2D coordinates of the object in the image frame). To start from a simple case, we discuss the requirements for the design of the cascaded control for a SISO system. Assume, we only measure and try to control one feature: the coordinate of the object in one axis, then the overall cascaded control diagram of this configuration is shown in **Figure 12**.

*uR* is the target of *u* coordinate of a point (one reference point in visual system). *Gcout* is the outer-loop controller, which provides the target joint angle *qRv* to the robot arm based on the image coordinate error *euR* . A combined uncertainty signal, *dqv* (e.g., sensor noise, backlash, friction, and compliance due to gear reduction in the joint) is added to the joint angle of rotation *qv*, the output of the inner control loop. Furthermore, the initial joint angle of robot manipulator, *qv*<sup>0</sup> , is added to the output joint angle with disturbance, *qv ^*, to generate the final joint angle *qv <sup>f</sup> ^*.

### **6.1 The camera sensor model for the SISO control design**

In this section, we are going to present a simplified mathematical model of the camera. Let us consider a one-link robot manipulator with a camera that can be rotated around the *Z*-axis, as shown in **Figure 13**. Let us also consider a point that is located in the *X* � *Y* plane.

We use a Cartesian coordinate frame *OXYZ*, which is attached at the camera center. The *X*-axis is perpendicular to the camera lens and the coordinate frame rotates around *Z*-axis. A point whose coordinate is (*XP*, *YP*, 0) in the rotational frame is projected on the image *u* � *v* plane with its coordinates as ð Þ *u*, 0 . In addition, an inertial frame *OXYZ* is shown at the base of the manipulator in **Figure 13**.

We derive the equations for a pin-hole camera model (a monocular case in stereo model in Section 2.1). Assuming the skew coefficient and image coordinate offsets are zero (*sc* ¼ *u***<sup>0</sup>** ¼ *v***<sup>0</sup>** ¼ **0**), then from Eq. (1), the one-dimensional image coordinate u can be written as:

**Figure 12.** *Control block diagram for the SISO camera movement adjustment system.*

*Role of Uncertainty in Model Development and Control Design for a Manufacturing Process DOI: http://dx.doi.org/10.5772/intechopen.104780*

### **Figure 13.**

*One-link manipulator with a camera.*

The coordinate system, located at the camera center, rotates with the camera. Assume the camera starts at the position where the *X*-axis is parallel to the *X*-axis of the inertial coordinate system and positive angle is defined when the camera rotates in a clockwise direction with an angle *q* around *Z*-axis. After the frame rotates *q* clockwise, the new coordinates of the point in the new coordinate frame (*X*<sup>0</sup> *<sup>P</sup>*, *Y*<sup>0</sup> *<sup>P</sup>*, 0) can be computed as:

$$
\begin{bmatrix} X\_P' \\ Y\_P' \end{bmatrix} = \begin{bmatrix} \cos\left(q\right) & -\sin\left(q\right) \\ \sin\left(q\right) & \cos\left(q\right) \end{bmatrix} \begin{bmatrix} X\_P \\ Y\_P \end{bmatrix} \tag{38}
$$

Combining Eqs. (37) and (38), the new image coordinate, *u*<sup>0</sup> , can be calculated as:

$$u' = \frac{f\_{\
u} Y\_P'}{X\_P'} = f\_{\
u} \frac{X\_P \sin\left(q\right) + Y\_P \cos\left(q\right)}{X\_P \cos\left(q\right) - Y\_P \sin\left(q\right)}\tag{39}$$

Let us write the coordinates (*XP*, *YP*) in the polar coordinates, such that,

$$R = \sqrt{{X\_P}^2 + {Y\_P}^2}$$

and

$$X\_P = R\cos(\rho), Y\_P = R\sin(\rho),$$

where

$$\rho = \tan^{-1}(Y\_P/X\_P) \tag{40}$$

Therefore, Eq. (39) can be written in the polar form as:

$$u' = f\_{\
u} \frac{R \sin(\varphi + q)}{R \cos(\varphi + q)} = f\_{\
u} \tan(\varphi + q) \tag{41}$$

The angle *φ* is the angle of the point with respect to the *X*-axis and the angle *q* is is already defined. Eq. (41) mathematically expresses a model of the camera sensor shown in the block diagram of **Figure 13**.

### **6.2 Outer-loop controller design**

In the previous sections, we presented the results for designing inner joint loop controllers using Youla parameterization method. In the following two sections, we will discuss the design of the outer-loop controllers by using two different approaches:


### *6.2.1 Feedback linearization*

Let us relook at the cascaded block diagram in **Figure 12**. The inner closed loop transfer function is already derived in (32):

$$T\_{inner-closed} = \frac{q\_v(\mathfrak{s})}{q\_{R\_v}(\mathfrak{s})} = \frac{\left(\mathfrak{3}\mathfrak{r}\_{in}\mathfrak{s} + \mathfrak{1}\right)}{\left(\mathfrak{r}\_{in}\mathfrak{s} + \mathfrak{1}\right)^3} \tag{42}$$

Notice we replaced *τ* with *τin* to indicate bandwidth of inner-closed loop. Using Eq. (41) and considering the block diagram in **Figure 12**, we can write:

$$\widehat{u\_R} = f\_u \tan\left(\rho + \leadsto \neg q\_{vf}\right), \text{with } \rho = \tan^{-1}(Y\_P/X\_P) \tag{43}$$

We can rewrite (42) and (43) in time domain, by introducing an intermediate variable or state, *W*, as:

$$
\pi\_{in}^{\cdots}\mathcal{W} + \mathfrak{Z}\pi\_{in}^{2}\ddot{\mathcal{W}} + \mathfrak{Z}\pi\_{in}\dot{\mathcal{W}} + \mathcal{W} = q\_{R\_{\nu}}\tag{44}
$$

$$\int f\_u \tan \left( \wp + q\_{v0} + \mathfrak{J} \tau\_{\dot{m}} \dot{W} + W \right) = \widehat{u\_R} \tag{45}$$

Eqs. (44) and (45) describe a nonlinear third order system, where *W* is the state, *qRv* is the input and *<sup>u</sup>*c*<sup>R</sup>* is the output. We can use feedback linearization method to design the outer-loop controller by taking the second order derivative of (45) and combine with (44) to obtain:

$$
\ddot{\hat{\mu}\_R} = R\left(\mathcal{W}, \dot{\mathcal{W}}, \ddot{\mathcal{W}}\right) + G\left(\mathcal{W}, \dot{\mathcal{W}}, \ddot{\mathcal{W}}\right)q\_{R\_v} \tag{46}
$$

where

$$R\left(\dot{W}, \dot{W}, \ddot{W}\right) = 2f\_u \cos^{-2}\left(\rho + q\_{v0} + 3\varepsilon\_{\text{in}}\dot{W} + \dot{W}\right) \tan\left(\rho + q\_{v0} + 3\varepsilon\_{\text{in}}\dot{W} + \dot{W}\right)$$

$$\left(3\varepsilon\_{\text{in}}\ddot{W} + \dot{W}\right)^2 - f\_u \cos^{-2}\left(\rho + q\_{v0} + 3\varepsilon\_{\text{in}}\dot{W} + \dot{W}\right)\left(8\dot{W} + \frac{9}{\varepsilon\_{\text{in}}}\dot{W} + \frac{3}{\varepsilon\_{\text{in}}}W\right) \tag{47}$$

$$G\left(W, \dot{W}, \ddot{W}\right) = f\_u \cos^{-2}\left(\rho + q\_{v0} + 3\varepsilon\_{\text{in}}\dot{W} + \dot{W}\right)\frac{3}{\varepsilon\_{\text{in}}}\tag{48}$$

We can transform or map these variables so that the nonlinear system in (47)–(48) can be written as an equivalent linear state-space representation as follows:

*Role of Uncertainty in Model Development and Control Design for a Manufacturing Process DOI: http://dx.doi.org/10.5772/intechopen.104780*

$$e\_1 = f\_{\
u} \tan \left( \wp + q\_{v0} + \mathfrak{Z} \mathfrak{r}\_{\dot{m}} \dot{\mathcal{W}} + \mathcal{W} \right) \tag{49}$$

$$\varepsilon\_2 = \dot{\varepsilon}\_1 = f\_{\text{ul}} \cos^{-2} \left( \rho + q\_{v0} + \mathfrak{H}\tau\_{\text{in}} \dot{W} + \mathcal{W} \right) \cdot \left( \mathfrak{H}\tau\_{\text{in}} \ddot{W} + \dot{\mathcal{W}} \right) \tag{50}$$

We can write the state-space form of (49) and (50) as:

$$
\dot{\boldsymbol{\varepsilon}} = \begin{bmatrix} \dot{\boldsymbol{\varepsilon}}\_1 \\ \dot{\boldsymbol{\varepsilon}}\_2 \end{bmatrix} = \begin{bmatrix} \mathbf{0} & \mathbf{1} \\ \mathbf{0} & \mathbf{0} \end{bmatrix} \begin{bmatrix} \boldsymbol{e}\_1 \\ \boldsymbol{e}\_2 \end{bmatrix} + \begin{bmatrix} \mathbf{0} \\ \mathbf{1} \end{bmatrix} \boldsymbol{U} \tag{51}
$$

$$
\widehat{u\_R} = [\mathbf{1} \,\mathbf{0}] \begin{bmatrix} \varepsilon\_1 \\\\ \varepsilon\_2 \end{bmatrix} \tag{52}
$$

where

$$U = G(\mathcal{W}, \dot{\mathcal{W}}, \ddot{\mathcal{W}}) q\_{\mathbb{R}\_{\mathbb{v}}} + \mathcal{R}(\mathcal{W}, \dot{\mathcal{W}}, \ddot{\mathcal{W}}) \tag{53}$$

Transform the state-space representation back to the transfer function form, we can write:

$$G p\_{nominal} = \frac{\widehat{u\_R}(s)}{U(s)} = \text{C}(sI - A)^{-1}B = \frac{1}{s^2} \tag{54}$$

where

$$A = \begin{bmatrix} \mathbf{0} & \mathbf{1} \\ \mathbf{0} & \mathbf{0} \end{bmatrix}, B = \begin{bmatrix} \mathbf{0} \\ \mathbf{1} \end{bmatrix}, \text{and } \mathbf{C} = \begin{bmatrix} \mathbf{1} \ \mathbf{0} \end{bmatrix} \tag{55}$$

Since the *Gpnominal* is the same as the plant transfer function in (27), the design of Youla controller for this linear system is similar to (28)–(35). Therefore, the transfer function of the outer-loop controller can be written as:

$$\mathbf{G}\_{\mathfrak{c}\_{\text{out}}} = \frac{\mathfrak{Z}\mathfrak{r}\_{\text{out}}\,^2\mathfrak{s} + \mathbf{1}}{\mathfrak{r}\_{\text{out}}\,^3\mathfrak{s} + \mathfrak{Z}\mathfrak{r}\_{\text{out}}\,^2} \tag{56}$$

*τout* determines the pole and zero locations of closed-loop transfer function of the outer-loop controller and therefore, represents the bandwidth of outer-loop controller. We must make sure that *τout* >*τin* so that inner-loop responds faster than the outer-loop in the cascaded control design strategy. The overall block diagram is shown in **Figure 14**.

The states *<sup>W</sup>*,*W*\_ ,*W*€ are computed from the rotational angle and its derivative *qv <sup>f</sup> ^* and \_ *qv f ^*. From Eq. (42), we can obtain the following relationship:

$$
\stackrel{\rightharpoonup}{q\_{v\_f}} = \mathfrak{Z}\mathfrak{r}\_{in}\dot{\mathcal{W}} + \mathcal{W} \tag{57}
$$

Therefore, the transfer function from *W* to *qvf ^* can be written as:

$$W(s) = \frac{1}{\mathfrak{J}\tau\_{in}s + 1} \overset{\smile}{q\_{v\_f}}(s) \tag{58}$$

**Figure 14.**

*The block diagram of the SISO outer-loop control with feedback linearization for robot arm movement adjustment.*

Also, we can obtain the transfer function of *W s* \_ ð Þ and *W s* € ð Þ as:

$$\dot{W}(s) = \frac{1}{3\tau\_{\dot{m}}s + 1} \overset{\cdot}{q\_{v\_f}}(s) \tag{59}$$

$$
\ddot{\mathcal{W}}(s) = \frac{s}{3\tau\_{\dot{m}}s + 1} \overset{\cdot}{q\_{v\_f}}(s) \tag{60}
$$

Eqs. (58)–(60) are shown as the state transformation block in **Figure 14**. It is worthwhile to note that the equation in the nonlinear interface:

$$q\_{R\_\tau} = \frac{-R\left(W, \dot{W}, \ddot{W}\right)}{G\left(W, \dot{W}, \ddot{W}\right)} + \frac{1}{G\left(W, \dot{W}, \ddot{W}\right)}U\tag{61}$$

is only defined when *G W*,*W*\_ , *<sup>W</sup>*€ � � <sup>¼</sup> *<sup>f</sup> <sup>u</sup> cos* �<sup>2</sup> *<sup>φ</sup>* <sup>þ</sup> *qv*<sup>0</sup> <sup>þ</sup> *qv* � � <sup>3</sup> *<sup>τ</sup>in*<sup>2</sup> 6¼ 0. It can be shown that this is always not equal to zero and *<sup>φ</sup>* <sup>þ</sup> *qv*<sup>0</sup> <sup>þ</sup> *qv* 6¼ � *<sup>π</sup>* <sup>2</sup>. This is always true because any angle of rotation should be within half of camera's angle of view *α*; that is *φ* þ*qv <sup>f</sup> ^* � � � � � �<sup>≤</sup> *<sup>α</sup>* <sup>2</sup> <sup>&</sup>lt; *<sup>π</sup>* <sup>2</sup>. In addition, *α* is always less than *π* for any camera type. Therefore, the controller works for the entire range independent of the camera type.

### **6.3 Model linearization**

We can deal with the nonlinear system by linearizing the system first and then design a linear controller using the system transfer function. In **Figure 12**, *Tinner*�*closed* transfer function is given in (42) and the nonlinear form of the camera model is provided in (43). The overall dynamic system combines the inner-loop and the camera model, which will be linearized so that the combined dynamic system will then be linear. Next, we linearize, the camera model, (43), around an equilibrium point *qv ^* 0 :

$$\widehat{u\_R} = f\_u \cos^{-2} \left( \boldsymbol{\varrho} + \overset{\smile}{\boldsymbol{q}\_{v\_0}} \right) \left( \overset{\smile}{\boldsymbol{q}\_{v\_f}} - \overset{\smile}{\boldsymbol{q}\_{v\_0}} \right) + f\_u \tan \left( \boldsymbol{\varrho} + \overset{\smile}{\boldsymbol{q}\_{v\_0}} \right) \tag{62}$$

If we assume *qv ^* <sup>0</sup> ¼ 0, then: *Role of Uncertainty in Model Development and Control Design for a Manufacturing Process DOI: http://dx.doi.org/10.5772/intechopen.104780*

**Figure 15.** *The block diagram of the SISO control with the linearized camera model for robot arm movement adjustment.*

$$
\widehat{u\_R} = f\_u \cos^{-2} \left( \overline{\phi} \,\right) \stackrel{\smile}{q\_{v\_f}} + f\_u \tan \left( \overline{\phi} \right) \tag{63}
$$

Assuming *<sup>C</sup>*<sup>1</sup> <sup>¼</sup> *<sup>f</sup> <sup>u</sup> cos* �<sup>2</sup> ð Þ *<sup>φ</sup>* , *<sup>C</sup>*<sup>2</sup> <sup>¼</sup> *<sup>f</sup> <sup>u</sup> tan* ð Þ *<sup>φ</sup>* , therefore, Eq. (63) can be rewritten as:

$$
\widehat{\mu\_R} = \mathbf{C\_1} \overleftarrow{q\_{v\_f}} + \mathbf{C\_2} \tag{64}
$$

Let us define *<sup>u</sup>*c*<sup>R</sup>* <sup>0</sup> <sup>¼</sup> *<sup>u</sup>*c*<sup>R</sup>* � *<sup>C</sup>*2, then, the overall block diagram of the linearized system is shown in **Figure 15**.

The plant transfer function is derived as:

$$G\_{p\_{linear}} = \frac{\widehat{\boldsymbol{\mu}\_{R}}^{\prime}}{q\_{R\_v}} = C\_1 \frac{\left(\mathfrak{T}\boldsymbol{\tau}\_{\text{in}}\boldsymbol{s} + \mathbf{1}\right)}{\left(\boldsymbol{\tau}\_{\text{in}}\boldsymbol{s} + \mathbf{1}\right)^3} \tag{65}$$

The design of a Youla controller is trivial in this case as all poles/zeros of the plant transfer function in (65) are located in the left half-plane, and therefore, they are stable. In this case, we can shape the closed loop transfer function, *Tout*, by selecting a Youla transfer function: *Yout* so that the closed loop transfer function, *Tout*, will not contain any plant poles and zeros. All poles and zeros in the original plant can be canceled out and new poles and zeros can be added to shape the closed-loop system. Let us select a Youla transfer function so that the closed-loop system behaves like a second order Butterworth filter, such that:

$$Y\_{out} = \frac{1}{G\_{p\_{linear}}} \frac{\alpha\_n^{-2}}{(s^2 + 2\zeta a\_n s + \alpha\_n^{-2})} \tag{66}$$

then:

$$T\_{out} = \frac{o\nu\_n^2}{\left(s^2 + 2\xi\rho\_n s + o\_n{}^2\right)}\tag{67}$$

where *ω<sup>n</sup>* is called natural frequency and approximately sets the bandwidth of the closed–loop system. We need to make sure the bandwidth of the outer-loop is smaller than the inner-loop, i.e., 1*=ω<sup>n</sup>* >*τin*. *ζ* is called the damping ratio, which is another tuning parameter.

Using Eqs. (34) and (35), we can calculate the sensitivity transfer function, *Sout*, and the controller transfer function, *Gcout* , of the outer-loop in cascaded control design as:

$$S\_{out} = 1 - T\_{out} = \frac{s^2 + 2\zeta\rho\_n s}{(s^2 + 2\zeta\rho\_n s + \rho\_n^2)}\tag{68}$$

$$\mathbf{G}\_{\text{c\_{\text{out}}}} = \mathbf{Y}\_{\text{out}} \mathbf{S}\_{\text{out}}{}^{-1} = \frac{\mathbf{1}}{\mathbf{C}\_1} \frac{\left(\tau\_{\text{in}} \mathbf{s} + \mathbf{1}\right)^3}{\left(\Re \tau\_{\text{in}} \mathbf{s} + \mathbf{1}\right)} \frac{\mathbf{o}\_{\text{n}}^2}{\left(\mathbf{s}^2 + 2 \mathbf{\zeta} \mathbf{o}\_{\text{n}} \mathbf{s}\right)} \tag{69}$$
