Foot trajectory following control of hexapod robot based on Udwadia–Kalaba theory

This paper provides an adaptive robust control strategy for foot trajectory following control of hexapod robot on basis of the Udwadia–Kalaba theory. In this paper, the foot trajectory following control problem of the hexapod robot is transformed into the problem of solving the system control constraint force on basis of the Udwadia–Kalaba theory. Compared with the traditional control strategy, linearization or approximations are not required by using the Udwadia–Kalaba theory for nonlinear system such as the hexapod robot. Due to modeling error, measurement error and the change of working state, the system may have non-ideal initial conditions, vibration interference and other uncertain factors during operation, which affect the control accuracy. An adaptive robust controller is designed for solving uncertainties. Meanwhile, the stability is analyzed by using the second method of Lyapunov function. Finally, the accuracy and stability of the control method proposed are verified by establishing the leg model of the hexapod robot and conducting simulation analysis. The simulation results show that the provided adaptive control process has faster error convergence speed and response speed compared with the sliding mode control method.


Introduction
With rapid increase in the level of automation technology, robot technology has also developed to a new height, more robots also have begun to serve the education, medical care, industry and other fields [1,2]. Robots are playing an increasingly important role in promoting industrial transformation characterized by intelligence. The development and application of robots can not only bring high productivity and huge economic benefits to country's economic construction, but also make outstanding contributions to the development of emerging fields [3,4].
Compared with wheeled robots, footed robots have the advantages of strong terrain adaptability, high degree of freedom and flexible walking, etc., so which can efficiently pass-through complex terrain [5,6]. Hexapod robot is a typical footed robot. But its control is more difficult because of complex structure and powerful motion coupling [7][8][9]. Foot trajectory following control is an indispensable link to achieve the manipulation of hexapod robot and it is also the main content in this study.
Researchers have adopted a variety of methods to realize the foot trajectory following control of footed robots. Wang et al. developed a force-impedance control method on basis of the dynamic model of a four-legged robot, in which dynamic feedforward was introduced to compensate for the disturbances caused by leg dynamics [10]. Zhao et al. applied the fractional order controller to the compliant control of the leg movement process of the electric wheel-foot robot, the smooth contact between the end of foot and the working surface during the system movement is also realized because of improving the impedance tracking performance of the system by introducing inverse position loop compensation [11]. Xie et al. established a kinematics model of the lower limb rehabilitation robot based on the traditional mechanical method, in which the joint motion data were input into the model to get the foot trajectory and the Fourier series method was used to obtain the foot end trajectory function about time [12]. Hae Yeon Park et al. designed a novel stability judgment criterion for bipedal mechanical structure on basis of the linear inverted pendulum model and proposed control method with the consideration of the norm-based stability criterion, which can deal with the influence of unknown interference and sensor noise on the stability of the biped walking system; this control method well achieved the trajectory following control of the biped walking robot [13]. Kirtas Oguzhan et al. developed a prototype of an active ankle-foot orthosis. For the purpose of achieving gait trajectory following, an adaptive backstepping control algorithm was created. Through numerical simulation and physical experiments, it was verified that the trajectory following performance of this method is more effective than PID control strategy [14].
On the basis of the Udwadia-Kalaba (the U-K theory for short) theory in this paper, an adaptive robust control method is developed to realize the foot trajectory following control of footed robots. Compared to the above methods, nonlinear system does not need to be linearized or approximated by using the U-K theory, while being able to solve explicit equations for system constraints including holonomic and nonholonomic constraints [15][16][17]. U-K theory was invented by Professor Udwadia and Kalaba on the basis of Lagrangian kinematic equations, there is no need to introduce additional parameters in the solution process, the solving procedure is brief and the logic is distinct, it is easy to solve the analytical solution of the equation compared with traditional analytical mechanics such as Lagrange multiplier method, Newton-Euler method and Kane method [18][19][20]. Furthermore, the U-K theory generalizes D'Alembert's principle, which is also suitable for multibody systems which have non-ideal forces and non-holonomic constraints, so it can be widely used in the research and analysis of multibody dynamic systems [21][22][23].
The U-K theory was invented at the end of last century; many scholars have created a large number of important results by using this theory after more than 20 years of development. The U-K theory works for both holonomic and/or non-holonomic constrained systems [24]. Yu Rongrong et al. proposed a novel approach for redundant parallel manipulator dynamics according to the U-K theory; the trajectory following control was realized by experimental simulation [25]. Yu RR et al. realized the trajectory following control of the mobile car and proposed ACC (asymptotic convergence criterion) method to overcome the trouble of incompatible initial conditions [26]. Qin Feifei et al. proposed a new method for the research problem of human lower extremity rehabilitation based on dynamic model of human lower limb movement which was established by U-K theory [27]. Zhang Yan et al. proposed a new automatic clutch position tracking servo control method based on U-K theory and verified that the method can more accurately achieve the position following control of the clutch by the actual vehicle experiment [28]. Zhang Shuzhen et al. made a dynamic analysis of the new parallel sun tracking device by applying U-K theory and established the dynamic model based on hierarchical stacking thought, finally, made co-simulation by MATLAB and Adams [29].
The U-K theory also has limitations in practical application. It will not work well when the starting conditions of the system do not conform to the constraints or there are uncertainties in the system [30]. The uncertainty in nonlinear systems cannot be eliminated in practical applications. In order to solve the uncertainty problem, the researchers divide the system model into a nominal part and an uncertainty part and assume that the uncertainty existing in the system is bounded, and the uncertainty is compensated by an adaptive control method [31][32][33]. Thanapat Wanichanon et al. used U-K theory to precisely control the nominal system and then compensated the uncertainty through the generalized sliding mode controller to achieve accurate trajectory tracking [34]. Hancheol Cho et al. combined U-K theory with sliding mode control theory to track and control the trajectory of ball pendulum, satellite and triple pendulum [35,36]. Udwadia F E presented a simple methodology for obtaining the entire set of continuous controllers that cause a nonlinear dynamical system to exactly track a given trajectory by exploring the close connection between nonlinear control and analytical dynamics [37]. Thanapat Wanichanon et al. proposed a formation-keeping control scheme with attitude constraints in the presence of uncertainties in the masses and moments of inertia of the satellites [38]. Hancheol Cho et al. presented simple and exact formation-keeping guidance schemes that addressed nonlinear problem completely and nonlinearizations and/or approximations are made [39]. Udwadia F E et al. proposed a two-step formation-keeping control methodology that includes both attitude and orbital control requirements in the presence of uncertainties, and a new additional set of closed-form additive continuous controllers is developed in the second step [40]. In this paper, an adaptive robust control strategy on basis of the U-K theory is developed to solve the foot trajectory following control problem of hexapod robot with uncertain systems by combining modern control theory.
The main contributions of this paper are concluded as follows: (1) The legs prototype model of the hexapod robot and the dynamic model on basis of the U-K theory are established; the motion constraint analytical expressions are obtained. (2) The adaptive robust controller is designed on basis of the dynamic model. The stability analysis of the controller is carried out by applying the second method of Lyapunov function.

Introduction to Udwadia-Kalaba theory
Assume there is a mechanical system which is an unconstrained system and it can be expressed by n generalized coordinates [41]. The n generalized coordinates are q ¼ q 1 ; q 2 ; . . .; q n ½ T . The motion equation of the system is obtained by using Lagrangian mechanics [42], which is expressed as: in the formula, M ð Þ is named inertia matrix of the system, which is symmetric and positive definite matrix. q is the generalized coordinate vector describing the system. t stands for time variable of the system. F ð Þ is named generalized given force of the system, which may include gravitational, centrifugal and Coriolis force. _ q is named generalized velocity and dt 2 Assuming that there are h þ l constraints in the system, which include h holonomic constraints and l non-holonomic constraints, which can be shown: where B i q; t ð Þ is an h-vector and B j q; _ q; t ð Þ is an lvector. Taking the second-order derivative with respect to time for the holonomic constraint and the first-order derivative with respect to time for the nonholonomic constraint, the first-order and second-order constraint equation of the following form can be obtained: where A ð Þ is called the second-order constraint matrix of the system, c ð Þ and b ð Þ are both h þ l ð Þvectors, respectively.
According to U-K theory, the motion equation of the constrained system is as follows: where Q c id ð Þ is the ideal constraint force and Q c nid ð Þ is the non-ideal constraint force. Q c id ð Þ and Q c nid ð Þ are expressed as follows in U-K theory [43]: The equation of motion constraints is shown as where ''?'' means the Moore-Penrose inverse. a is engineering factor and its value can be obtained by actual experimental measurement. It means that there are no non-ideal constraints in the system when a ¼ 0.
That is Q c nid ð Þ ¼ 0. When the system dynamics model is known, the binding force can be obtained by Eq. (9). Therefore, when an accurate model is established and there are no uncertainties in the system, the input control torque can be obtained according to the above equation.
According to the above, motion equation of constrained mechanical system according to the U-K theory is concise and clear. In addition, U-K theory does not require to the introduction of additional parameters such as Lagrange multipliers and it greatly simplifies the derivation calculation process, the servo control torque solving is transformed into a differential equation solving problem. When applying U-K theory to solve practical problems, the following steps can be followed [44]: (1) Analyze the structure of the system, split the system into multiple independent motion subsystems and determine the generalized coordinates of the system; (2) Each subsystem is analyzed by using Lagrangian mechanics method, the motion equation of the subsystem in an unconstrained state is derived so that M ð Þ and F ð Þ are obtained; (3) According to the structure of the system, the motion constraints of each subsystem are established. The constraints must be rewritten as the form of formula (5) so that A ð Þ and b ð Þ are obtained. (4) Construct the complete system motion equation according to the U-K equation and solve the differential equations to obtain the constraint expression.
The solution process is shown in Fig. 1. However, U-K theory has certain limitations in practical application. It can only deal with ideal system which does not consider the uncertainties.

Design of adaptive robust controller
The motion equation of the system in the ideal state was established based on the U-K theory in the previous section; we can obtain the explicit expression of control input torque. In practice, it is difficult for the system to be in an ideal state. The reasons include system initial conditions which may not satisfy constraints, errors made by physical parameters and dynamic modeling and unknown disturbance produced by temperature and resistance et al. during system working. At this point, the control method based only on the U-K theory can no longer be effectively controlled.
In this section, an adaptive robust control method based on the U-K theory will be proposed on the basis of the previous section considering the uncertainty factors. Uncertainty parameters r are introduced to solve the problem of uncertainty in the system.
The dynamic equation of system can be obtained as follows by Lagrangian dynamics It can be rewritten as follow after introducing r where r is time-varying and it has unknown boundary.
whereM ð Þ,Ĉ ð Þ andĜ ð Þ are the nominal parts. DM ð Þ, DC ð Þ and DG ð Þ are the uncertain parts. In the ideal state, there is no uncertainty in the system so ð Þ are all continuous and uninterrupted.
For convenience of expression, let It can be obtained from the above formula (14), (15) and (16) Assumption 3 8 q; t ð Þ 2 R n Â R and A q; t ð Þ is a full rank matrix, then for a given P 2 R mÂm , P [ 0,there is a constant q E [ À 1, so that 8 q; t ð Þ 2 R n Â R will have: where k m denotes the eigenvalues of a matrix, and The flowchart of solving by applying U-K theory q E is generally unknown, since the uncertainty boundary is unknown. There is no uncertainty factor in the system when the system is in an ideal state. At this time, M q; r; t ð Þ¼M q; t ð Þ, so E q; r; t ð Þ¼0 and W q; r; t ð Þ¼0, so that we can choose q E ¼ 0.
Assumption 4 For a given P 2 R mÂm and where k min is the smallest eigenvalue of the matrix. Ideal constraints imposed on the system cannot control the system to the desired constraint trajectory due to the uncertainty in the system, so ð Þ represents the constraint error and g indicates its weight, where g ! 0. Initial conditions may not satisfy constraints when t ¼ 0, so f 6 ¼ 0.
The following control strategy is proposed on the basis of U-K theory in order to solve the problem of uncertainty in the system.
Assumption 5 (1) There is an unknown constant vector b 2 0; 1 ð Þ k and a known function P ð Þ : 0; 1 ð Þ k ÂR n Â R n Â R, which can make all q; _ q; t ð Þ2R n Â R n Â R have the following relation: Þis a linear function of b. There is the functionP ð Þ : R n Â R n Â R that satisfies the following relation: According to formula (21), the control torque is decomposed into 3 parts: s 1 q; _ q; t ð Þis the nominal part of the system obtained by solving the U-K equation under ideal conditions; s 2 q; _ q; t ð Þcan keep the system error within stable boundary conditions and make the system have a certain robustness; s 3b ; q; _ q; t is the adaptive robust control part based on the adaptive parameterb. According to the actual situation of different models, the control accuracy can be improved and the control error can be reduced by adjusting the adaptive parameters, where where j is a positive constant.
wb; q; _ q; t ¼ /b; q; _ q; t ub; q; _ q; t Pb; q; _ q; t ð27Þ ub; q; _ q; t ¼ f q; _ q; t ð ÞPb; q; _ q; t ð28Þ where e [ 0 is a constant andb is obtained by the following adaptation law: In the study of system stability in control theory, the Lyapunov function and the derivative of the function are usually used to judge the stability of the system. The system equilibrium point involved in system stability by Lyapunov function is not easy to find, and the reason is the influence of uncertainty factors in nonlinear systems. Therefore, the stability judgment of the nonlinear system is usually made on the basis of the Lyapunov function with the help of the uniform boundedness and uniform ultimate boundedness of the system.
Uniform boundedness: In this paper, the second method of Lyapunov function is used to analyze the system stability. For the control strategy proposed in the previous section, the Lyapunov function is constructed as follows [45]: Taking the first derivative of the above formula (31), we get The first term on the right side of the above formula (32) is further written as Based on (11)-(17) According to (24) According to Assumption 5 (1), Based on (25) According to (26), Based on (38)- (40), If u k k e, / ¼ 1 e . At this point, According to Assumption 5 (2), Based on (41)-(43), for any u b; q; _ q; t ð Þ k k , The second term on the right side of Eq. (32) is further written as Using (44) and (45)

Uniform boundedness is obtained according to the above calculation
where where y ¼ ffiffiffi

Dynamic modeling and simulation analysis
In order to verify the accuracy and stability of the designed control strategy, a small hexapod robot model was established. The main material is aluminum alloy. The 3D model of hexapod robot is shown in Fig. 2. Physical parameters such as mass are calculated by SolidWorks software. Since the six legs of the hexapod robot have the same structural composition, this paper only analyzes the control of the Fig. 2 The prototype model of hexapod robot single leg. MATLAB R2019b is used to simulation analysis.

Dynamic model of hexapod robot
The leg structure of the hexapod robot consists of three parts: the trochanter, the femur and the tibia section. There are three degrees of freedom, namely the hip joint, the knee joint and the ankle joint. Figure 3a shows the leg prototype model of the hexapod robot. The leg model is simplified to a link structure for simplifying the calculation process. The link coordinate system is established based on the standard D-H (Denavit-Hartenberg) method as shown in Fig. 3b. Table 1 gives the values of the link parameters including a, a, d and h. We choose q ¼ q 1 ; q 2 ; q 3 ½ T on behalf of the generalized coordinates. Table 2 gives the meaning of parameters in the dynamic model.

Numerical simulation experiment
The proposed control method is simulated by MATLAB. Assuming that the center of mass is located at the end of the link, the values of the parameters in the system are shown in Table 3.
The kinematic model of the hexapod robot was established by Tian Hao, and the angular displacement function of each joint was obtained [46]. Assume that the expression of the foot end trajectory in the base coordinate system is as follows From this, the angular displacement function of each joint can be obtained as where We can rewrite Eq. (54)-(56) as the following In order to obtain the velocity and acceleration constraints of the system, the first-order and secondorder derivatives of Eq. (57) with respect to time t are obtained, which are written in the following form where Eq. (59) is velocity constraints and Eq. (60) is acceleration constraints, cðq; _ q; tÞ ¼ In Eqs. (62) and (63), _ q 1 , _ q 2 and _ q 3 are the first derivative of Eqs. (54)-(56), respectively. € q 1 , € q 2 and € q 3 are the second derivative of Eqs. (54)-(56), respectively. The calculation process is realized by the 'Derivative' module in Simulink.
By analyzing the constraints imposed by the leg system of the hexapod robot, we can obtain the ideal initial conditions as q 1 0 ð Þ ¼ 0:245, q 2 0 ð Þ ¼ 0:679, In order to verify the adaptability and robustness of the proposed control method to the uncertain factors in the system, the initial conditions are set as q 1 0 ð Þ ¼ 1, Considering the uncertainty existing in the system, we choose the following function to satisfy assumptions 5.
The adaptive law is given by Due to uncertainty in the system, we assume m 1 ¼m 1 þ Dm 1 , m 2 ¼m 2 þ Dm 2 , m 3 ¼m 3 þ Dm 3 , where Dm 1 ¼ 0:1 sinðtÞ, Dm 2 ¼ 0:1 sinðpt=4Þ and  The trend of q 1 over time Fig. 6 The trend of q 2 over time set to 10 s. The value ofbð0Þ is 0.1 in literature [15]. This paper selectsbð0Þ ¼ 0:4 according to the actual situation of the controlled model. The foot trajectory following simulation analysis of the simplified model of the hexapod robot leg is implemented by using Simulink module of Matlab. Figure 4 shows the Simulink simulation model. The simulation is mainly carried out from two aspects: uncertainties existing in the system are not considered in the controller; uncertainty compensation terms are Fig. 7 The trend of q 3 over time Fig. 8 The trend of q 1 over time Fig. 9 The trend of q 2 over time Fig. 10 The trend of q 3 over time Fig. 11 The torque trend of every joint over time in proposed control method Fig. 12 The torque trend of every joint over time in the sliding mode control method added to the controller and the control effect is compared with the sliding mode control which is another nonlinear controller that does not require linearization.
In this paper, the sliding mode surface function is s ¼ c Á e þ _ e. The sliding mode control adopts the exponential reaching law, that is, _ s ¼ ÀK Á sgnðsÞ À k Á s; ðK [ 0; k [ 0Þ. Assume that the desired angular displacement of each joint is q d ¼ ½q d1 ; q d2 ; q d3 T and the actual angular displacement is q ¼ ½q 1 ; q 2 ; q 3 T . e ¼ q d À q is joint motion error. sgnðÁÞ is a symbolic function and its expression is By referring to the controller parameters taken in the literature [47] and after several simulation experiments, the parameters of the slide controller are set to c ¼ 15, k ¼ 200 and K ¼ 5. Figures 5, 6 and 7 show the simulation results of the proposed controller without uncertainty compensation terms. Figures 5, 6 and 7 show the tracking effects of q 1 , q 2 and q 3 . Compared with the desired trajectory, the results show that the angular displacement change of each joint completely deviates from the predetermined trajectory. Therefore, the control model established by the U-K theory only will lead to divergent results and cannot achieve the purpose of accurately tracking the trajectory of the foot when the starting conditions of the system do not confirm to the constraints.
When the initial conditions of the system do not satisfy the constraints and there are unknown disturbances, the impact of these issues on the effectiveness of control must be considered. Therefore, uncertainty compensation terms are added to the controller and the control effect is compared with the sliding mode control method. Figures 8, 9, 10, 11, 12 and 13 show the simulation results. Figures 8, 9 and 10 show the trajectory variation trend of q 1 , q 2 and q 3 with time under two different control methods. The results show that the adaptive robust control strategy based on the U-K theory can control the legs of the hexapod robot to complete the predetermined trajectory following. Compared with Fig. 13 The trend of error over time the sliding mode control method, the trajectory tracking result of the proposed control method is closer to the predetermined trajectory, and the actual trajectory converges to the predetermined trajectory faster when the initial conditions do not satisfy the constraints. Figure 11 shows the torque trend of every joint over time in proposed control method. Figure 12 shows the torque trend of every joint over time in the sliding mode control method. The switching term sgnðsÞ in the sliding mode control method results in abrupt changes in the control torque. Figure 13 shows the variation trend of the trajectory errors of q 1 , q 2 and q 3 . The error is larger at time t = 0 because the initial conditions of the system are non-ideal initial conditions. The error converges to around 0 under the action of the controller. The error value of the sliding mode control method will still fluctuate after stabilization. The simulation results show that the control method proposed in this paper has a smaller stable error value and smoother control torque curve compared with the sliding mode control method. Figure 14 shows presents the trend of adaptive gain b with respect to time. The value ofb increases rapidly due to trajectory following error which caused by the non-ideal initial conditions and uncertain parameters.
Then it gradually converges to around 0 under the action of the controller.

Conclusion
In this paper, an adaptive robust control strategy on basis of the U-K theory is proposed for the foot trajectory following control problem of the hexapod robot. Nonlinear system does not need any linearization or approximations by using U-K theory compared with other methods. The simulation results show that the proposed control method has good trajectory tracking effect in the case of system uncertainty. The research of this paper developed a novel solution for foot trajectory tracking control of hexapod robot.
The values of the adaptive parameters in this paper are determined through multiple simulation experiments, but it is almost impossible to find optimal value of the parameter. In future research, optimization algorithms such as reinforcement learning and particle swarm optimization can be combined to select the optimal value to further improve the control effect and it can be verified by carrying out physical experiment verification. Data availability The data used to support the findings of this study are included within the article.

Declarations
Conflicts of interest The authors have no relevant financial or non-financial interests to disclose and have no conflict of interest.