Challenge

Project 1 (Mini Project on Vehicle Direction Detection

Aim of the Projct-

To create and simulate the Vehicle Direction Determination based on requirements using Matlab and Simulink.

Objective:-

  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.
  3. Create SLDD file in simulink based on the input and output signals.
  4. Simulate the model and note down the results by varying logical operator.

Introduction:-

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.

For this project,there are several steps taken which are as follows:-

  • Developement of the Desired model
  • Configuration Parameter Setting
  • Linking of the Simulink Data Dictionary
  • Requirement Tagging
  • Signal resolving and Signal Propogation
  • Model Advisor Report Generation
  • C-code generation
  • MIL Test
  • SIL Test

PROCEDURE:

1. Development of Simulink model as per requirements-

SIMULINK MODEL:

Under Vehicle Direction Detection Subsystem:

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

  • SteeringWheel_YawDegreeInput is used as input data.
  • The input is compared with relation operator as

- if the input is greater than zero then relational operator will give as output 1 and output will be as Right_Turn_AngularLimit.And if the condition fails then it will check below condition.

-if the input is equal to zero then relational operator will give as output 1 and output will be as Straight_Drive_Steering_Angle.Else below condition will be as output.

- if the input is not matched with above condition then third(Left_Turn_AngularLimit) will be output.

  • Output signal is denoted as -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).

  • Here output from requirement_1(Vehicle_Turn_Status) is as input.
  • Here input(Vehicle_Turn_Status) is compared with stored value using equal relation operator.
  • Output of Relation operator is applied to one of the input port of AND Logic Operator.
  • Second Input of AND Logic Operator is CameraInput_RoadSign which shows only two values as 1 or 0.
  • So When both the Input to AND operator is 1 then output will be according as Vehicle_Direction_Indicator.

2) Configuration Parameter settings:-

Solver Type is changed from variable step to Fixed step and Solver type is selected as Discrete ( No continuous state) and also sample time is declared as 0.01 sec as per the project requirement.

Also under the Code generation option selecting embedded real time as system target file (ert.tlc) under target selection option.

3-Linking of the Simulink Data Dictionary-

(a) -Link the SLDD file to model .

(b)-To creat the new file ,select New Tab.After selecting new ,a new window will pop-up which asked to save the file .Edit file name and save it to same folder in which Model is.

(c)-After saving file ,click on Model Explorer-

(d)-After doing Above step use below step -

(e)-click in add,if you want to add signal ,click on simulink signal(as denoted 2) and if constant then click simulink parameter(as denoted 1).

(f)-Now you can edit parameter as needed.Click on signal or constant in the dictionary object and after that on the right side as marked arrow.In which you can edit the parameter as needed.

4) Requirement Tagging:-

A MS Word file is created which contain all the requirements and necessary information to develop the model appropiately. This Word file is tagged for both the subsystem requirement1 and Requirement2 respectively.

Highlite the title as below-

now go as below-Clich right click on subsystem then>Requirements>LinkTo Selection in Word.

Similarily requirement tagging of the Requirement2 has been done:-

Highlite the required as below-

now go as below-Clich right click on subsystem then>Requirements>LinkTo Selection in Word.

5) Signal Resolving and Signal Tagging:-

All the input signal are resolved at the root level (which is comes at firt time)of the model and propogated (where the resolved signal is used again)accordingly as shown below:-

Right click on signal>Properties>then tick as right below image.

Output signal of Requirement1 is resolved at the root level and now propogated as -

6) Model Advisor Report Generation:-

Before Advisor report generation,RUN the Model and ensure that the model should run withour error then go for below process-

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:-

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 sleected check and clicking over there will run the selected checks

The result of the Modelling Standard for MAB is as shwon below:-

7)C-code generation-

The Code Generation is made by going over the APP tab and selecting the Embedded coder over there :-

Now clicking over the build option will create the C code as shown below:-

The generated code look on screen and a new file will created in located directory.

8)MIL Test-

(a)Now right click to subsystem and select to Test Harness and go to "Create for Subsystem".

(b)-A new window will open as below-

(c) - Select on Inport and choose Signal Builder (as with the help of signal builder we can create input and output values as wave form).And at output side use Outport.

In the Advanced Properties>Verification Mode>Normal(For MIL test)>Ok

(d)-After selecting signal builder and then "OK",Test Harness will created as below.And to play the test ,added Demux and Scope.

(e)Create signal builder using below file-

(f)Double click on signal builder ,a new window will open like below.Select 'File'>Import from File>Browse

Select file which have to draw the wave.

(g)After click on browse select file and then select All>Replace existing dataset>Confirm Selection>Apply.

By applying the signal will generated.

(h)Harness Input V/s Obtained Output.

(i)We have added a difference block to see the difference between Input V/s Obtained-

As the difference of expected to obtained value is zero which shows the correct MIL Test Envoronment.

9)SIL Test-

(a)Now right click to subsystem and select to Test Harness and go to "Create for Subsystem".

(b)-A new window will open as below-

(c) - Select on Inport and choose Signal Builder (as with the help of signal builder we can create input and output values as wave form).And at output side use Outport.

In the Advanced Properties>Verification Mode>Software in the loop(For SIL test)>Ok

(d)-After selecting signal builder and then "OK",Test Harness will created as below.And to play the test ,added Demux and Scope.

(e)Create signal builder using below file-

(f)Double click on signal builder ,a new window will open like below.Select 'File'>Import from File>Browse

Select file which have to draw the wave.

(g)After click on browse select file and then select All>Replace existing dataset>Confirm Selection>Apply.

By applying the signal will generated.

(h)Harness Input V/s Obtained Output.

(i)We have added a difference block to see the difference between Input V/s Obtained-

As the difference of expected to obtained value is zero which shows the correct SIL Test Envoronment.

In this manner the Mini Project of Vehicle Direction Detection has been finally made and the zip file containing all the necessary document is attached.

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.