speed-adaptive roll-angle-tracking control of an unmanned bicycle using fuzzy logic

17
This article was downloaded by: [University of Colorado - Health Science Library] On: 26 September 2014, At: 07:16 Publisher: Taylor & Francis Informa Ltd Registered in England and Wales Registered Number: 1072954 Registered office: Mortimer House, 37-41 Mortimer Street, London W1T 3JH, UK Vehicle System Dynamics: International Journal of Vehicle Mechanics and Mobility Publication details, including instructions for authors and subscription information: http://www.tandfonline.com/loi/nvsd20 Speed-adaptive roll-angle-tracking control of an unmanned bicycle using fuzzy logic Chih-Keng Chen a & Trung-Kien Dao a a Dept. of Mechanical and Automation Engineering , Dayeh University , 112 Shanjiau Rd., Changhua, 515, Taiwan, Republic of China Published online: 21 Jan 2010. To cite this article: Chih-Keng Chen & Trung-Kien Dao (2010) Speed-adaptive roll-angle-tracking control of an unmanned bicycle using fuzzy logic, Vehicle System Dynamics: International Journal of Vehicle Mechanics and Mobility, 48:1, 133-147, DOI: 10.1080/00423110903085872 To link to this article: http://dx.doi.org/10.1080/00423110903085872 PLEASE SCROLL DOWN FOR ARTICLE Taylor & Francis makes every effort to ensure the accuracy of all the information (the “Content”) contained in the publications on our platform. However, Taylor & Francis, our agents, and our licensors make no representations or warranties whatsoever as to the accuracy, completeness, or suitability for any purpose of the Content. Any opinions and views expressed in this publication are the opinions and views of the authors, and are not the views of or endorsed by Taylor & Francis. The accuracy of the Content should not be relied upon and should be independently verified with primary sources of information. Taylor and Francis shall not be liable for any losses, actions, claims, proceedings, demands, costs, expenses, damages, and other liabilities whatsoever or howsoever caused arising directly or indirectly in connection with, in relation to or arising out of the use of the Content. This article may be used for research, teaching, and private study purposes. Any substantial or systematic reproduction, redistribution, reselling, loan, sub-licensing, systematic supply, or distribution in any form to anyone is expressly forbidden. Terms &

Upload: trung-kien

Post on 15-Feb-2017

212 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Speed-adaptive roll-angle-tracking control of an unmanned bicycle using fuzzy logic

This article was downloaded by: [University of Colorado - Health Science Library]On: 26 September 2014, At: 07:16Publisher: Taylor & FrancisInforma Ltd Registered in England and Wales Registered Number: 1072954 Registeredoffice: Mortimer House, 37-41 Mortimer Street, London W1T 3JH, UK

Vehicle System Dynamics: InternationalJournal of Vehicle Mechanics andMobilityPublication details, including instructions for authors andsubscription information:http://www.tandfonline.com/loi/nvsd20

Speed-adaptive roll-angle-trackingcontrol of an unmanned bicycle usingfuzzy logicChih-Keng Chen a & Trung-Kien Dao aa Dept. of Mechanical and Automation Engineering , DayehUniversity , 112 Shanjiau Rd., Changhua, 515, Taiwan, Republic ofChinaPublished online: 21 Jan 2010.

To cite this article: Chih-Keng Chen & Trung-Kien Dao (2010) Speed-adaptive roll-angle-trackingcontrol of an unmanned bicycle using fuzzy logic, Vehicle System Dynamics: International Journal ofVehicle Mechanics and Mobility, 48:1, 133-147, DOI: 10.1080/00423110903085872

To link to this article: http://dx.doi.org/10.1080/00423110903085872

PLEASE SCROLL DOWN FOR ARTICLE

Taylor & Francis makes every effort to ensure the accuracy of all the information (the“Content”) contained in the publications on our platform. However, Taylor & Francis,our agents, and our licensors make no representations or warranties whatsoever as tothe accuracy, completeness, or suitability for any purpose of the Content. Any opinionsand views expressed in this publication are the opinions and views of the authors,and are not the views of or endorsed by Taylor & Francis. The accuracy of the Contentshould not be relied upon and should be independently verified with primary sourcesof information. Taylor and Francis shall not be liable for any losses, actions, claims,proceedings, demands, costs, expenses, damages, and other liabilities whatsoever orhowsoever caused arising directly or indirectly in connection with, in relation to or arisingout of the use of the Content.

This article may be used for research, teaching, and private study purposes. Anysubstantial or systematic reproduction, redistribution, reselling, loan, sub-licensing,systematic supply, or distribution in any form to anyone is expressly forbidden. Terms &

Page 2: Speed-adaptive roll-angle-tracking control of an unmanned bicycle using fuzzy logic

Conditions of access and use can be found at http://www.tandfonline.com/page/terms-and-conditions

Dow

nloa

ded

by [

Uni

vers

ity o

f C

olor

ado

- H

ealth

Sci

ence

Lib

rary

] at

07:

16 2

6 Se

ptem

ber

2014

Page 3: Speed-adaptive roll-angle-tracking control of an unmanned bicycle using fuzzy logic

Vehicle System DynamicsVol. 48, No. 1, January 2010, 133–147

Speed-adaptive roll-angle-tracking control of an unmannedbicycle using fuzzy logic

Chih-Keng Chen* and Trung-Kien Dao

Dept. of Mechanical and Automation Engineering, Dayeh University, 112 Shanjiau Rd.,Changhua, 515, Taiwan, Republic of China

(Received 15 December 2008; final version received 1 June 2009 )

This paper presents the development of dynamic equations and roll-angle-tracking controller of anunmanned bicycle. First, the equations of motion and constraints of a bicycle with rolling-without-slipping contact condition between wheels and ground are developed using Lagrange’s equations. Theequations are then used to implement the simulation of the bicycle dynamics. With the bicycle model,a fuzzy-logic controller, which is adaptive to the speed change is implemented to control the bicycleto follow the roll-angle commands. The controller parameters where fuzzy membership functionsare presented by scaling factors and deforming coefficients are optimised using genetic algorithms.Results show that the bicycle can follow the roll-angle command with short time delay and the controlstructure can adapt to a wide range of speed.

Keywords: two-wheeled vehicle; bicycle model; roll-angle control; fuzzy-logic controller (FLC);speed adaptive

1. Introduction

In recent years, there has been a significant interest in the development of efficient human-powered vehicles, including bicycle. Research on the dynamics and control of bicycles hasbeen attracting considerable attention. The dynamics of the bicycle is known to be a highlynonlinear system that has interesting non-trivial behaviours. To understand the nature of thedynamics and steering mechanisms of a bicycle, Jones [1] did a number of investigations.He pointed out that, in order to balance a ridden bicycle, an enough centrifugal force couldbe generated to correct its fall by steering the fork into the direction of the fall. This theorywas well formalised mathematically by Bouasse [2], later reproduced by Timoshenko andYoung [3] and is certainly confirmed by our bicycle riding experience. Schwab, Meijaardet al. [4,5] developed linearised equations of motion for a bicycle as a benchmark. In theirstudy, the results obtained by pencil-and-paper, the numerical multibody dynamics programmeSPACAR and the symbolic software AutoSim®, were compared for validation. Limitationsdue to simplification of the benchmark model were later discussed by Sharp [6], including

*Corresponding author. Email: [email protected]

ISSN 0042-3114 print/ISSN 1744-5159 online© 2010 Taylor & FrancisDOI: 10.1080/00423110903085872http://www.informaworld.com

Dow

nloa

ded

by [

Uni

vers

ity o

f C

olor

ado

- H

ealth

Sci

ence

Lib

rary

] at

07:

16 2

6 Se

ptem

ber

2014

Page 4: Speed-adaptive roll-angle-tracking control of an unmanned bicycle using fuzzy logic

134 C.-K. Chen and T.-K. Dao

acceleration effects, finite cross-section tires, tire forces and dynamics, frame compliance andrider compliance.

Most previous studies have dealt with simplified mathematical bicycle models that weresubsequently used to implement control simulations, analysis and experiments. However, dueto their simplicity, the mathematical models were incapable of presenting all of the dynamicmotions of the system in certain situations. With that in mind, the problem is approached in thisstudy with a relatively more completed bicycle model having nine generalised co-ordinates inthree-space by using Lagrange’s equations. The rolling-without-slipping conditions betweenthe two wheels and ground are also formulated and represented in constraint equations.

As an unstable and underactuated system, the bicycle is control-challenging and can offera number of research interests in the area of mechanics and robot control. Control efforts forstabilising unmanned bicycles have also been addressed in previous studies. Yavin [7] dealtwith the stabilisation and control of a riderless bicycle by a pedaling torque, a directional torqueand a rotor mounted on the crossbar that generated a tilting torque. Beznos et al. [8] modelleda bicycle with gyroscopes that enabled the vehicle to stabilise itself in an autonomous motionalong a straight line as well as along a curve. In their study, the stabilisation unit consistedof two coupled gyroscopes spinning in opposite directions. Han et al. [9] derived a simplekinematic and dynamic formulation of an unmanned electric bicycle. The controllability ofthe stabilisation problem was also checked and a control algorithm for self-stabilisation of thevehicle with bounded wheel speed and steering angle using nonlinear control based on thesliding patch and stuck phenomena was proposed.

Getz and Marsden [10,11] derived a controller using steering and rear-wheel torques torecover the balance of their bicycle from a near fall as well as to converge to a time-parameterised path in the ground plane. In another study, Getz [12] applied internal equilibriumcontrol to the problem of path following with balance for the bicycle. From the internal dynam-ics of the bicycle, an internal equilibrium manifold, a sub-manifold of the state-space, wasconstructed. Among studies relative to two-wheel-vehicle control, Sharp et al. [13] presenteda related work on the roll-angle-tracking of motorcycles. A PID controller was used to gener-ate the steering torque based on the tracking error. The PID gains were variant related to thespeed of the motorcycle, making the controller adaptive to the speed change. In others studies,Sharp applied optimal linear preview control theory in steering control of bicycle [6] via thebenchmark model developed in [4] and [5] with extensions to the limitations pointed out inthe same paper, and of motorcycle [14] via a linear model generated by AutoSim®.

In previous studies [15,16], a diversity of works have been introduced relative to the dynam-ics and control of an unmanned bicycle. When changing direction of a bicycle, the rider alwayshas to control the roll angle of the bicycle. This implies that the roll-angle control is a prelimi-nary step for developing the turning or path-tracking controllers [16]. The roll-angle-trackingcontrol structure presented in [15], which is based on the fuzzy-logic controllers (FLCs),showed that the bicycle could follow the roll-angle command with small tracking error. How-ever, that control structure revealed that the control parameters were speed-specific. The fuzzycontrol parameters are speed sensitive and the parameters tuned for a certain speed may not beused to control the bicycle at another speed. In this study, a speed-adaptive roll-angle-trackingcontrol structure to address this problem is presented. The controller structure has been sim-plified so that only one FLC is used to generate the steering torque directly from the roll-angletracking error.

The rest of this paper is organised as follows. Section 2 deals with the equations of motionand constraints of a bicycle model by Lagrange’s method. Section 3 discusses the speed-adaptive roll-angle-tracking control structure, and using genetic algorithms (GAs) to optimisethe FLC. The simulation results are presented in Section 4. Finally, Section 5 states someconcluding remarks.

Dow

nloa

ded

by [

Uni

vers

ity o

f C

olor

ado

- H

ealth

Sci

ence

Lib

rary

] at

07:

16 2

6 Se

ptem

ber

2014

Page 5: Speed-adaptive roll-angle-tracking control of an unmanned bicycle using fuzzy logic

Vehicle System Dynamics 135

2. Dynamics of bicycle

In this report, the bicycle model with nine generalised co-ordinates and two algebraic variablespresented in [15] and [16] is used. Figure 1 shows the bicycle model, where capital letters A, B,D and F represent the vehicle body, the rear wheel, the front wheel and the fork, respectively;lower-case ones a, b, d and f designate the centres of mass; ma , mb, md and mf are the massof each part. Reference point c is between the saddle and the vehicle body; e is a point betweenthe vehicle body and the front fork; o′ and s are the contact points between the ground and therear and front wheels, respectively. Three SAE (Society of Automotive Engineers) standardco-ordinate systems are used in the model: an inertial frame �o(I, J, K) fixed on the ground,a reference frame �c(ic, jc, kc) mounted on the model at point c, and a frame �e(ie, je, ke)

Figure 1. Bicycle model schematic.

Dow

nloa

ded

by [

Uni

vers

ity o

f C

olor

ado

- H

ealth

Sci

ence

Lib

rary

] at

07:

16 2

6 Se

ptem

ber

2014

Page 6: Speed-adaptive roll-angle-tracking control of an unmanned bicycle using fuzzy logic

136 C.-K. Chen and T.-K. Dao

placed on the front fork at point e. The co-ordinate �e is obtained by rotating �c about thelateral axis jc a rake angle ε, and about the vertical axis ke a steering angle δ, sequentially.The position vectors of the centres of mass of the frame, the rear wheel and point e relative topoint c in �c are denoted as ρa = [xa 0 za]T, ρb = [xb 0 zb]T and ρe = [xe 0 ze]T,respectively. The centres of mass of the front wheel and the front fork relative to point e in �e

are denoted as ρd = [xd 0 zd ]T and ρf = [xf 0 zf ]T, respectively.The dynamics of bicycles is described by the motion of the reference point c. Six co-

ordinates are used to designate the positions and orientations of �c at point c. The other threeco-ordinate variables are the steering angle δ, and the rotating angles φr and φf of the rear andfront wheels. According to the foregoing definitions, the generalised co-ordinates q ∈ R

9 canbe written as

q = [X Y Z ψ φ θ δ φr φf ]T, (1)

where (X, Y, Z) are the position parameters and (ψ, φ, θ) are the three 3-2-1 Euler anglesdescribing the relative orientation between the co-ordinates �c and �o; δ ∈ R, the steeringangle; φr and φf ∈ R, the rotating angles of the rear and front wheels, respectively. Thevelocity vector u ∈ R

9 is

u = [vx vy vz ωx ωy ωz δ φr φf ]T, (2)

where the first six components are the quasi-velocities of the vehicle body in �c. Thegeneralised velocities q are related to the quasi-velocities u by

u = Yq or q = Wu, (3)

where Y and W ∈ R9×9 are transform matrices.

Y =⎡⎣R 0 0

0 S 00 0 I

⎤⎦

is composed of the rotation matrix R ∈ R3×3 from �o to �c and the 3-2-1 Euler angle

transformation matrix S ∈ R3×3, and W is the inverse matrix of Y.

By using Lagrange’s method, the equations of motions of the nine-generalised co-ordinatesthe bicycle model without the wheel-rolling-contact constraints can be written as

Ju = −Ju − �TJu + WT

(∂T

∂q

)T

− WT

(∂V

∂q

)T

+ U, (4)

where J is the inertial matrix of the system; � = (Y − (∂u/∂q))W, the coefficient matrix;T = 1/2uTJu, the total kinetic energy; V , the total potential energy; and U, the non-conservative forces.

In this two-wheeled-vehicle model, the contact relationships between the two wheels andthe ground are assumed to have the properties of rolling without slipping. By considering thekinematic contact relations between the wheels and the ground, four constraint equations canbe developed for each wheel, among them two are holonomic and two are non-holonomic.The calculation of each contact point is done with the help of a new algebraic variable, i.e.,αr for the rear wheel and αf for the front wheel. The angle αf is included between ke and Rf

(where Rf is the vector from the centre of the wheel to the contact point), and αr is includedbetween kc and Rr (where Rr is the vector from the centre of the wheel to the contact point),as shown in Figure 1. The two algebraic variables extend the number of variables to 11.

Dow

nloa

ded

by [

Uni

vers

ity o

f C

olor

ado

- H

ealth

Sci

ence

Lib

rary

] at

07:

16 2

6 Se

ptem

ber

2014

Page 7: Speed-adaptive roll-angle-tracking control of an unmanned bicycle using fuzzy logic

Vehicle System Dynamics 137

Table 1. Simulation parameters.

Name Value Name Value

ma 11.05 (kg) mb 2.09 (kg)md 3.92 (kg) mf 4.04 (kg)ρa (0.1296, 0, 0.295) (m) ρb (−0.365, 0, 0.503) (m)ρd (0, 0, 0.601) (m) ρe (0.789, 0, −0.078) (m)ρf (0.017, 0, 0.1083) (m) rf = rr 0.325 (m)g 9.80665 (m/s2) ε 15◦kδ 5.11 (N/m deg) kdδ 3.23 (N s/m deg)

Component Moment of inertia (kg m2)

Vehicle body IA =⎡⎣0.407 0 −0.068

1.934 01.558

⎤⎦

Front fork IF =⎡⎣0.421 0 −0.025

0.384 00.041

⎤⎦

Wheels IB =⎡⎣0.109 0 0

0.218 00.109

⎤⎦ , ID =

⎡⎣0.204 0 0

0.408 00.204

⎤⎦

For the conditions of point-contact with the flat ground and rolling without slipping, eachwheel is restricted by two holonomic and two non-holonomic constraints. With the two holo-nomic constraints on each wheel, the number of degrees of freedom in configuration spaceis 11 − 2 × 2 = 7. In the velocity space, as each wheel is restricted by two non-holonomicconstraints, the number of degrees of freedom becomes 7 − 2 × 2 = 3.

The development of equations of motion and constraints is accomplished by programmingin the symbolic computational package Maple®. The complete procedure of developmentof dynamic equations is presented in [15] and [16]. Furthermore, in this study the steeringresistance is considered. A resistance model is introduced to be proportional to the steeringangle and its derivative as follows:

Fδ = −(kδδ + kdδδ), (5)

where kδ and kdδ are constants. The simulation parameters are presented in Table 1.

3. Roll-angle-tracking control

3.1. Fuzzy-logic controller

FLCs are the control systems based on a knowledge consisting of the so-called fuzzy IF–THENrules. In a fuzzy IF–THEN rule, words can be characterised by continuous membership func-tions (typically taking values from 0 to 1), representing the degree of truth of the statements.For example, to stabilise the bicycle, the following fuzzy rule can be used:

IF the bicycle is leaning to the right AND the roll angle is increasing,THEN apply large steering torque to the right,

Dow

nloa

ded

by [

Uni

vers

ity o

f C

olor

ado

- H

ealth

Sci

ence

Lib

rary

] at

07:

16 2

6 Se

ptem

ber

2014

Page 8: Speed-adaptive roll-angle-tracking control of an unmanned bicycle using fuzzy logic

138 C.-K. Chen and T.-K. Dao

Figure 2. Basic configuration of fuzzy systems.

where the words right, increasing and large are characterised by corresponding membershipfunctions. Similarly, more rules from human knowledge can be defined to make the controlsystem more precise. Combining these rules into a fuzzy system, a rule base is obtained, whichis used by the fuzzy inference system (FIS), as shown in Figure 2. Two common FIS used inthe literature are that of Takagi and Sugeno (TS), and that of Mamdani. The difference of thetwo FIS is in the THEN clause, where TS method uses algebraic linear combination of fuzzyvariables, while Mamdani method uses natural-language clauses.

By using FLC, one major advantage is that there is no need to beware of the exact plant modelas when classical control schemes are used. In reality, the plant model is usually nonlinearand difficult to specify exactly. Using FLC is a preferable approach to avoid this difficulty.However, in most cases, the fuzzy membership functions are difficult to be effectively definedmanually, and need to be tuned. One usual procedure to design a FLC is to build the fuzzyrules approximately and membership functions heuristically and subsequently use a certainoptimisation algorithm to tune the parameters.

In this study, Mamdani fuzzy inference system (FIS) is used instead of Takagi–Sugeno (TS)because of two reasons. First, since the IF–THEN rules of the Mamdani method are given innatural-language form, it is more intuitive to build the fuzzy rules so that the parameters can bedetermined later by using GAs. Second, the presentation of output membership functions by theTS method requires much more parameters, for example each THEN clause z = ax + by + c

of a single rule has three parameters, which make the optimisation become more complicatedand computationally intensive. The distribution of the membership functions of each variableof the FLC discussed in this study can be determined by two parameters, scaling factor anddeforming coefficient, using the Mamdani method; or six parameters in total for a two-input,one-output FLC.

3.2. Controller structure

Figure 3 shows the roll-angle-tracking control structure that Sharp et al. [13] used to controla motorcycle. The steering torque is derived from the roll-angle error using a PID controller,whose gains kP, kI and kD are speed-dependent. Their study has showed good results that thesteering torque of a two-wheeled vehicle can be directly controlled from the roll-angle error.In this study, since the PID controller is linear, it is replaced by a FLC in order to better dealwith the nonlinearity of the bicycle. This gives the controller shown in Figure 4.

The FLC has two inputs: the roll-angle tracking error eθ = θref − θ , that is the differencebetween the desired roll angle and the actual one; and its change �eθ . The controller generatesappropriate control output, which is the control torque τ to the steering fork. The FLC isPD-like since it requires two inputs, the error needs to be minimised, and its variation, whichare comparable to the proportional and derivative parts of a PD controller. Compared to theprevious studies [15,16], the controller structure has been simplified so that only one FLCis used to generate the torque τ directly from the roll-angle error eθ , as shown in Figure 4.

Dow

nloa

ded

by [

Uni

vers

ity o

f C

olor

ado

- H

ealth

Sci

ence

Lib

rary

] at

07:

16 2

6 Se

ptem

ber

2014

Page 9: Speed-adaptive roll-angle-tracking control of an unmanned bicycle using fuzzy logic

Vehicle System Dynamics 139

Figure 3. Roll-angle-tracking controller for motorcycle [13].

Figure 4. Constant-speed roll-angle-tracking controller.

Linguistic quantification used to specify a set of rules for this controller is characterised bythe following three typical situations:

(1) If eθ is negative large (NL) and �eθ is NL, then τ is positive large (PL). This rule quantifiesthe situation wherein the desired roll-angle is much smaller than the actual one and thebicycle is falling to the right at a significant rate. Hence, one should steer the fork to theright more at a large positive angle to make the bicycle lean to the left.

(2) If eθ is zero (Z) and �eθ is Z, then τ is Z. This rule quantifies the situation wherein thebicycle is already in its proper position. No control effort is needed.

(3) If eθ is PL and �eθ is PL, then τ is NL. This rule quantifies the situation wherein thedesired roll-angle is much larger than the actual one and the bicycle is falling to the left ata significant rate. Therefore, one should steer the fork to the left at a large angle to makethe bicycle lean to the right.

In a similar fashion, the complete rule base is constructed as listed in Table 2, where themembership functions negative large (NL), negative medium (NM), negative small (NS), zero(Z), positive small (PS), positive medium (PM), and positive large (PL) are used for the twofuzzy inputs as well as the output. Notice that the body of the table lists the linguistic-numericconsequents of the rules, and the left column and top row of the table contain the linguistic-numeric premise terms. For this controller, with two inputs and seven linguistic values foreach of these, there are totally 72 = 49 rules.

Table 2. Rule base for roll-angle-tracking FLC.

�eθ NL NM NS Z PS PM PL

NL PL PL PL PM PM PS ZNM PL PL PM PM PS Z NSNS PL PM PM PS Z NS NMZ PM PM PS Z NS NM NMPS PM PS Z NS NM NM NLPM PS Z NS NM NM NL NLPL Z NS NM NM NL NL NL

Dow

nloa

ded

by [

Uni

vers

ity o

f C

olor

ado

- H

ealth

Sci

ence

Lib

rary

] at

07:

16 2

6 Se

ptem

ber

2014

Page 10: Speed-adaptive roll-angle-tracking control of an unmanned bicycle using fuzzy logic

140 C.-K. Chen and T.-K. Dao

Figure 5. Deformed normalised fuzzy membership functions.

The membership functions of the FLC used in this study are triangular, i.e.,

tria,b,c(x) =

⎧⎪⎪⎪⎨⎪⎪⎪⎩

0, x < a,

(x − a)/(b − a), a ≤ x < b,

(c − x)/(c − b), b ≤ x < c,

0, x > c.

(6)

By using (6), for each input or output of the FLC, the membership functions characterisingseven levels, namely NL, NM, NS, Z, PS, PM and PL, are defined as depicted in Figure 5.Note that all fuzzy inputs and outputs in this study are normalised by scaling factors (SFs) sothat their values are distributed within the range from −1 to 1, the extreme limits of the twooutermost triangular membership functions are extended to infinity. The co-ordinates a, b andc of the membership functions are determined from the optimisation process presented in thenext sub-section.

3.3. Optimisation of control parameters

This section is a brief discussion on the use of GAs to tune the controller parameters usingGAs. GAs are global search techniques modelled after the natural genetic mechanism to findapproximate or exact solutions to optimisation and search problems. In a GA, each parameterto be optimised is represented by a gene; moreover, each individual is characterised by achromosome, which is actually a set of parameters awaiting optimisation. To estimate thequality of an individual, a fitness function (objective function, or cost function) must bedefined. For roll-angle control, the goal is to minimise simultaneously the tracking errorand the oscillation of the roll angle. Therefore, the fitness function used for optimisation isdefined as

Fitness function = κe

(1

N

N∑i=1

e2θ (i)

)1/2

+ κ�θ

(1

N

N∑i=1

(�θ(i)

�t

)2)1/2

, (7)

where �t is the simulation time step; N , the number of time steps; eθ (i) = θref(i) − θ(i)

and �θ(i) = θ(i) − θ(i − 1), the tracking error and the change in roll angle at time step i,respectively. The fitness function is the aggregation of two terms. The first is the root meansquare of the tracking error multiplied by a weighting factor κe, and the second is the rootmean square of the change in roll angle multiplied by a weighting factor κ�θ .

Dow

nloa

ded

by [

Uni

vers

ity o

f C

olor

ado

- H

ealth

Sci

ence

Lib

rary

] at

07:

16 2

6 Se

ptem

ber

2014

Page 11: Speed-adaptive roll-angle-tracking control of an unmanned bicycle using fuzzy logic

Vehicle System Dynamics 141

Figure 6. Optimisation of FLC using GAs.

A GA starts by generating an initial population for the first generation; then, the qualityof each individual is evaluated by using the fitness function. After one generation, only theadvantageous individuals survive and reproduce to generate a new population for the nextgeneration. By this process of selection from generation to generation, the quality of theoffspring is improved in comparison with their ancestors.

During the creation of a new generation, a portion of the surviving individuals is recombinedrandomly via the so-called crossover and mutation operations, being adopted from naturalevolution. The advantages of GAs over other searching algorithms are that they do not requireany gradient information neither continuity assumption in searching for the best parameters,and that they can explore many characteristics at once, which is necessary when dealing withcomplex problems. For a complete introduction to GAs, the readers can refer to [17].

The optimisation procedure of FLC using GAs is presented in Figure 6. To reduce thelearning efforts for GA computation to optimise the FLC, the SFs and deforming coefficients(DCs) [16] were adopted with a minor difference in presentation. Each fuzzy input or outputof the FLC is encoded by two numbers: a scaling factor and a deforming coefficient. Thismethod allows a PD-like 2-input, 1-output FLC to be represented as a 6-parameter optimisationproblem.

Originally, the normalised membership functions are scaled linearly by the SFs anddeformed exponentially within the universe of discourse by the DCs, as presented in Figure 5.Since the SFs of the FLC used in this study are variable, they are explicitly presented on theoutside of the FLC. However, it is important to note that, once the SFs are presented on theoutside of the FLC, their signification is changed, the effect of SFs for fuzzy inputs is inversed,since the SFs are now applied for signals, not for fuzzy membership functions. These SFs aredenoted by k1−3 in Figure 4.

3.4. Speed-adaptive controller

To overcome the parameter variation due to the speed change of the bicycle, the speed-dependent PID gains in the study of Sharp et al. [13] are replaced by speed-dependent SFsk1−3, as shown in Figure 7. In the study of Sharp et al., each of the PID gains depends on thevehicle speed by a polynomial relation. This introduces a set of subjacent parameters to thecontroller. The advantage of using a PID is its simplicity; however, one of the difficulties inimplementation of their controller is the choice of the speed-dependent parameters.

In the study of this paper, by profiting the property of the bicycle that it normally runsat a smaller range of speed in comparison with the motorcycle, look-up tables (LUTs) areproposed. One advantage of using LUTs over polynomial functions is that the parameters areeasier to be determined when an optimisation algorithm such as GA is used, while it is difficult

Dow

nloa

ded

by [

Uni

vers

ity o

f C

olor

ado

- H

ealth

Sci

ence

Lib

rary

] at

07:

16 2

6 Se

ptem

ber

2014

Page 12: Speed-adaptive roll-angle-tracking control of an unmanned bicycle using fuzzy logic

142 C.-K. Chen and T.-K. Dao

Figure 7. Speed-adaptive roll-angle-tracking controller.

to fit polynomial functions to the relations for different speeds, especially when the relationsare complicated. However, the LUTs are only reasonable to be built for a small range of speedsuch as a bicycle.

In this study, the bicycle speed is supposed to be variable in the range from 5 to 30 km/h;however, it could be extended without difficulty. This range is divided into many levels withthe increment of 1 km/h to tune the SFs. For the first step, the normalised fuzzy membershipfunctions, which are represented each one by three DCs, and the SFs are tuned for the speed of15 km/h by using GAs. Then, only the three SFs are needed to be tuned for all other possiblespeed levels, also by using GAs.

At each speed level, the parameters are tuned so that the roll-angle tracking error is minimisedwith the initial roll and steering angles both 0◦. The target roll-angle input used for training isdesigned as a stair function having seven steps. It is clear that, due to the dynamic equilibriumproperties, when running at low speed, the maximum roll angle that the bicycle can make issmall, and vice versa, when running at high speed, the bicycle can make a large roll anglewithout falling down. Having this in mind, the magnitude of the input function is scaledgradually with the speed during the training, i.e., at low speed, the bicycle is trained fortracking small roll angles, and at high speed, the bicycle is trained for tracking large rollangles.

After running the GAs, the optimal SFs are collected to establish the LUTs. Note that theLUTs used in this study are of type nearest-point, that is, one input speeds are substituted tothe nearest speed, and the nearest speed is used to find the corresponding output scaling factor.There is no interpolation.

4. Simulation results

The weighting factors of the fitness function used in this study are chosen as κe = 0.6 andκ�θ = 0.4. To estimate the performance of the PID controller for roll-angle tracking for thedeveloped bicycle model, control simulations were carried out. The PID gains are optimised byusing GAs, where the parameters to be optimised are the three PID gains kP, kI and kD. Figure 8shows the simulation results of the optimised PID controller at the speed of 12 km/h. It appearsthat the bicycle could not be controlled to follow the command rapidly while minimising theoscillation.

Figure 9 shows the control result by the FLC tuned via GA training for the speed of 5 km/h(low speed), Figure 10 for 12 km/h (medium speed), and Figure 11 for 30 km/h (high speed).The optimal fitness values of these simulations are presented in Table 3. It can be remarkedthat when the speed is increased, the optimal fitness value is also increased accordingly. Thiscan be explained by the fact that the tracking error of the roll angle increases for the higherspeeds.

In comparison with the same control simulation but using the PID controller in Figure 8,it appears that the roll-angle tracking error is reduced when the bicycle is controlled by the

Dow

nloa

ded

by [

Uni

vers

ity o

f C

olor

ado

- H

ealth

Sci

ence

Lib

rary

] at

07:

16 2

6 Se

ptem

ber

2014

Page 13: Speed-adaptive roll-angle-tracking control of an unmanned bicycle using fuzzy logic

Vehicle System Dynamics 143

Figure 8. PID controller performance at normal speed (12 km/h).

Figure 9. Roll-angle-tracking performance at low speed (5 km/h).

FLC, as shown in Figure 10. This is assured by the optimal value of fitness function of 0.0821from the FLC, and 1.7153 from the PID controller for the same speed of 12 km/h. Using theoptimised control parameters, the FLC can control the bicycle better than the PID controllerdoes, which can be explained by the essential nonlinear-control properties. The FLC cancontrol nonlinear systems with a larger range of parameters.

Figure 12 shows the performance when using the controller optimised for speed of 25 km/hto control the bicycle at 15 km/h. It is obvious that the controller did not generate appropriatelythe steering torque and made the bicycle become unstable. In Figure 13, the fuzzy SFs for

Dow

nloa

ded

by [

Uni

vers

ity o

f C

olor

ado

- H

ealth

Sci

ence

Lib

rary

] at

07:

16 2

6 Se

ptem

ber

2014

Page 14: Speed-adaptive roll-angle-tracking control of an unmanned bicycle using fuzzy logic

144 C.-K. Chen and T.-K. Dao

Figure 10. Roll-angle-tracking performance at normal speed (12 km/h).

Figure 11. Roll-angle-tracking performance at high speed (30 km/h).

Table 3. Optimal fitness values for simulations.

Controller Speed (km/h) Optimal fitness value

PID 12 1.7153FLC 5 0.0430FLC 12 0.0821FLC 30 0.1378

Dow

nloa

ded

by [

Uni

vers

ity o

f C

olor

ado

- H

ealth

Sci

ence

Lib

rary

] at

07:

16 2

6 Se

ptem

ber

2014

Page 15: Speed-adaptive roll-angle-tracking control of an unmanned bicycle using fuzzy logic

Vehicle System Dynamics 145

Figure 12. Using fuzzy controller optimised for 25 km/h to control at 15 km/h.

Figure 13. Speed-dependent fuzzy SFs for roll-angle-tracking controller.

the roll-angle-tracking controller collected from running the GAs are presented. These valueswere used to build the speed-to-scaling-factor LUTs of the roll-angle-tracking controller.

After establishing the LUTs, a simulation with varying speed was carried out. The speedwas controlled to increase from 5 to 30 km/h in 17 sec, then decrease back to 5 km/h also in17 sec. Note that the speed was controlled to vary in the range that the LUTs support, or therange that the system has been trained. In the meantime, the bicycle was controlled to followa sinusoidal function of roll angle with the magnitude of 20◦. The result of this simulation isshown in Figure 14. The maximal absolute tracking error value is 0.66◦ for this simulation.

Dow

nloa

ded

by [

Uni

vers

ity o

f C

olor

ado

- H

ealth

Sci

ence

Lib

rary

] at

07:

16 2

6 Se

ptem

ber

2014

Page 16: Speed-adaptive roll-angle-tracking control of an unmanned bicycle using fuzzy logic

146 C.-K. Chen and T.-K. Dao

Figure 14. Roll-angle-tracking performance at varying speed.

5. Conclusion

In this study, a speed-adaptive roll-angle-tracking controller was successfully developed. Thiswas an attempt to adapt the study of Sharp et al. for motorcycle to control the bicycle withseveral improvements. First, an FLC was used instead of a PID controller so that the sys-tem nonlinearity was better dealt. Second, the relations between the controller gains and thevehicle speed were implemented by LUTs instead of polynomial equations, which improvedthe controller performance. GAs were used to determine the controller gains and to build theLUTs. Simulation results indicated that the bicycle can follow a roll-angle command withsmall errors at different speeds.

Acknowledgements

The authors would like to thank the National Science Council of the Republic of China, Taiwan, for financiallysupporting this research under project number NSC 96-2221-E-212-027.

References

[1] D.E.H. Jones, The stability of the bicycle, Phys. Today 23 (1970), pp. 34–40.[2] H. Bouasse, Cours de Méchanique Relationnelle et Expérimentale, part 2, Library Ch. Delagrave, Paris,

pp. 620–623, 1910.[3] S. Timoshenko and D.H. Young, Advanced Dynamics, McGraw-Hill, New York, pp. 239–240, 1948.[4] A.L. Schwab, J.P. Meijaard, and J.M. Papadopoulos, Benchmark results on the linearized equations of motion

of an uncontrolled bicycle, KSME Int. J. Mech. Sci. Technol. 19 (2005), pp. 292–304.[5] J.P. Meijaard, J.M. Papadopoulos, A. Ruina, and A.L. Schwab, Linearized dynamics equations for the balance

and steer of a bicycle: A benchmark and review, Proc. R. Soc. Ser. A 463 (2007), pp. 1955–1982.[6] R.S. Sharp, On the stability and control of the bicycle, Appl. Mech. Rev. 61 (2008), 060803, DOI:

10.1115/1.2983014.[7] Y.Yavin, Stabilization and control of the motion of an autonomous bicycle by using a rotor for the tilting moment,

Comput. Methods Appl. Mech. Eng. 178 (1999), pp. 233–243.[8] A.V. Beznos, A.M. Formal’sky, E.V. Gurfinkel, D.N. Jicharev, A.V. Lensky, K.V. Savitsky, and L.S.

Tchesalin, Control of autonomous motion of two-wheel bicycle with gyroscopic stabilisation, Proceedings ofIEEE International Conference on Robotics and Automation, Vol. 3, Leuven, Belgium, 1988, pp. 2670–2675.

[9] S. Han, J. Han, and W. Ham, Control algorithm for stabilization of tilt angle of unmanned electric bicycle,Trans. Control Autom. Syst. Eng. 3 (2001), pp. 176–180.

Dow

nloa

ded

by [

Uni

vers

ity o

f C

olor

ado

- H

ealth

Sci

ence

Lib

rary

] at

07:

16 2

6 Se

ptem

ber

2014

Page 17: Speed-adaptive roll-angle-tracking control of an unmanned bicycle using fuzzy logic

Vehicle System Dynamics 147

[10] N.H. Getz, Control of balance for a nonlinear nonholonomic non-minimum phase model of a bicycle, Proceedingsof the American Control Conference, American Control Council, Baltimore, 1994, pp. 148–151.

[11] N.H. Getz and J.E. Marsden, Control for an autonomous bicycle, Proceedings of IEEE International Conferenceon Robotics and Automation, Nagoya, Japan, 1995, pp. 21–27.

[12] N.H. Getz, Internal equilibrium control of a bicycle, Proceedings of IEEE Conference on Decision and Control,Vol. 4, New Orleans, USA, 1995, pp. 4285–4287.

[13] R.S. Sharp, S. Evangelou, and D.J.N. Limebeer, Advances in the modelling of motorcycle dynamics, MultibodySyst. Dyn. 12 (2004), pp. 251–283.

[14] R.S. Sharp, Motorcycle steering control by road preview, J. Dyn. Syst. Meas. Control 129 (2007), pp. 373–381.[15] C.K. Chen and T.S. Dao, Fuzzy control for equilibrium and roll-angle tracking of an unmanned bicycle,

Multibody Syst. Dyn. 15 (2006), pp. 325–350.[16] C.K. Chen and T.S. Dao, Genetic fuzzy control for path-tracking of an autonomous robotic bicycle, J. Syst. Des.

Dyn. 1 (2007), pp. 536–547.[17] R.L. Haupt and S.E. Haupt, Practical Genetic Algorithm, 2nd ed., Wiley, New York, 2004.

Dow

nloa

ded

by [

Uni

vers

ity o

f C

olor

ado

- H

ealth

Sci

ence

Lib

rary

] at

07:

16 2

6 Se

ptem

ber

2014