Utilisation of Initialised Observation Scheme for Multi-Joint Robotic Arm in Lyapunov-Based Adaptive Control Strategy

In this paper, we present a modelling, dynamic analysis, and controller tuning comparison for a five-degree-of-freedom (DoF) multi-joint robotic arm based on the Lyapunov-based Adaptive Controller (LAC). In most pick-and-place applications of robotic arms, it is essential to control the end-effector trajectory to reach a precise target position. The kinematic solution of the 5-DoF robotic arm has been determined by the Lagrangian technique, and the mathematical model of each joint has been obtained in the range of motion condition. The Proportional-Integral-Derivative (PID) control parameters of the LAC have been determined by the Lyapunov stability approach and are initialised by four observation methods based on the obtained transfer function. The effectiveness of the initialised controller’s parameters is compared by a unit step response as the desired input of the controller system. As a result, the average error (AE) for Ziegler–Nichols is 6.6%, 83%, and 53% lower than for Pettit & Carr, Chau, and Bucz. The performance of LAC for the robotic arm model is validated in a virtual 3D model under a robot operating system environment. The results of root mean square error by LAC are 0.021 (rad) and 0.025 (rad) for joint 1 and joint 2, respectively, which indicate the efficiency of the proposed LAC strategy in reaching the predetermined trajectory and the potential of minimizing the controller tuning complexity.


Introduction
The advancements in robotic and autonomous systems involve various types of robots in our daily lives and in industry [1]. Therefore, the multi-joint robotic arm represents an essential role in the automotive, agriculture, and bio-medical sectors because of its satisfactory performance, flexibility, and accuracy [2][3][4].
The robotic arm is one of the most common types of robots that is used in several industrial applications [5]. For example, Xie et al. [6] developed an obstacle avoidance and path planning algorithm for a multi-joint manipulator equipped with a spacecraft based on forward and backward inverse kinematics. Pavlovcic et al. [7] utilised a six-degree-of-freedom (DoF) robotic arm for simultaneous laser profilometry and hand-eye calibration in an industrial application. In another study, Jeong et al. [8] presented brain-machine interfaces for robotic arm applications. They developed an electroencephalogram, worn by humans to acquire signals for implementation as desire tracking for a robotic arm.
Proportional-Integral-Derivative (PID) is one of the classical controllers, and it has been widely used in different industries due to its simplicity, flexibility, adequate results [9,10], ease of implementation, and excellent performance [11]. In order to increase the precision and robustness of the controller, its parameters are tuned by various methods, such as classical observation and optimisation techniques [12,13]. Belkadi et al. [14] presented a swarm optimisation to tune the parameters of the controller by minimizing the steady-state error. They verified their controller in a simulation model and compared it with conventional methods by numerical analysis. Phu et al. [15] combined optimisation with sliding mode control based on the Bolza-Meyer criterion to increase the performance of the controller by minimising and eliminating disturbances such as the vibration effect. Another example of the usage of a PID controller in different applications is the study by Wang et al. [16] that developed an optimal controller for vibration active control systems. In another study, Suhaimin et al. [17] used a PID controller for a 5-DoF robotic arm and controlled its joints for point-to-point trajectory tracking of the end-effector.
Adaptive control systems have been used in various works for different applications [18,19]. Pezzato et al. [20] presented an active inference controller that used an adaptive controller for industrial robots. They compared their proposed controller with a state-of-the-art model reference adaptive controller for an experimental setup of a 7-DoF robotic arm for the pick-and-place cycle. Tavoosi et al. [21] introduced an adjusting PID parameter through model predictive control. The parameters of the PID are tuned in real time by type-2 fuzzy-logic systems for a tank reactor application. Ma et al. [22] presented a trajectory regulating model reference adaptive controller to increase the stability and robustness of adaptation for the joint trajectory of a robotic arm. In our work, the PID controller's parameters are tuned by a Lyapunov-based Adaptive Controller (LAC) and are initialised by observation methods. In general, the contributions of this paper are as follows: • We tuned the controller parameters in real time based on stability analysis of the non-linear control system; • The LAC's parameters are initialised by using various observation methods and they are used to initialise the controller's parameters.
The contributions are validated in a 5-DoF robotic arm due to its serial structure, flexible action, accessible operation, and satisfactory load capacity in virtual simulation; it is extensively used in many robotic fields and industries [23].
The rest of the paper is organised as follows: Section 2 addresses the dynamic models of the 5-DoF robotic arm, developed using the Lagrangian method. Section 3 presents the LAC strategy determination. The results and discussion are presented in Section 4. The conclusions are given in Section 5.

Structure and Dynamics of the Robotic Arm
In this paper, a 5-DoF robotic arm, consisting of a base, four links, a wrist, and grippers, is selected as an example of a serial manipulator. The links are connected to each other by joints, which are powered by a motor and encoder sensor to move and capture the angular trajectory. The robotic arm is composed of two rotating and three swinging joints, among which the first and fifth joints are rotating and joints 2, 3, and 4 are swinging. Figure 1 shows the structure of the robotic arm. In this work, we employ the energy-based Lagrangian method to establish the relation between the torque and angle of joints [24]. The energy-based equation is expressed as follows: where L represents the Lagrangian function; E k and E p are the total kinetic and potential energies, respectively; B i is the joint friction coefficient; τ i is the torque of each joint, with i = 1, 2, 3, 4, 5; θ i andθ i are the angular trajectory and velocity, respectively. The equations of E p and E k are given as follows [25]: g is the gravity acceleration; m i and I i are the mass and inertia of each link, respectively; and (ẋ di ,ẏ di ,ż di ) is the time derivative of the centroid position of each linkage. According to the geometric relation, the centroid position (x di , y di , z di ) of every linkage is represented as Here, j X ∈ 3×1 is the position of joint (i − 1) th according to the reference frame; X d i ∈ 3×1 is the position of the centroid point of link i th relative to the reference frame; and i X d ∈ 3×1 represents the centroid position of the link i th regarding the coordinate system located in the joint i th . Moreover, R z i ∈ 3 is the rotation matrix around the z-axis according to the coordinate system placed in the i th joint, given as follows: By substituting E k and E p into the Lagrangian function, the dynamic equation is determined as follows: where τ ∈ 5×1 represents the torque vector; θ ∈ 5×1 andθ ∈ 5×1 are the angular rotation and acceleration; V ∈ 5 is the centrifugal, coriolis and friction matrix, and G(θ) ∈ 5 represents the gravity matrix, expressed as follows: where I 5 ∈ 5 is the identity matrix and e g i denotes the elements of mass and gravity matrices, represented as follows: where g represents gravitational acceleration. M ∈ 5 is a matrix containing mass and inertia elements, which is shown as follows: where e m i i = 1, 2, 3, 4, 5 represent the mass and inertia elements, expressed as follows: where l c i is the length of the centroid position for each link and l i is the length of the links. Table 1 shows the physical characteristics of the robotic arm's links.  The mathematical model of the robotic arm has non-linear characteristics. Thus, to simplify the model for further analysis, methods such as the range of motion (RoM) condition, where one joint is moving and the other ones are fixed, have been applied. The transfer functions of each joint are represented as follows: where a 51 l 2 a 53 = l c 5 gm 5

LAC Strategy for Robotic Arm Joints
PID control has been used by many researchers to move the joints' trajectory in the robotic arm, because of its potential in providing acceptable results and ease of operation [26,27]. The input and output of the control system are the desired and actual trajectory angle of each joint, respectively. In this paper, the PID controller's parameters are determined by stability analysis and initialised by observation tuning methods, i.e., Ziegler-Nichols (Z-N), Pettit & Carr, Chau, and Bucz [28,29]. Figure 2 shows the block diagram of the PID closed-loop control system, in which the parameters of the controller are tuned by a combination of observation methods and LAC based on the steady-state error. The process of observation methods is carried out by the mathematical model of the robotic arm and LAC is the real-time tuner of the controller. The steady-state error is the difference between the desired and actual trajectory, given as follows: where θ a i (s) and θ d i (s) represent the actual and desired angular trajectories for each joint, respectively.

Lyapunov-Based Adaptive Controller
The controller law for the Lyapunov-based adaptive controller is defined as follows: where it is assumed thatŻ E r ; therefore, Z t 0 E r dt. Equation (27) is rewritten as follows: Theorem 1. Consider a general non-linear dynamic system as follows: where X ∈ n is the state vector, y ∈ n is the controller output, u is the control input vector. f : n → n is a Lipschitz function. Consider a function V : n → [0, ∞], which is positive definite, denoted by V x . Therefore, there is a Lyapunov function for the non-linear dynamic system, if the following expression is valid.
Proof. The non-linear dynamic system can be shown to be asymptotically stable if such a Lyapunov function exists [30][31][32][33]. It is assumed that for a given positive-definite matrix Q, there is a positive-definite solution P such that PA + A T P = −Q, where P is the positive-definite matrix that is used to simplify the algebra without any loss of generality. The Lyapunov candidate function is defined as follows: where Γ is the adaptive rate, andK p ,K i , andK d are the differences between the actual and estimated controller parameters,K p ,K i , andK d respectively, given as follows: Differentiating the Lyapunov candidate function over time, we havė whereẊ T is the transpose of Equation (29) Therefore, the derivative of the Lyapunov candidate function is written as follows: By substituting Equation (28) in Equation (38), the derivative of the Lyapunov function is given as follows: Therefore,˙K p ,˙K i , and˙K d are expressed as follows, to haveV = −X T QX, which is negative-definite and satisfies Theorem 1.K Therefore, whereḰ p ,Ḱ i , andḰ d represent the initial values of PID parameters that are determined by conventional observation methods. The closed-loop transfer function of the control system is given as where C(s) is the transfer function of the controller, and G i (s) is the transfer function of each link. The controller C(s) is given as follows: There are various PID tuning methods, such as pole assignment, Cohen-Coon, amplitude, and phase margin methods. In this study, the parameters of PID are tuned by conventional observation methods of Z-N, Pettit & Carr, Chau, and Bucz. For tuning the controller by conventional methods, the values ofḰ i andḰ d are set as zero to convert the PID into a proportional controller. Initially, the gain of the proportional controller is tuned. Subsequently,Ḱ i andḰ d are obtained based on the tuned proportional gain, and the proportional controller is established as follows: where K u is the proportional gain, which increases gradually until the output of the control system starts to oscillate by equal amplitude. This parameter is the ultimate gain for K u and its period is selected as the oscillation period, T u . Figure 3 represents the unit step response to the proportional controller for joint 3. The tuning of controller parameters with various conventional methods is shown in Table 2. Although, in the observation methods, there is a lack of selection of parameters and excessive overshoot in the time response, they are still well-known and convenient to use. These methods are adopted to minimise the rise time, overshoot, and settling time. Algorithm 1 expresses the overall pseudo-code of the LAC strategy. K s is the proportional step to increase K u gradually until the ultimate gain is obtained.

Results and Discussion
We compare the performance of the tuned parameters by the conventional observation methods between Z-N, Pettit & Carr, Chau, and Bucz, in which the determined parameters are implemented in a closed-loop control system for each joint transfer function. Figure 4 compares the unit step response results of each joint in the closed-loop control system based on the transfer function of each link.  Table 4 compares the average error (AE) in radian and settling time (ST) in seconds determined by the tuning methods for each joint.
In Table 4, it can be observed that the AE and ST for Z-N show lower values in all joints. In addition, each joint followed the desired trajectory, with lower overshoot by the tuned Z-N parameters than other methods. For example, the AE for Z-N is 6.6%, 83%, and 53% lower than the AE for Pettit & Carr, Chau, and Bucz. Therefore, parameters Z-N are selected for the initialization of LAC due to its lowest AE and ST. To monitor the stability of the closed-loop control system tuned by Z-N, the root locus method is analysed for each joint based on the mathematical models and tuned controller. Figure 5 represents the root locus graph for the PID close-loop control system tuned for each joint.  In Figure 5, all the roots are on the left side of the graph, i.e., the stable region of the root locus. To validate the performance of the tuned controller, a 3-D model of a robotic arm was created in a virtual environment integrated with ROS, in which the physical characteristics are as defined in Table 1. The virtual environment and the model are designed to analyse the performance of the robotic arm, which resembles the actual one [24,34]. In addition, the model is designed and simulated with similar DoF and structure to the analysed robotic arm. Figure 6 shows the performance of the LAC strategy initialised by the Z-N method for the robotic model in the virtual environment, while the step response actual trajectory is applied for each joint. The experimental results in Figure 6 show that the robotic arm has good performance for various step response trajectories. There is an overshoot when there is a change in steps of the desired trajectory because the designed LAC needs to overcome the disturbances and converge the error. In the other experiment, the LAC strategy tuned by Z-N is validated in a 3D model in RoM condition, as shown in Figure 7. The experimental results are shown in Figure 7, in which the control system input is a periodic signal. The results represent satisfactory performance within an acceptable range of error. Table 5 illustrates the AE and root mean square (RMS) for each joint in RoM condition. AE and RMS are measured in radians and they are in the acceptable range. The statistical analysis shows that AE and RMS did not exceed 0.05 (rad), which represents satisfactory performance [35]. It is concluded that the proposed control method and tuning based on the mathematical model in RoM condition have satisfactory tracking performance.

Conclusions
This paper presented the modelling and analysis of an LAC strategy for a 5-DoF multi-joint robotic arm. The Lagrangian technique has been utilised to determine the mathematical model of a robotic arm based on its structure. The transfer functions of each joint were obtained in RoM condition. The LAC's parameters were determined based on the Lyapunov stability approach. The LAC parameters were initialised based on four observation methods, including Z-N, Pettit & Carr, Chau, and Bucz. The control strategy was validated in a 3D model of the robotic arm in a virtual environment. The results show that the controller with Z-N based on the mathematical model of each joint has better performance than other observation methods. For instance, the AE for Z-N in the unit step response was 6.6%, 83%, and 53% lower than the AE for Pettit & Carr, Chau, and Bucz. In addition, validation results in the virtual environment showed that the AE and RMS were in an acceptable range that was below 0.05 (rad).
The method can be employed for any multi-joint robotic arm to control its end-effector and track its angular trajectory. The limitation of this work is that we did not obtain the desired trajectory of each joint based on tracking the end-effector. In addition, this method was not validated in an actual robotic arm in the presence of disturbances. Future work will be devoted to combining inverse kinematic and visual algorithms to be developed for practical applications. Moreover, the proposed method is applicable in industries such as welding, material handling, and thermal spraying, or any other industrial applications.

Conflicts of Interest:
The authors declare no conflict of interest.