electronics Article Evaluating the Performance of Fuzzy-PID Control for Lane Recognition and Lane-Keeping in Vehicle Simulations Moveh Samuel 1 , Khalid Yahya 2,* , Hani Attar 3 , Ayman Amer 3, Mahmoud Mohamed 4,* and Tajudeen Adeleke Badmos 5 1 Department of Aeronautical Engineering, Faculty of Engineering and Architecture, Istanbul Gelisim University, Istanbul 34310, Turkey 2 Department of Electrical and Electronics Engineering, Nisantasi University, Istanbul 34398, Turkey 3 Department of Energy, Zarqa University, Zarqa 13133, Jordan 4 School of Engineering, Cardiff University, Cardiff CF24 3AA, UK 5 Industry and Innovation Research Institute, Sheffield Hallam University, Sheffield S1 1WB, UK * Correspondence: khalid.yahya@nisantasi.edu.tr (K.Y.); mohamedmt@cardiff.ac.uk (M.M.) Abstract: This study presents the use of a vision-based fuzzy-PID lane-keeping control system for the simulation of a single-track bicycle model. The lane-keeping system (LKS) processes images to identify the lateral deviation of the vehicle from the desired reference track and generates a steering control command to correct the deviation. The LKS was compared to other lane-keeping control methods, such as Ziegler–Nichols proportional derivative (PD) and model predictive control (MPC), in terms of response time and settling time. The fuzzy-PID controller had the best performance, with fewer oscillations and a faster response time compared to the other methods. The PD controller was not as robust under various conditions due to changing parameters, while the MPC was not accurate enough due to similar reasons. However, the fuzzy-PID controller showed the best performance, with a maximum lateral deviation of 2 cm, a settling time of 12 s, and Kp and Kd values of 0.01 and 0.06, respectively. Overall, this work demonstrates the potential of using fuzzy-PID control for effective lane recognition and lane-keeping in vehicles. Citation: Samuel, M.; Yahya, K.; Keywords: acoustic sensor; internet of things; temperature sensor; car parking Attar, H.; Amer, A.; Mohamed, M.; Badmos, T.A. Evaluating the Performance of Fuzzy-PID Control for Lane Recognition and Lane- Keeping in Vehicle Simulations. 1. Introduction Electronics 2023, 12, 724. https:// Autonomous vehicles are controlled through either of the following means: by the doi.org/10.3390/electronics12030724 use of sensors, Global Positioning System (GPS) synchronization, and cameras. One Academic Editors: Mohammad of the most common areas of interest in research for autonomous cars is active safety Bagher Dowlatshahi and Yue Wu systems, such as the advanced driver assistance system (ADAS). Examples of ADAS systems are lane-keeping assist (LKA) and lane departure warning (LDW) to mention Received: 28 December 2022 just a few. For the LKA using vision-based techniques in the development stage of an Revised: 26 January 2023 autonomous vehicle’s lane-detecting/keeping algorithm, the approach will only be effective Accepted: 29 January 2023 on marked lanes. However, one of the setbacks still under investigation is the process Published: 1 February 2023 of localizing a vehicle in real-time for unmarked lanes or road boundaries. Some of the available common libraries in either MATLAB or OpenCV do not even have adaptive functions for detecting unmarked lanes or boundaries, or even sharp curves, except for Copyright: some shapes, such as circles, ellipses, etc., which already have pre-defined functions in the© 2023 by the authors. Licensee MDPI, Basel, Switzerland. common libraries used for processing [1]. A further review also revealed that the use of This article is an open access article color thresholding for lane detection can be a terrible idea because it is not robust enough distributed under the terms and to detect discontinuity in lanes or noise present on the lanes, such as cast shadows and conditions of the Creative Commons illumination and disturbances [2]. Attribution (CC BY) license (https:// Typically, the detection of involuntary lane departures in commercial lane-keeping creativecommons.org/licenses/by/ assist systems (LKASs) is based on time to line crossing (TLC) [3]. It works by projecting 4.0/). Electronics 2023, 12, 724. https://doi.org/10.3390/electronics12030724 https://www.mdpi.com/journal/electronics Electronics 2023, 12, 724 2 of 11 the trajectory of the vehicle by using time and dynamics to project how and when the vehicle will arrive at the lane markings. The computation of TLC could be arrived at in certain ways depending on the shape/contour of the road and the conditions surrounding the making of the vehicle model. A major disadvantage of TLC-based LKASs is the false alarms they raise owing to previously set required thresholds [4]. Alternatively, lane departures can be predicted by maneuver recognition algorithms. The benefits of this are dual-pronged; first, no threshold is required; second, with time, they adapt to a specific driver’s style based on data accrued. Therefore, in terms of reliability, lane departure prediction tends to take the lead/perform better [5]. Several lane detection techniques exist and are classified as either vision-based or framework-based. Some framework-based techniques are robust and have a high cost of setup and development, such as LIDAR and magnetic sensors, as seen in [6]. The vision-based technique has a camera mounted on the vehicle, is cheaper, and owes greater advantage to lane recognition in both existent and non-existent lane markings [7]. Among the various advanced driver assistance systems that exist are LKASs, which came into existence a decade ago and are fast gaining popularity even in passenger cars. They function by sensors that are both exteroceptive and proprioceptive to forestall lane departures on highways that occur involuntarily by either actively taking over the control of the vehicle or warning the driver [3]. Ref. [8] believed that, in actively controlling a car, it is crucial to define a safe transition of control from the driver to the controller. The early detection of involuntary lane departures is necessary to ensure less evasive inputs by the controller. Over the years, researchers have proposed many control approaches. Ref. [9] described an efficient lane-change maneuver control system for platoons of vehicles. The problem of the combined longitudinal and lateral control of a platoon of non-identical vehicles on a curved lane of a highway was presented in the design and experimental implementation of an integrated longitudinal and lateral control system for the operation of automated vehicles in platoons. However, it was gathered from the literature that lane-keeping control is more effective when using lane detection [10,11], since the various studies used predictive measures for unintentional lane departure on the various trajectories. This method is not fully accurate because none of their studies could place or localize the vehicle at a given point in time, hence the lane detection method. Lane detection is a vital task in the development of lane-keeping systems. It involves the positioning of the vehicle coordinates on the road and is the process of locating lane markers on the road and then presenting these locations to an intelligent system. According to [12], intelligent vehicles cooperate with smart infrastructure to achieve a safer environment and better traffic conditions. Lane detection is a vital task in the development of lane-keeping systems, similar to how thermal management and marine environment interference are important for controlling unmanned surface vessels and fuel cells, respectively. As seen in references [13] and [14], the use of control methods such as the diploid genetic algorithm and fuzzy- PID controller and S-plane adaptive control algorithm can improve the adaptability and robustness of these systems. Previous studies, such as [15], have emphasized the importance of developing smaller and more efficient algorithms for the task of autonomous driving. This study primarily focused on the areas of lane-keeping control systems and steering angle prediction. Ad- ditionally, this study highlighted the importance of developing environmentally friendly algorithms for the task of autonomous driving. This is a crucial aspect to consider in the field of autonomous driving, as it not only allows for more efficient and cost-effective solutions, but also promotes sustainability. The applications of a lane-detecting system could be as simple as pointing out lane lo- cations to the driver on an external display or more complex tasks, such as predicting a lane change in the instant future to avoid collisions with other vehicles. Some of the interfaces used to detect lanes include cameras, laser range images, LIDAR, and GPS devices. ElEelcetcrtornoincisc s2022032,3 1, 21,2 x, 7F2O4R PEER REVIEW 3 o3f o1f21 1 la2n.eK cihnaenmgae tiinc tMheo dinesltaonf tL fautteurrael tVoe ahvicolied Mcoolltiisoinons with other vehicles. Some of the inter- faces uCseerdt atoin daestseuctm lapntieosn isncwluedree mcaamdeerafos,r ltahseerd reavnegleo pi maegnetso, fLIaDvAehRi,c alen’ds GlaPteSr adlemviocetiso. n, which will be mentioned in the course of this study. The equations of motion describe 2.m Kaitnheemmaattiicc aMllyodtheel ovfe hLiactuelraarl pVaethhiwcliet hMouottipoany ing attention to the forces acting on it. The bicyCcelertmainod aeslsiusmupsetidontos hwaenrdel emtahdeel aftoerr athl ed ydneavmeliocpsmofenfot uorf- wa hveeehlivcleeh’si cllaetse,rraelp mreosteinotne,d wbhyicthw wo-iwll hbeee lmvenhtiicolnesed[1 i6n]. tThhe ecfoourrmseu loaft itohniss simtupdlyifi. eTshteh eqdueartiivoantsiv oef omf tohteioenq dueasticornibbe y mtatkhinemg aotuictatlhlye tdhey nvaemhiiccuslaorf praotlhl awnidthpoiutct hpa(ywinhgic hattmenatyiobne tos itghnei fifocracnets) ,aactnindgi tonp riot.d Tuhce s biecqyucalet imonosdtehl aits aurseedim tpo lhemanednltea tbhle .laTthereaml doydnealmwiocsrk osf bfoyulrin-weahreizeli nvgehthicelessy, srteepmreisnensmtedal l byan tgwloe-awsshuemel pvteihonicslecso. r[r1e6s]p. oTnhde ifnogrmtoutlhaetiolin esaimr cpolieffifiesc itehnet doefrtihveatfiovrec eosf gtheen erqautaetdiobny btyh e tatkiriensg. Tohuet mthoed deyl nisaamssicusm oefd rtoollm aanidn tpaiintcha c(ownhsitcahn tmvaelyo cbiety .significant), and it produces equatiAonvs ethiactl ea’rse laimtepralelmdeyntaambliec. ITshsei mpoldifiele dwobrykstr ebayt ilningeaitriazsinag bthicey cslyesttehmat idno sems anlol t anexgplee raisesnucme ppitticohnso rcororrllesapnodntdrainvgel stoa tthaeu lninifeoarrm cosepfefeicdi.enFto roft htihsep fuorrpceoss eg,etnheereaqteuda tbioyn tshfeo r titrhese. fTrohne tmwohdeeell iss aarsesummatehde tmo amtiacianlltyaimn ae rcgoendsttaonfto vrmeloacistiyn. gle wheel and likewise for the rearA. B vyehigincloer’sin lgattehrealv dehynicalem’sicr oIsll ,sibmoupnlicfiee,da nbdy ptrietcahti,nagv iet haisc lae bmicoydcelel wthiatht dthoreese ndoetg erxe-es poerfiferneceed opmitc,hy aowr ,raonlld anpdla ntraarvmelos taiot na cuannifboermpr ospdeuecde.d F[o1r7 ]t.his purpose, the equations for the froWnth werheetehles vaerhe icmleatehxepmeraietinccaellsyl emssetrhgaend 0t.o3 fgo’srm, e aar lsieinrgwleo rwksheceoln afinrmd ltihkaetwthisies mfoor dtehlei s reaacrc.u Bryat ieg[n1o8r]i.nTgh tehree svuelhtsicpler’osd ruoclel,d bionusnitcuea, tainonds pwithcher, eah vieghhiecrleg ’ms aordeeel xwpietrhi etnhcreede duseignrgeeths e ofb ficreyecdleommo, dyealwy,i ealnddi npalacncuarr amteorteiosnu lctsa.nR bees eparrocdhuecxepdo [s1e7d].t h e dearth of literature outlining the Wvehheicrlee tdhyen vaemhiicclseo efxapuetroinenocmeos ulessns athviagna t0i.o3n gp’sr,o ebalrelmiesr. wItoirskosn corencfoirrmd tthhaatt tthheisN maotidoenla l isR aocbcoutriactseE [n18g]i.n Teehrei nregsCueltnst perr’osdCuRceUdS iHnE sRitumaatidoensse wvehrearlea httiegmheprt sgi’ns athree epxapset rtioenucseedm uascihnign e thleea brinciyncglet emchodnieql uyeiesltdo ianiadccinurtaetrer ariensutrltasv. eRressaelabrucht, ebxepinogseadm thilei tdaeryarpthro ogfr laimter,aittuisreh oiguht-ly lincoinngfi dthene tviaelhliicmleit dinygniatsmaivcsa iolafb aiulittyontoomthoeupsu nbalivcig[1a9t]i.oBn MprWobalnemd Vs.o Iltk issw oang ernec(obrodth thGaetr tmhea n Naautitoonmala Rnuobfaocttiucsr eErns)ghinaeveericnagrr Cieednoteurt’sh CigRhU-pSeHrfEoRrm maandcee asuevtoenraolm aottuems dprtisv iinn gthoen pleaasrt ntoed ucsoe umrsaecshbinuet lheaavrneinnogt tmecahdneiqtuheesr etosu alitds eina stielyrraaicnc etsrsaivbelers[a2l0 b].ut, being a military program, it is hiTghhelys tcaotnefeidqeunattiiaoln liomf itthinegd eitvse alovpaeildabmiloitdye tloi sthael ipnueabrlisci n[1g9le]. iBnMpuWt t oanodu tVpoultkssywstaegmeno f (btohtehs Ginegrlme ainnp auuttov amriaanbulef,acthtuersetrese) rhinavgew charereileadn ogulet ,haignhd-ptwerofoorumtpanuctev aauritaobnloems, othues ldartievr-al indge ovnia lteioanrnaendd cothuerssetse ebruitn hgaavneg nleo.t mFraodme tFhieg urerseu1lt,si neaaspilyp laycicnegssNibelwe [t2o0n]’.s second law of motTiohne, stthaeted eyqnuaamtiiocnm oofd tehlee dmepvleolyospethde mveohdiecll ei’ss ac elinnteearro sfignrgalve iitnypaustt htoe oreuftepruent cseysptoemin t. of the single input variable, the steemri(nψg +whrue)el= anFgle+, anFd two output variables, the lateraly f yr (1 ) deviation and the steering angle. From Figure 1, in applying Newton’s second law of mo- tiwonh,e trheeE dqyunaatimonic (m1)oids eall seomkpnlowysn thaes tvheehmicloem’s ecnetnMterz .of gravity as the reference point. Figure 1. Illustration of single tracked bicycle model of ve hicle handling characteristics as derived Fibgyu[r1e5 1].. Illustration of single tracked bicycle model of vehicle handling characteristics as derived by [15]. m = total mass, ψ front and rear wheel𝑚fo𝜓= +ya𝑟w rate, rrces.𝑢 = 𝐹 +=𝐹side slip, u = vehicle velocity, and Fyf + Fyr are both (1) Yaw dynamic is described when equilibrium is obtained about the z axis and is wchoenrsei dEeqrueadtiaosnf o(1ll)o iws sa:lso known as the moment Mz m = total mass, ψ = yaw rate, r =I zsτid=e saliFpy,f u− =b Fvyerhicle velocity, and Fyf + Fyr are both(2 ) front and rear wheel forces. wheYrea Iz τ is the vehicle’s inertia, a is the distthe diswta ndcyensafmroimc ist hdeersecarirbaexdl ewthoetnh eeqceuniltiebrr ainucmes isfr oobmtatihneedfr oanbtoauxtl eof mass. th teo 𝑧th aexicse nantedr, iasn cdonb-is sidered as follows: 𝐼 𝜏 = 𝑎𝐹 − 𝑏𝐹 (2) Electronics 2023, 12, 724 4 of 11 From Figure 1, resolving the forces to o(btain the)velocity at the rear, we obtain thefollowing: br − v tan αr = − (3)u where v is the lateral velocity. Assuming that tan αr = αr, therefore, Equation (3) can now be rewritten as follows: v αr = − br (4) u u Moreover, assuming the vehicle is taking a turn and its turning radius is denoted by r. − brαr = β (5)u − ar + vtan αr = δ (6)u where β is the vehicle slip angle and δ is the steering angle By simplifying and rearranging both (Equations (5)) and (6), we obtain the following:a α f = − δ − − β (7)R The steering angle now becomes ( ) L δ = − α f + αr (8)R where L is the sum of both a and b considering the tire model for this bicycle model given by Fy = −Caα (9) where Ca is the tire cornering stiffness. So, for the front and rear wheels, we have Fy f = −Ca f α f (10) Fyr = −Carαr (11) Caf is the cornering stiffness of the front axle and Car is the cornering stiffness of rear axle. The sum of Equations (10) and (11) will then be given as Fy = Fy f + Fyr = −Ca f α f − Carαr (12) Substituting Equation(s (5) and (6) into)Equa(tion (11), w)e obtain the following: − a bFy = Cu a f + Cu ar r − Ca f + Car β + Ca f δ (13) Moreover, Equation((1) now becomes2 2 )a ( ) Mz = − Ca f − b Car − aCa f − bCar β + aCu u a f δ (14) Using the state space for both Equations (12) and (13) can be written as [ ] ψ =    −Ca f +Car − aCa f +bC [ ] ar [ ] Ca f mu mu  v u τ aCa f +bCar a 2C +b2C + δ (15)a f ar r aCa f Izu Izu I Electronics 2023, 12, 724 5 of 11 Electronics 2023, 12, x FOR PEER REVIEW [ ] [ ] 5 of 12 ψ v = [A] + [B]δv (16) τ r where A is the state matrix and B is the input control matrix. whEeqrueaAtioisnt h(1e5s) taist ethmea strtaixtea-nspdaBcei sfothrme i nopf utthceo bnitcryocllme amtroidx.el used for the simulation studies Einq dueatteiormn i(n1i5n)gi sthteh eresstpaoten-ssep aocf ethfeo rvmehoicfleth aet banicyy cdlyenmamodice linupsuetd. for the simulation studies in determining the response of the vehicle at any dynamic input. 3. Methodology 3. Methodology The vision-based process started with capturing the road ahead of the vehicle by us- ing camTerhaesv misoiounn-tbeads eadboparrodc easnsds ttahretend pwrei-tphrcoacpetsusriningg ttehcehnroiqaudeash oena dthoef itmheagveehs iwcleerbey caurs-ing riedca omuetr. aPsrme-pouroncteesdsianbgo aisr da atnerdmth uesnedp rteo-p dreosccersisbien gvaterciohunsiq pureoscoesnseths eciamrraiegde sowute roenc athrrei ed comouptu. tPerre t-op rborcinesgs ionugt iisnafotremrmatuiosend btyo cdoensvcreirbteinvga rimioaugsep droacteas tsoe sdciagritraiel ddoatuat. oTnhteh perceo-mprpou- terto bring out information by converting image data to digital data. The pre-processing steps cestsainkgen stteopds etavkeelonp toth deelvaenleopd ethteec ltaionne dinevteoclvtieonv iidnevoo/lvime vaigdeeoco/inmvaegrsei oconn, vwehrseiroenv, iwdheoersea re vidceoonsv aerrete cdotnoviemrtaegde tsoa inmdasgmeso oatnhdin sgmaonodthwinhge raentdh ewyhaerreec tohnevye ratreed cfornomverttheedo frriogmin atlhree d– origgirneeanl –rebdlu–egr(eReGnB–b) lfuoerm (RaGt tBo) gfroarymsacat lteo fgorramyastc.aTleh feocromnavte. rTshioen coisnevsesresniotina lisfo erstsheentdiaelt efoctri on theo df edtiescctoionnti nouf idtiiescsoinnttihneuivtiidese oin/ itmhea gveidtehoa/timisasghea rtpha. t is sharp. AlgAolrgitohrmiths mofs eodfgeed gdeetdecettieocnti oanrea ureseuds etod dtoefdineefi ntheet hsheasphea poef ao freagrieogni oannda niddeindteifnyt ify objoebctjeivceti vreegreiogniosn tshtrhoruoguhg himimaaggee rreeccooggnniittiioonn aanndd aannaalylyssisis. .I mImaaggeep rporcoecsessinsigngre lrieelsieosn othne m thefmor foourt loinuitnligntinheg ttahreg ettabrgoeutn dboaruynadnadryd eavnedl odpemveelnotpomf oebnjte cotfb oabckjegcrto buancdk.gTrhouesnedt.e cThhneisqeu es tecwhneirqeuaepsp wlieedret oaptphleiepdr otcoe tshseed pirmocaegses/edvi dimeoa.gTe/hveideexotr. aTchtieo nexptrroaccteisosni spfroorcethsse idse ftoerc ttihoen of detpeoctsisoinb loefe pdogsesipbolein etds.geA pnoiimntasg. Ae nw iimthaaguet womithat aicutthomreashtioc ltdhsrewshasolpdrso wduacs epdrobdyuacesdu ibtayb le a sueditgaeblde eetdecgteo rd.etector. A pAoppouplaurl atrectehcnhinqiuqeu ekknnoowwnn aass tthhee HHoouugghh ttrraannssfoforrmm, ,a sass eseeneinn i[n2 1[]2,1w],a ws uasse dusteodis toola te isoflaetaet ufereastuorfessh oafp sehsawpeisth winitthhine itmhea gime aagned aunsde dusteodd teot edcettleicnte lirnoea drosaadssl aasn eladneet decettieocnti.oAnf. ter Aftseern sdeinndginthge theed egdedgeidm iamgaeg/ev/ivdiedoeoto tot htheel ilnineed deeteteccttoorr, ,i titp prroodduucceess lleefftt aanndd rriigghhtt bboouunndd-ary arys eseggmmeenntsts. .A As sccaanni iss ppeerrffoorrmeedd bbyy ddeetteeccttiinngg tthhee Hoouugghh lliinneess ttoo pprroodduuccee aa llaannee bboouunndd-ary aryw witihths eseriraial lp pooinintstso onnb booththt htheel eleftfta annddr irgighht.t.W Whheennt htheed daatataa arerep prorocceesssesedd, ,l alanneeb boouunnddar-ies arieasr earper opdroudceudceind tinhe thfoer fmoromf pofa iprasiorsf hoyf pheyrpbeorlbaosl.as. TheT hlaenlea-nke-ekpeienpgi nsgysstyesmte amrcahricthecitteucrteu irse disepdiecpteicdt eidn FinigFuigreu r2e. 2. FigFuirgeu 2r.e B2l.oBcklo dckiagdriaagmr aomf tohfe tlhaenela-nkeee-kpeinepgi nsygssteymst.e m. For the simulation studies, a lane-keeping system was modeled in Simulink with the folFloowr tihneg siinmpuultaptiaorna msteutderiesst,o at lhaenLe-KkSe:epprinevgi esywsetedmcu wrvaast muroed, veleehdic ilne Sloimnguitliundki nwailtvhe tlhoec ity, follaonwdinlagt eirnapludte pvaiartaimone.teTrhs etola tnhee- kLeKeSp:i npgremvioedweeldc ocnutraviantsutrher, eveemhiaclien lsoenggmiteundtisn: alal nveelcoecn-ter ity,e asntidm laattieorna,l ldaenveiadteitoenc.t iTohne, laannde-lkaneeep-kineegp minogdceol ncotrnotlaleinr.s three main segments: lane cen- ter estimAatsiuonbs, ylasnteem deitneclatinoen,d aentdec ltaionne-skeenedpisnogu ctoanntraollalerrm. when the vehicle is detected to beAt osoubcsloyssetetmo itnh elalnaen ed,ewtehctiiloent hseenfdusn cotuiot nano faltahreme swtihmenat tehlea nveehciecnlet eisr disetteocpterdo cteos bset he tood caltoasefr otom thlaen leanseen, swohrsilaen tdhet rfaunnscfteirotnh oemf thtoe tehsetilmanaete-k leaenpei ncegnctoenr tirso tlole rp.rTohceeslsa nthee-k deaetpai ng frocmo nlatrnoel lseerncsoonrstr aonlsdt htreanstsefeerri nthgewmh teoe tlhteo leannseu-kreeethpeinvge choicnlterorellmera. iTnhsein laintse-lakneeep. ing con- troller cTonhtisrowlsa tshme satdeeerpinogss wibhleeebly tose ettnisnugrteh tehlea vteerhailcdlee vreiamtiaoinnst oinz ietrso l.aTnhe.e lateral deviation errTohriss iwgnaasl misatdhee pdoisstsainblcee bbye tsweteteinngt htheev leahteicrlael pdoesviitaiotinona ntod zthereod. eTshiree ldatreerfaelr ednecveiattriaocnk at erraorg sivigennapl iosi ntht,ew dhisitcahnicse sbeenttwtoeetnh ethceo vnetrhoilclleer ,pwoshiitciohnt haennd athdeju dsetssitrheed srteefeerrienngcea ntrgalceko aftt he a gcivoenntr polowinht,e welhsiuchch ist hseant tt htoe tvheeh cicolnetfroolllloewr, swthhiechre tfheerenn acdejtursatcsk t.hTeh seteceornintrgo allnegrlceo onfs tthane tly control wheel such that the vehicle follows the reference track. The controller constantly works to minimize the distance between the vehicle position and the reference track at Electronics 2023, 12, x FOR PEER REVIEW 6 of 12 Electronics 2023, 12, 724 6 of 11 every given time. The scenario reader block in Simulink was used to create ideal left and rwigohrtk lsantoe mboiuninmdiazreietsh we idthis rtaenspceecbt etotw theeen vetheicvlee hpiocslietiponos fiotiro tnhea nstdudthieesr. e ference track at every given time. The scenario reader block in Simulink was used to create ideal left and 4r.i gChotnlatrnoel bSotruantedgayri e s with respect to the vehicle position for the studies. 4. CoTnhter oplaSthtr-atrtaecgkying control of an autonomous vehicle is one of the most difficult auto- mation challenges because of constraints on mobility, speed of motion, high-speed oper- ation,T choemppaltehx-t irnatcekriancgticoonn wtroitlho tfhaen eanuvtiornoonmmoeunst,v aenhdic tlyepisicoanlleyo af ltahcekm oof sptrdioifrfi icnuflotramuatotimona - [t2io2n]. cHhoawlleenvgeers, rbeesceaaursceheorfsc hoanvster apirnotps oosnedm ombailnityy ,csopneterodl oafpmprootiaocnh,ehs.i gRhe-fs.p [e1e0d] doepsecrraitbieodn , acno mefpfilceixenint tlearnaec-tcihonanwgeit hmtahneeeunvveirr oconnmtreonlt ,saynstdemty pfoicra plllyataoolancsk ooff vperhioicrleinsf. oTrhmea ptiroonbl[e2m2] . oHf othwee cvoemr,brienseeda rlcohnegristuhdaivnealp arnodp olasetedraml caonnytrcooln otfr oal palpaptoroona cohfe nso. nR-iedf.en[1t0ic]adl evsechriicbleeds oann ae fcfiucriveendt llaannee -ocfh aa nhgigehmwaanye wuavse rprceosnetnrotelds yins ttehme dfoesripgnla atonodn esxopfevriemheicnlteasl. imThpelepmroebnlteamtioonf othf eanco imntbeignreadteldo nlognitguidtuindainlaaln adnlda tleartaelracol ncotrnotlroolf asypsltaetmoo fnoro fthneo no-piedreantitoicna lovf eahuitcolemsaotneda vceuhrvi eof ancle dsl iann peloaftoaintegratedo hnisg. hMwoaylongiturdeo was invaelra, p ar eresvenietwed ind latera ol f n pthe designconretvroiol usys ssttu adnidese sxhpoewriemde tntal implementationem for the operhaattio vnaroiof uaus ttohmeoartieeds avnedh imcleesthinodpsl ahtaovoen sh.igMholirgehotveedr ,tahere uvsiee wofo cfeprtraeivni ofoursmstsu odfi ecsonshtroowl, ewdhthicaht ivnacrliuodues tthhee oPrIiDes caonndtrmole mtheotdhsohda, v[2e3h],i gthheli gphreteddictthiveeu csoenotfrocle rmtaeitnhfoodr m[2s4]o,f tchoen fturozlz,yw choinchtroinl cmluedtheothde, aPnIDd tchoen tmrooldmele trheofder,e[n23ce], tahdeapprteivdeic mtiveethcoodn tr[o2l5]m. eTthheordef[o2r4e],, tthhee fufiznzdyincgosn tfrroolmm etthheo dli,tearnadtuthree cmouoldde lbree sfuermenmcaeraizdeadp atisv tehmate tthhooudg[h2 5c]o.nTtrhoelrleerfos rseu,cthh easfi PnIdDin, gMsPfrCo,m antdh efuliztzeyra ltougriec cwouerled ubseesdu fmorm eaitrhizeer dthaes ltahtaertatlh ooru lgohngcoitnutdroinllaelr csosnutcrhola osf PthIDe ,aMutPoCno, manodufsu vzezhyiclloeg, itchweire rreesuusletds sftoilrl esihthoweretdh esolamteer laalteorrallo sntegeitruindgin caolnctoronlt risosluoefst, haes aau rteosnuoltm ofo uthsev cehhainclgei,ntgh epiarrraemsuelttesrss toilfl tshheo vweehdicsleo.m Ae mlaoterrea aldsatepetriivneg scyosntetmro lwisosuuleds ,baes aablree stuo lttaokfet hcaerceh oafn tghiensge pchaaranmgientge rpsaorfatmh-e evteehr iicslseu. eAs.m Sionrceea odtahpetrisv estsuydsiteesm, swucohu lads b[e26a]b, lheatvoet askheowcanr ethoaf tt hae fsuezczhya nggaiinng scphaerdamuleintegr sicshsueems.e Soifn cPeIDot choenrstrsotluledrise sf,osru pcrhoacses[s2 6c]o,nhtarvoel csahno wginveth aa tbaetftuerz zpyergfaoirnmsacnhceed uwlihnegres cfhuezmzye rouflePsI Dancdo nretarosollnerinsgf oarrep ruotcileiszsedc oonntlrionlec taon dgeitveermaibneet ttehre pceornftorromllearn pcearwamheerteerfsu bzazsyerdu olens tahned errreoars osinginnagl aanred uittsi lfiizresdt doifnfleirneenctoe, dtheetenr tmhiins emtehtehocdo ncotruolldle brep aaprapmlieedte frosr baausteodnoomnotuhse learnreo-rkseiegpninalga ansd a mitseafinrsst odf isfofelvreinngc eth, eth cehnanthgiisngm peathraomdectoeursl dissbueeas.p Fpulizezdy fgoarina usctohnedomuloinugs hlaans eb-keeeenp uinsgeda sina motehaenrs aopfpsloiclvaitniogntsh eanchda hnagsin bgepenar afomuentder ssuisistaubelse.. FTuhzuzys, gtahien uscshe eodfu tlhinisg choanstrboele sntruuscetudrien woothueldr adpepmliocnastitorantse athnadt hbaesttbere ecnonftoruonl dpesrufoitramblaen.cTe hcuans, bthe eacuhsieevoefdt hinis ccoomntpraorlisstornu cwtuitrhe owthoeurl dcodnetmroolsn, ssturachte atsh PatIDbe atntedr McoPnCtr.o l performance can be achieved in comparison with other controls, such as PID and MPC. 55.. Diissccuussssiioonn ooff Reessuullttss Fiigurree 3 showss tthe ffiirstt diifference determiined by conttrollller--based parrametteerrss ffrrom ffuzzzzyy rrulleess and reasoniing demonssttrraattiingg a betttterr perrfforrmaanccee iin conttrroll.. Thee apprroacch was generattiing controller parameters from fuzzy rules and reasoning. FFiiggurree 33.. SSiimuulliinnkk Diiaaggrraam ooff FFuzzzzy--PIID Conttrroll.. AA ffuuzzzzyy coconntrtorolllelre rwwasa susuesde dforfo trheth ceomcopmuptautitoanti oonf tohfe tshteeesrtienegr cinogntcroonl. tAro flu. zAzyf ucoznzy- tcroonllterro clloenrscisotns soifs tas rouflea brauslee cbonastaeincoinngt atihnei negxptehretse’ xpproecrtesd’uprraol ckendouwraleldkgneo awnlde dag vearainadblea bvaasreia cbolnetbaainsiencgo tnhtea idniifnfgertehnet dliinfgfeuriesntitcl ivnagluueisst itchavta tluheeys tchoantstihdeeyr acso nsesiedne irna [s2s7e]e. nThine [h2u7-]. mThaen hdurmivaenr’sd prirvoecre’ds uprraolc ekdnuorwallekdngoew wleadsg reewpraesserenpterdes benyt aed fubzyzay fruuzlze ybrausele. Tbahsee .ruTlhee brauslee base contains the necessary information on how drivers execute their actions to keep the vehicle in its lane. In this instance, the fuzzy rule base was common to all driving tasks Electronics 2023, 12, x FOR PEER REVIEW 7 of 12 Electronics 2023, 12, 724 contains the necessary information on how drivers execute their actions to keep the 7voefh1i1- cle in its lane. In this instance, the fuzzy rule base was common to all driving tasks because the main objective is to keep the vehicle in its lane, i.e., to minimize the lateral deviation berercoaru. sTehtehreefmoraei,n thorbejeec rtuivleesi swteorek euespedth teo vheehlpic lkeeienp ittshela vneeh, iic.ele., itno tmhein liamniez. eTthheesela rtuerleasl dsteavnidat ifoonr ebrarsoirc. hTuhmereafno rder,itvhirnege rreualesosnwinerge: uIfs ethdet ovehheilcplek eise pmtohveivnegh oiculet oinf tthhee llaannee. tToh ethsee rleuflte, sthsetann tdurfno rthbea ssitceehruinmga wnhdereivl itnog three arsigohntin tog :oIfffsthete tvheeh laictleeraisl dmeovviaintigono uertroofrt. hTehlea snaemtoe tthheinlge fatp, tphleiens tiuf trhnet hdeevsitaeteiroinn gis wtoh teheel rtioghtht.e Trhigeh mt teomobfefsresht itph efulantcetrioanl ds eovf itahteio innpeurrt ocro.nTshiset soaf mtheet lhoinggitaupdpilnieasl sifpteheedd, leavtieartaiol ndeivs itaotitohne, raingdht p. rTehveiemwe mcubrevrasthuirpe fwunitcht ifounzszyo fstehtse oinf pthuet csopneesids toof ffathste slponeegdit,u mdiendailusmpe sepde,eldat, earnadl dselovwia tsiponee, dan. Tdhper emveiemwbecursrhviapt ufurenwctiiothn foufz tzhye sleatts- oerfatlh deesvpieaetidono fisf adsitvsipdeedd i,nmtoe fdiviuem fuszpzeye sde,tas nedacshlo, whsipcehe adr.eT hhigehm peomsibteivresh dipevfiuanticotnio, nmoef- tdhieumlat peroaslitdiveve idateivoinatiisodni,v simdeadll idnetovifiavtieonfu, zmzyedsieutsme ancehg,awtivheic dheavrieathiiognh, panodsi thivigehd nevegiaattiiovne, mdeevdiiautmionp.o Fsiintiavlelyd, ethveia itniopnu,ts meamll bdervsihatipio fnu,nmcetidoinu mforn pergeavtiveewd ceuvrivaatitounr,ea ins dhihgihglhyn peogsaitive deviation., Fmineadliluy,mth peoisniptiuvtem demvibateirosnh,i psmfuanllc tdioevnifaotiropnr,e mviedwiucmur vnaetguarteivise hdiegvhilaytipoons, iatinvde dhiegvhia ntieogna,timve dieuvmiatpionsi,t rivesepdeecvtiivaetiloyn. M, somreaollvdeerv, fioatri othne, omuetdpiuutm, thnee mgaetmivbeedreshvipat fioun,catinodn hisi ghhignhe gpaotsiivteivdee svtieaetrioi ng, raensgpleec,t imveldyi.uMmo rpeoosviteirv,efo srtethereinogu tapnugt,let,h semmaellm sbteerrsihnigp afunngcleti,o mn eis- hdiguhmp noseigtiavteivset esetreienrginagn galneg, lme,e adniudm hpigohs intievgeasttieveer isntgeearninggle ,asnmglael,l astse eserienng iann Fgilge,umree d4,i urme- nspegecattiivelyst. eering angle, and high negative steering angle, as seen in Figure 4, respectively. Figure 4. Fuzzy lane-keeping system architecture. FigurBe a4s. eFduzozny tlhaneef-ukzezepyinargc shyistetecmtu arercihnitFecigtuurree. 4, fuzzy gain scheduling (FGS) was used for the fuzzy-PID controller. Fuzzy reasoning mechanisms, knowledge-based fuzzy rules, and the coBnavsedn toionn tahleP fIuDzzcoyn atrcohl istyecstuemre ainre Ftihgeumrea 4in, fcuozmzyp ognaienn tsschoef dthuilsintygp (eFGofSF) uwzazsy u-PsIeDd cforn throel fleurz.zTyh-PeIPDID cocnotnrotrlolelrle. rFugeznzyer raetaesoanrineqgu mirecdhsatneiesrminsg, kanogwlelefrdogme-bkansoewd lfeudzgzey- brauslesd, and tfhuez zcyoninvteenrtfieorneanlc PeItDu nceodntfrroolm syPstIeDmg aarien sthoen mlinaein. cTohmepsoimneunlatst iofn thwisa stybpaes eodf Founztzhye- fPuIzDz ycornutlreoslltehra. tTwher Pe IsDet cionntthreolfluerz zgyenaelgraotreitsh am retoquaidrejuds tsteherisntege aringglea nfrgolme b kanseodwolendtghee- cbhaasendg ianngdp faurzazmye itnetresr,fteoremncaek etutnhedv efrhoimcle PmIDa ignatainins othnelidne.s iTrehde sreimfeurelantcieontr wajeacst boarys.edT hoins itsheim fupzozryta rnutlebse cthauats ewaerceo smetb iin atthioe nfuozfzbyo atlhgoFruizthzmy atno dadPjIuDstw thoeu sldteehreilnpg tankgelcea braesoefdt ohne cthea ncghiannggpinagra pmaertaemrseatenrds,w to umldakgeiv tehbe evtteehricpler fmoraminatnaicne othned dyensairmedic rbeefhearevniocres tarsajseecetonriyn. oTthhiesr isa pimplpicoarttiaonts bwecitahucshe aan cgoinmgbpinaaratimone toefr sb.oth Fuzzy and PID would help take care of the changing parameters and would give better performance on dynamic behaviors as Pseeerfno rimn aonthceeAr anpalpylsiicsaotifotnhes Fwuizthzy c-hPaDnCgionngt rpolalrearmeters. Performance analysis was carried out with input constant longitudinal velocities of 1P0ermfo/rms,a1n5cem A/nsa,l2y0sism o/f sth, ea nFduz2z5y-mPD/s Cfonrtaroslclearl ed vehicle. The simulation was conducted and tPheerrfeosrumltasnacree asnhaolwysnisi nwFaisg cuarreri5e.d out with input constant longitudinal velocities of 10 mF/sr,o 1m5 mFi/gs,u 2r0e m5,/ist, caanndb 2e5 omb/sse frovre da stchaaltedfe wvehoivceler. sThhoet ssiamreuslaeteino.n Twhaes rceosnudltuscsthedow anedd athree rmesaurkltasb alreer sehdouwctnio inn Finigtuhree o5v. e rshoot as it guides the vehicle along the trajectory of the reference. Further analysis of the fuzzy-PID control at different longitudinal velocities was conducted as seen in Figure 6. The results show the performance of fuzzy-PID at different longitudinal velocities. A lateral deviation of −1 cm to 0.5 cm was observed in Figure 6 at a longitudinal velocity of 10 m/s. As the longitudinal velocity was increased from 10 m/s to 15 m/s, it could be observed that the oscillation changed, and a new lateral deviation of −1.2 cm to 0.2 cm was observed with a settling time of 7 s. By further increasing the longitudinal velocity, wider oscillations were seen with shorter settling times. Electronics 2023, 12, x FOR PEER REVIEW 8 of 12 -1 -2 Fuzzy-PID 4 3 2 1 0 -1 EEleleccttrroonnicicss2 2002233, ,1 122, ,7 x2 4FOR PEER REVIEW 88 off 1112 -2 0 5 10 15 20 25 30 35 40 45 50 Time (sec) Figure 5. Performance of the fuzzy-PID controller. From Figure 5, it can be observed that few over shots are seen. The results showed a remarkable reduction in the overshoot as it guides the vehicle along the trajectory of the reference Further analysis of the fuzzy-PID control at different longitudinal velocities was con- ducted as seen in Figure 6. The results show the performance of fuzzy-PID at different longitudinal velocities. A lateral deviation of −1 cm to 0.5 cm was observed in Figure 6 at a longitudinal velocity of 10 m/s. As the longitudinal velocity was increased from 10 m/s to 15 m/s, it could be observed that the oscillation changed, and a new lateral deviation of −1.2 cm to 0.2 cm was observed with a settling time of 7 s. By further increas ing the longi- Ftiugduirnea5l. veelrofocritya, wceidoefrt oescillatFigure 5. Performance of the ffuzzzzyi-oPnIs were seen with shorter settling times. y-PID ccoonnttrroolllleerr. . From Figure 5, it can be observed that few over shots are seen. The results showed a remarkable reduction in the overshoot as it guides the vehicle along the trajectory of the reference Further analysis of the fuzzy-PID control at different longitudinal velocities was con- ducted as seen in Figure 6. The results show the performance of fuzzy-PID at different longitudinal velocities. A lateral deviation of −1 cm to 0.5 cm was observed in Figure 6 at a longitudinal velocity of 10 m/s. As the longitudinal velocity was increased from 10 m/s to 15 m/s, it could be observed that the oscillation changed, and a new lateral deviation of −1.2 cm to 0.2 cm was observed with a settling time of 7 s. By further increasing the longi- tudinal velocity, wider oscillations were seen with shorter settling times. FFiigguurree 66.. Peerrffoorrmaanccee aannaallyyssiiss ooff tthhee ffuuzzzzyy--PPD ccoonnttrroolllleerra attv vaarrioiouussl olonnggitituuddininaallv veeloloccitiiteiess. . TThhee ppeerrffoorrmmaanncceeo offf ufuzzzzyy-P-PIDIDc oconntrtorlowl wasasc ocmompapraerdedw withitshi msiumlautleadteZdi eZgielegrl–eNr–iNchiochls- PoDls cPoDn tcroonl tarsols eaesn seinenF iing uFriegu7.reF r7o. mFrothme trheesu rlets,uitltw, iat swoabss oerbvseedrvtehda tthaaltth aoluthgohutghhe tchoen ctoronl- sttrroalt estgryatfeogry tfhoer tPhDe PcoDn ctroonltraoclh aiechvieedvetdhe thoeb ojebcjteicvteivoef osft esteereinrigngth tehev vehehicilcelet otowwaarrddss tthhee rreeffeerreenncceet trraajejeccttoorryya atta am muucchhl olowweerrl olonnggitiutuddininaal lv veeloloccitiytyo of f1 1m m//ss aanndd aaK Kp gp gaaiinn ooff 00..000044 aanndd KKd gaind gain ooff 00..000011,, iitt wwaass nnoott rroobbuusstt eennoouugghh ttoo mmaaiinnttaaiinn iittss ssttaabbiilliittyy uunnddeerr cchhaannggiinngg ppaarraammeetteerrss, ,s suucchha sass pspeeede,dw, weiegihgth, te,t ce.tcH. Howoewveevr,eirn, itnh ethcae sceaosfe tohfe tfhuez zfuyz-PzIyD-PcIoDn tcroonllterro,ltlheer, ptheref opremrfaonrmceawncaes wwaasy wbeatyte bretthtearn tthhaenZ tiheeg lZeire–gNleicrh–Noliscchoonlst rcoollnetrr.oFlloerr.m Faoxri mmuaxmimouvemrs ohvoeort- asnhdooste tatnlidng time, there was a unit step input in terms of the maElectronics 2023, 12, x FOR PE EsRe tRtEliVnIEgW ti me, there was a unit step input in terms ofx itmheu mmaoxvimerushmo ootvaenrdshtohoet 9 of 12 saenttdli nthget simetetl.inIng otitmheer. wIno ordths,efru wzzoyrd-PsI,D fuczoznyt-rPoIlDs t hcoenvterholisc ltehael ovneghiictlset aralojencgto irtys torfarjeecfetorernyc oef breetfteerreninceti bmeettaenr dinm tiaminet aainnds mmaininimtauinms movinerimshuomot .overshoot. Figure 6. Performance analysis of the fuzzy-PD controller at various longitudinal velocities. The performance of fuzzy-PID control was compared with simulated Ziegler–Nich- ols PD control as seen in Figure 7. From the result, it was observed that although the con- trol strategy for the PD control achieved the objective of steering the vehicle towards the reference trajectory at a much lower longitudinal velocity of 1 m/s and a Kp gain of 0.004 and Kd gain of 0.001, it was not robust enough to maintain its stability under changing parameters, such as speed, weight, etc. However, in the case of the fuzzy-PID controller, the performance was way better than the Ziegler–Nichols controller. For maximum over- shoot and settling time, there was a unit step input in terms of the maximum overshoot and the settling time. In other words, fuzzy-PID controls the vehicle along its trajectory of reference better in time and maintains minimum overshoot. Figure 7. Comparing the fuzzy-PID and Ziegler–Nichols PD control. Figure 7. Comparing the fuzzy-PID and Ziegler–Nichols PD control. It was observed that, by following the fuzzy rules and with a PID controller with a Kp gain of 0.01, Ki gain of 0, and Kd gain of 0.06, fuzzy-PID was able to steer the vehicle to the desired reference trajectory with fewer oscillations and a settling time of 12 s. There- fore, it can be concluded that fuzzy-PID performed better with fewer oscillations as com- pared with Ziegler–Nichols PD controllers, with a shorter settling time. Regardless of the different vehicle load and cornering stiffness, it was also observed that fuzzy-PID could easily steer the vehicle towards the reference trajectory, as a result of the fuzzy rule and reasoning. Little lateral deviations of 2 cm were recorded as compared to the Ziegler– Nichols PD control of 4 cm. Moreover, it can be observed that fuzzy-PID was able to sta- bilize the vehicle when it got to the desired reference trajectory. However, in the case of the Ziegler PD control, mild oscillations were observed all through the vehicle motion. Other simulations were carried out to compare the performance of fuzzy-PID as com- pared to both Ziegler PD control and MPC control. The result can be seen in Figure 8. Figure 8. Comparison of PD, MPC, and fuzzy-PID. At a steady longitudinal velocity, cornering stiffness, and vehicle mass, the results in Figure 8 shows the performance of PD, MPC, and fuzzy-PID controllers. The simulation results describe/produce/illustrate greater performance on control gains by comparing the fuzzy-PID controller to the PD controller. Moreover, a better performance was achieved based on the fuzzy rule and reasoning setup of a human driving scenario as inputted into the fuzzy rule database. It was also indicative that PID gain scheduling represented hu- man expertise on fuzzy rules. In addition, it was discovered that, although fuzzy-PID does not have an apparent structure of the PID control, the fuzzy logic controller may consider Electronics 2023, 12, x FOR PEER REVIEW 9 of 12 Electronics 2023, 12, 724 9 of 11 Figure 7. Comparing the fuzzy-PID and Ziegler–Nichols PD control. IItt wwaass oobbsseerrvveeddt thhaat,t,b byyf ofolllolowwininggt htehefu fzuzzyzyru rluesleasn adnwd iwthitahP aI DPIcDo nctoronltlreorllwerit wh aithK pa gKapin goaifn0 .o0f1 ,0K.0i1g, Kaiin goafin0, oafn 0d, Kanddg Kaidn goaf i0n.0 o6f, 0fu.0z6z,y f-uPzIDzyw-PaIsDa wblaest oabsltee etro tshteeevre thhicel evetohitchlee dtoe tshiree dderseifreerde nrecfeerteranjceec ttoraryjecwtoitrhy fwewithe rfeowsceirll oasticoilnlastaionnds aansedt tal isnegttltiinmge tiomf e1 2ofs .12T hs.e Trehfeorree-, iftocrea,n itb ceacno bnec lcuodnecdlutdhaedt f tuhzazty f-uPzIzDy-pPeIrDfo prmerefodrbmeettde rbewttitehr wfewithe rfeowsceirll oatsicoinllsataiosncso masp caormed- wpaitrhedZ iwegitlher Z–Nieigclheor–lsNPiDchcoolsn tPrDol lceorsn,twroiltlheras,s hwoirtthe ra ssehtotlrintegr tsiemttel.inRge gtiamrdel.e Rssegoafrtdheledssif foefr tehnet vdeifhfiecrleenlto vadehainclde clooarnde arinndg csotirfnfneersins,gi tstwifafnseaslss,o iot bwsaersv aeldsot hoabtsfeurzvzeyd- PthIDat cfouuzlzdy-ePaIsDily csotueledr tehaesivlye hsitceleert othwea vrdeshitchlee rteofweraerndcse ttrhaej ercetfoerrye,nacsea trreasjeuclttoorfyt,h aesf uaz rzeysurultl eoaf nthder efuaszoznyi nrug.leL aitntlde lraetaesroanl idnegv. iaLtiitotlnes loafte2racml dweveiraetiroencos rodfe d2 acsmc owmeprea rreedcotordthede Zaise gcloemr–pNaircehdo ltsoP tDhec oZnietrgollero–f 4Ncicmh.oMls oPrDeo cvoenr,tritocl aonf 4b ecmob. sMerovreedotvheart, fitu czazny -bPeID obwsearsvaebdle thtoats tfaubzizliyz-ePtIhDe wveahs iacblelew thoe sntai-t gboiltizteo tthe dvehsiircelde wrehfeerne nitc egotrta tjeoc tthoery d. eHsoirwedev rerf,eirnenthce ctraasjeecotfotrhye. ZHioegwlervePrD, icno tnhtero cla, smei lodf othsec ilZlaietigolners wPDer ec onbtsreorlv, emdialdll othsrcoilulagthiotnhse wvehreic olebmseorvtieodn .aOll tthherrosuimghu ltahteio vneshwicelere mcaortrioiend. oOutht etor csoi muplaarteiotnhse pweerrfeo rcmararniecde oofuftu ztoz yc-oPmIDparsec othmep paererdfotrombaontche Zoife gfulezrzPyD-PcIDon atrso lcoamnd- MpaPreCdc toon btrootlh. TZhieegrlesru PlDt c caonnbterosle aendi nMFPigCu croen8t.rol. The result can be seen in Figure 8. Figure 8. Comparison of PD, MPC, and fuzzy-PID. Figure 8. Comparison of PD, MPC, and fuzzy-PID. At a steady longitudinal velocity, cornering stiffness, and vehicle mass, the results in FigurAet8 as shtoeawdsyt hloenpgeitrufodrinmaal nvceeloocfitPyD, c,oMrnPeCri,nagn sdtiffufnzezsys-,P aInDdc voenhtricollel emrsa.sTs,h tehsei mresuulalttsio inn rFeisguulrtes d8 esshcoriwbes/ tphreo pdeurcfeo/rimlluanstcrea toefg PrDea,t eMrPpCer,f aonrmd afnuczezyo-nPcIDon ctroonltgroalilnesrsb.y Tchoem spimaruinlagtitohne frueszuzlyts-P dIeDsccroibnetr/polrloedrutocet/hileluPsDtractoen gtrreoallteerr. pMerofroeromvaenr,cae bonet cteornptreorlf goarminas nbcye cwomaspaacrhiniegv tehde bfuazszedy-oPnIDth ceofnutzrozlylerru tloe athned PreDa scoonnitnrgolsleertu. Mp oofreaohvuemr, aan bderttievrin pgesrfcoernmarainocaes winapsu atctehdieivnetdo tbhaesefudz ozny trhuele fudzaztayb rauslee. aItnwd arseaaslsooniinngd isceattuivpe othf aat hPuImDagna idnrsivchinegd usclienngarreiop raess iennpteudtthedu minatno ethxep efurtziszey ornulfeu zdzaytarbualsees.. IItn wadasd iatlisoon ,initdwicaastidvies ctohvaet rPeIdDt hgaati,na sltchhoeudguhlifnugz zreyp-PreIDsendtoeeds hnuo-t hmaavne eaxnpaeprtpisaer eont fsutzruzyct ruurleeos.f Itnh aedPdIDitioconn, ittr owl,atsh deisfucozvzeyrleodg tihc acto, natlrtohloluergmh fauyzczoyn-PsiIdDe dr othees nont h-lainvea arnP aIDppcaornetnrto lslterruwctuhores eofp tahrea mPIeDte crsoncatrnolb, ethdee fteurzmzyin leodgibca csoendtroonllerrr moradyi cstoannscied.er The main factor that caused the differences in performance observed between the three control methods (fuzzy-PID, Ziegler–Nichols PD, and MPC) in Figure 8 is the utilization of fuzzy logic in the fuzzy-PID controller. The fuzzy-PID controller, through the imple- mentation of fuzzy rules and reasoning, was able to effectively steer the vehicle towards the desired reference trajectory with minimal oscillations and a shorter settling time in comparison to the Ziegler–Nichols PD controller. Furthermore, the Fuzzy-PID controller demonstrated a superior performance in terms of lateral deviation and stabilization under varying vehicle load and cornering stiffness conditions. The simulation results presented in Figure 8 illustrate the improved control gains achieved by the fuzzy-PID controller in comparison to the PD and MPC controllers. This can be attributed to the ability of the fuzzy-PID controller to mimic human driving scenarios through the implementation of fuzzy rules and reasoning, as well as the gain scheduling of the PID controller within the fuzzy-PID controller. Electronics 2023, 12, 724 10 of 11 6. Conclusions The task of steering and keeping a vehicle in its lane is not an easy task. It involves the lateral control of the vehicle by a control algorithm. The objective of this algorithm is to keep the vehicle moving along the desired reference trajectory. The position and orientation of the vehicle can be determined by the use of sensors, such as the camera used in identifying the white middle marker and left and right boundaries on the road. Regardless of the apparent simplicity of discovering white lane marks on the road, it can be extremely hard to find white lane marks on a different kind of road. It is based on these prevailing issues that this study was researched. This study aimed to simulate and analyze a fuzzy-PID lane-keeping control using computer vision image processing with the following objectives: developing a lane detection algorithm used for the simulation of the fuzzy-PID lane-keeping control. The result of this simulation was also compared to other simulated lane-keeping controllers, such as PD and MPC, to compare which performs better. All simulations were conducted using the same parameters In conclusion, fuzzy-PID controller performance was way better than Ziegler–Nichols PD and MPC in terms of response time and settling time. Fewer overshoots were observed, as fuzzy-PID tried to direct the vehicle along the trajectory of reference. No oscillations were observed, but in the case of PD and MPC control, there exist oscillations as it could be seen in the results that wobbling was observed all through the motion of the vehicle. Moreover, it could be concluded that, regardless of the vehicle parameters in terms of speed, weight, or cornering stiffness, fuzzy-PID had a better performance with a minimal lateral deviation of 2 cm and settling time of 12 s. Further studies can be recommended on the result of the lane detection algorithm to develop a detection algorithm that uses multiple types of edge detection techniques. The algorithm could be trained to employ any of the detection techniques suitable at any given moment based on the current road condition and weather condition and feed the output processed image to the controller for the suitable steering command. Author Contributions: Formal analysis, M.S. and K.Y.; Funding acquisition, M.M. and H.A.; Investi- gation, K.Y.; Methodology, M.S., K.Y. and T.A.B.; Project administration, M.S. and K.Y.; Resources, K.Y.; Software, M.S., K.Y. and T.A.B.; Validation, K.Y., A.A. and T.A.B.; Writing—original draft, M.S., K.Y. and T.A.B.; Writing—review & editing, H.A., A.A. and M.M. All authors have read and agreed to the published version of the manuscript. Funding: This study received no external funding. Data Availability Statement: The data presented in this study are available upon request from the corresponding authors. Conflicts of Interest: The authors declare no conflict of interest. References 1. Rossi, A.; Ahmed, N.; Salehin, S.; Choudhury, T.H.; Sarowar, G. Real-time Lane detection and Motion Planning in Raspberry Pi and Arduino for an Autonomous Vehicle Prototype. arXiv 2009. [CrossRef] 2. Hoang, T.M.; Baek, N.R.; Cho, S.W.; Kim, K.W.; Park, K.R. Road Lane Detection Robust to Shadows Based on a Fuzzy System Using a Visible Light Camera Sensor. Sensors 2017, 17, 2475. [CrossRef] [PubMed] 3. Lefèvre, S.; Gao, Y.; Vasquez, D.; Tseng, H.E.; Bajcsy, R.; Borrelli, F. Lane Keeping Assistance with Learning-Based Driver Model and Model Predictive Control. dictive Control. In Proceedings of the 12th International Symposium on Advanced Vehicle Control, Tokyo, Japan, 22–26 September 2014; pp. 1–8. 4. Romano, R.; Maggi, D.; Hirose, T.; Broadhead, Z.; Carsten, O. Impact of lane keeping assist system camera misalignment on driver behavior. J. Intell. Transp. Syst. 2020, 25, 157–169. [CrossRef] 5. Li, D.; Lin, S.; Liu, G. Lane departure prediction based on closed-loop vehicle dynamics. Proc. Inst. Mech. Eng. Part I J. Syst. Control. Eng. 2022, 236, 913–926. [CrossRef] 6. Ershadi, N.Y.; Menéndez, J.M.; Jimenez, D. Robust vehicle detection in different weather conditions: Using MIPM. PLoS ONE 2018, 13, e0191355. [CrossRef] 7. Waykole, S.; Shiwakoti, N.; Stasinopoulos, P. Review on Lane Detection and Tracking Algorithms of Advanced Driver Assistance System. Sustainability 2021, 13, 11417. [CrossRef] Electronics 2023, 12, 724 11 of 11 8. Lei, Y.; Hu, J.; Fu, Y.; Sun, S.; Li, X.; Chen, W.; Hou, L.; Zhang, Y. Control strategy of automated manual transmission based on active synchronisation of driving motor in electric bus. Adv. Mech. Eng. 2019, 11, 1687814019846734. [CrossRef] 9. Ploeg, J.; de Haan, R. Cooperative Automated Driving: From Platooning to Maneuvering. In Proceedings of the 5th International Conference on Vehicle Technology and Intelligent Transport Systems (VEHITS 2019), Heraklion, Crete, Greece, 3–5 May 2019; pp. 5–10. 10. Somasundaram, G.; Kavitha; Ramachandran, K.I. Lane Change Detection and Tracking for a Safe-Lane Approach in Real Time Vision Based Navigation Systems. In Computer Science, Mathematics, Engineering; Institute for Computer Science and Technology: Washington, DC, USA, 2011; pp. 345–361. [CrossRef] 11. Kuo, C.; Lu, Y.; Yang, S. On the Image Sensor Processing for Lane Detection and Control in Vehicle Lane Keeping Systems. Sensors 2019, 19, 1665. [CrossRef] [PubMed] 12. Kaur, G.; Kumar, D. Lane Detection Techniques: A Review. Int. J. Comput. Appl. 2015, 112, 975–8887. 13. Zhao, R.; Qin, D.; Chen, B.; Wang, T.; Wu, H. Thermal Management of Fuel Cells Based on Diploid Genetic Algorithm and Fuzzy PID. Appl. Sci. 2022, 13, 520. [CrossRef] 14. Wu, G.; Luo, W.; Guo, J.; Zhang, J. A Sigmoid-plane adaptive control algorithm for unmanned surface vessel considering marine environment interference. Trans. Inst. Meas. Control. 2022, 44, 2076–2090. [CrossRef] 15. Hagler, J.C.; Lamb, D.J.; Tian, Q. Towards Greener Solutions for Steering Angle Prediction. arXiv 2022, arXiv:2211.11133. 16. Matute, J.A.; Marcano, M.; Diaz, S.; Perez, J. Experimental Validation of a Kinematic Bicycle Model Predictive Control with Lateral Acceleration Consideration. IFAC Pap. OnLine 2019, 52, 289–294. [CrossRef] 17. Kanchwala, H.; Viana, I.B.; Aouf, N. Cooperative path-planning and tracking controller evaluation using vehicle models of varying complexities. Proc. Inst. Mech. Eng. Part C J. Mech. Eng. Sci. 2020, 235, 2877–2896. [CrossRef] 18. Pereira, G.C. Lateral Model Predictive Control for Autonomous Heavy-Duty Vehicles: Sensor, Actuator, and Reference Uncertain- ties. Doctoral Dissertation, KTH Royal Institute of Technology, Stockholm, Sweden, 2020. 19. Alfred, C.F.R.; Wicks, L.; Chair; John; Ferris, B.; Dennis; Hong, W.; Samuel; Kherat, M. A Method for Modeling and Prediction of Ground Vehicle Dynamics and Stability in Autonomous Systems. Ph.D. Dissertation, Virginia Tech, Blacksburg, VA, USA, 2011. 20. Betz, J.; Wischnewski, A.; Heilmeier, A.; Nobis, F.; Stahl, T.; Hermansdorfer, L.; Lohmann, B.; Lienkamp, M. What can we learn from autonomous level-5 motorsport? In 9th International Munich Chassis Symposium 2018: Chassis. Tech Plus; Springer: Wiesbaden, Germany, 2018; pp. 123–146. [CrossRef] 21. Bachiller-Burgos, P.; Manso, L.J.; Bustos, P. A variant of the Hough Transform for the combined detection of corners, segments, and polylines. EURASIP J. Image Video Process. 2017, 2017, 2027. [CrossRef] 22. Rokonuzzaman, M.; Mohajer, N.; Nahavandi, S.; Mohamed, S. Review and performance evaluation of path tracking controllers of autonomous vehicles. IET Intell. Transp. Syst. 2021, 15, 646–670. [CrossRef] 23. Cheein, F.A.A.; Cruz, C.; Bastos, T.F.; Carelli, R. SLAM-based Cross-a-Door Solution Approach for a Robotic Wheelchair. Int. J. Adv. Robot. Syst. 2010, 7, 155–164. [CrossRef] 24. Lenain, R.; Thuilot, B.; Cariou, C.; Martinet, P. Model Predictive Control for vehicle guidance in presence of sliding: Application to farm vehicles’ path tracking. In Proceedings of the 2005 IEEE International Conference on Robotics and Automation, Barcelona, Spain, 18–22 April 2005; pp. 885–890. 25. Wang, W.; Kenzo, N.; Yuta, O. Model Reference Sliding Mode Control of Small Helicopter, X.R.B based on Vision. Int. J. Adv. Robot. Syst. 2016, 5, 233–242. [CrossRef] 26. Zhao, Z.-Y.; Tomizuka, M.; Isaka, S. Fuzzy gain scheduling of PID controllers. IEEE Trans. Syst. Man Cybern. 1993, 23, 1392–1398. [CrossRef] 27. Han, S.-Y.; Dong, J.-F.; Zhou, J.; Chen, Y.-H. Adaptive Fuzzy PID Control Strategy for Vehicle Active Suspension Based on Road Evaluation. Electronics 2022, 11, 921. [CrossRef] Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.