Impedance Force / Position Control for Planar 3DOF Robot Manipulator by Fuzzy Neural Network Combination

As the demands for more robot's complex tasks were increased, force and torque control had become necessary. When contact forces are present, the performance of the trajectory tracking controller is degraded. Impedance force / position controller is proposed in this paper. The impedance force at the tip is controlled by fuzzy PID controller. PID controller tuned by adaptive linear network is used for trajectory tracking. A combination of fuzzy PID controller and PID controller tuned by neural network is used to generate the required torque at the robot manipulator's joints. The Jacobian matrix is derived for planar 3-DOF to transform the forces into joints' torque. Simulations are presented for robot manipulator with force contact at the tip. The trajectory tracking is improved by using fuzzy PID controller for impedance force of the environment.


INTRODUCTION
Tracking a trajectory is the problem for tasks like spot welding and cleaning a glass with sponge. The controller generates the torques which are due to robot's mechanical structure inertia forces. But when contact force is required, additional torques will be generated at the joints [1]. This contact force should be controlled specially when dealing with fragile (breakable) material such as in the case of removing paint from a glass, surgery, and assembly of parts.
Most industrial applications use Proportional-Integral-Derivative (PID) controller because it is simple and gives accepted performance. The tuning of PID gains is important and not easy task. Simplified assumptions were proposed for this reason [2]. In robot's applications, the case is complex because the mechanical structure's dynamics is nonlinear with coupled terms ofjoints' angular position and velocity. This leads to the need of intelligent tools for tuning PID controllers such as neural networks and fuzzy logic [3][4][5][6][7][8].
Fuzzy logic controller (FLC) is recently used to control systems that have structural and unstructured uncertainties. Force and position control were presented in the works of [9][10][11]. Neural network (NN) has a strong self-adaptability, learning ability. It was used to compensate the uncertainties of robot's dynamics and environment. Neural network was used to work as a compensator in force tracking impedance control in the works of [12,13].
Fuzzy and neural network force control were implemented for position / force, and impedance force control with uncertainties and unknown environment [14][15][16]. A limitation was proposed for maximum and minimum values of environment's stiffness and position.
In this paper, tracking the desired trajectory is achieved by PID controller tuned by adaptive linear network. Fuzzy PID controller supplies the required joints' torque due to the Al-Rafidain Engineering Journal (AREJ) Vol. 24, No.1, October 2019, pp. 46-54 impedance force at the tip of the robot last link.Simulations for planar 3-DOF robot manipulator with force contact at the tip will be presented.In addition to this introduction, this paper contains four other sections. Section 2 presents the theoretical bases of the work. The proposed controller is fully explained in section 3. The obtained results and their corresponding discussions are included in section 4. Finally, section 5 concludes this paper.

ROBOT MANIPULATOR KINEMATICS
Kinematics is necessary for performing tasks by robots. The links' transformations are derived in the forwards kinematics. These transformations arerequired for derivation of Jacobean matrix (J) and dynamic equations.
Inverse kinematics maps Cartesian space coordinates into joint space angles. Joints' angle determine the configuration of the robot mechanical structure. Using the geometrical method, the inverse kinematics for planar 3-DOF ( Fig.1) gives the joints' angle as followed [17]: The Jacobean matrix relates the joint rate to Cartesian velocities. At first, the velocity propagation is calculate from the base to the tip. The tip velocity is transformed to the base frame. This give the Jacobean at the base frame [17]. The force vector (F) is transformed to joints' torque by the following relation: The simplification sin(ɵ 1 ) as s 1 will be adopted for all trigonometric function types elsewhere.

DYNAMIC EQUATIONS FOR 3-DOF ROBOT MANIPULATOR
In order to move a robot manipulator, the links must be accelerated from rest and decelerated to zero velocity at stop. The torques required for such a motion are functions of robot's mechanical structure inertia and desired trajectory. Using the Lagrangian formulation of manipulator dynamics, the dynamic equations are obtained. The details for 3-DOF robot manipulator's dynamic equations are presented in [18].
where M is inertia matrix, C, and G are the column vectors of centrifugal and Coriolis, and Gravity matrices; respectively. τ is vector of joints' total torque. τ e is vector of external disturbance joints' torque.

THE PROPOSEDCONTROLLER
The torque at manipulator joints puts the tip at the desired position. The controller determines the torques from the error (e) which is Vol. 24, No.1, October 2019, pp. 46-54 defined as the difference between the desired and actual angular position. In self tuning PID controller, the inputs to NN are desired trajectory, actual trajectory, and the error as shown in Fig. 2. The NN output (O NN (t)) adjusts the gains of PID controller on-line according to the change of the error signal. This overcomes the limitations of conventional PID controller and ensures stability. The control action of the PID controller after using the NN can be described as [5]: whereτ ɵ is the torque from self leaening PID controller, K PNN , K INN , and K DNN are the new gains of PID self tuning controller and equal to: The required torque signal to track the desired trajectory is supplied from PID controller tuned by NN. Neural network tunes on-line the gains of PID controller using feedback error learning technique. This produces adaptive controller capable of generating the control signal.
A fuzzy PID controller is used to produce additional control signal due to impedance force control. Thus the total torque becomes the summation of the trajectory tracking torque (τ ɵ ) and impedance force torque (τ f ). The inputs to Fuzzy PID are the force error (e f ) and derivative of this error as shown in Fig. 3. During the transient region, this controller works as PD controller. But at steady states it works as PI controller [8]. The membership symbols are described as PB (positive big), PM (positive medium), PS (positive small), PVS (positive very small), ZE (zero), NS (negative small), NM (negative medium), and NB (negative big). Triangular memberships are chosen for PM, PS,PVS, ZE, NS, and NM fuzzy sets. Trapezoidal memberships are chosen for PB and NB fuzzy sets [8]. The rules are shown in Tables (1 and 2).
The desired force (F d ) and actual force (f) are obtained as following [12]: where x d and x are the desired and actual xdirection position; respectively. k e is contact stiffness, x e is environmental disturbance.

ADAPTIVE LINEAR NETWORK
The adaptive linear network has one layer which contains S number of neurons connected to R inputs (Fig. 4). The input is multiplied by weight to produce the output through linear function. The output of this neural network is calculated as [19]:  This neural network is used in many practical applications.A supervised training is achieved by using the least men square error. The error is defined as the difference between desired output and network output. The performance of the network is improved by the training samples. The least mean square error is used to adjusts the weights and biases during learning. It is an approximate steepest descent procedure. In the case of multiple neurons, the weight and bias are written in matrix form as: where E and B are the error and bias vectors, and α is a learning rate. This NN achieves linear approximation to nonlinear function due to the quadratic error function of least mean square error [5]. Thus the performance is either weak or global minimum according to the training samples.
Adaptive linear network can be combined with delay in the input signal so as to produce adaptive filter. Using many delayed input values supplies the network with more information to minimize the error. The linear network changes to model the nonlinear system when the system moves to a different operating point.If this error is zero, then the network has done its prediction properly. In the proposed control system, multiple neuron adaptive filter is used which contains more than one neuron in the adaptive system.

RESULTS AND DISCUSSIONS
The task is to move the planar 3-DOF robot manipulator along vertical wall. The tip is to be maintained normal to the wall at specified constant x-coordinate positionwith the last link orientation (φ) equals to 0 o . Gravitational and payload force of magnitude 0.1 kg are considered. The step size for numerical integration is 0.001 seconds. Physical parameters for 3-DOF robot manipulator are: masses (m 1 =1, kg, m 2 =1 kg, The robot starts from rest and moves to the starting point (1.95m, 0.05m)during the first 10 seconds. This will give enough time for NN to tune the PID gainsin on-line. The environment force is defined as: where k e =1 kN/m and x e =1.94 m. This force will be transformed into joints' torque by using Jacobean transpose matrix. At position (1.95m, 0.05m) the robot starts to move its third link vertically in horizontal layout so as to maintain normal force against the vertical wall. The stop point is (1.95m, 0.4m).
The simulation results are presented in Figs. 5-13. Fig. 5 shows the time history of angular position at joint 1 using PID tuned by NN without Fuzzy PID controller for impedance force. The error is high because the controller is not supplying all the required torques. The minimum error in radian is 0.2768, 0.0272, and 0.0177 for joints 1, 2, and 3; respectively.
Figs. 6-8 show the angular position tracking using the proposed controller for joints 1, 2, and 3; respectively. The error is maximum at the beginning of simulation. This big error because high torques are required to move the robot's mechanical structure from rest. At starting point, the error becomes small because the NN had acquired enough learning during the first 10 seconds. The two controllers combine their signals so as to track the desired trajectory with applied forces at the tip. The Cartesian coordinates of the desired and actual paths are shown in Fig.9. The deviation is high at the beginning of motion due to the inertial effects of motion initiation. The time history of generated torques due to impedance force  presented in table  3. The total torques at joints due to robot dynamics and applied forces are presented in Fig. 13. Figure  14 shows the results between applied force and the system response during the last ten seconds of motion. The maximum error is no more than 5.795*10 -3 Newton.       Circular motion is considered as a second case to show the error in two directions. The circular path's radius is 0.5 meter and the radial impedance force's amplitude is 10 Newtons. Start point on the circular path is (2m ,0m) rotating in counter clockwise direction. The Cartesian coordinates of the desired and actual paths are shown in Fig.15. The time history of generated forces due to applied radial impedance force only are depicted in Figs. [16][17].The errors of Cartesian positions and forces are presented in table 4. The error in the vertical direction is bigger than that in the horizontal direction due to the presence of gravitational effects.

CONCLUSION
The kinematics and dynamics of planar 3-DOF present a nonlinear system with high coupling terms. Adaptive linear network tuning for PID gains is used because it has small size and fast learning. This controller improves tracking performance. The combination of PID tuning by NN and fuzzy PID controllers is proposed in this work. This combination provides robust tracking control with payload and impedance force applied at the tip of the last link. Simulation results for 3-DOF robot manipulator have demonstrated the effectiveness of this combination. Fuzzy PID controller for impedance force control improves the trajectory tracking. The error in radian is reduced from 0.2768, 0.0272, and 0.0177 to 0.00039, 0.00057, and -0.00096 for joints 1, 2, and 3; respectively.In the circular motion results, the error is increased due to the additional force component in the vertical direction.Future research will seek