314 IIUM Engineering Journal, Vol. 13, No. 2, 2012 Ab Rashid and Sidek 173 CONTROLLER DESIGN OF UNICYCLE MOBILE ROBOT M.Z. AB RASHID AND S.N. SIDEK Department of Mechatronics Engineering, International Islamic University Malaysia, P.O. Box 10, 50728 Kuala Lumpur, Malaysia. iruz_maz@yahoo.com ABSTRACT: The ability of unicycle mobile robot to stand and move around using one wheel has attracted a lot of researchers to conduct studies about the system, particularly in the design of the system mechanisms and the control strategies. This paper reports the investigation done on the design of the controller of the unicycle mobile robot system to maintain its stability in both longitudinal and lateral directions. The controller proposed is a Linear Quadratic Controller (LQR) type which is based on the linearized model of the system. Thorough simulation studies have been carried out to find out the performance of the LQR controller. The best controller gain, K acquired through the simulation is selected to be implemented and tested in the experimental hardware. Finally, the results obtained from the experimental study are compared to the simulation results to study the controller efficacy. The analysis reveals that the proposed controller design is able to stabilize the unicycle mobile robot. ABSTRAK: Kemampuan robot satu roda untuk berdiri dan bergerak di sekitar telah menarik minat ramai penyelidik untuk mengkaji sistem robot terutamanya didalam bidang rangka mekanikal dan strategi kawalan robot. Kertas kajian ini melaporkan hasil penyelidikan ke atas strategi kawalan robot bagi memastikan sistem robot satu roda dapat distabilkan dari arah sisi dan hadapan. Strategi kawalan yang dicadang, menggunakan teknik kawalan kuadratik sejajar (Linear Quadratic Control) yang berdasarkan model robot yang telah dipermudahkan. Kajian simulasi secara terperinci telah dijalankan bagi mengkaji prestasi strategi kawalan yang dicadangkan. Dari kajian simulasi sistem robot, pemilihan faktor konstan, K yang sesuai di dalam strategi kawalan telah dibuat, agar dapat dilaksanakan ke atas sistem robot yang dibangunkan. Keputusan dari kajian simulasi dan tindak balas oleh sistem robot yang dibangunkan akhirnya dibandingkan bagi melihat kesesuaian faktor kostan, K yang dipilih. Analisa menunjukkan dengan menggunakan strategi kawalan yang dicadangkan dapat menstabilkan robot satu roda. KEYWORDS: unicycle mobile robot; nonholonomic system; LQR 1. INTRODUCTION Unicycle mobile robot is a robot that can move and maneuver around using a single wheel. The advantage of the robot is its mechanism to stand upright without falling down either in the longitudinal or lateral directions within a small space has attracted many researchers to conduct studies on the system. The studies cover from the modeling of the system, designing and prototyping the mechanism, and the controller design. The way a human rides a unicycle has inspired many researchers. The rider of unicycle could stabilize his position by moving his two arms, wrist and body in unison. Meanwhile, the pitch angle is stabilized by pedalling the unicycle by using the two legs back and forth, in order to control the speed and the position of the wheel. Besides that, the yawing angle IIUM Engineering Journal, Vol. 13, No. 2, 2012 Ab Rashid and Sidek 174 of the unicycle is stabilized by rotating the left and the right hands synchronously. As a result from this, the researchers have proposed different models of unicycle mobile robot based on their assumptions on the way human rides a unicycle. Along with that, they have also proposed a few types of mechanisms and controllers to stabilize unicycle mobile robot. From the exploratory and intensive research conducted by other researchers earlier, different mechanisms of unicycle mobile robot have been proposed. Basically, in this paper, the proposed unicycle mobile robot system consists of a wheel, a frame and a rotating disc as mentioned in [1]. The three-dimensional (3D) unicycle robot system can be characterized by the three tilt angles namely the roll, the pitch and the yaw angles. This robot can reach longitudinal stability through appropriate control of the wheel (i.e. the control of pitch angle). It also can reach the lateral stability via applying appropriate torque generated by the rotating disc (i.e. the control of roll angle). The main problem of the research is to control the unicycle mobile robot especially when the posture of the robot needs to be stabilized upright, both whenever the robot is moving or when it is in the still mode. The posture of the robot can be characterized by three tilt angles namely the roll angle that is the lateral tilt angle which is perpendicular to direction of motion, the pitch angle or known as longitudinal tilt angle which is parallel to the direction of motion and lastly the yaw angle. Thus, the problem in the research work can be stated as to develop a unicycle mobile robot that can be stabilized by using proper controller based on the operation of the inverted pendulum system autonomously. This is to ensure the unicycle system can stay uprights without falling down longitudinally or laterally. A specific mathematical model of the system developed could lead to multiple ways to construct the robotic platform. On top of that, the system controller is designed and simulated as well as implemented in the real system hardware. In the following, an overview of works done in this field is mentioned in section-2. The dynamic modeling of the unicycle mobile robot is addressed in section-3. Section-4 elaborates the controller design. The simulations and the experimental results are reported in section-5. Finally a conclusion is drawn in section-6. 2. LITERATURE SURVEY 2.1 System Classification Over the last few decades, many researches and studies have been conducted on inverted pendulum system. Inverted pendulum can be defined as a system with a mass attached to a rod which can rotate about a pivot point [2]. According to [3], an inverted pendulum attached to a cart is called a cart-pole system. The pole with mass is pointing upward, while the cart can move back and forth in horizontal plane to make the pole stays upright. Another type of system related to inverted pendulum is called inertia wheel pendulum or better known as reaction wheel pendulum mentioned by [4] in their research. Reaction wheel pendulum consists of a symmetric disc attached to the end of rod which is freely rotated about an axis, parallel to the axis of rotation of the pendulum. The reaction disc can be actively controlled by coupling torque generated by angular acceleration actuated through a DC motor. In the research done by [5], the author classified the system into two classes; class 1 and class 2. Reaction wheel pendulum is considered as class 1 system while cart pole system is a class 2 system. IIUM Engineering Journal, Vol. 13, No. 2, 2012 Ab Rashid and Sidek 175 From the above mentioned definition, unicycle mobile robot can be composed of class 1 and class 2 systems. The rotating disc and frame (i.e. with fixed wheel) of the robot can be considered as class 1 while combination of robot’s wheel and frame (i.e. fixed rotating disc) can be classified as class 2 system. Furthermore, unicycle mobile robot is an under-actuated system because it possesses fewer control inputs compared to degree of freedoms [5]. Unicycle mobile robot has two motors to control its position and orientation. Besides, unicycle mobile robot is a non- holonomic system because it has dynamic non-holonomic constraint mentioned by [6]. It is considered as non-holonomic since the wheel of unicycle is maintained at a contact point on a planar plane, the wheel is impossible to move transversally and wheel displacement along the plane is equal to the wheel arc [7]. In the next section, the studies done by previous researchers related to the controller to control various unicycle’s mechanism are explored. 2.2 Controller Design In the research by [8], the author used Linear Quadratic Gaussian (LQG) controller to control the lateral and longitudinal stability of the unicycle mobile robot. The robot developed by this author is in the form of system that mimicked a human riding a unicycle which consists of a wheel, a frame which acted as the rider’s body and rotary turntable as the human arms. During simulation study, the lateral stability could be achieved at nonzero wheel speed by twisting the turntable and the wheel moved forward and backward. The author in [9] had proposed a new modified LQG method to control longitudinal stability of the unicycle robot which previously developed by [8]. However, the control strategy using the same method applied for lateral stability was not mentioned in the paper. The author then used gain scheduled lateral controller to control the lateral stability of the system. The author mentioned that friction effects in forward and yawing direction was contributed by wheel surface friction while drive train friction was considered as pitch and yawing friction. The author had used bang-bang controller to deal with the friction effects on the system. The author in [10] had proposed the unicycle movement based on the design by [8] and assumed that, when the robot moved in longitudinal plane, there is no lateral and yawing effect occurs on it. It was assumed that the linearized model behaved like an inverted spherical pendulum with a base that is free to move in the surface plane. The author proposed Linear Quadratic Regulator (LQR) controller to stabilize the system. The controller however was implemented in the simulation stage only. The author in [11] had proposed to use PD controller to control the lateral stability the unicycle mobile robot which had asymmetric turntable rotor rotated by a geared motor on the top of the system to control the roll angle while the wheel was driven by linkages that were connected to two motors. The linkages were assumed to replace human’s thigh and foot when they were riding the unicycle. From the author point of view, the experimental results conducted depend on initial posture of robot and ground unevenness. In another paper [11], the same author had proposed a new controller by using fuzzy gain schedule PD control technique. Experimental results shown that both of the robot’s longitudinal and lateral postures could be successfully stabilized. By comparing the experimental results with PD and D controllers, it was found that the lateral and the pitch controls with two fuzzy gain schedule PD controllers produced better results. IIUM Engineering Journal, Vol. 13, No. 2, 2012 Ab Rashid and Sidek 176 Another controller proposed by [12] and [13] developed a system namely as Gyrover which was a single wheel vehicle equipped with an internal gyroscope. This internal gyroscope was aligned with the wheel and spinning in the direction of forward motion. Angular momentum from the gyro contributed to the lateral stability when the wheel stopped or moved slowly. A tilt device tilted the gyro’s axis about roll axis with respect to the wheel. Because the gyro acts as inertial reference, the effect of tilt action caused the wheel to lean left and right and then caused the wheel to steer. The author in [14] had used LQR optimal control to control the robot whose design is slightly similar as the one in [12] and [13]. The author [14] had considered the motion about roll axis only and neglected the pitch and yaw controls. In the study done by [15], the researchers had used feedback control technique to stabilize the roll and pitch angles of the unicycle system. The system was equipped with two gyros which were used to detect angular velocities around the rolling and the pitching axes. Another gyro was applied to detect an angular velocity around yawing axis which was used to find the heading direction. The same control strategy was also applied to control the mechanism discussed in the research done by [12] and [13]. In the paper produced by, [16], a controller had been designed to control the yaw angle of unicycle by applying time phase difference on the roll and pitch angles. However, the study had been conducted only at simulation level. Further studied carried out by [17] had proposed a new fuzzy logic controller (FLC) to control the unicycle robot in two dimensional system. In the FLC design, the author had leveraged the linear quadratic regulator (LQR) and the gain-scheduling technique to obtain the FLC parameters. In addition by further comparing the FLC with the LQR which was designed around an operating point, the FLC coefficients could be easily tuned. However, the controller could only be applied to control the pitch angle of the system dynamics. Moreover, in another paper done by [18], the author had used linear controller to stabilize their design. The design done by [18] was based on inverse mouse roller ball. The controller had two loops; the proportional-integration (PI) controller as the inner loop and LQR as the outer loop. The study carried out by [19] had used an adaptive nonlinear control together with Radial Basis Function Neural Networks (RBFNN) which was based on adaptive back-stepping control technique to stabilize the system design. However, the author only provided the simulated results and no comparison was done between simulated results and experimental results. Another method proposed by [20] had used gain scheduling with linear parameter varying technique to control the unicycle robot. The system developed was composed of two gyroscopes acting as actuator for lateral stabilization and a wheel as actuator for longitudinal stabilization. The experimental results for lateral and longitudinal control were very good even though small oscillations still could be observed. Research by [21] had used the pole-placement and LQR to control the unicycle robot in longitudinal direction only. The system analysis and estimation of system- coefficients were completed on the simulated stage. 3. DYNAMIC MODELING OF THE UNICYCLE MOBILE ROBOT Based on [1] and [22], the model of the unicycle mobile robot for this research can be described in the form of non-linear model: IIUM Engineering Journal, Vol. 13, No. 2, 2012 Ab Rashid and Sidek 177 �� � ���� � ���� (1) where: 1 � � ��� ��� � ��� where α is the roll angle. 2 � ���� ��� � ��� where β is the pitch angle. 3 � ����� ��� � ��� where ω is the wheel angle 4 � ��� ��� � ��� where η is the rotation disc angle 5 � � ��� � �!"�# ( roll angle velocity). 6 � ���� � �!"�# (pitch angle velocity). 7 � ����� � �!"�# (wheel angle velocity) 8 � ��� � �!"�#.(reaction disc velocity) τ1= the torque applied to the reaction disc to control roll angle. τ2= the torque applied to the wheel to control the pitch angle. and ���� � � 5 6 7 8 �1 �2 �3 �4�' ���� � ( ) ) ) ) ) ) * 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 �11 �12 �13 �14 �21 �22 �23 �24 �31 �32 �33 �34 �41 �42 �43 �44, - - - - - - . where: (((( )))) )2(cos2634.0)2cos(00071.01923.0 1)2sin()2cos(651357.0)8665(135.0)2cos(6553.0 1 2 XX aXXXXXXXXXXX f ++++−−−− ++++−−−−++++−−−−−−−−−−−− ==== )2(cos2634.0)2cos(00071.01923.0 (X1)2.5692)sinX2)(5.873cos( 1 2 XX a ++++−−−− ++++ ==== )2cos(00456.001195.0 )2sin( 76002023.0)2cos(6004556.0 )1cos(1760.05004067.05002023.0)2cos(50079.0 2 2 22 X X XXXX XXXXX f −−−−         ++++++++ ++++−−−−−−−−−−−− ==== )2(cos004555.001195.0 )2sin( )1cos()2cos(3964.060269.0)2cos(500916.0 )2cos(5004555.0)2(cos501778.0)2cos(764555.0 3 2 2 222 X X XXXXX XXXXXXX f −−−−         −−−−−−−−++++ ++++++++−−−− ==== )2(cos2635.0)2cos(000714.01923.0 1)2(cos652635.0861357.06505729.0)2cos(653919.0 4 2 2 XX bXXXXXXXXXX f ++++−−−− ++++++++−−−−++++−−−− ==== (((( )))) )1sin(5692.2)2cos(8733.51 XXb ++++==== IIUM Engineering Journal, Vol. 13, No. 2, 2012 Ab Rashid and Sidek 178 )2(cos2635.0)2cos(0007135.01923.0 1 11 2 XX b ++++−−−− ==== )2(cos2635.0)2cos(0007135.01923.0 )2cos( 14 2 XX X b ++++−−−− −−−− ==== 043421312 ================ bbbb 034312421 ================ bbbb )2(cos004555.0012.0 03.0 22 2 X b −−−− ==== )2(cos004555.0012.0 )2cos(06749.0 23 2 X X b −−−− −−−− ==== )2(cos004555.0012.0 )2cos(06749.0 32 2 X X b −−−− −−−− ==== )2(cos2635.0)2cos(0007135.01923.0 1 41 2 XX b ++++−−−− −−−−==== )2(cos2635.0)2cos(0007135.01923.0 )2(cos94.1)2cos(995.0417.1 44 2 2 XX XX b ++++−−−− ++++++++ ==== Eqn.(2) as mentioned by [1] and [22] can be linearized so that the linear controller can be used. This equation is linearized with respect to the desired operating point and it can be described as: �� � /� � �0 (2) and the operating point for the system is exx ==== where 0≈≈≈≈ex which is the upright position of the unicycle robot.. In order to linearize Eqn. (2), Jacobian matrix is developed as shown in Eqn. (3); 0,0 ========       ∂∂∂∂ ∂∂∂∂ ==== ux x f A =                     ∂∂∂∂ ∂∂∂∂ ∂∂∂∂ ∂∂∂∂ ∂∂∂∂ ∂∂∂∂ ∂∂∂∂ ∂∂∂∂ ∂∂∂∂ ∂∂∂∂ ∂∂∂∂ ∂∂∂∂ ∂∂∂∂ ∂∂∂∂ ∂∂∂∂ ∂∂∂∂ ∂∂∂∂ ∂∂∂∂ n nnn n n x f x f x f x f x f x f x f x f x f Κ ΜΛΜΜ Λ Λ 21 2 2 2 1 2 1 2 1 1 1 , and 0,0 ========∂∂∂∂ ∂∂∂∂ ==== xxu f B (3) By employing Eqn. (1) - (2), Eqn. (3) can be represented as: )2(cos0045555.012.0 3986.0 33 2 X b −−−− ==== IIUM Engineering Journal, Vol. 13, No. 2, 2012 Ab Rashid and Sidek 179                           ==== 000000018.554164 00000053.63652-0 00000023.819380 000000018.554184 10000000 01000000 00100000 00010000 A                           ==== 9.5669002.19771- 053.92759.13231-0 09.13231-4.05555570 2.1977-002.19771 0000 0000 0000 0000 B The input to the system, 0 is given as: 0 � 10 0 1 22' (4) 4. CONTROLLER DESIGN In order to control the unicycle mobile robot, a linear controller has been designed. The controller is known as Linear Quadratic Controller (LQR) and designed to control the roll (α) and pitch angles (β) of the unicycle robot system shown in Figure 1 for both the simulation and the experimental study at the operating point. The performance of controller is then compared. Fig. 1: The generalized coordinate for unicycle mobile robot, roll angle (α), pitch angle (β), disc angle (η) and wheel angle (ω). The advantage of using the LQR controller in this system is, it can regulate the system output, x to zero while stabilizing the closed loop. In other words, it is strictly intended to stabilize the system and to make the time response faster as mentioned in [23]. IIUM Engineering Journal, Vol. 13, No. 2, 2012 Ab Rashid and Sidek 180 By considering the unicycle mobile robot model in the Eqn. (2), a full state feedback regulator for the system is designed based on [24] by using control input vector as in the Eqn. (5). 0 � 34���� (5) The target of the designed controller is to obtain the gain K so that u in Eqn.(5) can be included into quadratic objective function expressed in Eqn. (6). 5 � 6 1�' 7� � 0' 8029:9 ;� (6) Where, �� is the final time, and � is the initial time. In this system, we are interested in the steady state behaviour of the unicycle mobile robot system. As such the control period for the system will be infinite. Thus, tf in Eqn. (6) will be approaching infinity, ∞ and the quadratic objective function then become J∞. J∞ can be considered as the energy function. When J∞ is small, the energy of the closed loop system is also small. Since x and u in Eqn. (6) governed by J∞, neither x nor u is large. When J∞ is minimized, x becomes zero as tf goes to ∞ and it guarantees that the system is stable. In order to minimize J∞, the matrix Q and matrix R need to be selected. Matrix Q is defined as in Eqn. (7) while matrix R can be defined in Eqn.(8). 7 � ( ) ) ) * <== 0 0 … 0 0