
Autonomous Driving (Path Tracking)
A path of a double-lane change is set as the desired path.
Although path tracking is not part of the interest for the development of the 3-wheeler, I am interested to know whether the same path tracking controller will perform similarly on both vehicle model. I picked double-lane change so that another comparison of the vehicle dymanics between the 3-wheeler and the 4-wheeler can be made under a relatively extreme condition.
Three classic path tracking controllers are applied: Pure Pursuit, Stanley's, and LQR.

Pure Pursuit is also called the look-ahead method. L_d is the look ahead distance and P_g gives the information of the desire yaw angle. This method follows the simplified Ackerman's steering model, such that the controlled steer input can be expressed as:

Stanley is a path tracking method using the tracking error and heading error.

The tracking error is the distance between the vehicle's front axle to the tangent line of the desired path and the heading error is the difference between the desired path's yaw angle and the vehicle's yaw angle. The controlled steering law can be expressed as:

LQR is the method that uses the error functions and reduces them to preferablly zero. This is state-space based full-state feedback controller. The equation of motions (with error functions for the tracking and heading error) can be expressed as:

Where e1 is the tracking error and e2 is the heading error. Pairing with the 2 DoFs linear vehicle model with equation of motion as below:

It forms the basic for the LQR methods. Next is to use Riccati's equations to solve for the controller gain matrix K to calculate the controlled input u = (A - BK)x.
All these methods are then simulated using MATLAB/Simulink and below are the results.

First is for the Pure Pursuit Method

Next is Stanley

And LQR with the best fit to the desird path. It should be noticed that they are all applied to the 4-wheeler, the detailed performance of each controller applied on the 6 DoFs vehicle model with Dugoff non-linear tire model can be found in the file attached to the project name: Three-Wheel Vehicle VS Four-Wheel Vehicle.