Vehicle Dynamics and Autonomous Driving
Explore the dynamic behavior of a '69 Ford Mustang (1500 kg) managed entirely by an autonomous driving system in a simulated environment. The chassis uses Ackermann geometry coupled with an innovative 4-Wheel Steering (4WS) system.
The control unit automatically adjusts the rear wheel steering between in-phase and counter-phase based on speed conditions established by the Velocity Planning system, maximizing maneuverability and ensuring absolute stability at high speeds.
THE SIMULATION WILL BE LOADED SOON
Control Architecture & Analysis
1. Control Algorithms (PID)
Mustang's movement and steering are managed by applying forces calculated by full PID controllers, structured to dynamically handle position and speed:
- Proportional (P): Ensures a fast reaction proportional to the detected error.
- Integral (I): Eliminates steady-state error, counteracting constant resistances like ground friction.
- Derivative (D): Dampens oscillations induced by vehicle inertia, optimizing stability.
2. Saturation & Anti-Windup
Since Godot physics and real motors have force limits, the system implements Saturation. To prevent instability due to error accumulation, we integrated an Anti-Windup logic: when the system enters saturation, the integrator action is suspended to avoid excessive overshoots when returning to the target.
3. Workflow
- Sensing: Reading current telemetry data from Godot's internal sensors.
- Processing: Error calculation (Desired Target - Actual measured value).
- Control: Generation of the correction signal (Force/Torque) from the PID regulator.
- Action: Application of force within the physics engine to correct the trajectory.
class PID_Controller:
def compute(self, setpoint, measured, dt):
error = setpoint - measured
self.integral += error * dt
derivative = (error - self.prev_error) / dt
# Calcolo output PID
out = (self.kp * error) + (self.ki * self.integral) + (self.kd * derivative)
# Logica Anti-windup e Saturazione
if abs(out) > self.max_out:
out = math.copysign(self.max_out, out)
self.integral -= error * dt # Sospende l'integrale
self.prev_error = error
return out
Concept: Feedback Loop
PID Internal Structure
System Block Diagram
Telemetry Data Visualization
Comprehensive Analysis: Position Error, Velocity Planning, and 4WS Steering (In-Phase/Counter-Phase)