Project 1 (Mini Project on Vehicle Direction Detection
Aim:-
To Develop the Model as per the requirement and to tag the model with the requirements.
Objective:
To Development of MATLAB Simulink model as per requirement.
Tag the requirements to the simulink model; tagging requirement 1 & requirement 2 to their corresponding subsystems.
MBD compliant changes, Data Dictionary creation & code generation creation
Storage class for Input signals: ImportedExtern;
Storage class for Output signal: Export to File;
Storage class for local signals: localizable;
Storage class for calibration signals: Const.
Choose sample time for all signals as 0.01s
Model Creation as per Requirements:-
Requirement 1:-
As per Requirement 1 the input signal is compared against 3 values, one each for left turn, right turn & straight drive to say which specific direction the steering wheel is turning towards.
By using switch blocks to compare & develop this requirement. Keep this requirement in a subsystem & output of this requirement is a Vehicle_Turn_Status.
As per the above condition the requirement 1 subsystem is created.
Here the input is SteeringWheel_YawDegreeInput and the output is Vehicle_Turn_Status.

The subsystem for Requirement1 is created and is taged to its requirement as shown below.

Requirement 2:-
A separate subsystem for requirement 2 is created. Inputs to this requirement 1 are Vehicle_Turn_Status & an input signal from camera CameraInput_RoadSign, which confirms the occurrence of a road sign.

Signal Vehicle_Turn_Status is compared against RightTurn_RoadSign, LeftTurn_RoadSign, Straight_RoadSign, if each of them is found equal, then each of the three corresponding output is compared against the camera input signal.
Using a logical operator block, only one among them is finally given as output signal Vehicle_Direction_Indicator.
As per above requirements the subsytem is created as shown below

The Requirement 2 is tagged as seen below

Model:-

Subsystem Model:-
This contains the Requirement1 and requirement2 subsystem in it.

Sldd File Creation:-
The sldd file is created using link to data dictionary and which is as shown belown

The Values and data types are given as per the Signals and Calibration Data List which is shown below
Signals & Calibration Data List:
|
Signal / Calibration Name |
Signal Type |
Data Type |
Dimension |
Min |
Max |
Initial Value |
Units |
|
SteeringWheel_YawDegreeInput |
Input |
Int16 |
1 |
-180 |
180 |
- |
Deg |
|
CameraInput_RoadSign |
Input |
Boolean |
1 |
0 |
1 |
- |
- |
|
Vehicle_Turn_Status |
Local |
Int16 |
1 |
-180 |
180 |
- |
Deg |
|
Right_Turn_AngularLimit |
Calibration |
Int16 |
[1 1] |
-180 |
180 |
30 |
Deg |
|
Left_Turn_AngularLimit |
Calibration |
Int16 |
[1 1] |
-180 |
180 |
-120 |
Deg |
|
Straight_Drive_Steering_Angle |
Calibration |
Int16 |
[1 1] |
-180 |
180 |
0 |
Deg |
|
RightTurn_RoadSign |
Calibration |
Int16 |
[1 1] |
-180 |
180 |
30 |
|
|
LeftTurn_RoadSign |
Calibration |
Int16 |
[1 1] |
-180 |
180 |
-120 |
|
|
Straight_RoadSign |
Calibration |
Int16 |
[1 1] |
-180 |
180 |
0 |
|
|
Vehicle_Direction_Indicator |
Output |
Boolean |
1 |
0 |
1 |
- |
- |
Model Setting:-
The Model should have a sample time set to 0.01.
Thus under Modelling > Model Setting > Solver
The Data Type is choosen as Fixed Step and Solver as Discrete Solver and The Step time is set to 0.01 which is shown as below.

Model Advisor:-
Under Modelling>Model Advisor>Task>Modelling Standards for MOB the Advisor checks are made.

No Error is found for the model made.
Result:-
Thus the Modelling of Vehicle Direction Detection is done using MATLAB and Simulink as per requirements provided and the Requirements are taged to its respective subsystem.