Project 1 (Mini Project on Vehicle Direction Detection
1.
A.Aim of the project:
The aim of this project is to identify the direction of the vehicle movement based on the camera input.
B.Objective of the project:
I.Development of MATLAB/Simulink model as per requirement.
II.Tagging Requirement-1 and Requirement-2 to the corresponding subsystems in the model.
III.MBD compliant changes,data dictionary creation and code generation contribute to added advantages.
IV.While choosing code generation storage class for input signals 'Imported Extern',storage class for output signals 'Export to file',storage class for local signals 'localizable' and storage class for calibration signals 'constant'.
V.Sample time for all signals is chosen as 0.01 sec.
Requirement-1:
Steering wheel input as yaw rate (Signal name: SteeringWheel_YawDegreeInput) is the input for this system.This is compared against three angular values, one each for left turn, right turn & straight drive (Calibration Values: Right_Turn_AngularLimit, Left_Turn_AngularLimit, Straight_Drive_Steering_Angle) to find which specific direction the steering wheel is turning towards.Switch blocks have been used to compare and develop this requirement while keeping this requirement in a subsystem and extracting output of this requirement as a local signal (Signal Name: Vehicle_Turn_Status)
Requirement-2:
This requirement is fulfilled as a separate subsystem. Inputs to this requirement are local signal from Requirement-1 (Signal Name: Vehicle_Turn_Status) and 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 any one 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).
Signal and Calibration data as given in the assignment are enclosed in the Excel sheet Veh_Dir_Ind enclosed.
The Simulink model for the mini project as developed as per the conditions and requirements given is shown in Veh_Direction_Detection.slx enclosed.The inputs to the model are SteeringWheel_YawDegreeInput and CameraInput_RoadSign while the output is Vehicle_Direction_Indicator.Essentially the main model comprises of two subsystems.The input to the first subsystem is SteeringWheel_YawDegreeInput and its output is Vehicle_Turn_Status.The output is generated by comparing SteeringWheel_YawDegreeInput with Right_Turn_Angular_Limit,Left_Turn_Angular_Limit and Straight_Drive_Steering_Angle.This subsystem fulfills the details specified in Requirement-1.The output from the first subsystem is the input to the second subsystem along with CameraInput_RoadSign.Here the Vehicle_Turn_Status is compared against Road signs and then compared with the actual value of CameraInput_ RoadSign.The second subsystem fulfills the details specified in Requirement-2.
Two MS Word files have been created which contain the necessary specifications to develop the model.These are tagged for both the subsystems corresponding to Requirement-1 and Requirement-2.
Data Dictionary Creation:
For this purpose in the Simulink Editor on the Modeling tab under Design 'Link to Data Dictionary' was clicked and then in the MATLAB properties dialog box 'New' was clicked to create a data dictionary.The data dictionary was named Veh_Dir_Ind.sldd.It was saved after clicking 'Apply'.
Configuration Parameter Settings:
'Treat as Atomic Unit' was selected for the model.
In the Simulink Editor on the modeling tab 'Model Settings' was clicked.
Solver Type was changed from Variable step to Fixed step and Solver type was selected as Discrete ( No continuous state).Also sample time was declared as 0.01 sec as per the project requirement.
Further after adding Simulink Signals and Simulink Parameters to the data dictionary all input signals were resolved at the root level of the model and propogated accordingly.Output Signal of Requirement-1 was resolved at the root level and then propagated.Same was done for output signal of Requirement-2 also.
Code Generation:
This was done by going over to APPS tab and selecting EMBEDDED CODER over there.Next CCODE was chosen and finally 'Build' option was used to generate the C code.Before carrying out this exercise under the Code generation option embedded real time was selected as system target file (ert.tlc) under target selection option.
Model Advisor Report Generation:
To generate the report we have to go over the Modelling tab and then there at Extreme left corner there is a option of Model Advisor and selecting Model Advisor in it.
It will ask to select the system for which the report generation is to be taken up.
Then under the By task option unselecting all the previously selcted option and then selecting the Modelling Standard for MAB there and in the right box there is option to Run selected check and clicking over there will run the selected checks.
System Selector -> Model Advisor ->Configuration Editor
->Model Advisor Dashboard ->Upgrade Advisor
System is chosen from the System Hierarchy.
Also a HTML report is generated thereafter by clicking over the option Generate Report.
All the relevant documents related to this mini project are attached herewith.