Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
fmichalski03 authored Sep 14, 2024
1 parent c3a7fcf commit f5cccd3
Showing 1 changed file with 0 additions and 64 deletions.
64 changes: 0 additions & 64 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@


# PUTM_VP_SIM
## Introduction
PUT Motorsport Vehicle Performance group project of Torque Vectoring algorithm using CarMaker and Simulink.
Expand All @@ -11,7 +10,6 @@ PUT Motorsport Vehicle Performance group project of Torque Vectoring algorithm u
- [Normal Load Transfer](#normal-load-transfer)
- [Torque Allocator: Dynamic Distribution](#torque-allocator-dynamic-distribution)
- [Dynamic Distribution Method](#dynamic-distribution-method)
- [Car Power Limiting System](#car-power-limiting-system)
- [Variables description](#variables)
- [IPGDriver's Learning and Adaptation Mechanisms](#driver)
- [Learning Procedure](#learning-procedure)
Expand Down Expand Up @@ -103,68 +101,6 @@ where:
- $r_w$ is the wheel radius,
- $l_s$ is the half-width of the vehicle.



## Car Power Limiting System

### Description

This section implements a power limiting system for a Formula Student car. The mechanical power calculations are performed in a MATLAB function, while the PI controller that regulates the power is implemented using Simulink blocks.

### System Structure

The system consists of two main parts:
1. **Mechanical Power Calculation** - implemented as a MATLAB function.
2. **PI Controller** - implemented as a block model in Simulink.

### 1. Mechanical Power Calculation

The MATLAB function `computeMechanicalPower` calculates the mechanical power generated by each of the four motors of the car and then converts it to the total electrical power.

```matlab
function [P_el_total, Trq_FL, Trq_FR, Trq_RL, Trq_RR] = computeMechanicalPower(Trq_FL, Trq_FR, Trq_RL, Trq_RR, omega_FL, omega_FR, omega_RL, omega_RR, eta)
% Calculate mechanical power for each wheel
P_mech_FL = Trq_FL * omega_FL;
P_mech_FR = Trq_FR * omega_FR;
P_mech_RL = Trq_RL * omega_RL;
P_mech_RR = Trq_RR * omega_RR;
% Sum of total mechanical power
P_mech_total = P_mech_FL + P_mech_FR + P_mech_RL + P_mech_RR;
% Convert mechanical power to electrical power
P_el_total = P_mech_total / eta;
end
```

### 2. PI Controller

The PI controller is implemented in Simulink using blocks. It regulates the power to ensure it does not exceed a specified maximum value.

#### Simulink Model

1. **Inputs to the Model:**
- `P_el_total` (computed in the MATLAB function)
- `P_max`
- `Kp`, `Ki`, `Ts`

2. **PI Controller Blocks:**
- **Error Calculation:**
- Use a Sum block to compute the error (`P_max - P_el_total`).
- **Integral of Error:**
- Use an Integrator block to accumulate the error over time.
- **Proportional and Integral Gains:**
- Use Gain blocks to multiply the error and its integral by `Kp` and `Ki` respectively.
- **Control Signal Calculation:**
- Use a Sum block to add the proportional and integral parts.
- **Control Signal Limiting:**
- Use a Saturation block to limit the control signal between 0 and 1.

3. **Torque Scaling:**
- Use Product blocks to scale the torques (`Trq_FL`, `Trq_FR`, `Trq_RL`, `Trq_RR`) by the control signal.



<a name="variables"></a>
## Variables description
All variables you can find in file _script.m_
Expand Down

0 comments on commit f5cccd3

Please sign in to comment.