Challenge

Project 1 (Mini Project on Vehicle Direction Detection

AIM: To create a Simulink model of Vehicle Direction Detection as per the Requirement data.

GIVEN: -

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_Signal 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 outputs 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).

Objectives of the project:

  1. Development of MATLAB Simulink model as per requirement.
  2. Tag the requirements to the Simulink model; tagging requirement 1 & requirement 2 to their corresponding subsystems is fine.
  3. MBD compliant changes, Data Dictionary creation & code generation is added advantage, and that is not the scope of this project.
  4. 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.
  5. Choose sample time for all signals as 0.01s



Simulink Model:

  • The vehicle direction detection Simulink model.

  • In the above model, the steering wheel yaw degree and camera road sign are given as the inputs and getting the output as the vehicle direction indicator.
  • The required SLDD file is created.

  • Link the SLDD file with the Simulink model using link to data dictionary in modelling tab

  • After creating subsystems for requirement 1 as mentioned in the question, we must tag it with the word file following the steps:-

  • Copying the requirements as given and then creating it as a word document file and saving it in the same directory/location of the slx file.
  • Now we select the heading in the word document and, right-click on the Subsystem -> Requirements -> Link to selection in word.
  • The subsystem will be popped in yellow color after tagging.

  • After linking all the requirements

Building model based on Requirement 1:

  • Based on the degree of steering wheel yaw degree input, we have to find whether the vehicle is turning left or turning right, or going straight.
  • Here I have separated the turning cases into two switches,
  • The inputs were, a)right_turn _angularlimit, b)left_turn_angularlimit, c)straight_drive_steeringangle, and d)steeringwheel_yawdegreeinput.
  • In the first switch, we are comparing straight drive angle and right turn angular limit, with the steering wheel angular limit as base input.
  • If the input from the steering wheel yaw degree input is equal to any of the other input conditions, the switch will give the output based on the inputs either true or false.
  • Also, we can split this switch into two by adding a constant input for comparison.
  • If both the inputs are not equal to the steering wheel yaw degree input, switch one will give output as 0 and the condition will move to the second switch.
  • Where the input from the first switch and left turn angular limit is compared and output will be given out as 1.

Building model based on Requirement 2:

  • Here we have to compare the given input signals,(camera_input,straight_roadsign,leftturn_roadsign,rightturn_roadsign)and the vehicle_turn_status from the output of requirement 1.
  • use relational blocks and logical operator blocks to compare all the input values to get vehicle_direction_indicator.

To do code generation, first convert the subsystems into atomic subsystems from block parameter option.

  • Change the required solver settings and code generation settings in the configuration parameters.

  • Use the embedded c code to generate the code.

  • Generated c code is :-

  • Now we do the model advisor check.

  • Here is the Model Advisor Report

CONCLUSION: Created Data dictionary file and Simulink model for Vehicle Direction Detection System as per the requirements and data mentioned.

Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.