Challenge

Project 1 (Mini Project on Vehicle Direction Detection

Aim:

To create a Simulink model to determine the vehicle direction with the given inptus and conditions in a Matlab Simulink.

Objectives:

  • 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).

Steps for Requirement-1:

  • Initially an input of SteeringWheel_YawDegreeInput is taken in which streeing wheel degree will be given.
  • Then 3 constant blocks, which consistof Right,left turn & straight drive angle values.
  • Then the SteeringWheel_YawDegreeInput and the all three directions angles are compared and chosen accordingly with the help of switch blocks and taken as Vehicle_turn_status output.
  • First if sterring degree is greater than or equal to right turn then right turn will be passed through switch block.
  • If it less than left then left turn is passed, else if it is equal to zero then straight drive angle is passed through the switch and it is taken as vehicle_turn_status as output.
  • This is now converted into a subsystem with SteeringWheel_YawDegreeInput as input and vehicle_turn_status as output.
  • The subsystem is shown below.

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

Steps fro Requirement-2:

  • Here the inputs taken are Vehicle_turn_status which is output of before subsystem and the CameraInput_RoadSign.
  • And 3 constant which consist of right,left turn & straight roadsign data.
  • The vehicle_turn_status and 3 roadsign values are compared to check if they are equal with relational operators.
  • Then after relational operators they are connected to logical operator AND along with the CameraInput_RoadSign.
  • Mux block is used to combine these three signal and given to output.
  • This is also converted into a subsystem with CameraInput_RoadSign & Vehicle_turn_status as inputs and Vehicle_Direction_Indicator as output.
  • The subsystem is shown below.

Simulink Model:

Given Signals and Calibration Data list:

Creation of SLDD:

  • The given data is linked to the model with the help of Simulink Data dictionary.
  • In model configuration, open link to data dictionary and create a file.

  • Then add all the signals and constants, assign the datatypes & required data in the data dictionary in this form according to the given data.

  • For input values such as Steeringwheel_yawDegreeinput & camerainput change inital values to check the direction.

Code generation:

  • In model configuration, in code generation change the target file to ert.tlc embedded coder.

  • Then click the generate code in code generation in built model option.

  • Thus the code is generated.

Results:

Here will give different streeingwheel input values to check the model is giving correct results I.e., correct directions as per the given angle in input.

Right turn:

Here the input is given according to the condition that is more than or equal to 30 deg and the in output display block we can observe the value 1 for right turn indicator and 0 indicates no turn for those particular directions.

Left turn:

Similarly as input value is changed according to condition that is -120 and we can observe in the output display block that left turn indicator value is 1 and remaining are zero.

Straight drive:

Here the input value is given as 0 and we can observe the value as 1 for the Straight drive indicator and 0 for remaining which means vehicle go in Straight.

Conclusion:

  • Thus a model is created in simulink to know the direction at which vehicle turns with given angle and other all required parameters and signals.
  • Then the model was simulated and observed the results to compare that the results obtained are as per the conditions.
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.

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.