Challenge

Project on Wiper control system and Vehicle speed calculation for ABS using Wheel Speed sensor

Answer :

Wiper control system :

Aim : To Develop Simulink Model For Wiper Control System Based on the Given Conditions

Description of Challenge :

1. If the density of the rain is low, then wiper rotates with low speed, the output signal should be 100rpm.
2. If the density of the rain is medium, then wiper rotates with low speed, the output signal should be 200rpm.
3. If the density of the rain is high, then wiper rotates with low speed, the output signal should be 500rpm.

1) Model Development :

Subsystem :

No Rain Subsystem :

Low Rain Susystem :

Medium Rain Subsystem :

High Rain Subsystem :

2) Simulink Data Dictionary (SLDD) :

3) Requirement Tagging :

Create the Functional and SwReq File into the xls. File.

Click On the New Requirement Set :

After That Click on the Add Requirement :

Linking the Requirement :

Link to the Subsystem

Requirement Report :

4) Model Advisor (JMAAB) :

Going to the Simulink Model >> Click on the Modelling >> Model Advisor.

5) Fixed Point Tool :

Run thee Model Error Free >> and then Click on the Fixed Point Tool >> Iterative Fixed-Point Conversion.

Simulation Model :

Simulink Data Dictionary(SLDD) Before Applying the Fixed point Tool:

Block Before Applying Fixed Point Tool

Procedure to Start the Fixed Point Tool :

Collect Ranges using Current Settings

After Applying The Fixed Point Tool :

Simulink Data Dictionary (SLDD) After Applying the Fixed Point Tool:

6) SLDV Design Error Detection Report :

Goto the Model >> Open the Design Verifier App >> Select the Design Error Detection >> then Click on Design Error Detection Setting.

Design Error Detection Report :

7) Functional Test Cases, MIL, SIL Harness, Coverage Report :

Simulink Model :

Functional Test Cases :

Model in Loop (MIL) :

Signal Builder Waveform :

MIL Output :

MIL Coverage Report :

Software in Loop (SIL) :

Signal Builder Waverform :

SIL Output :

SIL Coverage Report :

Code Generated :

8) SLDV Test Generation Report :

Goto the Model Run the model Error Free >> App >> Desgin Verifier >> Click one the Test Generation

Click on the Test Generation Setting

Result Summary of Test Generation :

Report :

9) Auto Code Generation main .c & .h Files :

Code Report :

.c File :

/*
* Event Support License -- for demonstration use and event support. Not
* for government, research, commercial, or other organizational use.
*
* File: Wiper_Control_sys.c
*
* Code generated for Simulink model 'Wiper_Control_sys'.
*
* Model version : 1.9
* Simulink Coder version : 9.8 (R2022b) 13-May-2022
* C/C++ source code generated on : Sat Jul 15 23:14:34 2023
*
* Target selection: ert.tlc
* Embedded hardware selection: Intel->x86-64 (Windows64)
* Code generation objectives: Unspecified
* Validation result: Not run
*/
#include "Wiper_Control_sys.h"
#include "Wiper_Control_sys_private.h"
/* External inputs (root inport signals with default storage) */
ExtU_Wiper_Control_sys_T Wiper_Control_sys_U;
/* External outputs (root outports fed by signals with default storage) */
ExtY_Wiper_Control_sys_T Wiper_Control_sys_Y;
/* Real-time model */
static RT_MODEL_Wiper_Control_sys_T Wiper_Control_sys_M_;
RT_MODEL_Wiper_Control_sys_T *const Wiper_Control_sys_M = &Wiper_Control_sys_M_;
/* Model step function */
void Wiper_Control_sys_step(void)
{
/* Outport: '/No_Rain' incorporates:
* Constant: '/Constant2'
* Switch: '/Switch'
*/
Wiper_Control_sys_Y.No_Rain = 0;
/* Switch: '/Switch' incorporates:
* Inport: '/Rain_Density'
* RelationalOperator: '/Relational Operator1'
*/
if (Wiper_Control_sys_U.Rain_Density > 960) {
/* Outport: '/High_Rain' incorporates:
* Constant: '/Constant2'
*/
Wiper_Control_sys_Y.High_Rain = 8000;
} else {
/* Outport: '/High_Rain' incorporates:
* Constant: '/Constant1'
*/
Wiper_Control_sys_Y.High_Rain = 0;
}
/* End of Switch: '/Switch' */
/* Switch: '/Switch' incorporates:
* Inport: '/Rain_Density'
* Logic: '/AND'
* RelationalOperator: '/Relational Operator'
* RelationalOperator: '/Relational Operator1'
*/
if ((Wiper_Control_sys_U.Rain_Density > 0) &&
(Wiper_Control_sys_U.Rain_Density <= 480)) {
/* Outport: '/Low_Rain' incorporates:
* Constant: '/Constant2'
*/
Wiper_Control_sys_Y.Low_Rain = 1600;
} else {
/* Outport: '/Low_Rain' incorporates:
* Constant: '/Constant1'
*/
Wiper_Control_sys_Y.Low_Rain = 0;
}
/* End of Switch: '/Switch' */
/* Switch: '/Switch' incorporates:
* Inport: '/Rain_Density'
* Logic: '/AND'
* RelationalOperator: '/Relational Operator'
* RelationalOperator: '/Relational Operator1'
*/
if ((Wiper_Control_sys_U.Rain_Density > 480) &&
(Wiper_Control_sys_U.Rain_Density <= 960)) {
/* Outport: '/Medium_Rain' incorporates:
* Constant: '/Constant2'
*/
Wiper_Control_sys_Y.Medium_Rain = 3200;
} else {
/* Outport: '/Medium_Rain' incorporates:
* Constant: '/Constant1'
*/
Wiper_Control_sys_Y.Medium_Rain = 0;
}
/* End of Switch: '/Switch' */
}
/* Model initialize function */
void Wiper_Control_sys_initialize(void)
{
/* (no initialization code required) */
}
/* Model terminate function */
void Wiper_Control_sys_terminate(void)
{
/* (no terminate code required) */
}
/*
* File trailer for generated code.
*
* [EOF]
*/

10) Polyspace Analysis Report/ Output :

Procedure to Analysis the Polyspace Report

Bug Finder :

  • Firstly Generated the .C code
  • Initially, open the Polyspace in that new project click on start new project.
  • The Project Properties dialogue box will open in that give the project name as we saved in the MATLAB,then select the location where it we need to save after that click Next or use the default location.
  • Then ,it asks for the Projrct source,click on browserand select the folder where th .c file are generated then optionally we can add the include folder then clock on finish,the polyspace environment will open.
  • In the configuraton settings option called Target & compiler select the source code language as c,change the target processor as X86_64.
  • In the coding standards & code Metrics in that enable the check MISRA C:2004 also select the calculate the code metrics option
  • After that go to bug finder analysis under that select the default one.
  • Go to reporting enable the generate report option and ouput formet as PDF or any file we need
  • Finally save the polyspace and run the Bug Finder.

Code Prover :

  • Befour going to the Code Prover First setup the Configration setting.
  • In Configuration go to the Code prover verification and under code prover verification option.
  • Click on the Check Behavior and Enable the option (i,e Allow Negative Operand for left shifts).
  • and also click on the Consider Non-Finite floats.
  • Then After you go to the Precision
  • In Precision Select the Precision level -2 and Verification Level is Software Safety Analysis Level-2.
    then After Click on Save Botton the Configration setting will be save.
    then After We Run the Code Prover.
  • And After Click on the Dashboard option and see the Results.

11) Test Generation Report- Baseline and Back to back Testing :

Baseline Testing :

Run the model>> goto the Simulink Test >>Click on the Simulink Test Manager >> then Click on New >> Test File>> Create Test Name.

Click on the Requirement

then after Click one the System Under Testing

Click on the Input

then after click on the Baseline Criteria and click on the Capture

Click on the Coverage Setting >> Click on Enable Option.

then After Save and Run it.

Results :

Baseline Criteria Results :

Baseline Criteria Output :

Baseline Testing Report :

Back To Back Testing :

Click on the Simulink Test Manager

Click on New

Generated MIL And SIL Model :

Click on the Requirement

then After Click on the System under test and harness are link automatically.

then Click on the Input and enable it.

after that click on coverage Setting and Enable the Coverage.

and Save and Run it.

Results :

Equivalence Criteria Result :

Back to back testing Report :

---------------------------------------------------------------------------------------------------------------------------------------------

2. Vehicle speed calculation for ABS using Wheel Speed sensor

Aim : Develop Simulink/state flow model for the vehicle speed calculation unit inside the ABS system for the below conditions.

1) Simulink Model :

Subsystem :

2) Simulink Data Dictionary(SLDD) :

3) Requirement Tagging :

Create the Functional and SwReq into the .xls files.

Click on New Requirement Set

After that Click on the Add Requirement

Linking the Requirement:

Requirement Report :

4) Model Advisor (JMAAB) Report :

going to Simulink model >> Click o Modelling >> Click on the Model Advior.

5) Fixed-Point Tool :

Run the model Error Free then Goto the >> App>> Click on the Fixed point Tool.

Simulink Model :

Simulink Data Dictionary(SLDD) Before applying Fixed Point Tool

Blocks Before applying fixed point tool :

Procedure to Start Fixed-Point Tool :

Apply Data Type

After Applying the Fixed-Point Tool

SLDD After Applying Fixed-Point Tool

6) SLDV Design Error Detection Report :

Goto the Model >> Click on the App>> Select the Design Verifier >> Design Error Detection>> Design Error Detection Setting.

Simulink Model :

Design Error Detection Report :

7) Functional Test Cases, MIL,SIL Harness, Coverage Report :

Functional Test Cases :

Simulink Model :

Signal Builder Waveform :

MIL Model :

MIL Scope Output :

MIL Coverage Report :

Coverage Report :

SIL Model :

Signal Builder Waveform :

SIL Output :

SIL Coverage Output :

SIL Coverage Report :

Code Generated after Running Model :

8) SLDV Test Generation Report :

Goto the Model Run the model Error Free >> App >> Desgin Verifier >> Click one the Test Generation.

Simulink Design Verifier Test Generation : Advisor

SLDV Report :

9) Auto code Generation main .c & .h Files :

Generated Code:

/*
* Event Support License -- for demonstration use and event support. Not
* for government, research, commercial, or other organizational use.
*
* File: Speed_Control_Abs.c
*
* Code generated for Simulink model 'Speed_Control_Abs'.
*
* Model version : 1.16
* Simulink Coder version : 9.8 (R2022b) 13-May-2022
* C/C++ source code generated on : Sun Jul 16 16:23:24 2023
*
* Target selection: ert.tlc
* Embedded hardware selection: Intel->x86-64 (Windows64)
* Code generation objectives: Unspecified
* Validation result: Not run
*/
#include "Speed_Control_Abs.h"
#include "rtwtypes.h"
/* Named constants for Chart: '<S1>/Chart' */
#define Speed_Control_Abs_IN_Mode ((uint8_T)1U)
#define Speed_Control_Abs_IN_Mode1 ((uint8_T)2U)
#define Speed_Control_Abs_IN_Mode10 ((uint8_T)3U)
#define Speed_Control_Abs_IN_Mode11 ((uint8_T)4U)
#define Speed_Control_Abs_IN_Mode12 ((uint8_T)5U)
#define Speed_Control_Abs_IN_Mode13 ((uint8_T)6U)
#define Speed_Control_Abs_IN_Mode14 ((uint8_T)7U)
#define Speed_Control_Abs_IN_Mode2 ((uint8_T)8U)
#define Speed_Control_Abs_IN_Mode3 ((uint8_T)9U)
#define Speed_Control_Abs_IN_Mode4 ((uint8_T)10U)
#define Speed_Control_Abs_IN_Mode5 ((uint8_T)11U)
#define Speed_Control_Abs_IN_Mode6 ((uint8_T)12U)
#define Speed_Control_Abs_IN_Mode7 ((uint8_T)13U)
#define Speed_Control_Abs_IN_Mode8 ((uint8_T)14U)
/* Block states (default storage) */
DW_Speed_Control_Abs_T Speed_Control_Abs_DW;
/* External inputs (root inport signals with default storage) */
ExtU_Speed_Control_Abs_T Speed_Control_Abs_U;
/* External outputs (root outports fed by signals with default storage) */
ExtY_Speed_Control_Abs_T Speed_Control_Abs_Y;
/* Real-time model */
static RT_MODEL_Speed_Control_Abs_T Speed_Control_Abs_M_;
RT_MODEL_Speed_Control_Abs_T *const Speed_Control_Abs_M = &Speed_Control_Abs_M_;
/* Model step function */
void Speed_Control_Abs_step(void)
{
/* Chart: '<S1>/Chart' */
if (Speed_Control_Abs_DW.is_active_c3_Speed_Control_Abs == 0U) {
Speed_Control_Abs_DW.is_active_c3_Speed_Control_Abs = 1U;
Speed_Control_Abs_DW.is_c3_Speed_Control_Abs = Speed_Control_Abs_IN_Mode;
/* Outport: '<Root>/Speed' */
Speed_Control_Abs_Y.Speed = 0.0;
} else {
switch (Speed_Control_Abs_DW.is_c3_Speed_Control_Abs) {
case Speed_Control_Abs_IN_Mode:
Speed_Control_Abs_DW.is_c3_Speed_Control_Abs = Speed_Control_Abs_IN_Mode1;
/* Outport: '<Root>/Speed' incorporates:
* Inport: '<Root>/FL'
* Inport: '<Root>/FR'
* Inport: '<Root>/RL'
*/
Speed_Control_Abs_Y.Speed = ((Speed_Control_Abs_U.FR +
Speed_Control_Abs_U.RL) + Speed_Control_Abs_U.FL) / 3.0;
break;
case Speed_Control_Abs_IN_Mode1:
case Speed_Control_Abs_IN_Mode10:
case Speed_Control_Abs_IN_Mode11:
case Speed_Control_Abs_IN_Mode12:
case Speed_Control_Abs_IN_Mode13:
case Speed_Control_Abs_IN_Mode14:
case Speed_Control_Abs_IN_Mode2:
case Speed_Control_Abs_IN_Mode3:
case Speed_Control_Abs_IN_Mode4:
case Speed_Control_Abs_IN_Mode5:
case Speed_Control_Abs_IN_Mode6:
case Speed_Control_Abs_IN_Mode7:
case Speed_Control_Abs_IN_Mode8:
break;
default:
/* case IN_Mode9: */
break;
}
}
/* End of Chart: '<S1>/Chart' */
}
/* Model initialize function */
void Speed_Control_Abs_initialize(void)
{
/* (no initialization code required) */
}
/* Model terminate function */
void Speed_Control_Abs_terminate(void)
{
/* (no terminate code required) */
}
/*
* File trailer for generated code.
*
* [EOF]
*/

10) Polyspace Analysis Report/Output :

Procedure to Analysis the Polyspace Report

Bug Finder :

  • Firstly Generated the .C code
  • Initially, open the Polyspace in that new project click on start new project.
  • The Project Properties dialogue box will open in that give the project name as we saved in the MATLAB,then select the location where it we need to save after that click Next or use the default location.
  • Then ,it asks for the Projrct source,click on browserand select the folder where th .c file are generated then optionally we can add the include folder then clock on finish,the polyspace environment will open.
  • In the configuraton settings option called Target & compiler select the source code language as c,change the target processor as X86_64.
  • In the coding standards & code Metrics in that enable the check MISRA C:2004 also select the calculate the code metrics option
  • After that go to bug finder analysis under that select the default one.
  • Go to reporting enable the generate report option and ouput formet as PDF or any file we need
  • Finally save the polyspace and run the Bug Finder.

Code Prover :

  • Befour going to the Code Prover First setup the Configration setting.
  • In Configuration go to the Code prover verification and under code prover verification option.
  • Click on the Check Behavior and Enable the option (i,e Allow Negative Operand for left shifts).
  • and also click on the Consider Non-Finite floats.
  • Then After you go to the Precision
  • In Precision Select the Precision level -2 and Verification Level is Software Safety Analysis Level-2.
    then After Click on Save Botton the Configration setting will be save.
    then After We Run the Code Prover.
  • And After Click on the Dashboard option and see the Results.

12) Test Manager Report-Baseline & Back to Back Testing :

Baseline Testing :

Run the model>> goto the Simulink Test >>Click on the Simulink Test Manager >> then Click on New >> Test File>> Create Test Name.

Click on the Simulink Test Manager.

Click on the New

after that Click on the Requirement and Link the Requirement

then after Click one the System Under Testing

Click on the Inputs

After that Click on the Baseline Criteria

Click on the Coverage Setting and Enable the Coverage

then Save And Run it.

Results :

Baseline Criteria Results :

Baseline Generated Report :

Back To Back Testing :

Going to Model and run the model with Error >> Click on the App>> then Click on the Simulink Test>> Simulink Test Manager >> Click on New >> After that Click on the >> Test For Model Component.

Generated MIL and SIL Model :

Click on the Requirement >> Add Requirement

Click on the System Under Test

Click on the Coverage Setting and Enable the Coverage

Then Save and Run it.

Results :

Equivalence Criteria Results :

Iteration: 1

Back to Back Testing Report :

All Results and Files Are attached in below.

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.