Abstract
The traditional twowheeled selfbalancing robot can travel quickly in a flat road environment, and it is easy to destabilize and capsize when passing through a bumpy road. To improve the passing ability of a twowheeled robot, a new wheellegged twowheeled robot is developed. A sevenlink leg structure is proposed through the comprehensive design of mechanism configuration, which decouples the balanced motion and leg motion of the robot. Based on the Euler–Lagrange method, the dynamic model of the system is obtained by applying the nonholonomic dynamic Routh equation in the generalized coordinate system. The robot’s state space is divided according to the robot’s height, and the Riccati equation is solved in realtime by the linear quadratic regulator (LQR) method to complete the balance and motion control of the robot. The robot leg motion control is achieved based on the active disturbance rejection control (ADRC) way. A robot simulation model is built on Recurdyn to verify the algorithm’s feasibility, and then an experimental prototype is built to demonstrate the algorithm’s effectiveness. The experimental results show that the control method based on LQR and ADRC can make the robot pass through the bumpy road.
Introduction
The traditional twowheeled selfbalancing robot has the advantages of small size^{1, 2}, lightweight and flexible movement, but the environmental conditions on the ground limit it. To move the twowheeled robot not limited to the flat road environment, the wheellegged twowheeled selfbalancing robot came into being. Compared with traditional selfbalancing robots, wheellegged selfbalancing robots increase the degree of freedom of the legs. When the leg mechanism moves, the robot’s center of mass will shift^{3}, decreasing the effect of the traditional control strategy^{4, 5}. In Fig. 1, for the wheellegged twowheeled robot, to reduce the influence of leg motion on the balance control of the robot, when the leg’s centroid trajectory should be ensured to pass through the twowheel axis vertically as much as possible. The attitude angle of the platform on the vehicle should stay the same as possible. Because in many applications, the body is expected to remainstable, such as handling agricultural products.
To improve the robustness of the wheellegged robot, Wang^{6} proposed a series of double closedloop control strategies combining ADRC^{7, 8} and PID^{9,10,11} control, enhancing the robot’s robustness in fixedpoint balance. However, there are still challenges in the speed control of the robot. Shahida Khatoon et al.^{12} designed LQR^{13} and model predictive control (MPC)^{14,15,16} controllers for twowheeled selfbalancing robots. However, due to the introduction of the degree of freedom of the legs, it is not straightforward to model and linearize the robot dynamics. Ollie^{17} decoupled the robot’s balanced leg motion through a parallel fivebar leg geometry and added a robotic arm assist to assist the robot in completing jumps such as backflips. However, the robot is controlled by seven motors, with complex driving and low energy utilization.
In order to solve the problem of centroid deviation during robot movement, a sevenlink leg geometry is proposed. As shown in Fig. 2, it limits the offset of the robot’s centroid in the Xaxis direction and decouples the robot’s balanced and leg movements. For the balance of the center of mass in the Yaxis direction, it is divided into different state spaces according to the different heights of the robot’s center of mass. Then the optimal feedback control rate is obtained by solving the Riccati equation in realtime, which depends on the robot leg feedback for a stable and accurate center of mass height. Therefore, the active disturbance rejection method is used to complete the control of the robot leg. ADRC makes the robot legs have a robust antiinterference ability to provide a stable centroid height for the LQR controller. LQR and ADRC resimulation through the test and in the experimental prototype to complete the experiment, reflecting the robustness of the control strategy.
The main contributions of this paper are as follows:

1.
Robot dynamics modeling and robot controller design;

2.
Robot mechanical structure design and hardware implementation;

3.
The simulation model and the actual test prototype are established to verify the feasibility and effectiveness of the control method.
The following structure will be used for analysis: The second chapter introduces the robot system’s structure design and hardware implementation. In the third chapter, based on the Euler–Lagrange method, the system dynamics model is obtained by applying the nonholonomic Routh equation in the generalized coordinate system. The fourth chapter focuses on the design of the robot controller. Chapter 5 shows the performance of robots in simulated and realworld.
System description
As shown in Fig. 3a, the wheel leg structure of the robot is a sevenlink mechanism. The mechanism has one degree of freedom, allowing only upward movement of the legs. This parallelogram structure can ensure that the robot’s body Angle does not change during the ascent process. To maximize the decoupling of leg movement and robot balance movement. Taking the distance of the centroid offset in the Xaxis as the optimization objective, the least square method was used to determine the optimal length of each connecting rod through the constraints of the plane’s mechanism. The trajectory of the robot’s center of mass is an approximately straight line perpendicular to the hub motor’s axis in the travel range, which reduces the deviation error of the center of gravity during the robot’s leg movement.
As shown in Fig. 3b, the drive rod and the body frame are connected by a hip motor with a harmonic reducer. The FOC algorithm drives the hip motor, and the harmonic reducer makes the motor peak torque up to 80 NM. A damping spring is added between the thigh rod and the calf rod. On the one hand, the tension of the energy storage spring offsets the weight of the system itself, reducing the pressure of the system gravity on the hip joint motor, and on the other hand, it plays a shock absorber role during driving. At the end of the leg is a 15 NM wheel hub motor (Sentron 10530), which is responsible for the robot’s fixedpoint balance and driving.
As shown in Fig. 4, the robot’s body is a transversely retractable rectangular structure. The span of the wheel legs can be adjusted to adapt to different environments through the expansion of the connecting parts. The leading equipment and sensors are installed in the body part, including Singlechip Microcomputer (SCM) (STM32H743IIT6), power, Inertial Measurement (IMU)(HWT605), etc.
In Fig. 5, the hub motor and hip motor communicate with SCM through the CAN bus to provide feedback on the robot’s speed, position and height information. The IMU sends the robot’s attitude information to the processor through the serial port. The processor receives the information to complete the robot control and other work. Meanwhile, the main control board connects with the computer through the local area network to realize the wireless communication between the upper computer and the wheellegged machine.
Dynamic model
Compared with the traditional twowheeled selfbalancing robot, the wheellegged robot increases the leg’s degree of freedom of movement to actively adjust the body’s height. On the other hand, it also makes the system more complex. Because the optimal design of the leg geometry decouples the robot’s driving and leg motion, the robot dynamics model is divided into the body and leg dynamics models.
Body dynamics model
For the body part, when the hip joint motor is locked, the body and the leg structure are regarded as one, which is equivalent to a singlestage inverted pendulum with a fixed center of mass. When the hip joint moves, it is analogous to a singlestage inverted pendulum whose centroid position changes in the vertical direction. As shown in Fig. 6, the robot’s overall centroid height is linear with the hip joint angle. The relationship between the robot’s centroid and the hip joint motor angle is measured by computeraided measurement and then obtained by linear fitting.
The relationship between the height of the robot’s center of mass and the hip joint angle is obtained by fitting after measurement:
As shown in Fig. 7, when the hip joint angle is constant, the wheellegged robot body dynamics model can be simplified to a highly fixed twowheel inverted pendulum model. The generalized coordinate of the system \(q = [ x\; \;y\;\;\theta \;\;\omega \;\;\delta_{L} \;\;\delta_{R} ]^{T}\) is selected, and the dynamic model of the wheellegged twowheel robot is constructed by the Euler–Lagrange method.
In Fig. 7 θ is the body pitch angle. ω is the body yaw angle. v is the robot’s linear velocity. x and y are xaxis and yaxis displacements. δ_{L} and δ_{R} are the rotation angles of the left and right wheels of the robot. In order to reduce the workload of modeling and simplify the model, the following assumptions need to be made:

1.
pure rolling without sliding between wheel and ground;

2.
The dynamics of the leg linkage mechanism are not considered;

3.
All objects are rigid and have a uniform density.
Each component’s kinetic and potential energy are obtained using the space coordinate velocity transfer formula, and the Lagrangian energy function is obtained.
According to the Euler–Lagrange method, the nonholonomic dynamic Routh equation applied in the generalized coordinate system is:
From Formula 3:
where M(q) is the mass matrix, \(N(q,\dot{q})\) is the Coriolis gravity term; J(q) is Jacobian matrix; τ is the input vector; F_{T} (q) is a nonholonomic constraint matrix; λ for the Lagrangian multiplier.
The F_{T} (q) matrix is obtained by the twowheellegged robot subject to nonholonomic constraints. The Lagrange multiplier λ is eliminated according to the null space of the S(q) of the F_{T} (q) matrix. Since the vector q depends on S(q) of the F_{T} (q), it satisfies the following:
where \({\mathbf{p}} = [\theta \;\;{\mathbf{v}}\;\;\omega ]\). The nonlinear dynamic model of wheel leg robot is obtained:
Dynamics model
As shown in Fig. 8, ignoring the interaction force between each link, the entire wheellegged mechanism can be equivalent to a springdamping system.
The dynamic equation of the equivalent spring damping system is:
where k is the elastic spring coefficient; B is the damping coefficient between each member; M is the mass matrix; u is the output vector of the hip joint motor.
Control
Based on the robot dynamics model, the robot control system is divided into a balance motion controller and a leg adjustment controller. The leg adjustment controller is designed by the ADRC method. On the one hand, it controls the leg structure movement to complete the standing, squatting, and other actions. On the other hand, the hip joint motor’s absolute encoder feeds back the robot’s current centroid height. The balance motion controller is realized by the LQR method, which relies on the hip joint motor to feedback on the current centroid height of the robot to complete the functions of robot balance and stable driving. Figure 9 shows the overall control block diagram of the system.
Body stabiling control
According to the above body dynamics model, the system’s state variable is selected as \(x = [x_{{1}} \;\;x_{{2}} \;\;x_{{3}} \;\;x_{{{4}]}}^{T} = [\theta \;\;\dot{\theta }\;\;v\;\;\dot{\omega }]^{T}\), and the state space equation of the system is established. The system is linearized by Taylor expansion at the equilibrium point \(x^{*} = [x_{1}^{*} \;x_{2}^{*} \;x_{3}^{*} \;x_{4}^{*} ]^{T} = 0\):
Table 1 lists the parameters of the robot. Bring these parameters into Formula 6 to obtain the matrix A and B:
In order to simplify the model, this paper divides the state space equation into 10 segments in the height direction where φ ⊆ (70, 100), When φ = 73, 76, 79 · 100, 10 sets of state space equations corresponding to A1, A2, A3 ··· A10 and B1, B2, B3 ··· B10 are obtained, The current height of the robot fed back by the hip joint motor determines the current state space equation of the robot. Controllability analysis is performed for state spaces of different heights. The system is controllable from Formula 11:
According to the LQR control idea, the feedback gain matrix K is obtained by by minimizing the quadratic linear objective function J, Then, the linear feedback control rate u = −Kx is designed to stabilize the system at equilibrium. The quadratic performance index is:
Q ≥ 0 and R ≥ 0 are positive semidefinite real symmetric constant matrices in the formula and must be set according to the control weight.
According to the Lyapunov second equation, to obtain the optimal objective function, there must be a positive definite matrix P which is the steadystate solution of the Riccati equation. For infinite time steady state, the Riccati equation can be written as:
The optimal trajectory satisfies the following:
From Formula 13:
The matrix P is obtained by iteratively solving the Riccati equation, and the feedback gain matrix K is obtained. Then the robot feedback control rate u = −Kx is obtained.
Leg motion control
The leg adjustment controller is implemented by the ADRC method, a controller technique that estimates its compensation uncertainties. The control block diagram is shown in Fig. 10: It uses the extended state observer to compensate for the robot’s gravity disturbance and other disturbances as feedforward to the input. The robot stability is adjusted by nonlinear state error feedback.
The core idea of the ADRC controller is the extended state space observer, which observes the disturbance through the input and output of the system and eliminates the disturbance in the controller as much as possible. A secondorder linear extended observer is constructed based on the spring damping system of the leg:
The extended state observer based on the Luenburger observer is obtained by pole assignment:
w_{0} is the bandwidth coefficient. By adjusting and compensating the coefficient B_{0}, the estimated value of the observer is consistent with the actual output. The observation effect of the extended observer is shown in Fig. 11.
The pitch angle error and the velocity and angular velocity error observed by the ESO are then weighted by the nonlinear function.
where a, δ are the adjustment parameters; e_{0}, e_{1} are the differentials of error and error respectively; K_{1}, K_{2} are the gain coefficient. After nonlinear function processing, the adjustment of significant error large gain, small error small gain. It effectively solves the contradiction between rapidity and overshoot in convergence.
The regulating parameters of ADRC controller are compensation coefficient B_{0}, bandwidth coefficient w_{0}, K_{1} error gain coefficient, K_{2} error gain coefficient differential, and a, δ coefficients in the fal function. Usually need to fix the compensation coefficient B_{0} and select the smaller K_{1}, K_{2}, Then increase the bandwidth coefficient w_{0}, the state observer can quickly track the error. After determining the bandwidth coefficient w_{0}, increase K_{1}, K_{2}. where a ⊂ (1, 2), δ ⊂ (0, 1); after determining this series of parameters, increasing B_{0} can reduce the system’s jitter and finally select the compensation coefficient B_{0}.
Experiments
In Fig. 12 and 13b: In order to verify the performance of the wheellegged robot control method, the research group built a simulation model and experimental prototype of the wheellegged robot based on Recurdyn.
According to different scenarios and working conditions, the robot motion control experiments were carried out to analyze the performance of stability, speed control, and obstacle avoidance.

1.
Stability: Fig. 13a shows the pitch angle response of the robot in the robot simulation and experimental environments.

2.
The goal of control is to maintain the robot’s balance at any time, so the free release of the stick is set to hit the robot scene and simulate the external force disturbance link. The robot flexes and stretches through the legs, and the body is at different heights. Figure 14 shows the response of the body pitch angle when the robot is subjected to impact loads at different heights. In addition to impact disturbances, other forms of disturbances, such as longterm disturbances (tension, thrust, or increased weight), can keep the robotstable.

3.
Speed responsiveness: the robot needs to track the speed command sensitively at different heights. Figure 15 shows the robot’s response to the speed command when squatting (about 0.5 m) and standing (about 0.3 m). It can be seen from the diagram that different postures have accurate tracking for different speeds. In Fig. 15, the curve fluctuates greatly. This is because the IMU used in the actual measurement process has certain measurement errors, as well as the influence of mechanical structure such as the gap at the fuselage connection, resulting in certain jitter of the robot Angle. In the debugging process of the speed tracking experiment, if a larger weight coefficient is selected, the robot can track the target speed faster, but there will be a little overshoot, which is related to the friction coefficient and the inevitable error of the system. In general, such setting of parameters can make the robot perform better.

4.
Posture stability: Set obstacles such as speed bumps and boards to simulate complex road conditions. The flexion and extension states of the left and right wheel legs are adjusted by detecting changes in the roll angle to accommodate changes in the terrain. First, the robot joint angle and height response to the command is shown in Fig. 16a. Figure 16b shows the change of robot height with a hip joint angle when the robot height rises at a constant speed and verifies the linear relationship between hip joint angle and robot height.

5.
Figure 17 show the performance of the robot through continuous speed bump terrain with wheel or leg control. Figure 17d shows the robot’s performance through a continuous speed bump terrain with or without wheelleg control. When the leg height is actively controlled, the robot roll angle swing is reduced by about 51.7%.
Discussion
It is concluded that the new wheellegged robot faces two challenges: (1) After increasing the degree of freedom of the leg, how to ensure the balancer motion control for the metamorphic center robot; (2) how to ensure stable driving when the robot encounters uneven roads.
For the first challenge, a 1DOF sevenlink leg structure is designed. Optimizing the rod length limits the lateral centroid deviation of the robot, and the robot driving and leg motion are decoupled. For the offset of the longitudinal centroid, the robot height is divided, and the feedback gain is calculated in realtime by LQR to control the balance and movement of the wheellegged robot. For the second challenge, the ADRC controller controls the height difference between the left and right legs of the robot in realtime according to the body condition, which significantly reduces the roll angleswing amplitude of the robot and allows the robot to pass through the uneven road surface smoothly. The effectiveness and robustness of the control method are verified in various experimental results. The research results of this paper have guiding solid significance and reference value for the design of a twowheeled wordbalancing robot.
The stability control of the wheel legged robot verifies the feasibility of the robot structure design, and the sevenlink structure of the leg provides a reference value for the design of the compound wheel legged robot. The stable control of the robot’s high motion provides a solid foundation for subsequent devices such as robotic arms and radar cameras. We are installing robotic arms and radars for the robot and have completed more complex tasks and environmental awareness. More details will be presented in future papers.
Data availability
The current study of simulation models based on Recurdyn and the original data during the experiments are available at GitHub. The Robot driver code is available from the corresponding author on reasonable request.
References
Dabbagh, J. & Altas, I. H. Nonlinear twowheeled selfbalancing robot control using LQR and LQG controllers. In 2019 11th International Conference on Electrical and Electronics Engineering (ELECO) (2019)
Chen, C.T. Linear System Theory and Design (Saunders College Publishing, 1984).
Jmel, I., Dimassi, H., HadjSaid, S. & Msahli, F. An adaptive observer for two wheeled selfbalancing robot with a varying center of mass. In 2019 19th International Conference on Sciences and Techniques of Automatic Control and Computer Engineering (STA) (2019).
Kung, F. Design of agile twowheeled robot with machine vision. In 2017 International Conference on Robotics, Automation and Sciences (ICORAS) (2017).
Šimšaj, D. et al. Design of two legged robot. Am. J. Mech. Eng. 1, 355–360 (2013).
Wang, X. et al. Study on control design of a twowheeled selfbalancing robot based on adrc. In 35th Chinese Control Conference.
Jingqing, H. Improvement using nonlinear characteristics. Inf. Control 24, 9 (1995).
Jingqing, H. A new controller. Control. Decis. 9, 7 (1994).
Wardoyo, A. S., Hendi, S., Sebayang, D., Hidayat, I. & Adriansyah, A. An investigation on the application of fuzzy and PID algorithm in the two wheeled robot with self balancing system using microcontroller. In International Conference on Control (2015).
Gong, Y., Xiao, W. & Ma, H. Research on control strategy of twowheeled selfbalancing robot. In 2015 International Conference on Computer Science and Mechanical Automation (CSMA) (2015).
Pupek, L. & Dubay, R. Velocity and position trajectory tracking through sliding mode control of twowheeled selfbalancing mobile robot 1–5 (2018).
Khatoon, S., Chaturvedi, D. K., Hasan, N. & Istiyaque, M. Optimal controller design for two wheel mobile robot. In International Innovative Applications of Computational Intelligence on Power, Energy and Controls with their Impact on Humanity.
Taniai, Y. Profiles of movement speed and positional variability based on extended LQG for various noises. Sci. Rep. 12, 13354 (2022).
Ali, M. I. & Hossen, M. M. A twowheeled selfbalancing robot with dynamics model. In 2017 4th International Conference on Advances in Electrical Engineering (ICAEE) (2017).
Karthika, B. & Jisha, V. R. Nonlinear optimal control of a two wheeled self balancing robot. In 2020 5th IEEE International Conference on Recent Advances and Innovations in Engineering (ICRAIE) (2020).
Glushchenko, A. I. & Lastochkin, K. A. Development of twowheeled balancing robot optimal control system based on its feedback linearization. In 2019 International MultiConference on Industrial Engineering and Modern Technologies (FarEastCon) (2019).
Wang, S. et al. Balance control of a novel wheellegged robot: Design and experiments. In 2021 IEEE International Conference on Robotics and Automation (ICRA) 6782–6788 (IEEE, 2021).
Acknowledgements
The Project was Supported by the open fund for Jiangsu Key Laboratory of Advanced Manufacturing Technology (Project No. HGAMTL1906),Natural Science Research Program of Huaian (HAB202059),Zhejiang Nonprofit technology research program, sponsored by Natural Science Foundation of Zhejiang Province (LGN20E050003),Provincial key research project, sponsored by Science Technology Department of Zhejiang Province (2019C02003).
Author information
Authors and Affiliations
Contributions
X.F.: Conceptualization, Methodology Investigation, Writing  Review & Editing, WritingOriginal Draft. S. L.: Software, Investigation, Data Curation, WritingOriginal Draft, Visualization. Q.Y.: Formal analysis, Investigation, Data Curation, Visualization. J.X. (Cocorresponding author 1): Conceptualization, Methodology, Validation. D.Z. (Cocorresponding author 2): Conceptualization, Investigation, Writing  Review & Editing, Supervision. All authors reviewed the manuscript.
Corresponding authors
Ethics declarations
Competing interests
The authors declare no competing interests.
Additional information
Publisher's note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Rights and permissions
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.
About this article
Cite this article
Feng, X., Liu, S., Yuan, Q. et al. Research on wheellegged robot based on LQR and ADRC. Sci Rep 13, 15122 (2023). https://doi.org/10.1038/s41598023414621
Received:
Accepted:
Published:
DOI: https://doi.org/10.1038/s41598023414621
Comments
By submitting a comment you agree to abide by our Terms and Community Guidelines. If you find something abusive or that does not comply with our terms or guidelines please flag it as inappropriate.