This project presents the modelling, simulation, and control of an autonomous electric vehicle with a trailer using MATLAB/Simulink.
The system is designed to perform multiple driving and parking maneuvers, including forward driving, arc-based parking, and reverse parking, both with and without a trailer.
This project reflects core concepts used in autonomous driving systems, including vehicle modelling, control, and trajectory tracking.
The system consists of:
-
A 4 m electric vehicle
-
A 6 m trailer connected via a hitch
-
An electrical drive system powered by a battery and inverter
-
Sensors to measure:
- position
- orientation
- relative angle between car and trailer
The simulation is built in Simulink using a modular architecture.
The control system combines:
- PID controllers for velocity and hitch angle control
- Pure Pursuit algorithm for trajectory tracking
This enables the system to:
- follow predefined paths
- maintain stability during motion
- correctly align the trailer during maneuvers
The system supports six different scenarios:
- Parking with arc (with trailer)
- Straight driving (with trailer)
- Reverse parking (with trailer)
- Parking with arc (car only)
- Straight driving (car only)
- Reverse parking (car only)
The system successfully:
- follows planned trajectories
- aligns vehicle and trailer during parking
- reaches target positions within acceptable tolerance
-
Open the Simulink model from the
models/folder -
Set the maneuver selection variable:
manselect = 1; % choose from 1–6
-
Run the simulation
-
Run the plotting script:
plot_trajectory
- PID tuning is critical for stable motion
- Trailer dynamics significantly increase control complexity
- Reverse parking is the most challenging maneuver
- The system demonstrates reliable performance across scenarios
-
The full system is implemented in Simulink
-
MATLAB scripts are used for:
- trajectory visualization
- vehicle geometry rendering
- maneuver validation
Project structure:
models/→ Simulink modelscripts/→ MATLAB coderesults/→ output visualizations
- MATLAB
- Simulink (with Simscape)
- Model predictive control (MPC) for advanced trajectory planning
- Sensor integration (LiDAR, camera-based perception)
- Obstacle avoidance in dynamic environments
- Real-time deployment on embedded systems
Jessica Sutherns https://github.com/jessysutherns
This project demonstrates key concepts in autonomous systems:
- Vehicle kinematics and dynamics
- Control system design
- Trajectory tracking
- Multi-body system interaction (car + trailer)
It highlights how simulation and control techniques can be used to solve real-world autonomous driving and parking problems.



