top of page

Rear Wheel Steer Controller

Please enjoy the 2-minute summary gallery below, or scroll further to explore my work in greater detail

Project Background

This page details the progress of my personal 2020 Winter project. While it is incredibly unfortunate that the UK has fallen victim to a new variant of the Coronavirus, the new national lockdown has given me plenty of time at home to sharpen my tools and learn new skills!

​

I have always been interested in the opportunities brought by electrification to improve vehicle performance through active vehicle dynamics control, and really just control systems in general. I believe my Controls course at Clemson University did a fine job of teaching the fundamental tenets of linear system control, but the concepts were only presented in a theoretical setting, and I found trouble retaining any valuable insight without seeing a practical application.

​

This project represents my attempt to address these gaps in my knowledge. What better way to reinforce my learning than by applying it to vehicle dynamics? With that in mind, it's important to remember the context when considering the scope I decided to take with this project. The primary goal, first and foremost, was to improve my fundamental understanding of control systems - and hopefully I could improve vehicle performance somewhere along the way!

The TU Graz 2018 challenger, "Giulia", was the first Formula Student car I saw with rear wheel steering, and very much served as an inspiration to this project.

​

Source: https://racing.tugraz.at/en/fahrzeuge/tankia-2018/

Summary of Methodology

The vehicle used for this project was based on the 2020 Clemson FSAE car. For the first phase, I represented the vehicle as a simple linear two degree of freedom bicycle model. This would be inadequate for real-life implementation, but is perfect for taking a crash course in control system basics, and asking questions like "What is a lead compensator, and when would you use one?" Before jumping into optimization, I focused on design explorations to capture significant trends and insights. From there, I performed sensitivity analyses to evaluate the robustness of different control strategies to changes in parameters such as vehicle balance or tire cornering stiffness. Only when that was complete did I piece together my first "optimal" controller.

​

Once I felt comfortable with the basics, I graduated back to a full non-linear vehicle model. For this step, I essentially replicated the model I used for my differential project, but in Simulink. This ended up being great practice in syncing MATLAB with Simulink to automate the analysis process, which was a great set of skills to add to my toolbox. Once I had a more realistic model, the first focus was to recognize how control schemes would have to change to adapt to nonlinearity and tire saturation. Next I analyzed specific vehicle maneuvers, such as ramp-steer and sine+dwell inputs, to explore the versatility required for a real-life implementation. Lastly, I played around with more optimization, as well as exploring broader questions about what optimal vehicle control should look like. This is a really open-ended question that goes beyond the scope of this project, but was certainly interesting to investigate, even if on a surface level.

The 2020 Clemson FSAE car, Tiger22

Part 1: Linear Bicycle Model

Starting with a linear bicycle model enabled me to leverage the full MATLAB capability of transfer function analysis, enabling fast and efficient design explorations. I modelled the vehicle using a state space representation, with outputs yaw and sideslip velocity as a function of inputs front and rear steer angle. 

​

One important detail I wanted to account for immediately was the effect of actuator dynamics on the response of the rear steering angle. Even though the focus was more on learning controls fundamentals and less on absolute modelling perfection, assuming instant steer response was far too unrealistic to leave unaccounted for. I searched through several research papers and other online resources, and none I found would divulge the way they modelled the actuator dynamics in their models. With nothing else to go off of, I decided to represent the actuator using a first order plant with a time constant of 0.1 seconds. By no means a perfect representation, but at least something a little more realistic to move forward with.

​

Next I had to select a variable to control. With a single input (being the rear steer angle) control system, I could only select one output to control, between the options of lateral acceleration, sideslip angle, and yaw velocity. Each has it's merits - lateral acceleration is the purest indicator of vehicle performance, sideslip is an important factor in the qualitative driving experience, and yaw velocity has the largest impact on the trajectory of the vehicle. Since yaw and sideslip are the more direct quantities derived from the bicycle model, and my interest is in controlling path heading and maneuverability, I decided to control yaw velocity for this project.

Linear Analysis

Proportional Control

The first controller I played with was a proportional feedback controller, where the rear steering angle adjusts proportionally to the error between the observed and desired yaw rate. The effects of a proportional controller are pretty well known; increasing the control can minimize steady state error and improve response time, at the expense of overshoot and oscillation. This effect was outlined in a basic parameter sweep shown below.

​

The following plots compare different proportional control values (Kp) and the effect on vehicle yaw response. The two left-most plots describe the response to an instantaneous step-steer input, and the response/overshoot relationship s easily apparent. The two middle plots describe the frequency response of yaw velocity to steer input. This outlines another key influence of proportional control, where Kp values above 0.3 created significant overshoot near on-center frequencies. At higher frequencies, the yaw/steer phase difference was also significantly larger. Both of these could harm driver confidence and keep them from exploiting the full performance of the car. The right-most plots show the open loop frequency response, which describes the behavior of the controller and vehicle to a given yaw-demand without any feedback. While there is not much insight at the moment, the open-loop gain and phase margins provide critical information about the total system stability which will come into play later on.

For the vehicle above, the yaw-generation capacity of the car is perfectly matched to the target yaw rate, which is calculated using the ackermann gain of the steering angle. In reality, modelling imperfections will mean that true vehicle performance will not match theoretical, and it is important to be able to account for error with a robust controller. To highlight this effect, I ran the same analysis but with the front tire cornering stiffness reduced by 2.5%. The results are plotted below. Now, having a higher Kp value is more important if the goal is to minimize steady state error. This can be seen in the steady state values on the left-most plots, where the vehicle adopts a steady state rear steer angle in order to account for the vehicle performance error. The tradeoffs in determining the optimal Kp value are now more complicated than in the previous example.

Vehicle response to varying levels of proportional control (Kp).

Vehicle response to varying levels of proportional control (Kp), with yaw-error introduced.

Relaxation Length

Tire relaxation length is something that I had previously not taken the time to model in past simulations. In essence, when a slip angle is imparted on a tire, it exhibits a transient response before it reaches a steady state lateral force. This is often quantified as the "relaxation length", or the distance the tire rolls before steady state is achieved. Relaxation length is subsequently modelled as a first order distance constant, which can be translated into a time constant when the vehicle velocity is accounted for. The result is lateral force as a first order response to slip angle. This also implies that relaxation length has a greater effect at low speeds, because there is a greater time lag before the relaxation length is traversed.

​

Since time lags can have a huge effect on responsiveness and performance, not to mention become the deciding factor between stability and instability, I figured now was the best time to incorporate relaxation lengths into my models and explore its effects. The first image below compares the step response of the car at various velocities (still using the bicycle model), with the change in color representing an increasing relaxation length. The results show relaxation having a significant effect on vehicle behavior, causing slower initial response as well as increased overshoot. As predicted, these effects diminish at higher speeds.

Comparing the effect of tire relaxation length on vehicle step response.

The next plot represents the same vehicle at the same velocity from the original proportional control sweep, with the only difference being the inclusion of tire relaxation length of 1 foot. This is about the average relaxation length for the Hoosier R25B tire we run, though it varies with load and other operating conditions. Compared to the first plot, there is a dramatic increase in overshoot and overlap, especially for high Kp values. This highlights the importance of accounting for relaxation length to create a realistic and robust vehicle controller.

Proportional controller (Kp) sweep with relaxation length incorporated into the vehicle model.

Loop Shaping 

* The majority of this portion was informed by Karl Astrom and Richard Murray, in their book titled "Feedback Systems: An Introduction for Scientists and Engineers".

​

At this point, my first thought was to continue onto integral and derivative control, to complete the PID exploration. But before going down that path, I wanted to find a way to structure my process beyond simply "playing around" with values, or blindly relying on an optimizer to do the work for me. I turned to control theory, asking questions like "what are some performance indicators of interest, and what are target characteristics I should shoot for?"

​

This is when I learned about Loop Shaping, which is a collection of general principles to guide the design of closed loop control systems. Loop Shaping focuses on the formulation and evaluation of 6 key transfer functions, known as the "Gang of 6". Each transfer function represents a key element of controller performance, which is summarized below:

​

The Gang of 6

1) Sensitivity Function: The sensitivity of the measured yaw output to measurement noise

2) Complementary Sensitivity Function: The sensitivity of the control signal to a load disturbance

3) Load Sensitivity Function: The sensitivity of measured yaw output to a load disturbance

4) Noise Sensitivity Function: Sensitivity of the control signal to measurement noise

5) Primary Transfer Function: Describes the yaw response to a front steer input.

6) Controller Transfer Function: Describes the rear steer response to a front steer input

​

Loop shaping focuses on the frequency response behavior of these transfer functions, and each has it's own target characteristics based on the general requirements of control systems. I worked my way through these performance indicators, and selected the ones I felt were most relevant to my project and the expected requirements of a real-world rear steer controller. These are summarized in the table below:

Primary performance goals for the rear steer controller.

Lead/Lag Compensators

At this point I deviated away from my original plan to explore derivative and integral control, though I did play around with it a bit. There will be more PID control later in part 2. Since Loop Shaping was focused on frequency response, it made more sense to work with controllers that are defined and understood in a frequency response context. Lead and Lag compensators are often used in control systems to either boost or reduce the phase in a specific frequency range, giving me much more direct control over the key metrics described in the table above. Lead/lag compensators can also be used to boost or attenuate gain, though that is not the primary purpose.

​

As is usual, I started with parameter sweeps to build up my intuitive understanding of their primary effects. The plots below mirror the same vehicle used in the earlier plots. In this example, the vehicle has no steady state yaw error, and a lead compensator is applied at 5 Hz. Since a lead compensator is defined by a zero and a pole with a correction factor to achieve unity gain, the b/a ratio simply describes the ratio of the pole to the zero.

Exploring the effect of a lead compensator at 5 Hz.

The plot that caught my attention the most was the yaw gain frequency response plot (top-middle). If the right pole-zero ratio was selected, the gain could be held at near 1 for a much wider frequency range, significantly increasing the bandwidth of the vehicle (a.k.a. yaw responsiveness) without introducing overshoot. In addition, increasing the pole-zero ratio can reduce phasing from a sinusoidal steer input. However, raising it too much would slow overall response time, as seen in the step response plots.

​

The higher frequency the lead compensator is placed at, the more reduced its effects are on the vehicle step response and bandwidth frequency range. However, if the lead compensator is placed too low, its frequency range will overlap with the natural yaw frequency of the vehicle, and the subsequent interference can cause some erratic step response behavior. This is illustrated in the example below, where the compensator is moved to 2 Hz.

Exploring the effect of a lead compensator at 2 Hz.

I did also briefly explore lag compensators, but they typically created a forced yaw overshoot and did not really bring about any desirable frequency response behavior. See the plots below. However, I kept the lag compensator in my back pocket for potential future use. In situations where a lead compensator is used to boost phase, but then the increased gain causes problems at higher frequencies, it could be cancelled out by an adjacent lag compensator.

Exploring the effect of a lag compensator at 5 Hz.

Lastly, I reintroduced the cornering stiffness decrease to bring about a steady state yaw error for the controller to manage, with the results pictured below. This highlights a new downside of the lead compensator in its potential to hurt steady state error. This would have to be compensated for with increased proportional control, which can be harder to manage in more complex steering maneuvers. I also repeated the above comparisons for various other Kp values, but all of the plots here use Kp = 0.5 to maintain a like-for-like comparison.

Evaluating the lag compensator when steady state yaw error is present.

Final Parameter Sweeps

With many key controller parameters and their effects visualized, it was time to carry out a broader design exploration, and make some design decisions. I did this by creating generalized analysis plots of the most sensitive performance indicators listed earlier as a function of various  controller parameters. An example is pictured below. For the next few paragraphs, I will break down each plot and it's significance to vehicle performance, and discuss the subsequent controller design considerations.

​

The plot below features the vehicle travelling at 40 ft/s, with a constant proportional controller of Kp = 0.5 and various lead compensators applied. The steady state yaw gain is 10% off of the linear control target. For each subplot, the compensation frequency is represented on the x axis, with the pole:zero ratio on the y axis. This allows me to create a 'control map' and get a bigger picture view of design trends. I am able to repeat these plots at varying velocities and Kp values to complete a full exploration.

​

For each individual subplot, I will show two examples, both at 40 ft/s, with Kp values of 0.2 and 0.5, respectively.

An example of the design exploration plots I generated for this exercise.

The first performance indicator we will look at is yaw overshoot in a step response. As mentioned earlier, one tradeoff to consider when selecting a proportional controller is to balance fast response time with small overshoot. This is exemplified below, where the Kp = 0.5 controller has greater overshoot across the board than it's Kp = 0.2 counterpart. The plots also show that this can be mitigated using the design of the lag compensator, either by decreasing the compensation frequency or, to a lesser extent, increasing the pole to zero ratio. In this case, the target area of the map that we want to target is the blue.

Step response max overshoot performance comparison

To stay on the overshoot vs response time tradeoff, let's look at yaw rise time next, or the time required for the vehicle to achieve 63% of its steady state yaw value. In this case, the target range is again to be in the blue area of the map, which is almost exactly inverted from the ones above. It is again apparent that a higher Kp value can lead to faster response, as well as reducing the pole:zero ratio.

Step response yaw rise time performance comparison

Parameter Sweeps

For the last of the step response metrics, we will look at steady state error. For this example, a static yaw gain error of 10% may be extreme for a linear vehicle model, but it is an attempt to look ahead to the nonlinear analysis, when tire saturation will similarly lead to large yaw errors (if a linear reference target continues to be employed). The general principle that increasing proportional control reduces steady state error is present, and the plots make it clear that the pole-zero ratio can also have a significant effect. Once again, since the goal here is to minimize the error, the target area on the map is the blue zones.

Step response error performance comparison

Next let's move into the frequency response domain. Bandwidth is the frequency range where the gain of the system stays above 3 dB, or roughly 0.707. Since gain is the ratio of actual to demanded yaw amplitude, you generally want to stay as close to 1 as possible, for as long as possible. In essence, the bandwidth describes the operating range in which the system will remain responsive to user inputs. Bandwidth is something I also explored in my differential project.

​

For a high performance vehicle, we want bandwidth to be as large as possible to maintain maximum responsiveness. This time, the target map area is the yellow zone. Unsurprisingly, increasing proportional control will increase overall bandwidth by creating more extreme responses to error. In this case, the pole to zero ratio is also a significant contributor to the bandwidth, but as you approach a b/a value of zero the sensitivity increases drastically. This is something to be wary of; vehicle modelling is never perfect, and when correlation is not present it is very risky to tune your vehicle to a very narrow operating band.

Frequency response bandwidth performance comparison

Another important frequency response metric is the maximum yaw gain across the frequency range evaluated. Ideally, this would stay as close to one as possible, or near the light blue to green zone on the map. This is evidently a very narrow window to shoot for this time. Another thing to notice is the total color range of the map, which shows an error swing of -20% to +30%. This is because a poorly tuned controller can amplify yaw errors near on-center steering frequencies, or fail to make up for a static yaw error. This is one of the most sensitive metrics of the ones being explored. It is also one of the most critical, because during complicated steering maneuvers it is essential that the output of the car behavior matches the expected input from the driver.

Frequency response bandwidth performance comparison

There is a clear tradeoff here between yaw overshoot and total yaw bandwidth. A deeper look reveals a hidden danger to prioritizing bandwidth over all else. This is illustrated in the plot below, which shows an extreme example with aggressive proportional control. The bandwidth, highlighted in green, is very high, but it is only so because the entire amplitude curve has been shifted upwards, resulting in extreme overshoot (red) for a large frequency range. This is not a desirable tradeoff to make. 

An extreme example of the cost of blindly prioritizing bandwidth.

Now let's move on to the open loop dynamics of the controller. This is often used as a proxy to evaluate the closed loop stability of the system via the gain and phase margin. In essence, if the controller phasing is beyond 180 degrees while the gain is above 0 dB, divergent instability is achieved and the system will begin to oscillate at exponentially increasing amplitudes. The gain and phase margins are found by finding a crossover frequency where either gain or phase crosses its respective threshold, and seeing how close the other is to crossing its own.

​

Even if a system is perfectly stable across its full operating range, real-life disturbances can be difficult to predict and can tip the system just past the threshold into instability. In theory, one wants the gain and phase margins to be as large as possible, creating ultimate stability. In practice, there is a such thing as overkill, and generally there is a minimum threshold that above which you'll be fine. This depends on the application, but typically a phase margin of around 30-60 degrees and a gain margin of 2-10 dB is considered acceptable.

Open loop gain margin comparison

Open loop phase margin comparison

From the plots above, it would appear that achieving an adequate gain and phase margin is pretty easy. But there are two reasons to be cautious. Firstly, considering we are using a simple bicycle model, a car with sufficient understeer will have an inherent stability that one would have to go out of their way to try and destroy. In a nonlinear vehicle with tire saturation, achieving stability across all operating conditions will be much more difficult.

​

The second consideration is that sometimes looking at the margin values alone in isolation can be misleading. Pictured below is a bode plot for the static vehicle with no rear steer controller, for the sake of illustration. As the plot says, the gain margin is infinite because the phase never crosses -180 degrees. But a visual inspection quickly shows that the phase asymptotically approaches -180 at high frequencies, meaning that a road disturbance could suddenly shift the phase under -180, creating a finite gain margin. If you are not careful, a stable system could be thrust into instability in a situation like this. 

An illustration of why gain margin can't always be taken at face value.

For these reasons, gain and phase margin are not always a complete indicator of closed loop system stability. This is why, when I move to nonlinear analysis, I will use a different metric to define stability, which you will see more on later.

​

For one last plot, we will explore the frequency response of the controller itself, and evaluate it's sensitivity to noise in the yaw measurement. This will manifest itself as noise in the yaw error signal, which directly translates to controller behavior. There are two reasons to manage this. Firstly, you don't want measurement noise to cause uncontrolled oscillations in vehicle behavior, as that will hurt performance and driver confidence. Secondly, noise is a high frequency phenomenon, so an actuator that is sensitive to noise will be subject to high frequency oscillations. If this is not properly damped out or attenuated, this can lead to premature actuator wear. For these reasons, it is important to keep noise sensitivity to a minimum (aka in the blue area of the maps below).

Open loop noise sensitivity comparison

Speed Sensitivity Analysis

Once trends in the performance indicators had been evaluated, my last step was to carry out the same analysis at different vehicle speeds. As vehicle speed increases, yaw gain and damping naturally decrease (at least before downforce is taken into consideration). At the same time, tire relaxation effects diminish. For this reason, the proper tuner parameters may change with velocity. The plots below reflect the same ones discussed above, comparing the same vehicle travelling at 30 and 70 ft/s, respectively. 

Summary analysis performed at 30 ft/s

Summary analysis performed at 70 ft/s

Summarizing Thoughts

Through my design exploration, a few distinct design tradeoffs emerged. In the region generally defined by high proportional control Kp, low compensation frequency, and low pole to zero ratio, you can enjoy the benefits of fast response, low error, and high bandwidth. This comes at the expense of overall stability, noise sensitivity, and overshoot. I am overgeneralizing a bit here, but overall this highlights the classic tradeoff between speed and performance vs control and stability.

​

Low values of Kp yield a controller that is very easy to keep in a stable and predictable range. However, there is a hard ceiling on the response and steady state performance that can be achieved. On the other hand, it is possible to use a high Kp value that can achieve much higher performance while still maintaining comparable stability and control to a lower Kp controller. However, this requires much more careful and sensitive fine tuning of the lead compensator.

​

Having tested a range of Kp values from 0.1 to 1.0, and speeds from 30 to 70 ft/s, there is a key range where a decent balance can be struck between the performance indicators of interest. This lies in a Kp value between 0.3 and 0.5, a compensation frequency between 3 and 5 Hz, and a pole to zero ratio between 2 and 4. If you look back at the plots above, however, you'll see that almost all the performance indicators are at their highest sensivity to a change in parameters in that range. In practice, this means that trying to fine tune your controller and achieve predictable results in real life can be an elusive target. It would be wise to pick one side of the performance/stability spectrum to lean towards in order to stay in an area of predictable behavior.

​

As far as speed sensitivity goes, I found that simply scaling Kp to account for the changes in yaw gain for a given velocity did an adequate job of maintaining consistent control characteristics. This may not prove to be the case once I move to the nonlinear model.

​

And that wraps up my linear analysis! Now that I have a better grasps on some control systems basics, it is time to graduate to a more complex and realistic car model.

Part 2: Non-linear Simulink Model

Non-linear Model

Now it is time to move on to a non-linear analysis, and the second phase of this project. At this point, choosing a scope for the remainder of my work became a much more challenging open-ended question. As a result, the work I completed was not as linear as in the previous section. But here I will present my results in the following categories:

​

1) Details about the vehicle model used

2) Discussion of control objectives pursued

3) Description of vehicle maneuvers used for analysis

4) Discussion of control concepts evaluated

5) Performance indicators and optimization strategy

6) Final results

Vehicle Model

For my nonlinear analysis, I used the vehicle model from my differential analysis project. You can read more about that model here, but in essence it is a 7 degree of freedom nonlinear two-track model accounting for yaw, sideslip, longitudinal velocity, and individual wheel speeds. Roll and kinematics are excluded, but lateral load transfer distribution is a tunable parameter. For this project, I left out the differential model, because I didn't want torque split to act as a confounding variable. Instead, this vehicle is treated as having an open differential. I also upgraded the model to account for tire relaxation length via the same mechanisms as the linear model (using a first order distance constant).

​

Since I was working with nonlinear control, MATLAB's built in transfer function tools were no longer sufficient, and it was time to move my vehicle model into Simulink. This ended up being a good exercise for my Simulink skills, as I had to learn how to pass variables and call Simulink models from the MATLAB workspace to improve efficiency and enable parameter sweeps.

Control Objectives

With a more complex vehicle model, especially with tire saturation taken into account, deciding on a control ideology was a challenging question. With the linear bicycle model, it was simple to just create a linear reference model to pursue. Now we have a vehicle that behaves nonlinearly, and there are broader questions about what behavior is best for the car-driver interaction. On the one hand, keeping vehicle response as linear as possible for as long as possible seems like an obvious goal. But the gradual onset of understeer is a very important indicator to drivers that they are approaching the limit.

​

When I carried out initial research for this project, I completed a brief literature review to see how others approached this challenge. Some research papers took the straightforward method of pursuing a pure linear reference model. Others tried to specifically tune the onset of understeer with a target understeer curve. Below is an example from the work of Canale et al. Notice they are extending the linear range of the vehicle, while still allowing for a steady onset of understeer at the limit.

Example of plot from a different research paper, comparing the static understeer curve to a modified target curve. 

 

Source: Canale, M., et al. “Robust Vehicle Yaw Control Using Active Differential and Internal Model Control Techniques.” 2006 American Control Conference, 2006, doi:10.1109/acc.2006.1657574. 

Other papers worked to actually modify the turn radius gain for different velocities; for example, tuning the controller at low speeds to enable artificially tight turn radiuses. A common application of this method was for luxury performance vehicles or autonomous vehicles to aid in parking situations, but it would also serve a Formula Student vehicle well on the tight autocross courses it is designed for.

​

For the moment, I decided that I was spending too much time worrying about this question. "How the ideal vehicle ought to behave" is certainly a topic I want to explore further, but it outside the scope of this project. At this point, my goal is to, for a given target behavior, understand the control system techniques that would be required to achieve said behavior. So with that in mind, the simple route forward was to use a simple linear reference model with a fixed understeer gradient, with the control objective to maintain linear response for as long as possible. This is displayed in the plot below, where the lateral acceleration versus steer angle curves are compared for various speeds from the Simulink model. The grey line indicates the cornering limit for a given speed, and it's intersection with the purple reference line will indicate the steer angle where peak lateral acceleration will be expected. In the future, I definitely plan on exploring more open ended questions about ideal vehicle control. And the insights I gain with this project will serve me well when I decide to go there.

Lateral acceleration vs steer angle for the Clemson FSAE car, evaluated at various speeds.

Given the target vehicle behavior, the controller performance objectives remain similar to the performance indicators discussed in the linear section. I will go into further detail in the "Performance Indicators and Optimization Results" section. 

Vehicle Maneuvers