Challenge

Project 2 - Development of TFT Cluster Speedometer Software Component

Perform the complete V and V workflow for the obtained model

Development of TFT Cluster Speedometer Software Component

Cluster Instrument receives the signals from other ECU via CAN bus interface. It also receives commands from the driver via steering wheel buttons. The signals are then processed by the Cluster ECU, after which the Cluster ECU may send the vehicle information to the LCD or light the LEDs and so forth, according to the results. Therefore, the Cluster ECU can be viewed as a carrier of the information flow.

Requirements:

1.1 Calculating TFT Display Speed

Average Vehicle Speed would be displayed only if its between 2 kmph & 250 kmph. Any value outside this range will be discarded by its lower limit & upper limit

When Average Vehicle Speed is < 2 kmph, DisplaySpeed = 2 kmph

When Average Vehicle Speed is in between 2 kmph & 250 kmph, DisplaySpeed = Average Vehicle Speed

When Average Vehicle Speed is > 250 kmph, DisplaySpeed = 250 kmph

1.2 Main Data Filtering

Main Data Filtering subsystem will be activated for every 10th millisecond

DisplaySpeed1 (t) = ((DisplaySpeed (t) x 0.65)/ Main Filter Speed Value) 0.05

1.3 Auxiliary Data Filtering

Auxiliary Data Filtering subsystem will be activated for every 10th millisecond

DisplaySpeed_Filter (t) = ((DisplaySpeed1 (t) x 0.78)/ Auxillary Filter Speed Value) - 0.03

1.4 TFT Speed Output


If |(DisplaySpeedFilter - DisplaySpeed)| > 1.5

{

Vehicle Speed Display = DisplaySpeed

}

else

{

Vehicle Speed Display = DisplaySpeed Filter

}


To perform the complete Verification and Validation (V&V) workflow for the development of a TFT Cluster Speedometer Software Component, we'll follow these steps:

1. **Develop the Simulink Model**

2. **Link Requirements to the Model**

3. **Create Test Cases and Test Harnesses**

4. **Run Simulations and Analyze Results**

5. **Perform Model Coverage Analysis**

6. **Conduct Formal Verification**

### Step 1: Develop the Simulink Model

#### 1.1. Creating the Simulink Model

1. Open MATLAB and create a new Simulink model.

2. Save the model as `TFT_Cluster_Speedometer.slx`.

#### 1.2. Add the Components

1. **Calculating TFT Display Speed Block:**

- Add an **Inport** block named `AverageVehicleSpeed`.

- Add a **Switch** block to handle the lower and upper limit conditions.

- Configure the switch conditions and add **Constant** blocks for 2 kmph and 250 kmph.

- Add a **MinMax** block to limit the speed range between 2 kmph and 250 kmph.

- Connect these blocks to calculate `DisplaySpeed`.

2. **Main Data Filtering Block:**

- Add a Subsystem block and name it `Main Data Filtering`.

- Inside the subsystem, add a **Product** block, **Divide** block, and **Constant** blocks.

- Implement the equation: `DisplaySpeed1(t) = ((DisplaySpeed(t) * 0.65) / MainFilterSpeedValue) - 0.05`.

3. **Auxiliary Data Filtering Block:**

- Add a Subsystem block and name it `Auxiliary Data Filtering`.

- Inside the subsystem, add a **Product** block, **Divide** block, and **Constant** blocks.

- Implement the equation: `DisplaySpeed_Filter(t) = ((DisplaySpeed1(t) * 0.78) / AuxiliaryFilterSpeedValue) - 0.03`.

4. **TFT Speed Output Block:**

- Add a Subsystem block and name it `TFT Speed Output`.

- Inside the subsystem, add a **Abs** block, **Relational Operator** block, **Switch** block, and **Constant** block.

- Implement the condition: `if |(DisplaySpeedFilter - DisplaySpeed)| > 1.5, then VehicleSpeedDisplay = DisplaySpeed, else VehicleSpeedDisplay = DisplaySpeedFilter`.

5. **Connect all the blocks together** to form the complete model.

### Step 2: Link Requirements to the Model

1. Open the Requirements Manager in Simulink.

2. Create a new requirement set and define the requirements based on the provided information.

3. Link each requirement to the corresponding block or subsystem in the model.

### Step 3: Create Test Cases and Test Harnesses

1. **Creating Test Harnesses:**

- Right-click on the top-level subsystem and select "Create Test Harness".

- Configure the test harness for isolated testing.

2. **Define Test Cases:**

- Use the Test Manager in Simulink to create test cases.

- Create test cases for various scenarios:

- AverageVehicleSpeed < 2 kmph

- 2 kmph <= AverageVehicleSpeed <= 250 kmph

- AverageVehicleSpeed > 250 kmph

- Define expected outcomes for each test case.

### Step 4: Run Simulations and Analyze Results

1. Run the simulations for each test case.

2. Compare the simulation results with the expected outcomes.

3. Log and document any discrepancies for further analysis and debugging.

### Step 5: Perform Model Coverage Analysis

1. Open the Coverage Settings in Simulink.

2. Enable coverage analysis and run the simulation.

3. Generate the coverage report and review it to ensure all parts of the model are tested.

4. Identify any untested parts and create additional test cases if necessary.

### Step 6: Conduct Formal Verification

1. Open the Simulink Design Verifier.

2. Define formal properties to verify, such as ensuring the speed limits are respected.

3. Run the Design Verifier analysis to check for property violations.

4. Review the results and document any issues.

### Example Simulink Model Diagram

```plaintext

+-------------------------+ +--------------------------+ +----------------------------+

| AverageVehicleSpeed |--->| Calculating TFT Display |--->| Main Data Filtering |

| | | Speed Block | | Block |

+-------------------------+ +--------------------------+ +----------------------------+

| |

v |

+----------------------------+ | |

| Auxiliary Data Filtering |<---------------------------------+ |

| Block | |

+----------------------------+ |

|

+----------------------------+ |

| TFT Speed Output Block |<-------------------------------------------------------------+

+----------------------------+

```

### Example Requirement Links

1. **Calculating TFT Display Speed Block:**

- Requirement: "Average Vehicle Speed would be displayed only if it's between 2 kmph & 250 kmph."

2. **Main Data Filtering Block:**

- Requirement: "Main Data Filtering subsystem will be activated every 10 milliseconds."

3. **Auxiliary Data Filtering Block:**

- Requirement: "Auxiliary Data Filtering subsystem will be activated every 10 milliseconds."

4. **TFT Speed Output Block:**

- Requirement: "If |(DisplaySpeedFilter - DisplaySpeed)| > 1.5, Vehicle Speed Display = DisplaySpeed, else Vehicle Speed Display = DisplaySpeed Filter."

### Conclusion

By following these steps, you will develop a robust Simulink model for the TFT Cluster Speedometer Software Component. The V&V workflow ensures that the model meets the specified requirements through thorough testing, coverage analysis, and formal verification. This approach provides confidence in the model's correctness and reliability.

Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.