Queen Bee genetc optmzaton of an heurstc based fuzzy control scheme for a moble robot 1 Rodrgo A. Carrasco Schmdt Pontfca Unversdad Católca de Chle Abstract Ths work presents both a novel control scheme for a moble robot and an optmzaton method for mprovng ts performance. The analyzed control problem wll be to move a two wheeled robot from an ntal posture to a fnal destnaton usng the mnmum amount of tme and arrvng at a low speed to be able to stop. Frst the control strategy, based on a fuzzy logc controller for the robot knematcs and a PID controller for the robot dynamcs, s presented. The fuzzy controller s then optmzed usng a new type of genetc algorthm that reples the reproducton method of bees. The optmzed fuzzy controller presents an mportant mprovement on ts performance. Fnally, several optmal controllers are combned together to create an adaptve controller that can handle general cases n an effcent way. Index Terms Fuzzy control, Genetc algorthms, Moble robots, Optmzaton methods. T I. INTRODUCTION he use of robotcs and moble automaton systems s ncreasng every year, and wth t, the necessty of more robust and flexble products that solve problems effcently. One of the most dffcult robotc systems to create s autonomous vehcles, due to the fact that they have to deal wth dynamc and changng envronments whch make the task very challengng [1]. Wth the ad of robotc compettons lke RoboCup [1], and the acceptance, by the consumers, of new robotc products such as vacuum cleaners or robotc pets, the nterest n moble robotcs has ncreased. Ths has led to a great number of research studes amng to mprove autonomous vehcles, makng them capable of dealng wth the surroundng envronment. Several solutons have emerged from these studes, from robust gudance mechansms, to smple robots n colones, able to help each other to complete a certan task. One of the most mportant components of a moble robot s the control loop, whch enables the robot to follow a certan trajectory determned by hgher level decson system. Ths work presents a novel control scheme, consstng of two layers of control systems that are able to work effcently wth the nonlneartes nherent to the moble robot, but wthout addng too much extra computatonal cost. A smple fuzzy logc controller, based on heurstc rules, s presented as a way of dealng wth the nonlnear elements of the system, whch are optmzed afterwards usng new genetc technques. Evolutonary computatonal systems are one of the tools that have shown excellent results when used to optmze complex systems []-[4]. In ths work, a new genetc algorthm that emulates the evoluton prncples of bee colones s used as a way of optmzng the poston of each membershp functon, mprovng through ths method, the overall performance of the robot controller []. The results of the optmzaton are analyzed and tested, smulatng the system n a Smulnk model and showng that the performance of the resultng controller s better than the one of the orgnal fuzzy controller. The optmzaton s done several tmes usng dfferent destnaton ponts to check f the solutons are equvalent. Based on these optmzed solutons for specfc cases, a new adaptve fuzzy controller s then desgned, whch generates the best soluton for all general cases, but based on the optmzed controllers obtaned for specfc destnaton ponts. II. MOBILE ROBOT MODEL Fgure 1 shows the moble robot model wth the basc parameters used n the system. The body of the robot s consdered to be crcular dsc of radus b and mass M, wth two wheels of radus r and mass m each. The rght wheel rotates at an angular speed of ω1 = θ, and the left at 1 ω = θ. Each wheel s connected to an ndependent DC motor usng a gear system of rato G:1. Fg. 1. Robot model showng the man dynamc parameters 1 Ths work was presented at the IEEE Frst Latn Amercan Conference on Robotcs and Automaton (November 003 1
A. Robot Knematcs The knematcs equatons for the robot relate the state or posture of the robot, wth the angular veloctes of each wheel. The posture of the robot s defned as the vector X=[x y ϕ] T, where x and y are the coordnates of the center of mass of the robot on a reference plane, whereas ϕ s the angle of the drecton of moton of the robot, wth respect to the X axs. Equatons 1 and show the relaton between the angular speed of each wheel, and the rotatonal and tangental speed of the robot, as obtaned from [5]: ( θ1 θ r ϕ = (1 b r ( θ 1 + θ V = ( The posture elements x and y are obtaned projectng the velocty of the robot on the X and Y axes. Equatons 3, 4, and 5 gve the poston of the center of mass and the angle of drecton of the robot due to the speed of the wheels: ( θ 1( + θ ( t r t t x ( t = x( 0 + cos( ϕ ( t dt o ( θ 1( + θ ( t r t t y( t = y( 0 + sn( ϕ ( t dt ϕ o ( t = ϕ( 0 + t o ( θ 1( θ ( r t t b These equatons also make the system non-lnear, due to the trgonometrc equatons needed for the projecton of the velocty over each axs. B. Robot Dynamcs The dynamc equatons of the robot relate the torque appled to the wheels, wth the angular acceleraton they acqure, consderng the mass nerta of the dfferent elements n the model. These equatons can be deduced usng the Lagrangan formulaton, whch s based on the calculaton of the energy of the system [6]. The total energy of the robot can be calculated as the sum of the knetc energy of the body and the knetc energy of each wheel, shown on equaton 6, whereas the potental energy s not used, as the robot s consdered to move on a sngle level plane. dt (3 (4 (5 1 1 Kw = mv, 1, + I wθ = (8 In equaton 7, I B represents the moment of nerta of the robot whereas n equaton 8, I w represents the moment of nerta of each wheel. As both body and wheels are consdered sold dscs: I B 1 = Mb and 1 I w mr = (9 Replacng these values for the nerta, and usng equatons 1 and on equaton 6, the Lagrangan expresson s obtaned: 3r Mr M m θ1 θ θθ 1 ( 4 ( L = + + + 16 8 (10 The relaton between the angular acceleraton of each wheel and the torques appled s obtaned from equaton 10, usng the followng relaton: d τ = dt θ L θ L (11 In equaton 1 θ represents the acceleraton of wheel, and τ the appled torque. 1 3r Mr ( M + 4m θ 1 8 8 τ1 = θ Mr 3r τ ( M + 4m 8 8 (1 C. DC Motor Model To complete the model of the robot, the DC motors attached to each wheel must be also added. These motors wll apply the needed torque to acheve the desred acceleraton. The smplfed equatons that relate the voltage appled to each motor, V, wth the appled torque are as follows: d L + R = V KmGθ, = 1, dt (13 τ = GK, = 1, (14 a L represents the electrc nductance of the motor, R the electrc resstance, K m s the motor constant and K a s the armature constant. G represents the mechancal gear reducton that connects each wheel to ts motor. L = KB + Kw + Kw (6 1 Each of these terms wll consst on a term due to the lnear movement and one due to the rotaton: B 1 1 B K = MV + I ϕ (7 III. CONTROL STRATEGY A. Control Problem The objectve of the control strategy s to generate the necessary voltages on each DC motor, to move the robot from a startng posture X 0 =[x 0 y 0 ϕ 0 ] T, to a fnal goal (x f, y f, wthout constrans on the fnal angle ϕ f.
Fg.. Cascade control scheme The man dffculty of ths control strategy s that the knematc equatons of the robot are non-lnear and there s no unque operatng pont, whch could help the desgn by usng a lnearzaton [1]. Another problem s that the posture equatons (3 and 4 are coupled, as they both depend on ω 1 and ω, or τ 1 and τ whch are the actual manpulated varables. On the other hand, the dynamc and DC motor equatons are lnear, and although they are also coupled, the use of a classcal controller, such as a PID controller, to control the velocty of each wheel could return good results. However, the use of a PID controller for solvng the whole control problem s very neffcent, especally because there are no general methods to tune the gan parameters n the case of non-lnear plants such as ths one. A strategy that has shown to be very effcent to control non-lnear plants s fuzzy logc [7],[8]. The problem wth ths method s that the amount of nput varables needed n ths case s hgh, due to the fact that the manpulated varables are acceleraton related, whereas the control s done over poston related varables. Ths means that the controller needs not only the dstance and relatve angle to the fnal destnaton, but also the approachng velocty and angular speed of the robot. As a way to reduce the amount of nput varables on the fuzzy controller and smplfy the computatonal requrements, a cascade control scheme s used. Frst, a tuned PID controller s mplemented to control the velocty of each wheel by modfyng the voltage appled to the motors. On top of ths controller, a fuzzy logc controller s used to generate the needed angular veloctes so the robot moves to the desred reference. Fgure shows the proposed control scheme. B. PID Controller Desgn Although the dynamc equatons of the robot are coupled, the mplemented PID stage s based on two ndependent controllers, one for each wheel. As fgure shows, each PID controller senses the angular speed of the correspondng wheel and uses the detected error to ncrease or reduce the voltage appled to the motor. The reference for ths loop s gven by the fuzzy logc controller. As n real lfe robots have a lmted voltage range to apply to the motors and the motors have a maxmum nput voltage, the PID output s lmted to ±5 [V]. Ths also ensures that the torques appled by the motors to the robot wheels stay n a lmted range. The gans for each PID controller are tuned, havng as a goal a quck settlng tme and no more than 1% overshoot [9]. Fg. 3. Angular speed control As the smulaton on fgure 3 shows, the PID controller s able to meet the requrements usng the followng gans: K p =450, K =1, and K d =0. The PID control stage was tested n several condtons, showng n all the tests that the desgn constrans were respected, even n the worst scenaro: when one wheel s set to move n one drecton whle the other s set to another. The smulatons also showed that changes n one of the references made no sgnfcant dsturbances on the velocty of the other wheel. C. Fuzzy Controller The objectve of ths controller s to create the necessary references for the angular veloctes of each wheel, n order to move the robot from ts startng posture to the fnal destnaton. Consderng the problem from a qualtatve pont of vew, t s possble to create a set of rules that takes nto account the dstance to the objectve (named D and the relatve angle, between the drecton of the robot and the fnal destnaton (named ϕ, to determne the velocty of each wheel, whch wll be the manpulated varable. The rules wll be of the form: If D s LD and ϕ s L ϕ then ω 1 s Lω 1 and ω s Lω (15 In equaton 15, LD s one of the dstance related membershp functons, L ϕ s related to the relatve angle, and Lω 1 and Lω are the membershp functons for the speed of each wheel. Fgures 4, 5, and 6 show the membershp functons used for the fuzzy controller. The dstance between the center of mass of the robot and the objectve s used as a way of controllng the arrval speed. Ths s done later, n the creaton of the rule base, by relatng membershp functons (MFs assocated wth smaller dstances to MFs assocated wth slower speeds for each wheel. Three MFs were created for the dstance: Close (C, Far (F, and Very Far (VF, as shown n fgure 4. The other nput of the fuzzy controller s the relatve angle ϕ, whch was dvded nto fve MFs, coverng from π to π. The used MFs relate the poston of the objectve wth respect to the angle of the robot: Back Rght (BR, Front Rght (FR, Center (C, Front Left (FL, and Back Left (BL. 3
TABLE I D RULE BASE FOR ω 1 C BF BS Z FS FF F BF Z FS FS FF VF BF FS FF FF FF BR FR C FL BL ϕ Fg. 4. Dstance membershp functons. D TABLE II RULE BASE FOR ω C FF FS Z BS BF F FF FS FS Z BF VF FF FF FF FS BF BR FR C FL BL ϕ Fg. 5. Relatve angle membershp functons. Fg. 6. Membershp functons for the angular velocty of the wheels. Fgure 5 shows the dfferent MFs created for the relatve angle. Ths varable s used to control the rotaton speed of the robot, makng t turn quckly when the relatve angle s hgh, whereas t moves n a straght lne when the relatve angle s close to zero. The wdth of the center membershp functon, C, s responsble of decdng when the robot s gong to start to move forward. If C s too narrow, the robot starts movng towards ts goal only when t s n front, loosng tme and energy n a rotaton wthout advancng. On the other hand, f C s too wde, the robot starts movng before t s facng the objectve, dong long and curved trajectores that are not effcent. Fnally, fve MFs are mplemented for the speed of each wheel: Back Fast (BF, Back Slow (BS, Zero (Z, Front Slow (FS, and Front Fast (FF. These are presented on fgure 6. The rule base for the fuzzy logc controller s shown on tables 1 and, one for each wheel. These rules assocate the state of the robot wth respect to the objectve (dstance and relatve angle, wth the needed velocty for each wheel. The rule base s desgned to make the robot turn quckly when t s far away from the goal, and then contnue on a straght lne. In ths way the trajectory followed by the robot s mnmal and no energy s wasted n log turns. The rule base must also make the robot move fast when t s far away, and slow down at the tme of arrval. The rules of the fuzzy controller are nspred on heurstc knowledge of the behavor the robot must have n order to accomplsh the task. The behavor s smlar to what humans do n order to go from one pont to another. For example, f the objectve s at the back and to the left, then the rght wheel must go forward, whle the left one must go backwards, makng the robot turn tll the objectve s almost n front. Then the robot must start movng forward towards the goal, correctng slghtly the drecton of movement f the relatve angle ncreases whle movng. Dependng on how far s the objectve, the velocty of the wheels wll ncrease to move faster (or turn qucker, and when the goal s near the speed s reduced so the robot can stop on arrval. In a more general way, the robot wll turn untl t faces the goal and then move on an almost straght lne. The accuracy to face the objectve wll be gven by how narrow s the C membershp functon of the relatve angle varable. D. System Smulaton To test the performance of the controller, the whole system was smulated usng Smulnk. The goal of the robot was to move from and ntal poston (0,0 and a varable ntal angle, to a fnal poston (-,1 on the XY plane. Fgure 7 shows the smulaton results. Four dfferent ntal angles were used: -π, -π/4, π/4, and 3π/4, to consder the behavor of controller n dfferent cases. As fgure 7 shows, the robot moves usng small turns by rotatng frst from ts ntal poston and then movng n an almost straght lne towards the destnaton pont. Fg. 7. Robot trajectory for dfferent ntal angles: -π, -π/4, π/4, and 3π/4. 4
IV. GENETIC OPTIMIZATION OF THE FUZZY CONTROLLER A. Method Descrpton The smulatons show that the performance of the controller s very senstve to the poston of each MF on the fuzzy controller, ndcatng that t could be optmzed to mprove the performance. An nterestng way to do ths s by usng evolutonary computaton algorthms, to determne a better poston for each MF based on a performance parameter also known as ftness [3],[4]. Genetc optmzaton algorthms work n a smlar way to what evoluton theores descrbe. The algorthm starts wth an ntal populaton of possble solutons. Each one s tested and a ftness value s assgned to them dependng on the performance of the soluton, whch helps to determne the better solutons wthn the populaton. Usng one of the several methods [4], a group of solutons (generally the ones wth a hgher ftness are selected to be combned, wth some probablty, wth the other solutons of the populaton, hopng that the mxture between them could create a better soluton. The cycle s repeated several tmes and t s stopped after a certan number of generatons. There s a large number of ways to mplement a genetc algorthm [10], dependng on the goals of the optmzaton. Most of them use eltsm, whch means that the best solutons are always coped drectly nto the next generaton, ensurng that the genes of these solutons reman n the populaton. The use of eltsm gves an advantage over other mplementatons, because the process can be stopped at any tme and t wll always have a better or at least equal soluton to the best soluton n the ntal set. On the other hand, when usng genetc algorthms there s no demonstraton that the acheved soluton s the global optmum. Another evolutonary element added s the use of mutaton wthn the genetc algorthm. Ths means that wth a certan probablty the genes from some ndvduals change randomly, addng new elements to the populaton and elmnatng or at least dmnshng the possbltes that the whole populaton s kept wthn a local optmum. Several researchers have appled genetc optmzaton on fuzzy logc systems, achevng a better performance on ther systems compared to benchmark solutons. Ths optmzaton approaches nclude parameter tunng on the MFs and rule optmzatons as n [11]. In ths work, a recently appled method for selectng the better solutons of the populaton s used []. Ths algorthm s based on the evoluton scheme used by bees, n whch only one sngle member of the colony, the queen, s able to combne wth the rest of the populaton to create a new generaton. Ths makes easer choosng the parent solutons and helps to keep the best solutons wthn the populaton. The optmzaton wll only modfy the MFs of the dstance and relatve angle varables, leavng the MFs of the speed of each wheel wthout change. As the MFs are trangular, they can be expressed as a three element vector contanng the start, peak, and stop coordnates of each of them. Each controller contans 3 dstance MFs and 5 relatve angle ones, makng t possble to descrbe the whole controller by a 8x3 matrx, called C. Each matrx descrbes one element n the populaton. On every generaton, all solutons are tested and the one wth the hghest ftness s combned wth all the other solutons usng a certan probablty. The combnaton s done by averagng both ndvduals: C new Cbest + C = (16 Eltsm and mutaton s used wthn the optmzaton to ensure that the best soluton s kept and to mnmze the chance that the populaton converges to a local optmum. The two condtons of the control problem are that the robot acheves the goal as fast as possble, and that the end velocty s low enough so the robot s able to stop. As a way of ncludng these two restrctons, the ftness functon used s a lnear combnaton of both, as descrbed n equaton 17, where T s the tme used to reach the objectve and ω s the fnal speed of each wheel: ( F = T + α r ω + ω (17 1 The optmzaton seeks to get the lowest possble ftness, whch means that the robot must reach the goal fast, and wth low fnal speed. The α factor s used to gve a relatve weght between the tme and speed constrans, havng unts of [sec /mt] to leave the ftness n [sec]. A hgher value of α wll mply that the optmum wll have a slower end speed than the one wth a low α value. B. Optmzaton The optmzaton s done usng an ntal populaton of 0 dfferent fuzzy controllers. Each of these s created usng the orgnal robot fuzzy control as a base, but wth all ts genes modfed randomly. The combnaton probablty s set to 95% and a mutaton probablty to 5%, wth a smulaton tme of 50 generatons. Each ndvdual s tested usng [0 0 0] T as the ntal posture, and settng the goal at (-1,1. The α factor n the ftness functon s set to 1600 [sec /m], to make the tme taken to reach the goal and the fnal speed comparables. Usng these parameters the ftness value for the orgnal control system s 67,81 [sec]. The optmzaton cycle s repeated 3 tmes to check f the acheved solutons have thngs n common. In all three cases the ftness of the best soluton s n average 6 [sec], needng 5,88 [sec] to acheve the objectve and arrvng at a speed of 7,47x10-5 [m/sec]. The MFs obtaned after the optmzaton are shown on fgures 8 and 9. In all three cases the best solutons share an element n common: the Far (F membershp functon s moved away from the operatng range, whch was from 0 to 1,4 [m]. Ths means that ths MF s not needed n the system and only ntroduces delays, makng the controller less effcent. 5
Fg. 8. Optmzed set of MFs for the dstance varable. Fg. 11. Optmzed set of MFs for the relatve angle varable, after elmnatng both Front Rght (FR and Front Left (FL MFs from the orgnal set. Fg. 9. Optmzed set of MFs for the relatve angle varable. For the relatve angle MFs, a smlar effect occurred. All the optmal solutons elmnated the Front Left (FL membershp functon from the operatng range, ether by makng t so narrow that t never becomes actvated (as shown on fgure 9 or by movng t away from the operatng rage n the smulaton, whch was from 0 to 3π/4. Ths also mples that ths MF s not needed n the control system. As the MFs assocated to the rght sde of the robot are never actve, no mportant changes are observed on them, whereas the Center (C MF s deformed sdeways n all 3 solutons. To check f the optmum poston for the relatve angle MFs s symmetrcal, the optmzaton s done agan wth the goal set on (-1,-1. The optmzaton shows that the optmal soluton for the dstance varable s the same, whereas the soluton for the relatve angle varable s almost symmetrcal to the ones obtaned before. As all solutons ndcate that some MFs are not needed, these are elmnated from the fuzzy controller, and the optmzaton s done agan to check f some mprovement s possble. Wth the goal set on (-1,1 the optmzaton algorthm s able to reduce the ftness functon of the optmal controller to 5,1 [sec]. The MFs obtaned after the second optmzaton are shown on fgures 10 and 11. Notce the non symmetrcal shape of C on the relatve angle MFs. V. DESIGN OF AN ADAPTIVE FUZZY CONTROLLER The dfferent solutons show that the optmal postons for the MFs depend on the poston of the goal. The optmum soluton for gong from the orgn to the coordnate (-1,1 s not as good f the goal s set on (-1,-1. To create a general adaptve control system, the optmal solutons for both cases are combned dependng on the fnal destnaton, creatng a controller that s able to go effcently from one pont to another, wth an overall performance better than the optmzed controllers by themselves, outperformng the orgnal fuzzy controller, and wthout the need of optmzaton cycles for every new destnaton goal. The adaptve controller s created by a lnear combnaton of the two solutons obtaned n the optmzaton stage. Ths s done by combnng the matrces that descrbe the controller as equaton 18 shows: ( λ λ ( 1 λ C = C + C (18 1 Where C 1 s the control matrx that descrbes the fuzzy controller optmzed to go to the pont (-1,1, whereas C descrbes the controller optmzed to go to (-1,-1. The value of λ, the adaptaton parameter, s selected dependng on the angle of the goal wth respect to the angle of the robot. Ths type of adaptve controller can be used for trajectores based on checkponts, where the control system can recalculate the fuzzy MFs parameters every tme a checkpont s reached, adaptng the controller to have an mproved performance dependng on the poston of the next checkpont. In ths way, the control strategy s optmzed based on the actons the robot must take on the future. To compare the adaptve controller wth the prevous control systems, the robot s set to move from the orgn to (1,1 and then to (,0. Three controllers are used n the smulaton: the orgnal fuzzy controller, one of the optmzed controllers from secton IV, and the adaptve controller. For all three cases the dfferent trajectores are compared, as well as the angular speed of the wheels over tme. Fg. 10. Optmzed set of MFs for the dstance varable, after elmnatng the Far (F MF from the orgnal set. 6
Fg. 13. Trajectory comparson between the orgnal fuzzy controller (1, one of the optmzed controllers ( and the general controller (3. [5] P. Goel, G. Dedeoglu, S. Roumelots, G. Sukhatme, Fault Detecton and Identfcaton n a Moble Robot usng Multple Model Estmaton and Neural Network, Proceedngs of the IEEE Internatonal Conference on Robotcs and Automaton, San Francsco, USA, 000. [6] J. Crag, Introducton to Robotcs: Mechancs and Control, nd ed., Addson-Wesley Pub. Co., 1989. [7] R. Palm, D. Drankov and H. Hellendoor, Model Based Fuzzy Control, Sprnger Verlag, 1997. [8] M. Renfrank, H. Hellendoorn, D. Drankov, An Introducton to Fuzzy Control, nd ed., 1996 [9] G. Goodwn, S. Graebe, M. Salgado, Control System Desgn, Prentce Hall, 000. [10] X. Yao, Evolvng artfcal neural networks, Proceedngs of the IEEE, September, 1999, vol. 87, n o. 9, pp. 143-1447. [11] M. Manadaks, H. Surmann, A Genetc Algorthm for Structural and Parametrc Tunng of Fuzzy Systems, European Symposum on Intellgent Technques, 1999. [1] L. Kleeman, Optmal estmaton of poston and headng for moble robots usng ultrasonc beacons and dead-reckonng, IEE Internatonal Conference on Robotcs and Automaton, Nce, France, 199, vol. 3, pp. 58-587. [13] The Mathworks Inc., Fuzzy Logc Toolbox. User s Gude, 1998. Fg. 14. Angular speed for the orgnal fuzzy controller (1, one of the optmzed controllers ( and the general controller (3. As fgure 13 shows, the general controller makes the robot move almost n straght lnes towards the checkponts, usng less tme and wastng less energy than the other controllers. Fgure 14 shows that the general controller also allows the robot to move faster, arrvng n less tme and wth a lower end speed than the other controllers. The ftness value for the dfferent controllers n ths test s: 13,14 [sec] for the orgnal controller, 48,89 [sec] for the optmzed one, and 47,5 [sec] for the adaptve controller. VI. CONCLUSION Through ths work t s showed that the new descrbed control scheme results n an excellent control system for a wheel moble robot. It s also demonstrated, that the Queen Bee based genetc optmzaton algorthm s a very good tool to optmze the performance of fuzzy logc controllers, and that by modfyng the parameters that create each membershp functon the effcency can be mproved. Fnally, ths work presents an adaptve fuzzy controller that can modfy ts membershp functons based on the goals ahead, wthout the need of an optmzaton cycle every tme the goal s changed. REFERENCES [1] S. Coradesch, S. Tadokoro, A. Brk, RoboCup 001: Robot Soccer World Cup V, Sprnger Verlag, 00. [] S. H. Jung, Queen-Bee Evoluton for Genetc Algorthms, IEE Electronc Letters, 0 March 003, pp. 575-76. [3] W. Banzhaf, P. Nordn, R.E. Keller, F.D. Francone, Genetc Programmng : An Introducton, Morgan Kaufmann, 1997. [4] M. Mchell, An Introducton to Genetc Algorthms, MIT Press, 1998. 7