Project 1 (Mini Project on Vehicle Direction Detection
PROJECT-1 MINI PROJECT- VEHICLE DIRECTION DETECTION
AIM:- To create a simulink model for vehicle direction detection as per given requirements.
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 vehicle is basically identifying the direction the vehicle is taking based on the camera input.
Camera reads the road signs & stores into its memory with unique values for left turn, right turn & straight drive. Depending on the direction it is taking, 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 along - side 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.
Objective of Mini Project:
- Development of MATLAB Simulink model as per requirement.
- Tag the requirements to the simulink model; tagging requirement 1 & requirement 2 to their corresponding subsystems is fine.
- MBD compliant changes, Data Dictionary creation & code generation is added advantage, and that is not 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
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 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 & 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 local signal from requirement 1 (Signal Name: Vehicle_Turn_Status) & an input signal from 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 output signal (Signal Name: Vehicle_Direction_Indicator).
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 |
- |
- |
* step by step process of build this project.
step1:-1 simulink model
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 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 & output of this requirement is a local signal (Signal Name: Vehicle_Turn_Status)
- as per requirement-1 to consider the blocks and input port is connected to the compare to zero blocks and those are connected to the switch blocks and aslo conect the constant blocks for the calibration of values are connected to the output port.
- these are all angular signals to the compare to threshold voltage then compare value is >0 then right_turn_angularlimit wiil work else ==0 the straight_drive _steering _angle will work...else ~=0 then left_turn_angularlimit will be work. this total requirement-1 model shuold be work as a vehicle _turn_status subsystem.

Requirement – 2:
- Keep this requirement as a separate subsystem. Inputs to this requirement are local signal from requirement 1 (Signal Name: Vehicle_Turn_Status) & an input signal from 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 output signal (Signal Name: Vehicle_Direction_Indicator).
- as per given requirement-2 to design the vehicle_direction_indication subsystem.
- as per given requirement-2 to consider the required blocks after that it will connected properlly input is connected to the relatational operator to logical operator AND blocks and and another input is directely connected to the AND blocks to use the compare and road signs with camera input and to get the output. mux is connected to the signal covertion to the output port. it is compare the vehicle_turn_status and camera input.then finnaly get output it will be indicate the direction of the vehicle.this requirement-2 model treat as a vehicle direction indicator model.

- the above vehicle _direction_indication model is to created as a subsystem.

- after that to create a vehicle_direction_detection model by using this requirements both subsystems after that it treat subsyatem then that is the vehicle_direction_detection simulink model.


- next to change the model configaration settings those are solver settings and code generation settings.



- the SLDD_file is created to store the calibration values and input and output signals.
- as per our requirement to create the sldd file with calbration values and input,output values.after that calling this sldd file to the simulink model of vehicle direction detedtion.
- In this case, we have updated our signals inputs in the sldd file so we have to add the signal into the connection lines to get the proper output.So, we have used the resolve and propagation method on this model.
Steps to get resolve and propagate signals.
once right-click the line a popup window can be opened select properties option to open the resolve and propagate option.
- In that window, we may type the required input signals which is updated in the sldd file and select the resolve option to resolve the signal.
- In that window, type the required input signals which is updated in the sldd file and select the propagate option to propagate the signal.

step4:- to generate the code.
- Select the apps option which is available on the top the Simulink window then select the embedded code option to generate the code are shown below.



step5:-Model advisor.
- A model advisor is a tool that automatically checks the model for errors using pre-defined checks The model advisor can analyze the entire simulink model.to selecting the model advisor option as shown below.

to click the model advisor tool one window will be opend to select the modelling stadards for MAB and next click run checks...next to get the model advisor report....next save it as a pdf..

step6:- Requirement tagging.
- make sure while doing this requirement tagging process is should be open in ms word application.
- Once we right-click the vehicle _turn_status subsystem then select the requirements option and select the link to the word.

- Once we right-click the vehicle_direction_indication subsystem then select the requirements option and select the link to the word.
RESULT:-
Hence, created on simulink model for the vehicle direction detection as per given requirements.
conclusion:-
Hence, created on simulink model for the vehicle direction detection as per given requirements.The vehicle direction determination as per the requirement, all the signals are defined in Simulink data dictionary. All input and output signals are resolved and propagated. Code has been generated using Embedded Coder. Run the model advisor tool to see any errors. since there are no errors in Model Advisor Report.