Project 1 (Mini Project on Vehicle Direction Detection
The objective of the Mini Project:
- Development of MATLAB Simulink model as per requirement.
- Tag the requirements to the Simulink model; tagging requirements 1 & requirement 2 to their corresponding subsystems is fine.
- MBD compliant changes, Data Dictionary creation & code generation is added advantage, and that is not the scope of this project.
- If choosing code generation, 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
TASK:
we have to perform tasks according to the given requirements-
Requirement - 1:
- Steering wheel input as yaw rate (Signal name: SteeringWheel_YawDegreeInput) is the input for this system.
- This is compared against 3 angular values, one each for a left turn, right turn & straight drive (Calibration Values: Right_Turn_AngularLimit, Left_Turn_AngularLimit, Straight_Drive_Steering_Angle) to say which specific direction the steering wheel is turning towards.
- Use switch blocks to compare & develop this requirement. Keep this requirement in a subsystem & the output of this requirement is a local signal (Signal Name: Vehicle_Turn_Status).
Requirement – 2:
- Keep this requirement as a separate subsystem. Inputs to this requirement are a local signal from requirement 1 (Signal Name: Vehicle_Turn_Status) & an input signal from the camera (Signal Name: CameraInput_RoadSign), which confirms the occurrence of a road sign.
- Signal Vehicle_Turn_Status is compared against calibration values (Calibration Values: 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 an output signal (Signal Name: Vehicle_Direction_Indicator).
General Overview:
Identifying the direction of the vehicle is one of the important & diverse features in Autonomous driving & Advanced Driver Assistance Features. This particular sub-feature of identifying the direction of the vehicle is identifying the direction the vehicle is taking based on the camera input.
The camera reads the road signs & stores them into its memory with unique values for a left turn, right turn & straight drive. Depending on the direction it is taking, the final indication is given to the driver – as an indication if he is driving in the recommended direction or not.
Vehicle Direction Determination can also be coupled alongside features like GPS systems to identify whether the vehicle is reaching its destination in an optimized manner. This sub-feature can also be used along with Lane Detection, Highway Warning, Ramp Entry / Exit in Wrong Way Detection, etc.



To, create a model follow the steps done below-
STEP1-
create sldd_file-
all the input and outputs calibration parameters are saved in SLDD so while simulation the model takes all the values and its parameter from the Simulink data dictionary.

how to create sldd_file-
first, go to modeling tag> click on a link to data dictionary> then click on new and name the file >ok.


STEP-2
DESIGN THE MODEL ACCORDING TO THE GIVEN REQUIREMENTS -
This main model subsystem that having two inputs SteeringWheel_yawDegreeInput and CameraInput_RoadSign entering into the Vehicle Detection Determination subsystem and outputting Vehicle_Direction_Indicator.

THERE ARE TWO REQUIREMENTS DESIGNED IN THE MODEL

REQUIREMENT1--
The subsystem of 1 Requirement-



REQUIREMENT-2



STEP-3 REQUIREMENT TAGGING-
all requirements are tagged in order for a better understanding anyone who is reviewing the model or who is trying to update the model can get a clear idea of what logic is used in the system from the requirement manager we can see what are all tagged and description
1. firstly I wrote all requirements in a word file then I selected my first requirement then I return in the model select my first subsystem right clicked on it then goto requirement and link to selection in word my subsystem box is highlighted and linked in this way I link my second subsystem with my requirement 2




STEPS-4 Signal Resolving
signal resolution for input and output:
the input and output signals are resolved so the signals will take the values from sldd and pass them to the logical blocks otherwise it may take some junk values it is unresolved

to propagate the signal-

step-4
Model update:
the model update is done by ctrl+d this is done to check for any static error, if there are no errors coming the model is working fine with any error
simulation:
the model is simulated too for checking for errors and warning
Configuration:
various configuration parameters are updated as per code generation the solver type should be fixed for code generation.


STEP-5
Model Advisory Report:
by running the model advisor tool I can see commonly made mmodelingerrores.
I go in modeling and click on model advisor than their selected by-product in that select MAB and run selected check I got the following result is passed successfully.


Creation Of MIL(the model in the loop) and SIL(software in loop) test.
FOR THE CREATION OF A TEST HARNESS WE USE THE FOLLOWING PROCESS
Creation Of MIL(the model in the loop)
- IN a subsystem block we click on test harness, for creating harness click subsystem name"Vehicle_Direction'.

After clicking Vehicle_direction one block parameter is open, where we can change the required parameter. here we change the input parameter instead of the signal builder block to get desired output


completing all processes we get one new model of test harness which is the Simulink model itself
the below sample model of the test harness, here we are able to see the left side of the input signal builder is added.
Adding the signal builder input in the model, here we add the sum block and scope block to verify the
model in the loop test(MIL). for this when we run the model we got desired output.

by clicking the signal builder block we Import an excel file. there we have given the input, simulation time, and various directions of the vehicle
- input
- Left_turn
- Right_turn
- Round_turn

through that excel sheet, we got the signal builder waveform which is shown below.
here we can clearly see the input and direction of the WAVEFORM
- Left_turn
- Right_turn
- Round_turn

Creation Of SIL(the Software in the loop):
Same procedure we repeat again which we are using in MIL testing

completing all processes we get one new model of test harness which is the Simulink model itself

Code Generation:
for this code generation, I go into the apps tab then the embedded coder I chose c code and build
that has been attached to the code window.

CODE -