Control and Trajectory Planning of an Autonomous Bicycle Robot
Abstract
:1. Introduction
2. Mathematical Models
2.1. Objective Functional
2.2. Control System, Kinematic Model
2.3. Problem Formulation
3. Hamiltonian and Feasible Controls
4. Pontryagin’s Minimum Principle
Theorem
5. Numerical and Computational Simulations
Algorithm 1 Fourth-order Runge–Kutta method |
function [t,z] = runge_v2(state_costate_robot,t0,tf,N,z0) h = (tf–t0)./(N−1); % N is the number of discrete points, h is the step. % t0 and tf are the lower bound and the upper bound of the time interval [t0,tf]. t = t0:h:tf; % Discretization of the time interval [t0,tf]. % t is the time vector with N elements. His elements are the discrete time points. t = t′; z = zeros(N,length(z0)); % z is initialized to zero. It is initially set as a matrix of N rows and with the The first row of the solution z is set to z0; for n = 2:N k1 = feval(fs,t(n − 1),z(n − 1,:)); k2 = feval(fs,t(n − 1) + (h/2),z(n − 1,:) + (h/2) × k1′); k3 = feval(fs,t(n − 1) + (h/2),z(n − 1,:) + (h/2) × k2′); k4 = feval(fs,t(n − 1) + h,z(n − 1,:) + h × k3′); z(n,:) = z(n − 1,:) + (h/6) × (k1′ + 2 × k2′ + 2 × k3′+k4′); end |
Algorithm 2 The combined state–costate system of ordinary differential equations |
function dzdt = bicycle_centerOfGravity (t,z) dzdt = zeros(14,1); R = 0.4; L = 0.8; lr = 0.4; c1 = R; c2 = lr/L; c3 = R/L; a1 = 0.25; a2 = 0.25; dzdt (1) = c1 × z(6) × cos(z(3) + z(5)); %Coding of Equation (38) dzdt (2) = c1 × z(6) × sin(z(3) + z(5)); % Coding of Equation (39) dzdt (3) = c3 × z(6) × tan(z(4)) × cos((z(5))); % Coding of Equation (40) dzdt (4) = z(7); % Coding of Equation (41) dzdt (5) = c2 × z(7) × ((cos(z(5))^2)/(cos(z(4))^2)); % Coding of Equation (42) dzdt (6) = −a1 × z(6) + a1 × (−0.5 × a1 × z(13)); % Coding of Equation (43) dzdt (7) = −a2 × z(7) + a2 × (−0.5 × a2 × z(14)); % Coding of Equation (44) dzdt (8) = 0; % Coding of Equation (45) dzdt (9) = 0; % Coding of Equation (46) dzdt (10) = c1 × z(6) × (z(8) × sin(z(3) + z(5)) − z(9) × cos(z(3) + z(5))); % Coding of Equation (47) dzdt (11) = −c3 × z(6) × z(10) × cos(z(5)) × (sec(z(4))^2) + 2 × c2 × z(7) × z(12) × (cos(z(5))^2) × tan(z(4)) × (sec(z(4))^2); % Coding of Equation (48) dzdt (12) = c1 × z(6) × (z(8) × sin(z(3) + z(5)) − z(9) × cos(z(3) + z(5))) + c3 × z(6) × z(10) × tan(z(4)) × sin(z(5)) + c2 × z(7) × z(12) × (cos(z(4))^(−2)) × sin(2 × z(6)); % Coding of Equation (49) dzdt (13) = −c1 × (z(8) × cos(z(3) + z(5)) + z(9) × sin(z(3) + z(5))) −c3 × z(10) × tan(z(4)) × cos(z(5)) + a1 × z(13); % Coding of Equation (50) dzdt (14) = −z(11) − c2 × z(12) × ((cos(z(5))/cos(z(4)))^2) + a2 × z(14); % Coding of Equation (51) |
Algorithm 3 State–costate system of ordinary differential equations |
function dzdt = bicycle_centerOfGravity (t,z) dzdt = zeros(14,1); R = 0.4; L = 0.8; lr = 0.4; c1 = R; c2 = lr/L; c3 = R/L; a1 = 0.25; a2 = 0.25; dzdt = [c1 × z(6) × cos(z(3) + z(5)); c1 × z(6) × sin(z(3) + z(5)); c3 × z(6) × tan(z(4)) × cos((z(5))); z(7); c2 × z(7) × ((cos(z(5))^2)/(cos(z(4))^2)); −a1 × z(6) + a1 × (−0.5 × a1 × z(13)); −a2 × z(7) + a2 × (−0.5 × a2 × z(14)); 0; 0; c1 × z(6) × (z(8) × sin(z(3) + z(5)) − z(9) × cos(z(3) + z(5))); −c3 × z(6) × z(10) × cos(z(5)) × (sec(z(4))^2) + 2 × c2 × z(7) × z(12) × (cos(z(5))^2) × tan(z(4)) × (sec(z(4))^2); c1 × z(6) × (z(8) × sin(z(3)+z(5)) − z(9) × cos(z(3)+z(5))) + c3 × z(6) × z(10) × tan(z(4)) × sin(z(5)) +c2 × z(7) × z(12) × (cos(z(4))^(−2)) × sin(2 × z(6)); −c1 × (z(8) × cos(z(3) + z(5)) + z(9) × sin(z(3) + z(5))) − c3 × z(10) × tan(z(4)) × cos(z(5)) + a1 × z(13); −z(11) −c2 × z(12) × ((cos(z(5))/cos(z(4)))^2) + a2 × z(14)]; |
Algorithm 4 First-order system |
function main_bicycle_centerOfGravity clear all clc format long disp(‘Nonlinear Control of an Autonomous Bicycle Robot: Computation of Feasible Controls’) R = 0.4; L = 0.8; lr = 0.4; c1 = R; c2 = lr/L; c3 = R/L; a1 = 0.25; a2 = 0.25; t0 = 0; tf = 5; N = 501; z0 = [zeros (7,1);2 ∗ ones (7,1)]; [t,z] = runge_v2(‘ bicycle_centerOfGravity ‘,t0,tf,N,z0); control1 = −0.5 × a1 × z(:,13); control2 = −0.5 × a2 × z(:,14); control = [ control1, control2]; dx = c1 × z(6) × cos(z(3) + z(5)); % x component of the velocity dy = c1 × z(6) × sin(z(3) + z(5)); % y component of the velocity dTheta = c3 × z(6) × tan(z(4)) × cos((z(5))); % Heading angular velocity dDelta = z(7); % Steering angular velocity dOmega = c2 × z(7) × ((cos(z(5))^2)/(cos(z(4))^2)); % Rate of change of the slipping angular velocity dPhi = −a1 × z(6) + a1 × (−0.5 × a1 × z(13)); dzdt7 = −a2 × z(7) + a2 × (−0.5 × a2 × z(14)); % Feasible trajectory plot(z(:,1),z(:,2),’r’); xlabel(‘x (in meters)’);ylabel(‘y = f(x) (in meters)’); % Converting the plot into a png (Portable Network Graphic) format print C:\Users\Guest\Documents\16september2022\bicyclepath.png; disp(‘To display the first three state functions, press a key’) % distance = intsplin(t,sqrt(dx.^2 + dy.^2)); % First 3 state functions subplot(3,1,1); plot(t,z(:,1),’r’); xlabel(‘Time t in seconds’); ylabel(‘State 1 ‘); subplot(3,1,2); plot(t,z(:,2),’r’); xlabel(‘Time t in seconds ‘); ylabel(‘State 2 ‘); subplot(3,1,3); plot(t,z(:,3),’r’); xlabel(‘Time t in seconds ‘); ylabel(‘State 3 ‘); % The file containing the first three state function graphs is named “bicycleFirst3states” and saved in the folder whose path is C:\Users\Guest\Documents\16september2022 % Converting the plot into png (Portable Graphic network) format print C:\Users\Guest\Documents\16september2022\bicycleFirst3states.png; % Last 4 state functions disp(‘To display the last four state functions, press a key’) subplot(2,2,1); plot(t,z(:,4),’r’); xlabel(‘Time t in seconds’); ylabel(‘State 4 ‘); subplot(2,2,2); plot(t,z(:,5),’r’); xlabel(‘Time t in seconds ‘); ylabel(‘State 5 ‘); subplot(2,2,3); plot(t,z(:,6),’r’); xlabel(‘Time t in seconds ‘); ylabel(‘State 6 ‘); subplot(2,2,4); plot(t,z(:,7),’r’); xlabel(‘Time t in seconds ‘); ylabel(‘State 7 ‘); % Converting the plot into png (Portable Graphic network) format print C:\Users\Guest\Documents\16september2022\bicycleLast4states.png; % First 3 costate functions disp(‘To display the first three costate functions, press a key’) subplot(3,1,1); plot(t,z(:,8),’r’); xlabel(‘Time t in seconds’); ylabel(‘Costate 1 ‘); subplot(3,1,2); plot(t,z(:,9),’r’); xlabel(‘Time t in seconds ‘); ylabel(‘Costate 2 ‘); subplot(3,1,3); plot(t,z(:,10),’r’); xlabel(‘Time t in seconds ‘); ylabel(‘Costate 3 ‘); % Converting the plot into png (Portable Graphic network) format print C:\Users\Guest\Documents\16september2022\bicycleFirst3Costates.png; % Last 4 costate functions disp(‘To display the last four costate functions, press a key’) subplot(2,2,1); plot(t,z(:,11),’r’); xlabel(‘Time t in seconds’); ylabel(‘Costate 4‘); subplot(2,2,2); plot(t,z(:,12),’r’); xlabel(‘Time t in seconds ‘); ylabel(‘Costate 5‘); subplot(2,2,3); plot(t,z(:,13),’r’); xlabel(‘Time t in seconds ‘); ylabel(‘Costate 6‘); subplot(2,2,4); plot(t,z(:,14),’r’); xlabel(‘Time t in seconds ‘); ylabel(‘Costate 7‘); % Converting the plot into png (Portable Graphic network) format print C:\Users\Guest\Documents\16september2022\bicycleLast4Costates.png; % Control strategies disp(‘To display the two control functions, press a key’) subplot(2,1,1); plot(t,control1,’r’); xlabel(‘Time t in seconds ‘); ylabel(‘Control1′); subplot(2,1,2); plot(t,control2,’r’); xlabel(‘Time t in seconds ‘); ylabel(‘Control2′); % Converting the plot into png (Portable Graphic network) format print C:\Users\Guest\Documents\16september2022\bicycleControls.png % Velocities disp(‘To display the directional velocities functions, press a key’) subplot(3,1,1); plot(t,dx,’r’); xlabel(‘Time t in seconds ‘); ylabel(‘x velocity’); subplot(3,1,2); plot(t,dy,’r’); xlabel(‘Time t in seconds ‘); ylabel(‘y velocity ‘); subplot(3,1,3); plot(t,c1*abs(z(:,6)),’r’); xlabel(‘Time t in seconds ‘);ylabel(‘Robot speed’); % Converting the plot into png (Portable Graphic network) format print C:\Users\Guest\Documents\16september2022\bicycle_velocities.png diary C:\Users\Guest\Documents\16september2022\Results_Runge-Kutta; % diary allows to store the numerical data and results into a specified file. |
6. Conclusions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Conflicts of Interest
References
- Charlen Raymond. Crashes Cost SA Billions a Year: Here’s Where the Money Goes. Available online: https://www.news24.com/wheels/roads/road_trip/news/crashes-cost-sa-billions-a-year-heres-where-the-money-is-bein-spent-20161101 (accessed on 4 September 2022).
- Lee, S.; Ham, W. Self Stability Strategy in Tracking Control of Unmanned electric bicycle with mass balance. IEEE/RSJ Int. Conf. Intell. Robot. Syst. 2002, 3, 2200–2205. [Google Scholar]
- Owczarkowski, A.; Kozierski, P.; Lis, M. Mathematical Modeling of the Bicycle Robot with the Reaction Wheel. Ind. Res. Inst. Autom. Meas. 2015, 9, 3–8. [Google Scholar] [CrossRef]
- Zhuang, W.; Li, G.; Zhang, R.; Huang, Y. Dynamical model of a new type of self-balancing tractor-trailer-bicycle. MATEC Web Conf. 2020, 309, 05002. [Google Scholar] [CrossRef] [Green Version]
- Zhang, K.; Zheng, X.; Zheng, X.; Chen, Z.; Chen, Z.; Wang, Q. Non-smooth dynamic modeling and simulation of an unmanned bicycle on a curved pavement. Appl. Math. Mech. 2022, 43, 93–112. [Google Scholar] [CrossRef]
- Yi, J.; Song, D.; Levandowski, A.; Jayasuriya, S. Trajectory tracking and balance stabilization control of autonomous motorcycle. In Proceedings of the IEEE International Conference on Robotics and Automation, Orlando, FL, USA, 15–19 May 2006; pp. 2583–2589. [Google Scholar] [CrossRef] [Green Version]
- Cossalter, V.; Lot, R.; Maggio, F. On the Braking Behavior of Motorcycles. J. Passanger Cars Mech. Syst. J. 2004, 1274–1280. [Google Scholar] [CrossRef]
- Bayraktaroglu, Z.Y.; Argin, O.F. Modelling, Control System Design and Simulation of an Autonomous Bicycle. In Proceedings of the IASTED International Conference on Modelling, Identification and Control (MIC 2014), Innsbruck, Austria, 17–19 February 2014. [Google Scholar]
- He, J.; Zhao, M. Control System Design of Self-balanced Bicycles by Control Moment Gyroscope. Lect. Notes Electr. Eng. 2015, 338, 205–214. [Google Scholar]
- He, J.; Zhao, M.; Stasinopoulos, S. Constant-Velocity Steering Control Design for Unmanned Bicycles. In Proceedings of the 2015 IEEE Conference on Robotics and Biomimetics, Zhuhai, China, 6–9 December 2015. [Google Scholar]
- Yi, J.; Zhang, Y.; Song, D. Autonomous Motorcycles for Agile Maneuvers, Part I: Dynamic Modeling. In Proceedings of the Proceedings of the 48h IEEE Conference on Decision and Control (CDC) Held Jointly with 2009 28th Chinese Control Conference, Shanghai, China, 16–18 December 2009. [Google Scholar]
- Saguchi, T.; Yoshida, K.; Takahashi, M. Stable Running Control of Autonomous Bicycle Robot. Trans. Jpn. Soc. Mech. Eng. Part C 2007, 73, 2036–2041. [Google Scholar] [CrossRef] [Green Version]
- Saguchi, T.; Yoshida, K.; Takahashi, M. Stable Running Control of Autonomous Bicycle Robot for Trajectory Tracking considering the running velocity. Hen/Trans. Jpn. Soc. Mech. Eng. Part C 2007, 75, 397–403. [Google Scholar] [CrossRef] [Green Version]
- Satoh, H.; Namerikawa, T. Robust stabilization of running self-sustaining two-wheeled vehicle with varying speed and mass variations. Nippon. Kikai Gakkai Ronbunshu Trans. Jpn. Soc. Mech. Eng. Part C 2009, 75, 882–889. [Google Scholar] [CrossRef] [Green Version]
- Satoh, H.; Namerikawa, T. Modeling and Robust Attitude Control of Stationary Self-sustaining Two-wheeled Vehicle. Trans. Jpn. Soc. Mech. Eng. Part C 2006, 72, 2130–2136. [Google Scholar] [CrossRef] [Green Version]
- Yamaguchi, T.; Shibata, T.; Murakami, T. Self-Sustaining Approach of Electric Bicycle by Acceleration Control Based Backstepping. In Proceedings of the Industrial Electronics Society, 2007. IECON 2007. 33rd Annual Conference of the IEEE, Taipei, Taiwan, 5–8 November 2007. [Google Scholar]
- Defoort, M.; Murakami, T. Sliding-Mode Control Scheme for an Intelligent Bicycle. IEEE Trans. Ind. Electron. 2009, 56, 3357–3368. [Google Scholar] [CrossRef]
- Guo, L.; Liao, Q.; Wei, S.; Zhuang, Y. Design of linear quadratic optimal controller for bicycle robot. In Proceedings of the 2009 IEEE International Conference on Automation and Logistics, Shenyang, China, 5–7 August 2009. [Google Scholar]
- Chen, P.; Islam, S.M.N. Optimal Control Models in Finance: A New Computational Approach; Applied Optimization Series; Springer: Berlin/Heidelberg, Germany, 2005; Volume 95. [Google Scholar]
- Federico, S.; Ferrari, G.; Regis, L. Applications of Stochastic Optimal Control to Economics and Finance; MDPI: Basel, Switzerland, 2020. [Google Scholar]
- Hans, P. Geering, Optimal Control with Engineering Applications; Springer: Berlin/Heidelberg, Germany, 2007. [Google Scholar]
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |
© 2022 by the author. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Mavungu, M. Control and Trajectory Planning of an Autonomous Bicycle Robot. Computation 2022, 10, 194. https://doi.org/10.3390/computation10110194
Mavungu M. Control and Trajectory Planning of an Autonomous Bicycle Robot. Computation. 2022; 10(11):194. https://doi.org/10.3390/computation10110194
Chicago/Turabian StyleMavungu, Masiala. 2022. "Control and Trajectory Planning of an Autonomous Bicycle Robot" Computation 10, no. 11: 194. https://doi.org/10.3390/computation10110194
APA StyleMavungu, M. (2022). Control and Trajectory Planning of an Autonomous Bicycle Robot. Computation, 10(11), 194. https://doi.org/10.3390/computation10110194