Research Article  Open Access
OpenClosedLoop PD Iterative Learning Control with a Variable Forgetting Factor for a TwoWheeled SelfBalancing Mobile Robot
Abstract
A novel iterative learning control (ILC) algorithm for a twowheeled selfbalancing mobile robot with timevarying, nonlinear, and strongcoupling dynamics properties is presented to resolve the trajectory tracking problem in this research. A kinematics model and dynamic model of a twowheeled selfbalancing mobile robot are deduced in this paper, and the combination of an openclosedloop PDILC law and a variable forgetting factor is presented. The openclosedloop PDILC algorithm adopts current and past learning items to drive the state variables and input variables, and the output variables converge to the bounded scope of their desired values. In addition, introducing a variable forgetting factor can enhance the robustness and stability of ILC. Numerous simulation and experimental data demonstrate that the proposed control scheme has better feasibility and effectiveness than the traditional control algorithm.
1. Introduction
Twowheeled selfbalancing mobile robots [1–3] are naturally unstable systems with characteristics such as nonlinear, multivariable, timevarying, and incomplete underactuativity, and these characteristics can be used to study variable control algorithms. As the abovementioned robots have advantages in terms of different aspects of strong environmental adaption, low cost, and stable operation, these robots have many applications in many areas. Kazuo Yamafuji first introduced the concept of a twowheeled selfbalancing robot in the nineteen eighties. Since then, scholars have investigated numerous kinematic models and control algorithms for twowheeled selfbalancing mobile robots. Grasser [4] developed the DSPbased wheeled balancing robot “Joe”, which achieved good mobility through decoupling motion and simplified control but poor interference resistance. Miasa [5] designed the selfbalancing robot “Equibot”, but it was only good for moving on flat ground and could fall over on uneven ground and thus has high requirements for road conditions. Additionally, the adaptability of the controlled object is undesirable. Thao [6] used the PID inverse step method to control a robot; a reverse step controller maintained the balance of the system, and a PID controller controlled the motion direction. However, the algorithm is too complex to implement in practical applications. Wu [7] applied a state feedback controller and a fuzzy controller to a robot. Experiments showed that the combination of these two control algorithms could achieve a good control effect. Because of its small capacity, feasible rotation and strong ability to adapt to terrain changes, this combined algorithm is widely used in many fields[8–10], such as traffic, survey, rescue and entertainment. However, this method is cost prohibitive and time consuming because of its fuzzy rules.
Determining how to maintain balance and realize perfect tracking under the correlated interference condition is absolutely critical to research about twowheeled selfbalancing mobile robots. However, conventional modern control methods, including sliding mode control and intelligent control, need accurate knowledge of the robot dynamics and physical parameters of the system to ensure consistency and convergence. Thus, we introduced a novel iterative learning control (ILC) algorithm. The basic idea behind ILC [11–13] is that the controller should learn from previous executions and perform better every cycle. The idea of ILC is that a skill can be improved and subsequently perfected through constant practice. An ILC algorithm has already been designed for mobile robots in [14–16], Kyung [14] used ILC pathtracking algorithm to control mobile robot under state disturbances and state errors, but its trajectory tracking accuracy is not very ideal. Chong [17] adopted ILC with predictive, current, and past learning items to achieve high precision trajectory tracking. However, the tracking performance of this algorithm is poor in the real experimental environment with interference. There are quite a few other learning control methods. Zhou [18] design a robust observerbased learning control method with a prescribed H∞ disturbance rejection for modified repetitivecontrol system to compensate the system delay. Zhou [19] presents an estimation and compensation learning control of statedependent nonlinearity for EIDbased modified repetitivecontrol system to improve the tracking performance.
This algorithm is extended to include the openclosedloop PDILC scheme [20–22] for twowheeled selfbalancing mobile robot systems to improve the performance of the algorithm. Openclosedloop PDILC not only ensures system stability but also improves tracking performance and vibration control. To reduce buffeting caused by robot system uncertainty and disturbances, this control law has been improved by the introduction of a variable forgetting factor, which can dynamically and precisely compensate for system errors. This combination not only stabilizes the robot's balance but also maintains the motion of the robot to track the desired trajectory.
The remainder of this paper is organized as follows. In Section 2, a mathematical model of a twowheeled selfbalancing mobile robot is derived from Newton's laws and Lagrangian mechanics. Section 3 describes the design of the proposed ILC controller schemes. A robust convergence analysis is performed in Section 4. In Section 5, simulations are presented and discussed. Section 6 illustrates the experimental results for the control system. The paper is concluded in Section 7.
2. TwoWheeled SelfBalancing Mobile Robot System Model
2.1. System Description of the TwoWheeled SelfBalancing Mobile Robot System
As shown in Figure 1, the mechanical part of the twowheeled selfbalancing mobile robot [23–25] basically consists of two wheels and a body. The parameters of the two wheels of the robot are the same in terms of mass, diameter and rotational inertia; additionally, these wheels are coaxially installed and independently driven. The body moves in an upright fashion and maintains balance through two rounds of rotation. The fundamental equation and derivation of the robotic mathematical model use Newton’s laws of motion and Lagrangian mechanics. Based on the model, an openclosedloop controller, in combination with ILC, is deployed for equilibrium stability and drive control.
When the two wheels move at different speeds, the robot body can change its direction and rotate around its center by setting different rotation directions for the two wheels. The steering principle is exactly the same as the tank steering principle shown in Figure 2.
2.2. Dynamic Modeling of the TwoWheeled SelfBalancing Mobile Robot System
According to Newton's second law of motion and the momentum balance, the following differential equation is obtained after force analysis of the robot body and twowheeled bottom in the horizontal direction:
The following differential equation is obtained by analyzing the force and momentum balance of the robot body in the vertical direction:
Formulas (1) and (2) are the mathematical model in the form of the system's nonlinear differential equations. Since keeping the robot in balance is the primary purpose of control under appropriate external conditions, the exact model is treated as follows:
The linearization of the equation of motion is as follows:
After taking the Laplace transform [26, 27], the transfer function is as follows:where .
According to formulas (4) and (5), the equation of state in which the displacement , velocity , pitch angle , and angular velocity of the robot are state variables is
The output equation with the displacement and pitch angle of the robot as the output variables iswhere is the displacement of the robot, is the velocity of the robot, is the acceleration of the robot, is the angle between the robot body and the vertical upward direction, is the input, is the mass of the twowheeled bottom part of the robot, is the upper body mass of the robot, is the coefficient of friction between the robot's bottom wheel and the ground, is the linear distance between the axis of the robot's bottom wheel and the center of its body mass, and is the upper body inertia of the robot.
Formulas (8) and (9) can simplify the system state equation as follows:where is the state matrix, is the input matrix, is the output matrix, and is the feedforward matrix.
3. Designed Controller and Variable Forgetting Factor
The designed control algorithm, which includes the tracking error of previous iterations and current iterations, as shown in Figure 3, iswhere indicates the iteration number; is the openloop differential learning gain matrix; is the closedloop differential learning gain matrix; is the openloop proportional learning gain matrix; is the closedloop proportional learning gain matrix; and are the control variable; is the initial value of the input; and .
Scholars generally use a fixed forgetting factor, but cannot vary with changes in the system features. In this article, is a multivariable forgetting factor that is introduced to the designed controller. This multivariable forgetting factor can vary automatically according to changing system deviation. The factor is used to balance perfect learning and robustness, which can increase the robustness of ILC against uncertainty, disturbance, initialization error, and fluctuation of system dynamics:where coordinates gain changes and is used to control the rate at which approaches 1. The smaller the value of , the better the system tracking performance.
4. Convergence Analysis
Assumption 1. Function is uniformly Lipschitz with respect to ,where is the Lipschitz constant and is a nonlinear function.
Assumption 2. The initial value of the system satisfies the following criterion:
Assumption 3. For , unique and exist that satisfy the following equations:where is a nonlinear function, is the desired control input, and is the desired state.
Assumption 4. The uncertainty, disturbance and their derivatives are bounded.Letwhere is the desired state of the system and indicates a formula that is defined as another formula.
Let us consider nonlinear multivariable systems [28, 29] with uncertainty and disturbances as follows:where and are the number of iterations and the running time, respectively. is the state variable, is the control variable, is the system output, and are the uncertainty item and interferential term, respectively, and is a nonlinear function.
Theorem 5. The sufficient convergence conditions of the ILC algorithm areThen, we choose a sufficiently large constant to reach the conclusion of this theorem: the error approaches uniformly bounded with [0, T] by ILC.
Proof. From (11) and (18), we obtainInserting (21) into (20) yieldsUsing Assumption 1 yields the following:Let us take the norm on both sides of (24), where norm is defined to simplify the formula as follows:Then, (24) implies the following.Multiplying both sides of (13) by and taking the norm yieldwhere , , and .
From Assumption 2, we obtainTaking the norm yieldsUsing the BellmanGronwall Lemma condition givesMultiplying both sides of (30) by to compute the norm, we haveThe same lesson applies as follows:Substituting (31) and (32) into (27) givesWe haveThis equation means thatwhere .
We choose a sufficiently large constant to satisfy and , and we can reach the conclusion . Thus, it is concluded that the error approaches uniformly bounded with [0, T] by ILC.
5. Simulation
In the simulation, openclosedloop PDILC is used for comparison to verify the effectiveness of the proposed algorithm. The physical parameters of the twowheeled selfbalancing mobile robot are displayed in Table 1. The desired trajectory is . The interference terms are

. The data used in the simulation are chosen as , , and .
The simulation results are shown in Figures 4–6. Substantial error reductions take place over 40 iterations. Figure 4 shows the trajectory tracking of the wheeled selfbalancing mobile robot in the process of iterative operation, and this tracking can illustrate the effectiveness of ILC laws. The angle and position are converged after 30 iterations.
(a)
(b)
(a)
(b)
(a)
(b)
(c)
(d)
The maximum tracking errors of the mobile robot are presented in Figure 5. It is obvious that the errors greatly decrease with an increasing number of iterations. In addition, this figure shows that the proposed algorithm has very small and monotonically decreasing tracking errors, and the convergence rate of this algorithm is much greater than that of the traditional openclosedloop PDILC controller. The dynamic performance of the system can be greatly improved.
Figure 6 shows the pitch angle of the mobile robot. These graphs show that the pitch angle decreases as the number of iterations increases. The controlled object is a twowheeled selfbalancing robot. To maintain the balance in the dynamic movement, pitch angle cannot be zero. Compared to traditional algorithms, the proposed algorithm has a smaller pitch angle. This contribution is due to the multivariable forgetting factor. Thus, the work developed and reported in this paper forms the basis of the design and development of openclosedloop PDILC with variable forgetting factor algorithm schemes for output trajectory tracking and selfbalancing control of robot systems and can be extended to and adopted in practical applications.
6. Experiment
The selfbalancing robot is shown in Figure 7. We choose STM32 MCU [30–32] as the main control unit. To verify the reliability and advantages of the proposed algorithm, two groups of experiments are conducted to compare the control performance of the two algorithms with the same conditions in a real twowheeled selfbalancing mobile robot.
The motion trajectory of the robot is shown in Figures 8 and 9 indicate the desired and actual position trajectories in the last iteration and the pitch angle is shown in Figure 10. The selfbalancing mobile robot travels roughly along the black line of the road, especially while turning. The results of the experiment show that the proposed algorithm can effectively track the desired trajectory and yaw angle and stabilize the pitch angle.
(a)
(b)
(c)
(d)
The comparative results indicate that, with the same parameters, the performance of openclosedloop PDILC with a variable forgetting factor is better than that of traditional openclosedloop PDILC in terms of robot control. Figures 9 and 10 indicate that the designed control algorithm for twowheeled selfbalancing mobile robot systems has better trajectory tracking control ability, faster convergence speed and maintains variation in the lower pitch angle despite a variety of disturbances. The proposed algorithm has potential value for practical applications.
7. Conclusions
After adopting an ILC strategy combining openclosedloop PD and a variable forgetting factor, a new iterative approach that can effectively solve twowheeled selfbalancing mobile robot kinematics is constructed in this paper. The selfbalancing robot is a complicated dynamic system that has highly nonlinear and coupled characteristics. Acceptable trajectory tracking control and selfbalancing features have been achieved with both control strategies. Simulation and experimental results validate the effectiveness and feasibility of the designed algorithm. In the future, we will apply this algorithm in other control fields.
Data Availability
All data and metadata used to support the findings of this study are included within the article.
Conflicts of Interest
The authors declare that they have no conflicts of interest.
Authors’ Contributions
Jian Dong designed the experiment. Jian Dong and Gang Li were involved in designing and conceiving the article. Bin He and Gang Li performed the experiment. Chenghong Zhang crunched the data. Jian Dong wrote the paper. Chenghong Zhang and Gang Li revised the paper.
Acknowledgments
This work was supported by the National Natural Science Foundation of China under Grants nos. 61801330, 61825303, 2018YFB1305300, and U1713215. It was supported by key innovation team program of innovation talents promotion plan by MOST of China (no. 2016RA4059).
References
 J. Han, X. Li, and Q. Qin, “Design of TwoWheeled SelfBalancing Robot Based on Sensor Fusion Algorithm,” International Journal of Automation Technology, vol. 8, no. 2, pp. 216–221, 2014. View at: Publisher Site  Google Scholar
 Junfeng Wu, Wanying Zhang, and Shengda Wang, “A TwoWheeled SelfBalancing Robot with the Fuzzy PD Control Method,” Mathematical Problems in Engineering, vol. 2012, Article ID 469491, 13 pages, 2012. View at: Publisher Site  Google Scholar
 H. Yau and Q. Liang, “Sliding Mode Controller Design of a SelfBalancing TwoWheeled Robot,” Advanced Science Letters, vol. 9, no. 1, pp. 609–613, 2012. View at: Publisher Site  Google Scholar
 G. Felix, A. Aldo, C. Silvio et al., “JOE:A mobile, inverted pendulum,” IEEE Trans on Industrial Electronic, vol. 49, no. 1, pp. 107–114, 2002. View at: Google Scholar
 M. Samer, M. AlMjali, I. Anas et al., “Fuzzy control of a twowheel balancing robot using DSPIC,” in Proceedings of the 2010 7th International MultiConference on Systems Signals and Devices (SSD), pp. 1–6, Jordan, 2010. View at: Google Scholar
 T. Nguyen, N. Duong, and P. Nguyen, “A PID backstepping controllet for two—wheeled self—balancing robot,” in Proceedings of the 2010 International Forum on IEEE Strategic Technology (IFOST), pp. 76–81, 2010. View at: Google Scholar
 J. Wu and W. Zhang, “Design of fuzzy logic controller for twowheeled selfbalancing robot,” in Proceedings of the 6th International Forum on Strategic Technology, IFOST 2011, pp. 1266–1270, China, August 2011. View at: Google Scholar
 X. Ruan, J. Chen, and L. Dai, “Motor learning based on the cooperation of cerebellum and basal ganglia for a selfbalancing twowheeled robot,” Intelligent Control and Automation, vol. 2, no. 3, pp. 214–225, 2011. View at: Publisher Site  Google Scholar
 J. W. Zhao and X. G. Ruan, “Modelling and control of a flexible twowheeled selfbalancing mobile robot,” International Journal of Systems, Control and Communications, vol. 3, no. 3, p. 330, 2011. View at: Publisher Site  Google Scholar
 H. Saryanto and A. Wardoyo, “An investigation on the application of fuzzy and PID algorithm in the two wheeled robot with selfbalancing system using microcontroller,” in Proceedings of the International Conference on Control, Automation and Robotics: International Conference on Control, Automation and Robotics (ICCAR, pp. 64–68, Singapore, 2015. View at: Google Scholar
 F. Bouakrif, “Iterative learning control for MIMO nonlinear systems with arbitrary relative degree and no states measurement,” Complexity, vol. 19, no. 1, pp. 37–45, 2013. View at: Publisher Site  Google Scholar
 J. de Best, L. Liu, R. van de Molengraft, and M. Steinbuch, “SecondOrder Iterative Learning Control for Scaled Setpoints,” IEEE Transactions on Control Systems Technology, vol. 23, no. 2, pp. 805–812, 2015. View at: Publisher Site  Google Scholar
 B. Cichy, L. Hladowski, K. Galkowski, A. Rauh, and H. Aschemann, “Iterative Learning Control of an Electrostatic Microbridge Actuator With Polytopic Uncertainty Models,” IEEE Transactions on Control Systems Technology, vol. 23, no. 5, pp. 2035–2043, 2015. View at: Publisher Site  Google Scholar
 K.L. Han and J. S. Lee, “Iterative path tracking of an omnidirectional mobile robot,” Advanced Robotics, vol. 25, no. 1314, pp. 1817–1838, 2011. View at: Publisher Site  Google Scholar
 K. L. Moore, M. Ghosh, and Y. Q. Chen, “Spatialbased iterative learning control for motion control applications,” Meccanica, vol. 42, no. 2, pp. 167–175, 2007. View at: Publisher Site  Google Scholar
 W. Wang, J. Chen, and L. Mao, “TwoWheeled Mobile Robot Tracking Based on Iterative Learning Control,” Advanced Materials Research, vol. 433440, pp. 5866–5870, 2012. View at: Publisher Site  Google Scholar
 C. Yu and X. Chen, “Trajectory tracking of wheeled mobile robot by adopting iterative learning control with predictive, current, and past learning items,” Robotica, vol. 33, no. 7, pp. 1393–1414, 2015. View at: Publisher Site  Google Scholar
 L. Zhou, J. She, and S. Zhou, “Robust H∞ control of an observerbased repetitivecontrol system,” Journal of The Franklin Institute, vol. 355, no. 12, pp. 4952–4969, 2018. View at: Publisher Site  Google Scholar  MathSciNet
 L. Zhou, J. She, S. Zhou, and C. Li, “Compensation for statedependent nonlinearity in a modified repetitive control system,” International Journal of Robust and Nonlinear Control, vol. 28, no. 1, pp. 213–226, 2018. View at: Publisher Site  Google Scholar  MathSciNet
 Z. Feng, Z. Zhang, D. Pi et al., “Openclosedloop PDtype iterative learning controller for nonlinear systems and its convergence,” in Proceedings of the WCICA 2004  Fifth World Congress on Intelligent Control and Automation, Conference Proceedings, pp. 1241–1245, China, June 2004. View at: Google Scholar
 S. Yu, J. Wu, X. Yan et al., “A PDtype openclosedloop iterative learning control and its convergence for discrete systems,” in International Conference on Machine Learning and Cybernetics, vol. 2, pp. 5659–5662, 2002. View at: Google Scholar
 Y. Hu, B. Zuo, J. Li et al., “Fast algorithm of openclosed loop pdtype iterative learning control for dc motor , intelligent control and automation,” in The Sixth World Congress on 2006 Intelligent Control and Automation, pp. 3834–3838, WCICA, 2006. View at: Google Scholar
 J. Hu, J. Wang, G. Sun et al., “Selfbalancing control and manipulation of a glove puppet robot on a twowheel mobile platform,” in Proceedings of the 2009 IEEE/RSJ International Conference on Intelligent Robotics and Systems, pp. 424425, 2009. View at: Google Scholar
 I. Nail, M. Omer, S. Uluc et al., “Path following with an underactuated selfbalancing sphericalwheel mobile robot,” in Proceedings of the 17th International Conference on Advanced Robotics, pp. 194–199, Istanbul, Turkey, July 2015. View at: Google Scholar
 D. Choi and J. Oh, “Four and two wheel transformable dynamic mobile platform,” in Proceedings of the 2011 IEEE International Conference on Robotics and Automation (ICRA), pp. 6404–6407, Shanghai, China, May 2011. View at: Publisher Site  Google Scholar
 H. Gzyl, A. Tagliani, and M. Milev, “Laplace transform inversion on the real line is truly illconditioned,” Applied Mathematics and Computation, vol. 219, no. 18, pp. 9805–9809, 2013. View at: Publisher Site  Google Scholar
 F. Yin, J. Song, and F. Lu, “A coupled method of Laplace transform and Legendre wavelets for nonlinear KleinGordon equations,” Mathematical Methods in the Applied Sciences, vol. 37, no. 6, pp. 781–792, 2014. View at: Publisher Site  Google Scholar
 Y. Tan, H. Dai, D. Huang, and J. Xu, “Unified iterative learning control schemes for nonlinear dynamic systems with nonlinear input uncertainties,” Automatica, vol. 48, no. 12, pp. 3173–3182, 2012. View at: Publisher Site  Google Scholar
 C. Yin, J.X. Xu, and Z. Hou, “A highorder internal model based iterative learning control scheme for nonlinear systems with timeiterationvarying parameters,” IEEE Transactions on Automatic Control, vol. 55, no. 11, pp. 2665–2670, 2010. View at: Publisher Site  Google Scholar  MathSciNet
 S. Sun, J. Ni, Z. Chen et al., “The design of a DeviceNet  SPI converter module based on the STM32 MCU,” in Proceedings of the 2015 IEEE International Conference on Mechatronics and Automation, pp. 843–847, China, August 2015. View at: Google Scholar
 T. Zhang and Y. Li, “Data acquisition design based on the STM32,” in Proceedings of the 2012 international conference on manufacturing engineering and automation, pp. 1527–1530, Guangzhou, China, 2012. View at: Google Scholar
 W. Huajie and S. Juan, “The design and research of infrared sensor monitoring system based on STM32,” in Proceedings of the 2012 Fourth international conference on computational and information sciences, pp. 876–879, 2012. View at: Google Scholar
Copyright
Copyright © 2019 Jian Dong et al. This is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.