ISTANBUL TECHNICAL UNIVERSITY  GRADUATE SCHOOL M.Sc. THESIS JANUARY 2024 VIABILITY OF DIFFERENTIAL BRAKING BASED STEERING REDUNDANCY FOR AN AUTONOMOUS VEHICLE Dorukhan TOKAY Department of Mechanical Engineering Automotive Programme Department of Mechanical Engineering Automotive Programme January 2024 ISTANBUL TECHNICAL UNIVERSITY  GRADUATE SCHOOL VIABILITY OF DIFFERENTIAL BRAKING BASED STEERING REDUNDANCY FOR AN AUTONOMOUS VEHICLE M.Sc. THESIS Dorukhan TOKAY 503201709 Thesis Advisor: Prof. Dr. Özgen AKALIN Makina Mühendisliği Anabilim Dalı Otomotiv Programı Ocak 2024 ISTANBUL TEKNİK ÜNİVERSİTESİ  LİSANSÜSTÜ EĞİTİM ENSTİTÜSÜ OTONOM BİR ARAÇ İÇİN DİFERANSİYEL FRENLEME TABANLI DİREKSİYON YEDEKLİLİĞİNİN UYGULANABİLİRLİĞİ YÜKSEK LİSANS TEZİ Dorukhan TOKAY 503201709 Tez Danışmanı: Prof. Dr. Özgen AKALIN v Thesis Advisor : Prof. Dr. Özgen AKALIN .............................. İstanbul Technical University Jury Members : Prof. Dr. Muammer ÖZKAN ............................. Yıldız Technical University Assoc. Prof. Dr. Osman Taha ŞEN .............................. İstanbul Technical University Dorukhan Tokay, a M.Sc. student of İTU Graduate School student ID 503201709, successfully defended the thesis/dissertation entitled “VIABILITY OF DIFFERENTIAL BRAKING BASED STEERING REDUNDANCY FOR AN AUTONOMOUS VEHICLE”, which he/she prepared after fulfilling the requirements specified in the associated legislations, before the jury whose signatures are below. Date of Submission : 24 December 2023 Date of Defense : 17 January 2024 vi vii To future, viii ix FOREWORD I would like to express my gratitude to my advisor, Prof. Dr. Özgen AKALIN for sharing his knowledge and experience and guiding me in all circumstances in my graduate education. The multi-body-dynamics model of the FED-Alpha vehicle was provided by MSC Software and validated as a part of “AVT-308 Cooperative Demonstration of Technology (CDT) for Next-Generation NATO Reference Mobility Model (NG- NRMM)” research task group effort. ADAMS Car academic licenses and technical support provided by Hexagon AB and BİAS Mühendislik are gratefully acknowledged. I would like to thank my mother and father for staying with me and providing support in every difficulty I have faced throughout my life. I would like to thank my girlfriend, who is also my best and only friend, for all her love and for being the light that brightens up my life. December 2023 Dorukhan TOKAY Mechanical Engineer x xi TABLE OF CONTENTS Page FOREWORD ............................................................................................................. ix TABLE OF CONTENTS .......................................................................................... xi ABBREVIATIONS ................................................................................................. xiii SYMBOLS ................................................................................................................ xv LIST OF TABLES ................................................................................................. xvii LIST OF FIGURES ................................................................................................ xix SUMMARY ............................................................................................................. xxi ÖZET ........................................................................................................... xxiiiii INTRODUCTION .................................................................................................. 1 Purpose of Thesis ............................................................................................... 1 Literature Review ............................................................................................... 1 Hypothesis .......................................................................................................... 2 METHODOLOGY ................................................................................................. 3 Scenario .............................................................................................................. 3 Controller ........................................................................................................... 5 Particle Swarm Optimization ............................................................................. 6 Wheel Slip Control ............................................................................................. 8 Co-Simulation Scheme ..................................................................................... 10 Front Wheel Geometry ..................................................................................... 11 RESULT AND DISCUSSION ............................................................................. 15 High Speed Simulations ................................................................................... 15 Low Speed Simulations .................................................................................... 17 The Effect of Front Wheel Geometry .............................................................. 18 CONCLUSION AND FUTURE WORK ........................................................... 21 REFERENCES ......................................................................................................... 23 APPENDICES .......................................................................................................... 27 APPENDIX A ........................................................................................................ 28 APPENDIX B ........................................................................................................ 30 APPENDIX C ........................................................................................................ 30 APPENDIX D ........................................................................................................ 30 APPENDIX E ......................................................................................................... 33 CURRICULUM VITAE .......................................................................................... 37 xii xiii ABBREVIATIONS ECS : Electronic Stability Control EPAS : Electronic Power Assisted Steering HPAS : Hydraulic Power Assisted Steering DoF : Degree of Freedom MPC : Model Predictive Control DLC : Double Lane Change PSO : Particle Swarm Optimization FED-Alpha : Fuel Efficiency Demonstrator Alpha xiv xv SYMBOLS Ψ : Yaw (heading) angle Kp, Ki, Kd : Proportional, integral, and derivate gains w : Weight c1, c2 : Cognitive and social parameters χ : Constriction factor s : Longitudinal slip σ : King pin inclination angle rσ : Scrub radius εw : Camber angle τ : Caster angle rdyn : Dynamic wheel radius xvi xvii LIST OF TABLES Page Vehicle parameters. ................................................................................. 10 xviii xix LIST OF FIGURES Page NATO DLC test boundaries. ................................................................... 3 Lateral offset and longitudinal distance. ................................................. 4 Figure 2.3 : Reference trajectory and yaw angle. ....................................................... 4 Figure 2.4 : PID controller flow. ................................................................................. 6 Figure 2.5 : Controller margin of pseudo-ABS. ......................................................... 9 Figure 2.6 : Co-simulation flow. ............................................................................... 10 Figure 2.7 : FED-Alpha vehicle on ADAMS Car test course. .................................. 11 Figure 2.8 : Front wheel geometry. ........................................................................... 12 Figure 2.9 : FED-Alpha front wheel geometry. ........................................................ 13 Figure 3.1 : High speed trajectory and plant input. ................................................... 15 Figure 3.1 : High speed reference and actual yaw angle. ......................................... 16 Figure 3.2 : High speed longitudinal characteristics. ................................................ 16 Figure 3.3 : Low speed trajectory and plant input. ................................................... 17 Figure 3.4 : Low speed reference and actual yaw angle. .......................................... 18 Figure 3.5 : Low speed longitudinal characteristics. ................................................ 18 Figure 3.6 : Effect of scrub radius on cost function. ................................................. 19 Figure 3.7 : Effect of scrub radius on trajectory following. ...................................... 20 Figure A.1 : Simulink controller. .............................................................................. 28 Figure A.2 : Controller model. .................................................................................. 29 xx xxi VIABILITY OF DIFFERENTIAL BRAKING BASED STEERING REDUNDANCY FOR AN AUTONOMOUS VEHICLE SUMMARY The exploration of differential braking as an alternative steering method for autonomous vehicles is a pivotal theme of this research, particularly in the context of steering system failure. Differential braking, which applies varying braking forces to the wheels, has been integral to enhancing vehicle stability and maneuverability in systems like Electronic Stability Control and Differential Braking Assisted Steering. This thesis underscores the importance of redundant systems in autonomous vehicles, given the rapid advancements in autonomous driving technologies and the inherent risks of steering system failures, especially at high speeds. Differential braking emerges as a promising safety net in such critical situations. The historical progression of differential braking is examined, from its initial role in cornering stability to its integration with advanced control strategies that enable sophisticated vehicle control tasks. The technology has evolved significantly, now being combined with active steering systems to improve vehicle handling. The research methodology involves assessing differential braking as an emergency steering system through double lane change maneuvers based on NATO standard. A reference trajectory is generated for the vehicle, and two PID controllers are optimized to minimize trajectory and yaw angle deviations. The optimization process uses a heuristic algorithm inspired by natural swarms, Particle Swarm Optimization, which iteratively updates to find the optimal solution. The algorithm's parameters are carefully chosen to ensure stability and convergence, with the optimization process tailored to reduce computation time. A pseudo-ABS system is introduced to manage wheel slip during intense braking, ensuring optimal braking performance and preventing loss of traction. The system adjusts braking force based on longitudinal slip, with control margins customized to the tire and ground characteristics. A co-simulation approach is employed, integrating a high-fidelity vehicle model with the controller, to evaluate the system. The simulations are conducted at different vehicle speeds, with the optimized controller gains derived from the higher speed. The vehicle model used is well-documented and validated, ensuring the reliability of the simulation results. The findings reveal that at higher speeds, the vehicle can successfully navigate the maneuver within the course boundaries, though with some response lag. The pseudo- ABS system effectively controls longitudinal slip, maintaining tire traction. At lower speeds, the vehicle performs the maneuver with minimal delay, but the gains tuned for higher speeds may be too aggressive, indicating the need for speed-dependent tuning. The impact of front wheel geometry on differential braking performance is also explored, with the scrub radius identified as a critical suspension parameter. Simulations with varying scrub radii show that there is a threshold below which the necessary steering torque for successful maneuvers is not produced. While larger scrub radii improve differential braking effectiveness, they are not typically preferred for road vehicles due to the negative implications for steering effort, tire wear, and road xxii feel. The study concludes that the default scrub radius offers an optimal balance, allowing the vehicle to follow the reference path with minimal steering wheel oscillations. In conclusion, the research confirms the viability of differential braking as a redundant steering system for autonomous vehicles, as demonstrated by successful simulations of obstacle avoidance maneuvers. The simple yet effective PID controllers could be further enhanced by optimizing control parameters for specific vehicle speeds. The significant influence of front wheel geometry, particularly the scrub radius, on the success of differential steering is highlighted, with an optimal radius being necessary to generate sufficient steering torque while minimizing unwanted steering vibrations. The potential of differential steering as a reliable redundant steering system is underscored, with future work aimed at leveraging predictive model-based control systems to refine such systems in autonomous vehicles. xxiii OTONOM BİR ARAÇ İÇİN DİFERANSİYEL FRENLEME TABANLI DİREKSİYON YEDEKLİLİĞİNİN UYGULANABİLİRLİĞİ ÖZET Bu tezin merkezi teması, direksiyon sistemlerinin arıza yapması durumlarında, otonom araçlar için alternatif bir direksiyon yöntemi olarak diferansiyel frenlemenin keşfidir. Diferansiyel frenleme, tekerleklere farklı frenleme kuvvetleri uygulanmasını içerir ve Araç Stabilite Kontrolü (ESC) ve Diferansiyel Fren Destekli Direksiyon (DBAS) gibi sistemlerin temeli olmakla birlikte, araç stabilitesini ve manevra kabiliyetini artırır. Giriş bölümü, otonom sürüş teknolojilerinin hızlı ilerlemesi ve özellikle yüksek hızlarda direksiyon sistemlerinin arızalanmasıyla ilişkili potansiyel riskler nedeniyle otonom araçlarda yedek sistemlerin artan önemini vurgular. Diferansiyel frenleme, bu tür kritik durumlarda kullanılabilecek bir yedek direksiyon sistemi olarak tanımlanmıştır. Literatür araştırmasında, diferansiyel frenlemenin viraj stabilitesini iyileştirmede ilk kullanımından, çarpışma önleme ve şerit koruma gibi karmaşık araç kontrol görevlerini kolaylaştıran Model Öngörülü Kontrol (MPC) ve bulanık mantık gibi gelişmiş kontrol stratejileriyle entegrasyonuna kadar olan evrimi izlenir. Teknoloji, Nissan Maxima gibi araçlardaki ilk uygulamalarından, araç kullanımını geliştirmek için aktif direksiyon sistemleriyle birleştirilen sofistike uygulamalara kadar ilerlemiştir. Metodoloji bölümü, bir NATO standardına dayanan çift şerit değiştirme (DLC) manevrası aracılığıyla diferansiyel frenlemenin acil bir direksiyon sistemi olarak değerlendirilmesini tanımlar. Otonom aracın DLC manevrası sırasında referans bir yol çizgisi oluşturmak için Sabit Hız Dengesi Artı Sinüs modeli seçilmiştir. Parçacık Sürü Optimizasyonu (PSO) ile optimize edilmiş iki PID kontrolcüsü, yol yörüngesi ve yalpa açısındaki sapmaları en aza indirmek için uygulanmıştır. PID kontrolcüerinin kazançları, kuş sürülerinin doğal davranışlarından esinlenen bir optimizasyon algoritması olan PSO ile ayarlanmıştır. PSO, arama alanındaki parçacıkların pozisyonlarını ve hızlarını iteratif olarak güncelleyerek en iyi çözümü bulur; bu süreç, bir bedel fonksiyonunun değerlendirilmesini, mevcut ve önceki en iyi değerlerin karşılaştırılmasını ve genel minimum bedelin belirlenmesini içerir. Hızlar ve pozisyonlar belirli denklemler kullanılarak hesaplanır; atalet ağırlığı, bilişsel ve sosyal parametreler gibi hiperparametreler ve sistem stabilitesini ve yakınsamayı sağlayan bir kısıtlama faktörü içerir. Bu araştırmada, PSO hesaplama süresini azaltmak için yalnızca yan pozisyon PID kontrolcüsünün oransal kazancını optimize etmek üzere basitleştirilmiştir; integral ve türev kazançlar yalpa açısı PID kontrolöründen enterpolasyonla alınmıştır. Negatif PID kazançları bedel değerleri sonsuza eşitlenerek dışlanmış ve bedel fonksiyonu mutlak hata integralinin bir varyasyonuna dayandırılmıştır. Yoğun frenleme sırasında tekerlek kaymasını yönetmek için bir pseudo-ABS sistemi tanıtılmıştır, bu sistem optimal frenleme performansını sağlar ve çekiş kaybını önler. xxiv Pseudo-ABS sistemi, uzunlamasına kaymayı kontrol etmek için frenleme kuvvetini ayarlamak üzere algoritmik koşullu ifadeler üzerinde çalışır; kontrol marjları lastik ve zemin özelliklerine göre özelleştirilmiştir. Sistem değerlendirmesi için, yüksek doğruluklu bir araç modeli ADAMS Car ile Simulink'teki kontrolcünün entegre edildiği bir ko-simülasyon yaklaşımı kullanılmıştır. Bu ko-simülasyon şemasında, ADAMS Car aracın bir sonraki durumunu simüle eder ve uzunlamasına ve yan pozisyonu, yalpa açısını Simulink'e gönderir; Simulink daha sonra her iki taraf için fren yüzdesini hesaplar ve bunu ADAMS Car'a geri gönderir. Simülasyonlar için işleme frekansı 100 Hz olarak ayarlanmıştır ve simülasyonlar 35 km/s ve 60 km/s araç hızlarında gerçekleştirilmiştir. Simülasyonlar, ADAMS Car'da tipik kuru asfalt için 0.8 olarak seçilmiş yol adhezyon katsayısına sahip varsayılan düz bir yol kullanır. ADAMS Car'daki hız kontrolcüsü, aracın frenleme nedeniyle doğal olarak hız kaybetmesine rağmen belirtilen hızı korur. Simülasyonlar için kullanılan araç modeli, önemli teknik verilere ve doğrulanmış bir ADAMS Car modeline sahip FED Alpha’dır. Sonuçlar, daha yüksek hızlarda, aracın pist sınırları içinde DLC manevrasını başarıyla gerçekleştirebildiğini, ancak yanıtta bir gecikme olduğunu gösterir. Pseudo-ABS sistemi, uzunlamasına kaymayı etkili bir şekilde kontrol eder, lastik çekişini korur. Araç, düşük hızlarda DLC manevrasını hızlı bir şekilde gerçekleştirirken, yüksek hızlarda oransal kazanç fazla agresif olabilir, bu da hız bağımlı ayarlamaların önemini vurgular. Pseudo-ABS sistemi, lastiklerin tutunmasını sağlayarak uzunlamasına kaymayı etkili bir şekilde kontrol eder. 35 km/s hızda araç, gecikmesiz bir şekilde DLC manevrasını tamamlar, ancak yüksek hız için ayarlanmış oransal kazanç bu durumda fazla olabilir. Ön tekerlek geometrisinin, diferansiyel frenleme performansı üzerindeki etkisini inceleyen bu araştırma, scrub radiusun kritik rolünü vurgulamaktadır. Scrub radius, king pin eğimi (KPI) ekseni ile yer seviyesindeki tekerlek düzlemi arasındaki yan ofset olarak tanımlanır ve direksiyon sistemi üzerindeki kuvvetlerin moment kolunu temsil eder. Simülasyon sonuçları, scrub radiusun belirli bir eşik değerin altında kaldığında, yeterli direksiyon torku üretilemediğini ve bu durumun başarılı direksiyon manevralarını engellediğini ortaya koymaktadır. Diğer yandan, aşırı büyük scrub radius değerleri, artan direksiyon çabası, hızlı lastik aşınması ve azalan yol hissi gibi olumsuz etkilere yol açmaktadır. Ayrıca, düzensiz yüzeylerde direksiyon titreşimlerine ve beklenmedik direksiyon hareketlerine neden olabilir, bu da sürüş güvenliği ve konforu açısından ciddi bir tasarım zorluğu oluşturur. Bu nedenle, araştırma, diferansiyel frenleme kontrolü ve direksiyon titreşimleri arasında optimal bir denge sağlayan ve engel kaçınma manevralarını yönlendirmek için yeterli direksiyon torku üreten bir scrub radius değerinin belirlenmesinin önemini vurgulamaktadır. Araştırma ayrıca, PID kontrolörlerinin basit yapısına rağmen, manevraları yüksek hızlarda başarıyla tamamlayabildiğini ve aracın hızına özgü kontrol parametrelerinin optimize edilmesiyle performanslarının daha da geliştirilebileceğini göstermektedir. Bu bulgular, diferansiyel direksiyonun, uygun tasarım ve kontrol parametreleri ile otonom araçlarda güvenilir bir yedek direksiyon sistemi olarak hizmet edebileceğini ortaya koymaktadır. xxv Sonuç olarak, bu çalışma, diferansiyel frenlemenin otonom araçlar için güvenilir bir yedek direksiyon sistemi olarak uygulanabilirliğini yüksek doğruluklu çoklu gövde dinamikleri simülasyonları ile desteklemektedir. Gelecekteki araştırmaların, bu tür sistemlerin geliştirilmesi için model tabanlı kontrol sistemlerinin tahmin yeteneklerinden yararlanmayı hedeflemesi beklenmektedir. Bu yaklaşım, otonom araçların güvenliğini ve güvenilirliğini artırmada önemli bir adım olabilir. xxvi 1 INTRODUCTION Purpose of Thesis As the development on autonomous driving technologies progress further and customer interest for autonomous vehicles rises, research on the redundancy for safety- critical systems gets even more important. One such example is steering, in which a high-speed vehicle with a failure in the steering system could risk human lives. Differential braking has a significant potential to be used as a redundant steering system in case of main steering system failure. Literature Review Differential braking is performed by applying different braking torques to the opposite wheels which causes a force imbalance that produces a yaw moment [1]. In addition to this, unbalanced longitudinal forces along with the effect of scrub radius, travel to the steering linkage and induce a torque on the steering system [2]. It has many other uses which can be encountered in systems such as Electronic Stability Control (ECS), Differential Braking Assisted Steering (DBAS), Electronic and Hydraulic Assisted Steering (EPAS/HPAS) [2]. First uses of differential braking in the literature were aimed to increase handling performance during cornering, employed independent brake fluid pressure control and Anti-Lock-Braking System (ABS), resulted in more stable maneuvers and the final system was implemented in Nissan Maxima [3]. Another work, with the goal of performing limited steering functions such as anti-road departure and collision avoidance, used a simple 2 degree of freedom (DoF) bicycle model with a PD controller found that the brake steer system responded fast enough to deliver intervention maneuvers in certain situations [4]. In more recent studies, differential braking in combination with active steering is used more frequently. One such example that is closely related to aforementioned work is trying to achieve evasive steering maneuvers, however with active steering 2 and differential braking as a backup [5]. A different study also uses both methods; however, the main objective is to track a predefined path with Model Predictive Control (MPC) [6]. Another work assesses differential braking’s effectiveness of stabilizing vehicles after a flick maneuver on an icy road using MPC based on a 2 DoF bicycle model with active steering in use [7]. A separate study also uses a combination of active steering and differential braking, although via a fuzzy controller based on an 8 DoF vehicle model with the goal of assessing the effect on directional stability through flick maneuver and lane change simulations [8]. Differential braking as a means of an assistance system still continues to being researched. As one example, differential braking on its own is used as a lane-keeping assistance system using a custom control algorithm based on the remaining distance to lane crossing [9]. A work that combines active steering to achieve previous work’s goal also exists [10]. A different paper tries to avoid collisions during lane change maneuvers by utilizing differential braking using sliding mode control and backstepping strategies [11]. There also exists a comparable work to this paper with the main target of trying to provide redundant steering in EPAS failure situations while also investigating the effects of scrub radius to differential braking effectiveness [12]. Hypothesis In this work, the efficacy of differential braking as a means of redundant steering system is analyzed by using double lane change (DLC) maneuvers performed solely with differential braking. A reference trajectory of the vehicle is precomputed using “Constant Velocity Offset Plus Sine Lane Change” model and vehicle’s yaw angle and lateral position are controlled by two PID controllers with gains tuned with Particle Swarm Optimization (PSO) method. Two PID controllers are utilized to minimize the error between reference lateral position, yaw angle and system outputs providing a simple and efficient control strategy which require less computational burden compared to the state-of-the-art control techniques, enabling the use of real time or faster than real time applications. 3 METHODOLOGY Scenario Double lane change is one of the most frequently used tests to benchmark a vehicle’s lateral stability [13]. Described by the standard ISO 3888-1, it is composed of a track of two lanes made by pylons. The target is to complete the maneuver without hitting any of the pylons or tire lift-off, where higher speed maneuvers indicate better vehicle handling. The driver aims to complete the avoidance maneuver at the fastest speed possible through the test course while keeping the vehicle’s speed as steady as possible. Since the selected vehicle is a military vehicle, NATO version of the DLC layout described in NATO’s Allied Vehicle Testing Publication AVTP 03-160 W [14] was adopted in this work allowing a large variation of military vehicles to be tested as shown in Figure 2.1. NATO DLC test boundaries. NATO double-lane-change maneuver is selected as an obstacle avoidance scenario so that efficacy of differential braking as a steering redundancy can be tested in extreme handling limits. In a typical DLC test, the driver is free to choose any path to complete the test. In order to generate a reference trajectory of the maneuver, different lane change models such as Sigmoid function [15], Constant Velocity Offset Plus Sine model [16] and Hyperbolic Tangent function [17] are used in the literature. Because of its simplicity and higher correlation with the real-world lane change test results, Constant Velocity Offset Plus Sine model was selected to define the target path to be used in closed loop 4 controller. Based on this model, the trajectory with respect to the longitudinal coordinate can be given in Equation 2.1. 𝑦(𝑥) = 𝑑𝑤 2𝜋 [ 2𝜋𝑥 𝑙𝑤 − 𝑠𝑖𝑛⁡( 2𝜋𝑥 𝑙𝑤 )] (2.1) Where dw is the lateral offset and lw is the longitudinal distance of the lane change maneuver as shown in Figure 2.2. This formula was applied to both of the lane changes in a DLC maneuver, 2nd one being inverted. Reference yaw angle can be obtained from Equation 2.2. 𝛹(𝑥) = 𝑎𝑟𝑐𝑡𝑎𝑛(𝑦′(𝑥)) (2.2) The graphs of resulting reference trajectory and yaw angle can be seen in Figure 2.3. Lateral offset and longitudinal distance. Reference trajectory and yaw angle. 5 Controller PID control is the most commonly used control technique utilized, accounting for more than half of the industrial controllers used today because of its general applicability to most control systems [18]. The name, PID, comes from the controlling technique employed with proportional, integral, and derivative parameters which act on the error of the output of the system with respect to a reference value to calculate the optimal input to the system. The error is calculated as in Equation 2.3. 𝑒(𝑡) = 𝑦𝑟𝑒𝑓(𝑡) − 𝑦𝑎𝑐𝑡𝑢𝑎𝑙(𝑡) (2.3) Using this, the main equation of a PID controller which calculates what to input to the controlled system is obtained from Equation 2.4. 𝑢(𝑡) = 𝐾𝑝𝑒(𝑡) + 𝐾𝑖∫ 𝑒(𝑡)𝑑𝑡 𝜏 0 + 𝐾𝑑 𝑑𝑒(𝑡) 𝑑𝑡 (2.4) Where Kp, Ki and Kd are proportional, integral, and derivative gains respectively. The choice of these parameters depends on the dynamics of the system and affects the performance of the response produced by the PID controller. The proportional gain mainly affects the response time of the system by being multiplied by the error. However, the response of the system includes a steady state error with just the proportional gain set. To eliminate this, integral gain is adopted. The integral gain accumulates past errors and drives the steady state error down. Derivative gain is employed to predict system behavior from past values and improve settling time and response stability [19]. There exist several different tuning techniques to find optimal gains for a PID controlled system. These include such as manual hand tuning and Ziegler-Nichols. Manual tuning consists of observing how the response of the system changes with respect to changing controller gains and requires experience. Ziegler-Nichols on the other hand is algorithmic and easier to apply. In addition to these, optimization techniques such as PSO can be used, which is the case for this work. This study employs 2 PID controllers for two generated reference inputs, being vehicle’s lateral position and yaw angle. For the vehicle’s perspective, controlled parameters are from the front axle. This ensures that the vehicle starts turning as soon 6 as the lane transition begins. Look-up tables for reference inputs were constructed based on the vehicle’s longitudinal position to articulate reference signals to be sent to the PID controllers. Outputs from the PID controllers are summed and the result is sent to a filter with an upper saturation limit of 100 since the brake force is expected as a percentage of the maximum brake force that the brake system can provide. The decision on which side, left or right brakes to be applied can be determined from the sign of the final error. Considering the singular case, for example, the lateral position controller, if the error is positive, meaning that the vehicle is on the right side of the tracking point looking from behind of the vehicle, left brakes must be applied to turn the vehicle towards the reference trajectory. A similar case exists for the yaw angle controller. The controller itself is designed in Simulink environment. A simplified block diagram is illustrated in Figure 2.4. PID controller flow. Particle Swarm Optimization The gains of the PID controllers were tuned with PSO. Inspired by the natural behavior of swarms such as bird flocks, PSO is the predominant optimization algorithm used when searching for optimal PID gains [20]. PSO works iteratively over generations of swarms, with the first-generation having positions given by the user. Each position coordinate is considered to be a parameter in the optimization space. These positions have velocity components, used to move particles towards the optimal solution, which are calculated using the global and current generation’s best solution so far, together with some adjustment parameters specific to PSO. Comparison between the solutions is articulated via a cost function. PSO employs the following list of heuristic procedures: 7 1. Initialize the positions and velocities of the first-generation swarm. 2. Evaluate the cost function on each particle. 3. Compare the current cost to particle’s previous best value. If current cost is less than previous best value, update best positions and cost for this particle. 4. Determine the global minimum cost across the generation of particles. 5. Update each particle’s velocities and positions based on particle with global minimum cost and hyperparameters. 6. Repeat steps 2 to 5 until an acceptable solution is found or maximum number of iterations is reached. Velocities and positions based on these velocities are calculated using Equation 2.5 and 2.6. 𝑣𝑖𝑗 𝑘+1 = 𝜒(𝑤𝑣𝑖𝑗 𝑘 + 𝑐1𝑟1(𝑝𝑏𝑒𝑠𝑡𝑖𝑗 − 𝑥𝑖𝑗 𝑘 ) + 𝑐2𝑟2(𝑔𝑏𝑒𝑠𝑡𝑖𝑗 − 𝑥𝑖𝑗 𝑘 )) (2.5) 𝑥𝑖𝑗 𝑘+1 = 𝑥𝑖𝑗 𝑘 + 𝑣𝑖𝑗 𝑘+1 (2.6) Where i and j are particle and parameter indexes respectively, k is the iteration number, x is the position, v is the velocity, pbest and gbest are the minimum cost states for each individual and globally, respectively, r1 and r2 are uniformly sampled random numbers in the range of [0, 1]. The algorithm also employs some hyperparameters. w is called inertial weight and, in general, decreases linearly as iterations progress. c1 and c2 are called cognitive and social parameters respectively and control the acceleration towards minimum cost particles. χ is called the constriction factor and is calculated in Equation 2.7 and 2.8. 𝜑 = 𝑐1 + 𝑐2 (2.7) 𝜒 = 2 |2 − 𝜑 − √𝜑2 − 4𝜑| (2.8) Constriction factor is used for system’s stability and convergence. This can be ensured by selecting χ as in Equation 2.9 and 2.10 [21]. 8 𝑤𝑚𝑎𝑥 𝑐𝑜𝑛𝑣 = { 1, 𝑤 𝜑 < 1 4 ⁡⁡⁡⁡⁡⁡⁡ 2𝑤 𝜑0 − 2𝑤 , 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒 ⁡ (2.9) 0 < 𝜒 < 𝑤𝑚𝑎𝑥 𝑐𝑜𝑛𝑣 𝑤 (2.10) The original PSO equations do not contain weight or constriction factors. This form is called Original PSO. The form with inertial weight is commonly referred to as Classical PSO whereas the form with constriction factor is named Constricted Original PSO. The use of combination of these hyperparameters is referred to as Constricted Classical PSO, which is the kind of PSO employed in this research. In this work, instead of having 6 parameters, 3 for each PID controller, being proportional, integral, and derivative gains, PSO was instructed to just find the proportional gain of the lateral position PID controller to reduce computation time as 6 parameter search was not feasible. Integral and derivative gains were linearly interpolated from the yaw angle PID controller. The cost of individuals with negative PID gains were equated to infinity to discard them. The cost function was selected as a variation of integral of absolute error (IAE) with positional integrator instead of time because of the simulations with different speeds to be not dependent on the time taken of the maneuver as can be observed from Equation 2.11. 𝑓 = ∫ |𝑒(𝑥)|𝑑𝑥 𝑥𝑒 𝑥𝑠 = ∫ |𝑦𝑟𝑒𝑓(𝑥) − 𝑦𝑎𝑐𝑡(𝑥)|𝑑𝑥 𝑥𝑒 𝑥𝑠 (2.11) Wheel Slip Control Controlling wheel slip is a crucial task in hard braking scenarios as tires lose grip with longitudinal slip reaching 0, thus losing the braking force. Systems such as ABS are implemented to release hydraulic pressure in the braking system to prevent this scenario. In this work, a pseudo-ABS is implemented to ensure proper braking force acts on the vehicle in the event of turning, since the high-speed case considered is very close to the actual handling limits of the vehicle (65 km/h), thus requiring hard braking scenarios. The controller works in the following heuristic conditional statements [22]: 9 • If longitudinal slip is less than sABS(1+m), the braking force is reduced to zero. 𝐹𝑏𝑟 𝐴𝐵𝑆 = 0 (2.12) • If longitudinal slip is in the range of [sABS(1+m), sABS(1-m)], the braking force is calculated using a simple linear relationship. 𝐹𝑏𝑟 𝐴𝐵𝑆 = 𝐹𝑏𝑟 2𝑥 (− 𝑠 𝑠𝐴𝐵𝑆 + 1 +𝑚) (2.13) • If longitudinal slip is in the range of [sABS(1-m), 0], the braking force can be forwarded as it is. 𝐹𝑏𝑟 𝐴𝐵𝑆 = 𝐹𝑏𝑟 (2.14) Where Fbr ABS represents the final braking output, s is the longitudinal slip, sABS and m represent longitudinal slip regulation value and regulation margin, respectively. The selection of sABS and x depends on tire and ground characteristics, specifically longitudinal characteristics representing longitudinal force and slip. The control margins of the developed pseudo-ABS can be examined in Figure 2.5. Controller margin of pseudo-ABS. 10 Co-Simulation Scheme In addition to the controller in Simulink, vehicle dynamics calculations were performed using a high-fidelity vehicle model in ADAMS Car, in a co-simulation scheme. In each timestep, ADAMS Car first simulates vehicle’s next state from its current state and sends the longitudinal and lateral position, and yaw angle of the vehicle to Simulink. Then, Simulink controller articulates each side’s braking percentage and sends it as an input back to ADAMS Car. A simple diagram of the co- simulation scheme can be viewed in Figure 2.6. Co-simulation flow. The output sampling rate of each simulation was set to 100 Hz. Automatic solver was used for Simulink, whereas HHT integrator with integration tolerance of 2E-5 and maximum timestep of 1E-2 was used for ADAMS Car. Simulations were done with vehicle speeds of 35 km/h and 60 km/h, with optimized PID gains being from the latter one. The default flat road of ADAMS Car with a modified coefficient of road adhesion of 0.8 was used, which is a typical number for a dry asphalt road [23]. The vehicle naturally loses speed due to braking, however the speed controller in ADAMS Car was instructed to maintain the declared speed. ADAMS Car uses a PID controller for the aforementioned task and allows the gains to be modified which can be tweaked to make speed transitions smoother, however they were left on default for this application. A set of vehicle parameters can be examined in Table 2.1. Vehicle parameters. Item Value Unit Vehicle weight 53768 N Front axle load 51.8 % 11 Wheelbase 3202 mm Front track width 1953 mm Caster angle 1.98 deg Kingpin inclination angle 11.5 deg Default scrub radius 55.3 mm Fuel Efficiency Demonstrator Alpha (FED-Alpha) was selected as a vehicle model since it had considerable technical data and validated ADAMS Car model available [24]. PAC 2002 tire model for 60 psi inflation pressure is used in all simulations. Multi-body-dynamics model of FED-Alpha in ADAMS Car Simulation environment is shown in Figure 2.7. FED-Alpha vehicle on ADAMS Car test course. Front Wheel Geometry Scrub radius is the most crucial suspension parameter regarding the effectiveness of differential braking. It is known as the lateral distance between kingpin inclination (KPI) axis and wheel plane at ground as shown in Figure 2.8 [25]. Scrub radius is affected by various suspension parameters such as camber angle, KPI angle and kingpin offset. However, since changing camber or KPI angle would also affect the dynamics of the suspension, it has been decided to vary scrub radius via changing kingpin offset so that parameters such as track-width, camber angle and KPI angle are maintained in the design settings. Kingpin offset is the lateral distance between wheel 12 center line and KPI axis at wheel center axis, that is why scrub radius is also referred to as kingpin offset at ground [26]. Front wheel geometry. Scrub radius functions as a moment arm for forces on the tire that acts on the steering system. If these forces are different on left and right sides, a net steering torque is induced on the steering linkage proportional to force imbalance and scrub radius [26]. Since differential braking is applied via the concept mentioned before, the larger the scrub radius, the more effective it is, in theory. For road vehicles small scrub radius values are not desirable since this increases the required steering effort, causes high tire wear and results in lack of road feel. In normal driving situations, high scrub radius values are not desirable either, since this may cause extreme steering vibrations that can be felt by the driver and may cause unexpected steering wheel rotations on uneven roads. This poses a design challenge as scrub radius’ effect on differential braking and aforementioned effect are contradictory. FED-Alpha uses a double wishbone type of suspension. The modification of varying the kingpin offset can be done by offsetting the upper and lower ball joint positions with the same amount in a double wishbone suspension. Mathematical formulas can be developed to show the relationship between scrub radius and the effectiveness of differential braking. The yaw moment induced on the vehicle will be based on the difference of longitudinal forces multiplied by half of the track width as can be observed by Equation 2.15. The scrub radius has no net effect on the induced total yaw moment. 13 𝑀Ψ = 0.5𝑇(𝐹𝑏𝑟 𝑙 − 𝐹𝑏𝑟 𝑟 ) = 0.5𝑇Δ𝐹𝑏𝑟 (2.15) The net moment induced in the steering system on the other hand, will be proportional to the scrub radius directly as can be observed from Equation 2.16 [27]. 𝑀z = Δ𝐹𝑏𝑟(𝑟𝜎 cos(𝜎) + 𝑟𝑑𝑦𝑛sin⁡(𝜎 + 𝜖𝑤))cos⁡(𝜏)) (2.16) Where rσ is the scrub radius, σ is the KPI angle, rdyn is the dynamic wheel radius, εw is the camber angle and τ is the caster angle. FED-Alpha front wheel geometry. For small angles of KPI, camber, and caster, the cosine components will be approximately 1, where sine components will be closer to 0. In this case, the net moment induced on the steering system will be dominated by the scrub radius, as can be observed from Equation 2.17. 𝑀z = Δ𝐹𝑏𝑟(𝑟𝜎1 + 𝑟𝑑𝑦𝑛0)1 = ΔFbr𝑟𝜎 (2.17) In order to test this, a number of simulations with 5 mm scrub radius intervals were performed at 60 km/h using the PID coefficients optimized for the default scrub radius. 14 15 RESULTS AND DISCUSSION High Speed Simulations The simulations are performed for two scenarios with one high and one low speed case. High speed case is selected as 60 km/h since it is close to the handling limits of the selected vehicle in DLC test. It is observed from Figure 3.1 that vehicle can complete the DLC maneuver successfully in co-simulation environment applying proper brake torques to the front-left and front-right brakes according to the control scheme and none of the vehicle’s extremities exceed the test course boundaries. The resulting vehicle trajectory and yaw (heading) angle is shown in Figure 3.2. It can be seen that the system has a delayed response. This delay can be attributed to either proportional gain being too low or vehicle response time being too high because of high speed. Actual yaw angle not being able to reach reference yaw angle’s peak hints that proportional gain must be increased. The overall performance of the controller for this speed can be increased manually by tuning the gains further. Figure 3.1 : High speed trajectory and plant input. 16 Figure 3.2 : High speed reference and actual yaw angle. Figure 3.3 : High speed longitudinal characteristics. From Figure 3.3, it can be seen that the implemented pseudo-ABS can successfully regulate the longitudinal slip around the control value with regards to the control margin, ensuring that the tires do not lock up and lose grip so that both longitudinal and lateral tire forces can be transmitted to the ground. 17 Low Speed Simulations Low speed simulations are performed at 35 km/h where DLC maneuver can be completed by using differential braking without reaching the peak coefficient of road adhesion. As it is seen in Figure 3.4, DLC maneuver can be successfully completed applying differential braking in the low-speed case as well and none of the vehicle’s extremities goes outside the test boundaries. For the low-speed case, compared to high speed, there is no noticeable delay observed in the vehicle’s response as shown in Figure 3.5. However, the predetermined proportional gain might be too high for this speed range considering the aggressive maneuver the vehicle attempts to make when changing the lanes. DLC performance can be further improved by manually tuning the gains as it was in the previous case. PID parameters obtained for the high-speed case are used in the low-speed case as well since these parameters work well in the low-speed case. However, further improvement in the tracking performance can be obtained by running the PSO algorithm for the low-speed case to obtain gains specific to a particular speed. As can be seen in Figure 3.6, longitudinal slip does not even reach the controlling margin because of lower brake forces needed. Figure 3.4 : Low speed trajectory and plant input. 18 Figure 3.5 : Low speed reference and actual yaw angle. Figure 3.6 : Low speed longitudinal characteristics. The Effect of Front Wheel Geometry As can be seen in Figure 3.7, the cost function, which was selected to be as the same cost function used with PSO, decreases with increasing scrub radius, as expected and 19 the relationship seems to be exponential. However, scrub radii outside the range between +45.28 mm and +75.28 mm resulted in unsuccessful maneuvers. It is observed from the simulated results that sufficient steering torque cannot be generated with scrub radius values smaller than +45.28 mm and DLC maneuver cannot be completed successfully. Figure 3.7 : Effect of scrub radius on cost function. In addition, it can be seen in Figure 3.8 that steering wheel oscillations increase with increasing scrub radius. The simulated results revealed that increasing the scrub radius by 20 mm resulted in oscillatory movements in the steering wheel, making it undesirable even though it managed to track the reference path better when only the cost function is considered for the success of the maneuver. The default scrub radius is found to be the optimal design setting when both differential braking control and steering vibrations are considered. 20 Figure 3.8 : Effect of scrub radius on trajectory following. 21 CONCLUSION AND FUTURE WORK In this paper, viability of differential braking as a means of redundant steering system for self-driving vehicles was investigated with high-fidelity multi-body-dynamics simulations using DLC maneuvers. Two PID controllers were implemented for lateral position and yaw angle control. Reference trajectories were generated using Constant Velocity Offset Plus Sine Lane Change model. The PID controller gains were tuned using PSO. The effects of scrub radius on the differential braking were also investigated. Although simple and straightforward, the PID controllers implemented were able to complete the DLC maneuvers successfully with considerably high speeds. When compared to the state-of-the-art control techniques, the adopted methodology is much less computationally intensive and can run in real time, although requires pre- computation of PID controllers with PSO tuning. The performance of PID controllers can be further improved by determining optimized control parameters specific to vehicle’s speed. The simulated results revealed that front wheel scrub radius has significant influence on the success of the differential steering. Optimum scrub radius is required to generate sufficient steering torque to complete the obstacle avoidance maneuver and eliminate undesired steering vibrations. The results proved that differential steering can be used as a redundant steering system in self-driving vehicles if suitable design and control parameters are acquired. Model- based control systems also have high potential to be used in redundant steering systems because of their predictive capability. There exists a recent paper, that investigates high speed DLC maneuvers via MPC, based on the same vehicle model that was used in this work, that takes steering angle and wheel torques as an input which also compares the MPC strategy to a PID control strategy. This study shows promising improvements achieved by the MPC method that allows the vehicle to complete the maneuvers with higher speed [28]. The future work for this study will be developing 22 a model-based control strategy that will investigate the effects of braking forces on the steering system and compare the achieved results with the PID strategy. 23 24 REFERENCES [1] Di Cairano, S., Tseng, H.E., Bernardini, D. and Bemporad, A. (2013). Vehicle yaw stability control by coordinated active front steering and differential braking in the tire sideslip angles domain. IEEE Transactions on Control Systems Technology, 21(4), 1236-1248. [2] Zhang, D., Lin, B., Kirli, A. and Okwudire, C. (2017). Reduction of steering effort in the event of EPAS failure using differential braking assisted steering. SAE International Journal of Transportation Safety, 5(2), 227- 233. [3] Nakazato, H., Iwata, K. and Yoshioka, Y. (1989). A new system for independently controlling braking force between inner and outer rear wheels. SAE International Congress and Exposition, Detroit, MI, February 27 – March 3, Paper No. 890835, 1-8. [4] Pilutti, T., Ulsoy, A.G. and Hrovat, D. (1995). Vehicle steering intervention through differential braking. Proceedings of 1995 American Control Conference - ACC'95, Seattle, WA, June 21–23, 1667-1671. [5] Kissai, M., Do, A.-L., Mouton, X. and Monsuez, B. (2020). Autonomous evasive steering with differential braking backup. 20th International Conference on Control, Automation and Systems, Busan, October 13– 16, 1172-1176. [6] Zhang, L. and Wu, G. (2016). Combination of front steering and differential braking control for the path tracking of autonomous vehicle. SAE 2016 World Congress and Exhibition. [7] Jalali, M., Khosravani, S., Khajepour, A., Chen, S.-K. and Litkouhi, B. (2017). Model predictive control of vehicle stability using coordinated active steering and differential brakes. Mechatronics, 48, 30-41. [8] Mirzaeinejad, H., Mirzaei, M. and Rafatnia, S. (2018). A novel technique for optimal integration of active steering and differential braking with estimation to improve vehicle directional stability. ISA Transactions, 80, 513-527. [9] Lee, J., Choi, J., Yi, K., Shin, M. and Ko, B. (2014). Lane-keeping assistance control algorithm using differential braking to prevent unintended lane departures. Control Engineering Practice, 23, 1-13. [10] Enache, N.M., Mammar, S., Glaser, S. and Lusetti, B. (2010). Driver assistance system for lane departure avoidance by steering and differential braking. IFAC Proceedings of the 6th IFAC Symposium Advances in Automatic Control, Munich, July 12–14, 471-476. [11] Son, Y.S. and Kim, W. (2021). Nonlinear differential braking control for collision avoidance during lane change. Mathematics, 9(14), 1-15. 25 [12] Jonasson, M. and Thor, M. (2018). Steering redundancy for self-driving vehicles using differential braking. Vehicle System Dynamics, 56(5), 791-809. [13] Zhao, Y., Cui, J., Zhou, Z., Fang, Y., Wang, D., Zhang, T., Wu, A., Sun, Q. and Zhao, Y. (2020). Direct yaw moment control of electric vehicle with 4 in-wheel motors to improve handling and stability. WCX SAE World Congress Experience. [14] NATO Military Agency for Standardization. (1991). Allied Vehicle Testing Publication, AVTP 03-160 W, ‘Dynamic Stability’ – Double Lane Change Tests. [15] Wang, G., Liu, L., Meng, Y., Gu, Q. and Bai, G. (2022). Integrated path tracking control of steering and differential braking based on tire force distribution. International Journal of Control, Automation and Systems, 20(2), 536-550. [16] Wang, Y.Y., Pan, D., Liu, Z. and Feng, R. (2018). Study on lane change trajectory planning considering of driver characteristics. Intelligent and Connected Vehicles Symposium. [17] Zhou, B., Wang, Y., Yu, G. and Wu, X. (2017). A lane-change trajectory model from drivers’ vision view. Transportation Research Part C: Emerging Technologies, 85, 609-627. [18] Ogata, K. (2002). Modern Control Engineering. New Jersey: Pearson. [19] Dorf, R.C. and Bishop, R.H. (2011). Modern Control Systems. New Jersey: Pearson. [20] El Hajjami, L., Mellouli, E.M. and Berrada, M. 2021. Robust adaptive non- singular fast terminal sliding-mode lateral control for an uncertain ego vehicle at the lane-change maneuver subjected to abrupt change. International Journal of Dynamics and Control, 9(4), 1765-1782. [21] Innocente, M.S. and Sienz, J. (2011). Particle swarm optimization with inertia weight and constriction factor. ICSI 2011: International Conference on Swarm Intelligence, Cergy, June 14–15. [22] He, X., Yang, K., Liu, Y. and Ji, X. (2018). A novel direct yaw moment control system for autonomous vehicle. Intelligent and Connected Vehicles Symposium. [23] Evtukov, S. and Golov, E. (2019). Adhesion of car tires to the road surface during reconstruction of road accidents. E3S Web of Conferences Topical Problems of Green Architecture, Civil and Environmental Engineering. [24] Letherwood, M., Jayakumar, P., Gerth, R. and Dasch, J. (2020). AVT-308 Cooperative Demonstration of Technology (CDT) for next Generation NATO Reference Mobility Model (NG-NRMM). NATO STO Technical Memorandum, Technical Report No. AC/323(AVT- 308)TP/888. [25] Seward, D. (2014). Race Car Design. Suffolk: Macmillan Education. 26 [26] Jambukar, S. and Sujatha, C. (2020). Effects of kingpin and caster offset on braking stability of long wheelbase bus. In: Advances in Mechanical Engineering. Springer, 601-615. [27] Reimpell, J., Stoll H., and Betzler, J.W. (2011). The Automotive Chassis. Oxford: Butterworth-Heinemann. [28] Yangin, V.B., Akalin, O. and Yalcin, Y. (2024). High-speed trajectory following of a heavy-duty vehicle via adaptive nonlinear model predictive controller. International Journal of Vehicle Performance, 1(1), 1-25. 27 28 APPENDICES APPENDIX A: Simulink controllers APPENDIX B: Side decision algorithm APPENDIX C: Pseudo-ABS algorithm APPENDIX D: Trajectory generation APPENDIX E: Particle swarm optimization 29 APPENDIX A Figure A.1 : Simulink controller. 30 Figure A.2 : Controller model. 31 APPENDIX B function [left_o, right_o] = side_decision_algorithm(left, right) if left > right left_o = left - right; right_o = 0; elseif right > left left_o = 0; right_o = right - left; else left_o = 0; right_o = 0; end end APPENDIX C function br_o = fcn(br, w, u) u = -u / 1000; tire_r = 0.4987; u_tire = tire_r * w; slip = 0; if u > u_tire slip = (u - u_tire) / u; elseif u < u_tire slip = (u_tire - u) / u_tire; else slip = 0; end x = 0.5; s_abs = 0.188; if slip > s_abs * (1 + x) br_o = 0; elseif slip <= s_abs * (1 + x) && slip >= s_abs * (1 - x) br_o = (br / (2 * x)) * (-(slip/s_abs) + 1 + x); else br_o = br; end end APPENDIX D close all clear clc l = 4648.2; w = 2280.92; l_1 = 15 * 1000; w_1 = 1.1 * w + (0.25 * 1000); l_2 = l + (24 * 1000); l_3 = 25 * 1000; w_3 = 1.2 * w + (0.25 * 1000); 32 l_4 = l + (24 * 1000); l_5 = 15 * 1000; w_5 = 1.1 * w + (0.25 * 1000); dw = ((w_1 + w_3) / 2) + ((3.5 * 1000) - w_1); x = zeros(1, 6); x(2) = l_1; x(3) = x(2) + l_2; x(4) = x(3) + l_3; x(5) = x(4) + l_4; x(6) = x(5) + l_5; y = [0, 0, -dw, -dw, 0, 0]; xx_12 = x(1):10:x(2); xx_12(end) = []; xx_23 = x(2):10:x(3); xx_23(end) = []; xx_34 = x(3):10:x(4); xx_34(end) = []; xx_45 = x(4):10:x(5); xx_45(end) = []; xx_56 = x(5):10:x(6); xx = [xx_12, xx_23, xx_34, xx_45, xx_56]; yy_12 = interp1(x, y, xx_12); yy_34 = interp1(x, y, xx_34); yy_56 = interp1(x, y, xx_56); trajectory_and_yaw_fig = figure(); trajectory_and_yaw_fig.Position(3) = 2 * trajectory_and_yaw_fig.Position(3); tiledlayout(2, 1, "Padding", "compact", 'TileSpacing', "compact") ax = nexttile; bounds = readtable("dlc_course.xlsx"); bounds_x = bounds.double_lane_change_Course_dlc_path_dlc_x; filter = bounds_x > xx(end); bounds_x(filter) = []; bounds_y_l = bounds.double_lane_change_Course_dlc_path_dlc_Left; bounds_y_l(filter) = []; bounds_y_r = bounds.double_lane_change_Course_dlc_path_dlc_Right; bounds_y_r(filter) = []; left_lane = plot(bounds_x / 1000, bounds_y_l / 1000); left_lane.DisplayName = "Left Boundary"; left_lane.LineStyle = "--"; left_lane.Color = [1 0 0]; left_lane.LineWidth = 1; hold on right_lane = plot(bounds_x / 1000, bounds_y_r / 1000); right_lane.DisplayName = "Right Boundary"; right_lane.LineStyle = "--"; right_lane.Color = [1 0 0]; right_lane.LineWidth = 1; hold on %% Constant Velocity Offset Plus Sine [yy_const_vel_off_plus_sine, yaw_const_vel_off_plus_sine] = const_vel_off_plus_sine(y, xx_12, xx_23, xx_34, xx_45, xx_56, yy_12, yy_34, yy_56); 33 const_vel_off_plus_sine_plot = plot(xx / 1000, yy_const_vel_off_plus_sine / 1000); const_vel_off_plus_sine_plot.DisplayName = "Reference Trajectory"; const_vel_off_plus_sine_plot.Color = [0 0 1]; xlabel(ax, "x [m]") ylabel(ax, "y [m]") grid on grid minor hold off legend(ax, "Location", "southeast") ax = nexttile; const_vel_off_plus_sine_yaw_plot = plot(xx / 1000, yaw_const_vel_off_plus_sine); const_vel_off_plus_sine_yaw_plot.Color = [0 0 1]; xlabel(ax, "x [m]") ylabel(ax, "Yaw Angle [deg]") grid on grid minor hold off x0 = 50; y0 = 50; width = 560; height = 420; set(gcf, 'position', [x0,y0,width,height]); % Model Predictive Automatic Lane Change Control for Intelligent Vehicles 10.4271/2020-01-5025 % Study on Lane Change Trajectory Planning Considering of Driver Characteristics 10.4271/2018-01-1627 function [yy, yaw] = const_vel_off_plus_sine(y, xx_12, xx_23, xx_34, xx_45, xx_56, yy_12, yy_34, yy_56) dw = abs(y(3)); xx23_norm = xx_23 - xx_23(1); lw23 = xx_23(end) - xx_23(1); xx45_norm = xx_45 - xx_45(1); lw45 = xx_45(end) - xx_45(1); syms const_vel_off_plus_sine_f(x_const_vel_off_plus_sine) const_vel_off_plus_sine_reverse_f(x_const_vel_off_plus_sine) const_vel_off_plus_sine_f(x_const_vel_off_plus_sine) = -dw/(2*pi) * (2*pi*x_const_vel_off_plus_sine/lw23 - sin(2*pi*x_const_vel_off_plus_sine/lw23)) + yy_12(end); const_vel_off_plus_sine_reverse_f(x_const_vel_off_plus_sine) = - dw/(2*pi) * (-2*pi*x_const_vel_off_plus_sine/lw45 - sin(- 2*pi*x_const_vel_off_plus_sine/lw45)) + yy_34(end); const_vel_off_plus_sine_mf = matlabFunction(const_vel_off_plus_sine_f); const_vel_off_plus_sine_reverse_mf = matlabFunction(const_vel_off_plus_sine_reverse_f); yy_23 = const_vel_off_plus_sine_mf(xx23_norm); yy_45 = const_vel_off_plus_sine_reverse_mf(xx45_norm); yy = [yy_12, yy_23, yy_34, yy_45, yy_56]; yaw = yaw_calc(xx_12, xx23_norm, xx_34, xx45_norm, xx_56, const_vel_off_plus_sine_f, const_vel_off_plus_sine_reverse_f); 34 end function [yaw] = yaw_calc(xx_12, xx_23, xx_34, xx_45, xx_56, func, func_reverse) func_prime = diff(func); func_reverse_prime = diff(func_reverse); yaw = atan(func_prime); yaw_reverse = atan(func_reverse_prime); yaw = matlabFunction(yaw); yaw_reverse = matlabFunction(yaw_reverse); yaw_23 = yaw(xx_23); yaw_45 = yaw_reverse(xx_45); yaw = -1 * [zeros(size(xx_12)), rad2deg(yaw_23), zeros(size(xx_34)), rad2deg(yaw_45), zeros(size(xx_56))]; end APPENDIX E close all clc log_file = fopen("optim_res.txt", "w"); % parameters iterations = 3; winit = 0.9; % initial inertia wmax = winit; % max inertia wmin = 0.4; % min inertia c1 = 2.05; % cognitive parameter c2 = 2.05; % social parameter % constriction factor kappa = 1; phi = c1 + c2; if phi > 4 chi = 2 * kappa / abs(2 - phi - sqrt(phi^2-4*phi)); if wmax/phi > 1/4 wmax = 1; else wmax = (2 * wmax) / (phi - 2 * wmax); end else chi = kappa; end % stability check stability_error = false; % Perez and Behdinan (2007) if chi == 1 if c1 + c2 <= 0 || c1 + c2 >= 4 stability_error = true; disp("Convergence error in paremeters (1)"); end if ((c1 + c2) / 2) - 1 >= wmax || wmax >= 1 35 stability_error = true; disp("Convergence error in paremeters (2)"); end end % Innocente and Siez (2011) if chi ~= 1 if chi >= wmax / winit || chi <= 0 stability_error = true; disp("Convergence error in paremeters (3)"); end end if stability_error == true return; end % --- initial swarm position --- n = 0; % population size for l = 0.04:0.03:0.1 for i = 12:3:21 for j = 0:2:4 for k = 0:2:4 n = n + 1; particle(n, 1, 1) = i; particle(n, 1, 2) = j; particle(n, 1, 3) = k; particle(n, 1, 4) = l; end end end end particle(:, 4, 1) = inf; % best value so far particle(:, 2, :) = 0; % initial velocity %% Iterations for iteration = 1:iterations w = (wmax - ((wmax - wmin) / iterations) * iteration); % --- evaluating position & quality --- for i = 1:n particle(i, 1, 1) = particle(i, 1, 1) + particle(i, 2, 1); %update x position particle(i, 1, 2) = particle(i, 1, 2) + particle(i, 2, 2); %update y position particle(i, 1, 3) = particle(i, 1, 3) + particle(i, 2, 3); %update z position particle(i, 1, 4) = particle(i, 1, 4) + particle(i, 2, 4); %update w position Kp = particle(i, 1, 1); Ki = particle(i, 1, 2); Kd = particle(i, 1, 3); pid_ratio = particle(i, 1, 4); if Kp < 0 || Ki < 0 || Kd < 0 || pid_ratio < 0 cost = inf; else try warning_cache = warning("off", "all"); sim("ds_cosim"); warning(warning_cache); 36 [cost, success] = cost_f(bounds_x, bounds_y_l, bounds_y_r, x_fl.Data, y_fl.Data, x_fr.Data, y_fr.Data, path_actual{1}.Values.Data, path_actual{2}.Values.Data, xx, yy_const_vel_off_plus_sine); % fitness evaluation catch e cost = inf; end end if cost < particle(i, 4, 1) % if new position is better particle(i, 3, 1) = particle(i, 1, 1); % update best x, particle(i, 3, 2) = particle(i, 1, 2); % best y, particle(i, 3, 3) = particle(i, 1, 3); % best z, particle(i, 3, 4) = particle(i, 1, 4); % best w postions particle(i, 4, 1) = cost; % and best value if success == true log_text = sprintf("Iteration = %d, Step = %d, Cumulative Error = %.2f, PID Ratio = %.2f, Kp = %.2f, Ki = %.2f, Kd = %.2f\n", iteration, i, particle(i, 4, 1) / 10^6, particle(i, 3, 4), particle(i, 3, 1), particle(i, 3, 2), particle(i, 3, 3)); fprintf("%s", log_text); fprintf(log_file, "%s", log_text); plot_and_save_fig(bounds_x, bounds_y_l, bounds_y_r, x_fl.Data', y_fl.Data', x_fr.Data', y_fr.Data', sprintf("res/%.2f-%.2f- %.2f-%.2f.png", pid_ratio, Kp, Ki, Kd)); end end end [temp, g_best] = min(particle(:, 4, 1)); % global best position % --- updating velocity vectors --- for i = 1:n particle(i, 2, 1) = chi*(w*particle(i, 2, 1) + c1*rand*(particle(i, 3, 1) - particle(i, 1, 1)) + c2*rand*(particle(g_best, 3, 1) - particle(i, 1, 1))); % x velocity component particle(i, 2, 2) = chi*(w*particle(i, 2, 2) + c1*rand*(particle(i, 3, 2) - particle(i, 1, 2)) + c2*rand*(particle(g_best, 3, 2) - particle(i, 1, 2))); % y velocity component particle(i, 2, 3) = chi*(w*particle(i, 2, 3) + c1*rand*(particle(i, 3, 3) - particle(i, 1, 3)) + c2*rand*(particle(g_best, 3, 3) - particle(i, 1, 3))); % z velocity component particle(i, 2, 4) = chi*(w*particle(i, 2, 4) + c1*rand*(particle(i, 3, 4) - particle(i, 1, 4)) + c2*rand*(particle(g_best, 3, 4) - particle(i, 1, 4))); % w velocity component end end fclose(log_file); 37 38 CURRICULUM VITAE Name Surname : Dorukhan Tokay E-Mail : EDUCATION : • B.Sc. : 2020, Istanbul Technical University, Faculty of Mechanical Engineering, Department of Mechanical Engineering PROFESSIONAL EXPERIENCE AND REWARDS: • 2023 Software Engineer - Trilogy Innovations PUBLICATIONS, PRESENTATIONS AND PATENTS ON THE THESIS: • Tokay D., Yangin V., Akalin, O. 2023: Viability of Differential Braking Based Steering Redundancy for an Autonomous Vehicle. International Association for Vehicle System Dynamics Symposium, August 21-25, 2023 Ottawa, Canada.