Project 1 - Wiper control system and Vehicle speed calculation for ABS using Wheel Speed sensor
Wiper Control System:
- Procedure to solve the problem statement
- Developing the Simulink model as per the problem statement given above.
-
Explanation of the Simulink model:
- We have taken one input (RainDensity) and one output (WindVelocity)
- A stateflow logic is implemented to determine the appropriate velocity of the wiper motor depending on the rain density.


- The logic for the system is as follows:

- If RainDensity < 3 g/cm^3 then the WindVelocity output will be 100 rpm
- If RainDensity >=3 g/cm^3 and RainDensity <7 g/cm^3 then the WindVelocity output will be 200 rpm
- If RainDensity>=7 g/cm^3 and RainDensity < 10 g/cm^3 then the WindVelocity output will be 500 rpm
-
SLDD of the Simulink model:
- RainDensity is a sensor in the car and WindVelocity is an output parameter signal which will be given to the motor. We have prepared the SLDD for the same.

-
Requirement Tagging:
- Go to Apps -> click "Requirement editor" -> click "New Requirement Set"
- Save the requirement set
- Select the requirement set and click Add Requirement
- In the Properties pane, we entered details for the requirement. In total, we added 3 requirements from the problem statement.
- Linked the requirements to their specified blocks by right-clicking the requirement and select Link from "object name"

-
Model Advisor Report:
- First "Run" the program without errors.
- Then click the "Model Advisor" tab from the "Modeling" section.
- Select the "modeling standards for JMAAB v5.1 and v6.0" and unselect everything else.

- Then press "Run checks" and try to clear the maximum warnings as possible.

- Model Advisor Report is attached separately for the same.
-
Fixed Point Tool Test:
- Go to Apps -> click on "Fixed point tool"
- select "iterative fixed point conversion"

- Click "collect ranges"

- Click "Propose data types" and one suggestion to change the data type for input RainDensity was suggested.

- Click "Apply datatypes"

-
SLDV Design Error Detection Report:
- Go to Apps and click "Design Verifier"
- Go to "Error detection settings" click "report" enable the option "Generate a report of the result" and click Apply
- Click "Detect Desing Errors" and a report is generated.

- The design Error Detection report is attached separately.
-
Coverage Report:
- Go to the modeling tab and click Model settings
- Go to coverage and enable the option "Enable coverage analysis"
- Click "Run ( Coverage)"
-
MIL:
- Right-click on the main subsystem and create the harness
- Select "Signal builder" as the inport and "from workspace" as the outport
- Enable "create external harness of the model" and click apply
- This creates a separate harness.
- Now, click on the signal builder and inport the functional test case Excel file.
- This will create an extra output port from the signal builder. We take the output from this to a different workspace named "calculated wind velocity" and output from the harness has a workspace block named "MIL wind velocity".
- With the help of this, we can compare the values and observe that the same values are obtained from the model as calculated. This makes the MIL testing successful.


- The MIL & Data inspector report's coverage report is attached for your reference.

-
SLDV Test Generation:
- Go to Apps and click "Design Verifier"

- Go to "Test Generation" select "MCDC" and click Apply

- Click "Test Generation" and a report is generated
- Result Summary:

- Test Generation Report:

- Test Generation Harness:

-
Baseline Testing:
- Go to Apps -> "Simulink Test Manager" -> Click "New" -> Click "Test file"
- In the test file section fill in the details for the following tabs.
- Requirements: Add the slreq file to the requirements section by checking the requirement toolbox option inside the tab.

- Go to the next section "System under test". In this add the Simulink model .slx file to this section.
- Next, go to the inputs section and create an Excel sheet where all the input data or the input signals of the Simulink model are created.
- After creating the excel sheet, we have to manually enter all the input states we prepared in the functional test case file.


- Click the next section "Baseline Criteria". In this, we have to capture the time and output of the designed Simulink model inside an Excel sheet. Once, we click the capture button, an Excel sheet is created with the time and output data based on the modification done inside the inputs Excel sheet.


- Go to the next section "Coverage settings". Enable the "Record coverage system under test"

- After this, click RUN. Results are shown under the section "results and artifacts"
- A report is generated for Baseline testing.


-
Back to Back Testing:
- Open apps -> Go to "Simulink Tester" -> Go to "Simulink Test Manager"
- Test Manager window opens separately. Select New -> Test File -> Go back to the model and select the "Top Model" i.e the 1st subsystem of the model -> Comeback to the Test manager window and select New again -> Click "Test for component model"
- "Create Test for component model window opens" -> Click the "use current model" tab for the top model to be selected -> Click Next
- Test inputs -> Select the option with "Use Design Verifier to generate test input scenarios" and click Next
- Verification strategy -> Select "Perform back-to-back testing" and select Normal for simulation.1 and SIL for simulation 2. Also, enable "Set Model coverage objectives as Enhanced MCDC"
- Generated test -> Select input source as "Inports" and file format as "Excel" -> Click Done
- Two harnesses were created. Normal harness and SIL harness.
-
SIL Testing:
- Harness for SIL is made by right-clicking the subsystem and selecting Create Harness.
- Then select SIL Harness in advance parameters.
- SIL Harness is created with inport as the signal editor and outport as the scope
- We import functional test cases into the signal editor and compare the output of calculated test cases with SIL output with a sum block.
- We subtract the SIL output from the calculated output and give it to the scope
- We observe zero value which shows that the SIL testing is successful.

-
Auto-Code Generation:
- Right-click on the subsystem
- Go to C/C++ code
- Build this system
- Code gets generated after these steps.
Vehicle speed calculation for ABS using Wheel speed sensors:
- Procedure to solve the problem statement
- Developing the Simulink model as per the problem statement given above.
-
Explanation of the Simulink model:
- We have taken four inputs (Fl, Fr, Rl, Rr) and one output (VehicleSpeed). Inputs are wheel sensors.
- A stateflow logic is implemented to determine the appropriate velocity of the vehicle depending on the wheel sensors.



- The logic for the system is as follows:
- If all the wheel sensors are working properly, then the output will be the average speed of all the wheels
- If any of one wheel is not working, then the average speed of the remaining 3 sensors will be taken
- If any of the two wheels are not working, then the average speed of the remaining 2 wheel sensors will be taken.
- If only 1 wheel sensor is working then the average vehicle speed will be shown as 0.
-
SLDD of the Simulink model:
- Fl, Fr, Rl, and Rr are the wheel sensors in the car and VehicleSpeed is an output parameter signal that will be the average speed of the wheels used for ABS. We have prepared the SLDD for the same.

-
Requirement Tagging:
- Go to Apps -> click "Requirement editor" -> click "New Requirement Set"
- Save the requirement set
- Select the requirement set and click Add Requirement
- In the Properties pane, we entered details for the requirement. In total, we added 3 requirements from the problem statement.
- Linked the requirements to their specified blocks by right-clicking the requirement and selecting Link from "object name"

-
Model Advisor Report:
- First "Run" the program without errors.
- Then click the "Model Advisor" tab from the "Modeling" section.
- Select the "modeling standards for JMAAB v5.1 and v6.0" and unselect everything else.

- Then press "Run checks" and try to clear the maximum warnings as possible.
- Model Advisor Report is attached separately for the same.
-
Fixed Point Tool Test:
- Go to Apps -> click on "Fixed point tool"
- select "iterative fixed point conversion"

- Click "collect ranges"

- Click "Propose data types" and one suggestion to change the data type for input RainDensity was suggested.

-
SLDV Design Error Detection Report:
- Go to Apps and click "Design Verifier"
- Go to "Error detection settings" click "report" enable the option "Generate a report of the result" and click Apply
- Click "Detect Desing Errors" and a report is generated.


- The design Error Detection report is attached separately.
-
Coverage Report:
- Go to the modeling tab and click Model settings
- Go to coverage and enable the option "Enable coverage analysis"
- Click "Run ( Coverage)"
-
MIL:
- Right-click on the main subsystem and create the harness
- Select "Signal builder" as the inport and "from workspace" as the outport
- Enable "create external harness of the model" and click apply
- This creates a separate harness.
- Now, click on the signal builder and inport the functional test case Excel file.
- This will create an extra output port from the signal builder. We take the output from this to a different workspace named "calculated wind velocity" and output from the harness has a workspace block named "MIL wind velocity".
- With the help of this, we can compare the values and observe that the same values are obtained from the model as calculated. This makes the MIL testing successful.

- The MIL & Data inspector report's coverage report is attached for your reference.


- MIL Data Inspector:

-
SLDV Test Generation:
- Go to Apps and click "Design Verifier"

- Go to "Test Generation" select "MCDC" and click Apply

- Click "Test Generation" and a report is generated
- Result Summary & Test Generation Report:

- Test Generation Harness:

-
Baseline Testing:
- Go to Apps -> "Simulink Test Manager" -> Click "New" -> Click "Test file"
- In the test file section fill in the details for the following tabs.
- Requirements: Add the slreq file to the requirements section by checking the requirement toolbox option inside the tab.

- Go to the next section "System under test". In this add the Simulink model .slx file to this section.
- Next, go to the inputs section and create an Excel sheet where all the input data or the input signals of the Simulink model are created.
- After creating the Excel sheet, we have to manually enter all the input states we prepared in the functional test case file.


- Click the next section "Baseline Criteria". In this, we must capture the time and output of the designed Simulink model inside an Excel sheet. Once, we click the capture button, an Excel sheet is created with the time and output data based on the modification done inside the inputs Excel sheet.


- Go to the next section "Coverage settings". Enable the "Record coverage system under test"

- After this, click RUN. Results are shown under the section "results and artifacts"
- A report is generated for Baseline testing.

-
Back to Back Testing:
- Open apps -> Go to "Simulink Tester" -> Go to "Simulink Test Manager"
- Test Manager window opens separately. Select New -> Test File -> Go back to the model and select the "Top Model" i.e the 1st subsystem of the model -> Comeback to the Test manager window and select New again -> Click "Test for component model"
- "Create Test for component model window opens" -> Click the "use current model" tab for the top model to be selected -> Click Next
- Test inputs -> Select the option with "Use Design Verifier to generate test input scenarios" and click Next
- Verification strategy -> Select "Perform back-to-back testing" and select Normal for simulation.1 and SIL for simulation 2. Also, enable "Set Model coverage objectives as Enhanced MCDC"
- Generated test -> Select input source as "Inports" and file format as "Excel" -> Click Done
- Two harnesses were created. Normal harness and SIL harness.
SIL Testing:
- Harness for SIL is made by right-clicking the subsystem and selecting Create Harness.
- Then select SIL Harness in advance parameters.
- SIL Harness is created with inport as the signal editor and outport as the scope
- We import functional test cases into the signal editor and compare the output of calculated test cases with SIL output with a sum block.
- We subtract the SIL output from the calculated output and give it to the scope
- We observe zero value which shows that the SIL testing is successful.

Auto-Code Generation:
- Right-click on the subsystem
- Go to C/C++ code
- Build this system
- Code gets generated after these steps.