Project 1 - Wiper control system and Vehicle speed calculation for ABS using Wheel Speed sensor
ANS:
1)
- Wiper control system
Develop Simulink/state flow model for wiper control system based on the given conditions.
Description of Challenge:
Aim:
To develop a Simulink/state flow modules for wiper control system based on the given conditions.
BLOCKS USED:
1.Knob
2.constant
3.Display
4.Inport & Outport
5.Chart: States
Rain density input comes from the external sensor, for the simulation purpose constant block with knob can be taken.
Here,The Density are
1.Less than 100
2.Less than or equal to 600
3.Greater than 600
4.equal to 0
Conditions:
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.Simulink model:


2.SLDD(Simulink data dictionary)
Open -> modelling -> goto modelling properties.

Click on -> External data -> New -> given name -> apply -> ok.

Now a symbol is shown below the model like below image:

Now add all the simulink signals in design data
like below
3.Requirement tagging report:
Open model -> gogot apps - select .Requirement manager.

A window will oen -> in that select .Requirement editor.

Click on new .Requirement set

click on add .Requirement.

Now we have to add remaining .Requirements in .Requirement set.
here,one .Requirement are there.

now we have to link to every subsystem.
click on particular subsystem -> give right click on your .Requirement -> select link from "(name of the subsystem)".

now we have to add remaining links in .Requirement set
here, only one link is there

save all links & .Requirements now we have to generate report.
click on export - generate report -> give name -> apply -> ok
report looks like below:


4.Model advisor -JMAAB Coompliance report:
after developing the model simulating without ant errors.
goto modelling tab -> select model advisor among three options.

choose project_1(entire model) -> select ok.

under by product -> enable modelling standards for JMAAB.
Click on RUN button to see the checks information about the model(fail,pass & warinings).

Before this process we have to make some changes in the configuration settings.

here, i have 108-pass cases 0-fail,17-warnings.

Now we have to generate report under advisor click on generate report.
enter the basic details about the report get generate -> apply -. ok.
the generated report looks like below:


5.Fixed point tool box:
Open model -> goto apps -> select FIXED POINT.

Click on new -> select iterative fixed point conversion among three.

click on prepare it shows about model.

if the preparation is 100% then goto next process.

under collect ranges -> click on use current settings then click on collect ranges.

Now all data types are updated according to the block ranges like below: clcik on propose data types.

property, proposed data types and specified data types are updated.

click on apply data types our model get automatically updated as per the ranges collected.

incase any blocks is not updated data types means we have to explicitly give the ranges.
do updates in SLDD file also
explicitly given in the signal attributes.
in proposed data types summary.
property,proposed data type and specified data type are automatically updated.
here,the picture shoen is after updating the data types.

6.SLDV (Simulink design verifier)Design error detection report:
* what is SLDV-Simulink design verifier.
It is a toolbox for format verification of model for not identify any small errors in the model.
these all errors are not detecting at the model level by Cntrl+B, cntrl+D it can be detected here,
after running model goto apps tab -> select DESIGN VERIFIER.

Awindow will open select DESIGN ERROR DETECTION among three options.

click on error detection settings and make some changes according to therequirement.
like below,enable those options in configuration parameters -> design verifier-> design error detection.

check compatability -> click on detection design errors.
A window will open it tells abut the objectives processed valid and falsified objects, and give it gives elapsed time also,

now we have to generate report SLDV -> click on HTML in the above window it directly open the report.
the generated report looks like below:
it gives detailed information about what are the objects falsified and satisfied.


8.SLDV Test gneration report:
SLDV (Simulink design verifier)
goto apps -> select design verifier.

Awindow will oen for coverage like below, select mode: Test generation among three options.

Make some changes in test generation settings to the requirement. -> clcik on advisor.

It will open a window in that it describes about the objectives(condition) & fit detects any dead logics present in the model.

click on RUN BUTTON test generation starts working.
this is progress report if test generatino, here 16 objectives are processed 5 objectives get satisified and 11 objects are unsatisified.and elapsed time is 0.07

TEST GENERATION REPORT:
report looks like below:


7.Functional tets cases ,MIL,SIL harness, Coverage report:
functional test cases:
here the harness inputs are density.

now we have to perform MIL and SIL tests.
MIL HARNESS;
before this treat subsystem as atomic subsystem.
give right click on particular subsystem -> select test harness - choose create (subsystem name).

a window will open like below, give input:signal builder,output:to workspace.

in advanced parameters verificatin mode as: Normal

after applying -> ok -> the model looks like below:

double click on signal builder a window will open -> click n file -> select import from file.

Browse the file name -> enable SELECT ALL -> placement for selected for selected data; replace existing data base -> confirm selection -> apply -> ok.

these are the inputs for TEST HARNESS:

Now the MIL is looks like below with an extra input(wiperspeed)

TEST HARNESS FOR SIL:
there is no much difference between MIL & SIL The only difference is change the verification mode as; SIL(Software in loop)-> clcik on ok.

Harness inputs are build -> browse the file name -> enable select all - placement for selected data: replace existing data base -> confirm selection -> APPLY -> ok.
now the best harness of SIL model looks like below:

Harness inputs for SIL test:

after uploading th etest cases the model looks like below it added an extra input og wiperspeed.

at buttom of our model a symbol shown below ,if we click on prospective the harness are present in that.
COVERAGE REPORT:
Goto apps -> click on COVERAGE

Make sure you have to enable coverage analysis in configuration settings.

click on RUN coverage our model shows the coverage report like below:
COVERAGE REPORT:



9.AUTO CODE GENERATION REPORT .C & .H CODES:
Goto apps -> select embedded coder.

In c-code select build options to build the code.

make sure you have to do some settings in configuration parameters.
in solver: type:fixed step size ,solver:discrete(no continuos states) and fixed step size-0.01.
In code generation target file is ert.tlc - embedded coder -> apply ->ōk.
now the code generatin report looks like below:

ert main file:

.c file:

.h file:

10.POLY SPACE ANALYSIS REPORT OUTPUTS:
As we don't have the polyspace licence,only steps to find ut the polyspace bug finder report is written below:
POLYSPACE BUG FINDER:
polyspace bug finder is a static analysis tool that can help you verify the absence of runtime errors in your in your matlab code t generate a polyspace bug finder output you can follow these steps:
1.BUG FINDER:
1.open MATLAB and navigate to the directory where you were code is located.
2.open the polyspace bug finder interface by typing polyspace in the MATLAB command window.
3.In the polyspace bug finder interface, select: create new project and give your project name.
4.Select matlab as the programming language for your project. -> Browse the file
5.In the project setting window select the files you want to analyse and specify any additional analysis options.
In configuration settings: Do some settings shown below:
6.Click run analysis to start the analysis process.
7.Once the analysis complete polyspace bug finder will generate report that list any potential bugs it has identified in your code.
8.To view the reports selected view report in the policies bug finder interface.
9.The report will display a list of potential bugs along with a detailed information about each bug and recommendations for how to fix it.
10.You can save the report in various formats such as a pdf, html or XML by selecting export report in the participate bug finder interface.
11.Review the project and fix any potential bugs identified by by policies bug finder to improve the quality and relatable of your matlab code.
Don't have the polyspace licence:
2.CODE FINDER:
Polyspace code prover is a static analysis tool that can help you verify the absence of runtime errors in your matlab code to generate a polyspace code prover output you can follow these steps:
The process of code proven is same as bug finder the only difference is set the code prover at run button:
1.Open MATLAB and navigate to directory where you were code is located.
2.Open the participate code prover interface by typing psrun in the MATLAB command window.
3.In the polyspace code prover interface select create new project and give your project a name.
4.Select matlab as a programming language for your project.
5.In the project settings window select the files you want to analyse and specify any additional analysis options.
6.Click run analysis to start the analysis process.
7.Once the analysis is complete polyspace code prover will generate and output that indicates whether your code is free of runtime errors.
8.To view the output selective view results in the pollyspace code prover interface.
9.The output will indicate whether your code is free of runtime errors or if any errors were detected.
10.You can you can save the output in various formats such as PDF, html or XML by selecting export results in the polyspace code prover interface.
11.Review the output and address any errors identified by polyspace code prover to ensure the correctnees and reliable of your matlab code.
11. TEST MANAGER REPORTS-BASELINE & BACK-TO-BACK TESTINGS:
BASELINE TESTING:
what iis baseline testing:
In baseline comparision the model output is calculated and it is compared against the excepted results.
Goto apps -> select simulink test.

click on NEW give name of the test apply - ok.


under requirements:
click on add -> open link editor.
a dialog box will open clicl on new -> type : requirement set - use current -> browse the file for requirements ->selct particular requirement -> apply -> ok.

under System under test:
click on browse(model.slx file)upload it.
now the requirement & System under test:are shown below.

Automatically thye inputs are created in excel sheet.like below
Under inputs:
click n create -> browse the file.Now your inputs are mapped like below,
Under baseline criteria:
Click on capture,

Now baseline also mapped like above
Under coverage:
click on coverage to collect: record coverage for system under test & decision automatically set.

Save all -> click on RUN button.
Here,all test cases are passed.

Output wiper speed output:Density

Output wiper speed output of sim output.

wiper speed1 output:

save all tests -> generate report on the basis of tests.right click on results -> give title name ,author andresults : all test,format:PDF -> apply -ok.

The report looks like below:


BACK TO BACK TEST:
In test manager -> click on new -> give your test name -> apply -> ok.
click on new select test for model component.
window will open give top model name before this make sure give a click on model such that it easily identify tour model.-> click on next.
under test inputs: select use design verifier to generate test inputs scenarios. click on next.

under verification strategy: enable perform back-to- back testing
simulation1:Normal
simualtion2;SIL Click on next

Under generated tests: select the harness input scenario: inports and format is EXecl
enable -add tests to the currently selcted test file. -> click on Done.

design verifier report get generated:

A window will open it describes about how many objects are satisfied & unsatisfied.
here13 objects are satisfied and 3 objects are unsatisfied.

Go back to original model at bottom of the model symobol is shown click on that.
MIL & SIL harness are present in that
MIL: harness shown below:

SIL:harness shown below:

Now we have to add the requirement click on New -> type: requirement set -use

Under the simulation: the information automatically get updated.
requirements & simulation are updated like below,

under coverge settinge:
Enable record coverage for system under test.

under inputs:
inputs are automatically get mapped,like below.
save all the tests -> click on RUN button.

here,all test cases are passed shown below.
Harness 1 has 75% decision and 100% execution.

wiperspeed 1of sim output:

the graph shown below is output of wiperspeed:1

the graph shown below is output of wiperspeed1

Iteration 2:69% of decision and 100% execution.

Now we have to generate report on back to back test.
give right click on results -> give title name, author and results for: file format PDF ->apply -> ok -> create.

TEST GENERATION REPORT:


2)
Vehicle speed calculation for ABS using Wheel Speed sensor
Deveop Simulink/state flow model for the vehicle speed calculation unit inside the ABS system for the below conditions.
Description of Challenge:
fl, fr, rl and rr are the wheel speeds of front left, front right, rear left and rear right respectively.
After developing the model it looks like below;
1.Simulink model file:
BLOCKS USED;
1.constant
2.chart
3.outport
