# Workspace Analysis of a Mobile Manipulator with Obstacle Avoidance in 3D Printing Tasks
## 2 Materials and Methods
### Motion Control
#### 2.4.2 Trajectory Tracking  
The kinematic model proposed in Section 2.2 is used to describe the behaviour of mobile manipulator. This model is based on linear and angular velocities to represent the position of the end-effector. We consider a typical trajectory tracking task with a reference guidance trajectory \(h_{eded}=[x_{eded}\ y_{eded}\ z_{eded}]^{T}\), where \(x_{ed}\), \(y_{eded}\) and \(z_{eded}\) are the desired position of the end-effector. The control of the mobile manipulator is a function of the trajectory tracking error expressed as \(e=h_{eded}-h_{\sigma c}\) and the control signals are defined by \(U_{(n)}=[\ \mu\ \omega\ \theta_{1}\ \theta_{2}\ \theta_{3}\ \theta_{4}\ \theta_{5}\ \theta_{6}]^{T}\). Equation (9) presents the kinematic model of the mobile manipulator expressed in discrete time.  
\[\begin{bmatrix}\frac{x_{e\sigma(n+1)}-x_{e\sigma(n)}}{I_{\sigma}}\\ \frac{y_{\sigma(n+1)}-y_{\sigma(n)}}{I_{\sigma}}\\ \frac{z_{\sigma(n+1)}-z_{\sigma(n)}}{I_{\sigma}}\end{bmatrix}=J_{(n)}U_{(n)} \tag{9}\]  
The proposed control law is defined by [33]:  
\[U_{(n)}=J_{(n)}^{+}\begin{bmatrix}x_{ed(n+1)}-k_{x}\Big{(}x_{ed(n)}-x_{e\sigma( n)}\Big{)}-x_{e\sigma(n)}\\ y_{ed(n+1)}-k_{y}\Big{(}y_{ed(n)}-y_{e\sigma(n)}\Big{)}-y_{e\sigma(n)}\\ z_{ed(n+1)}-k_{z}\Big{(}z_{ed(n)}-z_{\sigma(n)}\Big{)}-z_{e\sigma(n)}\end{bmatrix} +\Big{(}I_{(n)}-I_{(n)}^{T}\Big{(}I_{(n)}I_{(n)}^{T}\Big{)}^{-1}J_{(n)}\Big{)} \Gamma \tag{10}\]  
Figure 5: Stabilization point of the end-effector of the mobile manipulator. The actual position of the end-effector towards the starting point of the desired trajectory.  
where the position of the end-effector is defined by the values of \(h(t)\) at discrete time \(t=nT_{o}\), where \(T_{o}\) is the sampling period, and \(n\in\{0,1,2,\ldots\}\), are denoted as \(h_{(n)}=\left[x_{ee(n)},\ y_{ee(n)},\ z_{ee(n)}\right]^{T}\) and \(h_{(n+1)}=\left[x_{ee(n+1)},\ y_{ee(n+1)},\ z_{ee(n+1)}\right]^{T}\), \(J_{(n)}^{+}\) is the Jacobian pseudo-inverse matrix of the mobile manipulator and \(k_{x}\), \(k_{y}\) and \(k_{z}\) are design parameters to calibrate the controller. Furthermore, the term \(\left(I_{(n)}-J_{(n)}^{T}\Big{(}J_{(n)}J_{(n)}^{T}\Big{)}^{-1}J_{(n)}\right)\Gamma\) refers to the self-movement of the mobile manipulator, where the matrix \(\left(I_{(n)}-J_{(n)}^{T}\Big{(}J_{(n)}J_{(n)}^{T}\Big{)}^{-1}J_{(n)}\right)\) projects onto the null space of the Jacobian manipulator so that the secondary control targets do not interfere with the 3D end-effector printing task. Therefore, any value assigned to \(\Gamma\) affects only the internal structure of the manipulator and does not affect the absolute control of the end-effector. Thus, the redundancy of mobile manipulators can be used effectively to achieve additional performances, such as avoiding obstacles in the workspace, avoiding singular configurations or optimising various performance criteria. Where \(\Gamma=\left[\mu_{obs}\ \ \omega_{obs}\ \ \theta_{1 obs}\ \ \theta_{2 obs}\ \ \theta_{3 obs}\ \ \theta_{4 obs}\ \ \theta_{5 obs}\ \ \theta_{6 obs}\right]^{T}\).