Proceedings of IMECE28 28 ASME International Mechanical Engineering Congress and Exposition November 2-6, 28, Boston, Massachusetts, USA IMECE28-68948 YAW RATE AND VELOCITY TRACKING CONTROL OF A HANDS-FREE BICYCLE Dale L. Peterson, Mont Hubbard Sports Biomechanics Laboratory Dept. of Mechanical and Aeronautical Engineering University of California Davis Davis, California 95616 Email: {dlpeterson,mhubbard}@ucdavis.edu ABSTRACT The control of a bicycle has been well studied when a steer torque is used as the control input. Less has been done to investigate the control of a hands free bicycle through the rider s lean relative to the bicycle frame. In this work, we extend a verified benchmark bicycle model to include a rider with the ability to lean in and out of the plane of the bicycle frame. A multi-input multi-output LQR state feedback controller is designed with the control objective being the tracking of a reference yaw rate and rear wheel angular velocity through the use of rider lean torque and rear wheel (pedaling) torque. The LQR controller is tested on the nonlinear model and numerical simulation results are presented. Conclusions regarding the required lean angle of the rider relative to the bicycle frame necessary to execute a steady turn are made, as well as observations of the effects of right half plane zeros in the transfer function from rider lean torque to yaw rate. INTRODUCTION The Whipple bicycle model [1] is the simplest model of the bicycle that adequately describes the dynamic behavior of a hands-free bicycle (i.e. no applied steer torque). The key features of the model are four rigid bodies (two wheels, the frame with rigidly attached rider, and the fork and handlebar assembly) connected by three frictionless revolute joints, and knife-edge wheels rolling without slip. An excellent literature review and description of the model and its behavior for a set of parameters provided for benchmarking purposes is provided by Meijaard et al. [2]. We have derived and verified the full nonlinear equations of motion for this model using Kane s method [3]. Additionally, we have extended this model to allow for unequal toroidal wheels, although for this work we only consider knifeedge wheels. Due to the complexity and length of the equations, model verification is done through comparison of the eigenvalues of the model when linearized about the upright, zero steer configuration over a range of forward speeds. An additional verification tool is to evaluate the velocities and accelerations that result from an arbitrary configuration. The validity of this bicycle model has also been verified experimentally by Kooijman et al. [4]. The importance of this benchmark study for purposes of model validation cannot be overstated. Motorcycle handling qualities have been a large impetus for the study of two-wheeled vehicles. A key difference in the dynamic behavior of a bicycle and a motorcycle is that in a motorcycle, the mass of the rider is a much smaller percentage of the overall mass, typically 15-3%. In contrast, a person riding a bicycle may comprise of 85-95% of the overall mass. This difference is one reason why a person can easily ride a bicycle no handed and execute fairly sharp turns, while on a motorcycle, such a task is much more difficult without applying a steering torque. For this reason, most of the control studies in motorcycle and bicycle dynamics have used steer torque as the control input (e.g. those by Åström et al. [5], Getz [6], Getz and Marsden [7]) and these models often ignore the complex front fork geometry and front and rear wheel mass and radii, and make simplifications such as treating the rider as a point mass. Rider lean has been studied in the context of motorcycles by 1 Copyright c 28 by ASME
Weir [8]. A more complicated model of a motorcycle with a rider lean torque is presented by Sharp in [9], and it is noted that for a motorcycle, steer torque is much more effective than lean torque. Van Zytveld [1] specifically addressed no hands control of a bicycle. He derived mostly correct linearized equations and attempted to build an autonomous hands-free bicycle that used a leaning mass for control of the bicycle. One study by Lee and Ham [11] examined the control of a bicycle through the use of a mass balancing system representative of a rider leaning relative to the bicycle frame. However, the model on which their study is based is also simplified in that it assumes point masses for the rider and the bicycle frame, and ignores inertial effects of the wheels. At this time, little research has been done on the control of a physically realistic bicycle through rider lean torque alone. While much understanding of the qualitative behavior of the bicycle can be obtained through such reduced models, it is unlikely that these reduced models could be used for controller design of a real world bicycle. Much of this can be attributed to the significant complexity of the full nonlinear equations of motion for a bicycle. Although the Whipple bicycle model helps one understand the dynamic behavior of a hands free bicycle with a rigidly attached rider, it sheds no light on how a human rider can control the bicycle while riding no handed. To this end, we extend the benchmark model presented in [2] by splitting the single rigid body representing bicycle frame and rider into two rigid bodies. We introduce a rider lean torque that allows the rider to lean in and out of the frame of the bicycle; we also introduce a torque between the rear wheel and the bicycle frame. Several control strategies are possible. In this paper we study the control of yaw rate and rear wheel angular velocity through the use of rider lean torque and rear wheel torque. METHODS The first step in this work was to develop equations of motion and validate them against a benchmark bicycle model presented in [2]. Our model was validated in two ways. First, linearized equations of motion about the upright, zero steer configuration were developed, and the resulting eigenvalues were compared with the eigenvalues presented in [2] for eleven different forward velocities. Second, given a set of five quantities (lean, steer, lean rate, steer rate, and rear wheel rate), the resulting velocities and accelerations of all generalized coordinates were calculated and compared to those presented in [12]. In order for these velocities and accelerations to be correct, they must be consistent with the configuration constraint, the four rolling constraints, and the laws of dynamics. For both of these model validation methods, our eigenvalues, velocities, and accelerations matched those presented by [2] and [12] to 14 digits. The behavior of this hands free model with a rigidly attached rider will not be discussed in detail here, but in order to un- Figure 1. θ F H δ F B F B R θ B φ y θ R ψ R x N n 1 Configuration of extended bicycle model. All generalized coordinates are positive in the direction of the arrows. (adapted from [2]) x,y ψ φ θ R θ B δ θ F φ R Table 1. Rear wheel contact point coordinates in ground plane φ R Yaw angle of rear wheel and bicycle frame Lean (roll) angle of rear wheel and bicycle frame Rotation angle of rear wheel Pitch angle of bicycle frame n 3 Steer angle of fork relative to bicycle frame Rotation angle of front wheel Lean of rider upper body relative to bicycle frame Generalized coordinates of extended bicycle model. derstand our work, one must be familiar with the basics of the model. The four rigid bodies of the model are the rear wheel, bicycle frame with rigidly attached rider, handlebar-fork assembly, and front wheel, denoted by R, B, H, and F, respectively. The configuration of the four rigid bodies is typically done using the first (i.e. excluding φ R ) 8 generalized coordinates shown in Table 1. The condition that both wheels must touch the ground gives rise to a non-trivial holonomic constraint relating φ, θ B, and δ. This constraint is given explicitly as an analytically solvable quartic polynomial in the sine of θ B in [13]. (Some prior presenters of this constraint clearly did not realize that the constraint was a quartic; while others, who may have, did not exhibit that quartic explicitly. In any event, virtually all had simplified to the case of knife-edge wheels.) Additionally, there are four nonholonomic rolling con- n 2 ψ 2 Copyright c 28 by ASME
straints, enforcing two no-slip conditions for each wheel. The eight generalized coordinates, combined with the four nonholonomic and one holonomic constraint result in a system with three degrees of freedom (8 4 1 = 3). Typically, one chooses the independent generalized speeds to be rear wheel velocity, lean rate, and steer rate. In general, a system with three degrees of freedom would have a six dimensional state space, but due to the symmetry of the rear wheel, θ R is an ignorable coordinate. The result is a five dimensional state space. To fully describe the four rigid bodies, 25 independent inertial and geometric parameters are used. These parameters define things such as wheel radii, center of mass locations, mass and inertial properties of each rigid body, and the relative locations of each rigid body. The parameters used in this work are identical to those presented in [2], with the exception of the mass and inertial properties of the rigid body B. Extension of the Whipple model In order to study the effects of a rider with the ability to lean with respect to the bicycle frame, we divide the rigid body B into two rigid bodies. The first represents the bicycle frame and the rigidly attached legs of the rider, and is denoted by B F. The second represents the upper body of the rider, and is denoted by B R. The rigid body B R is allowed to rotate by an angle φ R about an axis in the plane of the bicycle frame. The axis of rotation is horizontal when the bicycle is in the upright (zero lean and steer angles) configuration. Figure 1 illustrates all nine generalized coordinates of our extended model. To ensure the correctness of our model, the mass and inertial properties of B F and B R (which replace B), are chosen such that when φ R =, the center of mass location of B F and B R is identical to the center of mass location of B in [2]. Similarly, when the rider lean is zero, the moment of inertia of B F and B R about the combined center of mass is chosen so that it is identical to the moment of inertia of B as specified in [2]. There is some choice of how to apportion the mass and inertia between B F and B R, i.e. whether the rider center of mass is behind or in front of the bicycle frame center of mass, or how the components of the inertia matrix are apportioned between B F and B R. Seven weighting coefficients were introduced in order to allow for independent adjustment of relative masses (one coefficient), relative center of mass locations (two coefficients), and relative inertia matrix components (four coefficients). The first step in determining these parameters is to choose an appropriate relative mass between the rider s upper body (B R ) and the sum of the rider s lower body and bicycle frame (B F ). Next, the relative positioning of B R and B F is chosen, both fore and aft as well as up and down. Once these three parameters are specified, the mass and center of mass positions of B R and B F are determined. Finally, one specifies the relative magnitudes of each of the four entries of the inertia matrix. Using the parallel axis theorem, one Rear frame and rider body (B F ) Mass Center of mass position Mass moment of inertia Rider upper body (B R ) Hinge height above ground in upright configuration Mass Center of mass position Mass moment of inertia Table 2. 34. kg (.345,.765) m 3.869 1.3 4.667 1.3 1.272.9 m 51. kg (.27,.99) m 4.299 1.444 5.186 1.444 1.413 kg m2 kg m2 Extended model parameters. Note that masses and positions are shown exactly, while inertia components are rounded to three decimal places. Center of mass locations are for the bicycle in the upright configuration, taken in the n 1 and n 3 directions. Mass moment of inertia matrices are taken about the center of mass of each rigid body with respect to a body fixed coordinate system that is aligned with the inertial coordinate system (N in Figure 1) with the bicycle in the upright configuration. can solve for each component of the inertia matrices corresponding to B R and B F. Table 2 shows the masses, inertias, center of mass locations for B R and B F, as well as the hinge height. All other model parameters remain the same as in [2]. The center of mass locations were chosen so that the rider s center of mass is above and behind the that of the bicycle frame and rider lower body. Finally, two inputs to the model were defined; a torque τ θr was added between the rear wheel R and the bicycle frame B F, and a torque τ φr between the rider upper body B R and the bicycle frame B F. Derivation of Equations of Motion The equations of motion were derived with Autolev TM, a symbolic manipulator that implements Kane s method [3]. Autolev symbolically generates the nonlinear equation of motion and has the ability to analytically differentiate them so that linear equations may be formed for the purposes of linear analysis or controller design. The addition of a rider lean results in a system 3 Copyright c 28 by ASME
with 4 degrees of freedom. The extra independent generalized speed was chosen to be the rider lean rate ( φ R ). Again, due to the symmetry of the rear wheel, θ R is uncoupled from the lean, steer, and rider lean dynamics, so the resulting state space is seven dimensional. In order to ensure that the mass, mass moments of inertia, and center of mass location of both B R and B F were calculated correctly, the equations of motion were generated for the model constraining φ R = and setting τ θr to zero. This enforces the rider to be rigidly attached to the bicycle frame. The behavior of the constrained model was found to be identical to that of the benchmark Whipple model (through comparison of the eigenvalues over a range of speeds, and through a nonlinear simulation for a set of initial conditions as given in [2]). Next, the restriction on the rider lean angle was removed and the torques were designated as inputs to the system. The equations of motion were generated in the form of a Matlab TM.m file, and put into a Simulink TM S-Function block. The inputs to the block are the two torques τ θr and τ φr. The outputs of the block are the nine generalized coordinates and their associated time derivatives. It is important to note that there are many quantities of interest besides the seven state variables. For example, in order to perform path following control (tracking of x(t) and y(t)), one needs to integrate the equations for the dependent generalized speeds associated with x and y. The Simulink block does just this, allowing great flexibility for a variety of control studies. Symbolic linearized equations of motion were derived with Autolev TM, allowing the generation of numerical linear dynamic equations about any configuration. For the purposes of controller design, we chose to linearize the equations about the upright configuration and several different rear wheel angular velocities. The linearized equations of motion are of the form ẋ = Ax + Bu (1) y = Cx + Du (2) z = Gx + Hu (3) where x = [φ, δ, φ R, φ, θ R, δ, φ R ] T are the states, and u = [τ φr, τ θr ] T are the control inputs. The measured outputs are assumed to be all of the states, so C = I 7 7 and D = 7 7. The controlled outputs z were chosen to be yaw rate and rear wheel angular velocity, z = [ ψ, θ R ] T. Since there is no feed-forward from the control inputs (torques) to the outputs (velocities), H = 2 2. The first row of G was obtained by linearizing the equation for yaw rate ψ. This equation is formulated by solving the nonholonomic constraint equations for ψ in terms of the seven state variables. The second row of G is zero except for a one in the fifth entry, corresponding to the fifth state variable θ R. LQR Controller Design Having derived the linearized equations of motion for a model of the bicycle with two inputs and two controlled outputs, the next task was to design a controller that would perform reference tracking of yaw rate and rear wheel angular velocity. Our control formulation follows that presented by Hespanha [14]. In tracking a constant reference signal, once equilibrium is reached and the controlled output equals the reference, ẋ = and z = r. Letting x eq and u eq be the corresponding state and control input that result in ẋ = and z = r, Eqns. (1) and (3) imply = Ax eq + Bu eq (4) r = Gx eq + Hu eq (5) These equations are linear in x eq and u eq, therefore [ xeq u eq ] = [ A B G H ] 1 r Letting F be the 7 2 matrix given by the7 top-most rows and 2 right-most columns of the inverse in Eqn. (6), and letting N be the 2 bottom-most rows and 2 right-most columns of the inverse in Eqn. (6) gives (6) u eq = Nr, x eq = Fr (7) Since the control objective is for the output z to follow the reference r, the quadratic cost function with output weighting is chosen to be J(u) = (z T Qz + u T Ru)dt (8) The lqry() command in Matlab TM conveniently solves the associated Riccati equation and computes the state feedback gain matrix K such that u = K(x x eq ) + u eq = Kx + (KF + N)r (9) minimizes J(u) and stabilizes Eqn. (1). The closed loop system (with D = and H = ) is given by ẋ = (A BK)x + B(KF + N)r (1) z = Gx (11) The resulting block diagram is shown in Figure 2. While linearized equations of motion were used for determination of F, N, and K, all dynamic simulation results are based upon the nonlinear equations of motion. 4 Copyright c 28 by ASME
r F u eq N + K u ẋ = f (x,u) + + Bicycle Model x eq Figure 2. Set point control with state feedback. z x torque [N m] 2 1 1 2 angular velocity [rad/sec].3.2.1.1 21 Ψ ref Ψ θ R ref angule [rad] 3.4.3.2.1 τ φr τ θr φ δ φ R angular velocity [rad/sec] 22 23 Figure 3. 1 2 3 4 5 6 7 8 Time [sec] Nonlinear step response: Yaw rate step is shown in the upper plot; rear wheel angular velocity response is shown in the upper plot. The steps in both reference signals were given simultaneously. RESULTS Dynamic simulation results were obtained using the following cost function weighting matrices 1 Q = 1 θ R R = 1 1 (12).1 1 2 3 4 5 6 7 8 Time [sec] Figure 4. Nonlinear step response: Control torques are shown in the upper plot; lean, steer, and rider lean angles are shown in the lower plot. The linearized dynamics equations were formulated about x = [,,,, 23. 3,,] T, which corresponds to the steady, upright, zero steer configuration with a forward speed of 7 m/s ( θ R = 23. 3). The resulting gain and feed-forward matrices were 185.2 95.9 12.4 5.8 7.9 34.8 K = 1. 1.87 N =.734.153.262 F = 1 (13) (14) (15) It is clear from these gain matrices that in the upright configuration, yaw rate control is independent of rear wheel velocity control. However, in any non-upright configuration, there will be a coupling between these two control tasks, and it will be reflected in the N, F, and K matrices. The bicycle model was put in an initial condition of x = 5 Copyright c 28 by ASME
[,,,, 21. 3,,] T. The reference yaw rate was initially zero while the reference rear wheel velocity was initially 21. 3. Figure 3 show the nonlinear system response to simultaneous steps in the reference yaw rate and forward speed of the rear wheel. There is a steady state tracking error in the yaw rate, while perfect tracking of rear wheel velocity ( θ R multiplied by rear wheel radius) can be seen in Figure 4. An understanding of the yaw rate response can be found through examination of the zeros of the transfer function from τ φr to Ψ, which has two real right half plane (RHP) zeros. In response to a positive step in reference yaw rate corresponding to a steady right hand turn, the bicycle first begins turning with a positive yaw rate ( Ψ > ), then switches directions ( Ψ < ), before changing directions again ( Ψ > ). This behavior is due to the presence of two RHP zeros. These RHP zeros also manifest themselves in the responses of the other states. When initiating a right handed turn ( Ψ positive), the rider first accelerates to the right ( φ R > ). As a result of the opposite torque, the bicycle frame initially accelerates to the left ( φ < ) and begins yawing to the right ( Ψ > ). As a result of the bicycle leaning to the left (φ < ), a very slight steer to the right occurs (δ > ), followed shortly thereafter by a more pronounced steer to the left (δ < ). Just before the time when the left handed steer is greatest, the bicycle frame begins to lean back towards the right ( φ > ) and the yaw acceleration becomes positive as well ( Ψ > ), followed quickly by the handlebars turning back to the right again (δ > ). As the lean and steer angles become more positive, the rider lean angle begins decreasing, finally resulting in a steady turn in which the bicycle is leaned and steered towards the right (φ > and δ > ), with the rider leaned slightly to the left (φ R < ). This behavior is visible in the bottom of Figure 4. The pole-zero map and the frequency response of the linearized equations (about an upright configuration with v = 7. m/s) are shown in Figure 5 and Figure 6, respectively. These zeros remain in the RHP for all forward velocities. The poles of the open loop transfer function from τ φr to Ψ are the eigenvalues of A in Eqn. (1). Figure 7 shows the eigenvalues as a function of forward speed. Clearly visible are the weave mode, capsize mode, and caster mode. These modes are inherent to the bicycle with a rigidly attached rider. Not labelled in the figure is a zero eigenvalue whose eigenvector is zero except for a one in the component associated with θ R. The addition of the leaning rider gives rise to two inverted pendulum-like real eigenvalues, one negative and one positive. One of the pair is unstable at all velocities, so without active control, there is no stable speed range for this extended model. CONCLUSIONS AND FUTURE WORK Simulation results show that a hands free bicycle can be controlled through the use of rider lean torque. The nonlinear re- Imaginary 8 6 4 2 2 4 6 8 1 8 6 4 2 2 Real Figure 5. Poles and zeros of transfer function from lean torque to yaw rate at a forward velocity of 7 m/s. At this particular velocity, there are two real zeros and two real poles in the right half plane. sponse demonstrates the effect of the two right half plane zeros. The controller presented here accomplishes the goal of tracking a yaw rate and a rear wheel angular velocity. However, other control schemes need to be explored to better address the issue of right half plane zeros. Steady state tracking error in the yaw rate indicates that a controller design with an integral effect would be desirable. Additionally, since the dynamics of the bicycle are extremely speed dependent, it may be that the controller performance will suffer at velocities far from the velocity of linearization. Implementation of a nonlinear gain-scheduled approach to account for the velocity dependence of the dynamics could help address this problem. Gain scheduling would also help take advantage of the ability of the rear wheel torque to influence the yaw rate when the bicycle is in a leaned and steer configuration, or when there are significant variations in the forward speed. The spikes in the commanded control signals in Figure 4 are not achievable with any realistic actuator. Future work will examine the performance of this controller including actuator dynamics. Finally, the addition of a steer torque to this model will be the next step in studying how lean and steer torques can be used together to better control the bicycle. It is our goal to eliminate the right half plane zeros through the use of steer and lean torques, and further studies will be focused on this issue. 6 Copyright c 28 by ASME
Magnitude (db) Phase (deg) 2 4 6 8 1 26 22 18 14 1 Figure 6. 6 1 3 1 2 1 1 1 1 1 1 2 1 3 Frequency (rad/sec) Bode plot of transfer function from lean torque to yaw rate at a forward velocity of 7 m/s. ACKNOWLEDGMENT Thanks go to Jason Moore for the countless discussions about bicycles, dynamics, and control. Additional thanks go to Arend Schwab, Jim Papadoupolous, Andy Ruina, Pradipta Basu- Mandal, and Anindya Chatterjee for their input and assistance in studying the Whipple bicycle model. Their technical comments greatly improved the quality of this paper. REFERENCES [1] Whipple, F., 1899. The stability of the motion of a bicycle. Quarterly Journal of Pure and Applied Mathematics, 3, pp. 312 348. [2] Meijaard, J., Papadopoulos, J., Ruina, A., and Schwab, A., 27. Linearized dynamics equations for the balance and steer of a bicycle: a benchmark and review. Proceedings of the Royal Society A, 463(284), August, pp. 1955 1982. [3] Kane, T., and Levinson, D., 1985. Dynamics: Theory and Applications. McGraw Hill, New York, NY. [4] Kooijman, J., Schwab, A., and Meijaard, J., 28. Experimental validation of a model of an uncontrolled bicycle. Multibody System Dynamics, 19(1-2), February, pp. 115 132. [5] Åström, K., Klein, R., and Lennartsson, A., 25. Bicycle dynamics and control, adapted bicycles for education and Re(λ) [1/s] 1 8 6 4 2 2 4 6 8 Weave Capsize Caster Rider Rider 1 1 2 3 4 5 6 7 8 9 1 Forward speed [m/s] Figure 7. Eigenvalues of extended bicycle as a function of forward speed when linearized about the upright, zero steer configuration. Dashed line corresponds to the imaginary part of the eigenvalues. The zero crossings of the real part of the eigenvalues are for the weave motion and the capsize motion are at speeds v w 4.53m/s and v c 6.4m/s, respectively. research. IEEE Control Systems Magazine, 25(4), August, pp. 26 47. [6] Getz, N., 1994. Control of balance for a nonlinear nonholonomic non-minimum phase model of a bicycle. In American Control Conference Baltimore, American Control Conference Council. [7] Getz, N., and Marsden, J., 1995. Control for an autonomous bicycle. IEEE International Conference on Robotics and Automation, 2, May, pp. 1397 142. [8] Weir, D., 1972. Motorcycle Handling Dynamics and Rider Control and the Effect of Design Configuration on Response and Performance. PhD Thesis, University of California Los Angeles, Los Angeles, CA. [9] Sharp, R., 21. Stability, control and steering responses of motorcycles. Vehicle System Dynamics, 35(4 5), pp. 291 318. [1] Van Zytveld, P., 1975. A method for the automatic stabilization of an unmanned bicycle. MS Thesis, Stanford University, Stanford, CA, May. [11] Lee, S., and Ham, W., 22. Self stabilizing strategy in tracking control of unmanned electric bicycle with mass balance. IEEE/RSJ International Conference on Intelli- 7 Copyright c 28 by ASME
gent Robots and Systems, 3, pp. 22 225. [12] Basu-Mandal, P., Chatterjee, A., and Papadopoulos, J., 27. Hands-free circular motions of a benchmark bicycle. Proceedings of the Royal Society A, 463(284), August, pp. 1983 23. [13] Peterson, D., and Hubbard, M., 28. Analysis of the holonomic constraint in the whipple bicycle model. In The Engineering of Sport 7, M. Estivalet and P. Brisson, eds., Vol. 2, International Sport Engineering Association, Springer-Verlag France, pp. 623 631. Paper number 267. [14] Hespanha, J. P., 27. Undergraduate Lecture Notes on LQG/LQR controller design. at http://www.ece. ucsb.edu/ hespanha/published, April. 8 Copyright c 28 by ASME