Challenge

Project 1- Traffic Jam Assistant Feature

Traffic Jam Assistant Feature

Introduction to the Feature:

Traffic Jam Assistant is one of the most common feature in Advanced Driver Assistance System. Traffic Jam Assistant helps the driver arrive more relaxed at their destination, even in dense traffic or in traffic jams. As a partially automated comfort function, the system takes over the longitudinal & lateral guidance of the vehicle. This means that the car can drive off, accelerate & brake automatically, as well as steer the vehicle within certain constraints. The driver has to permanently supervise the system & be ready to take over the complete control of the vehicle at any time.

Traffic Jam Assistant system helps to avoid rear end collisions in dense traffic conditions & traffic jams. In Traffic jams, the vehicle takes over driving off, acceleration, braking and steering within same lane.

Basic Working Principle:

Traffic Jam Assistant is based on the sensors and the functionality of the Adaptive Cruise Control (ACC) with stop & go and Lane Keeping Support (LKS). When ACC ‘Stop & Go’ is turned ON, the Traffic Jam Assistant continuously analyses the speed of the surrounding vehicles and compares it with the own driving speed. If the system detects dense traffic or a traffic jam at speeds less than 60 kmph, the driver can activate the functionality by press of a button. The vehicle will now automatically follow the vehicle in front, takes over driving off, acceleration, braking and steering within same lane.

Information regarding the Traffic Jam Assistant will be available to be displayed to the driver in the Instrument Panel Cluster (IPC). The Algorithm which the students need to implement here in this project is predominantly based on IPC units.

1) Creating SLDD:

Firstly I created sldd for that I click on modelling tab-->setting properties-->external data-->new-->apply-->ok-->the sldd window will be pop up-->design data-->click on add signal-->add variables-->create sldd.

Signal/variables Value Data type Dimensions Complexity Min Max
Input_Voltage unit8 -1 auto 0 255
Enable_Dispaly unit8 -1 auto 0 255
Input_Switch boolean -1 auto 0 1
Output_Display unit8 -1 auto 0 255
Optimum_Voltage boolean -1 auto 0 1
VOLTAGE_MINIMUM_RANGE 30 unit8 [1 1] real 0 255
VOLTAGE_MAXIMUM_RANGE 50 unit8 [1 1] real 0 255
OFF_MODE 2 unit8 [1 1] real 0 255
ON_MODE 1 unit8 [1 1] real 0 255
STANDBY_MODE 3 unit8 [1 1] real 0 255
INTERRUPT_1 1 boolean [1 1] real 0 1
INTERRUPT_2 1 boolean [1 1] real 0 1
NO_DISPLAY 0 unit8 [1 1] real 0 255

Sldd:

2)Making Model:

This is the main model subsystem that has three inputs Input_Voltage,Input_Switch and Enable _Display entering into Traffic_Jam_Assistant_Feature the subsystem and one output_Display.

There are 2 requirements are designed in two subsystem.

Requirement No 1:

  • Input Signal “Input_Voltage” is compared against voltage values “VOLTAGE_MINIMUM_RANGE” & “VOLTAGE_MAXIMUM_RANGE”.
  • Incoming input signal “Input_Voltage” must be greater than – equal to “VOLTAGE_MINIMUM_RANGE” and less than – equal to “VOLTAGE_MAXIMUM_RANGE”.
  • Output signal from here is “Optimum_Voltage” which will be one of the inputs to the subsystem “DisplayUnit”.

Under Requirement_No_1:-

Requirement No 2 (DisplayUnit Subsystem):

  • Input Signals are “Optimum_Voltage”, “Input_Switch”,“Enable_Display”. Signal “Enable_Display” must be saturated between the range 0 – 7. Output signal from the subsystem is “Output_Display”.
  • Input Signal “Enable_Display” is compared against pre – defined set of values in a multiport switch. Total data ports in the multiport switch is 5.
  • Multiport switch inputs 1 & 2 is connected to calibration signal “ON_MODE”, Multiport switch inputs 3 & 4 is connected to calibration signal “OFF_MODE” while Multiport switch input 5 is connected to calibration signal “STANDBY_MODE”.
  • The output from Multiport switch is connected to the first input port of the Switch block. The third input port of the Switch block is connected to the calibration signal “NO_DISPLAY”.
  • Meanwhile NOT value of input signal “Input_Switch” is compared in an AND gate against input signal “Optimum_Voltage” and the output from comparing if calibration signals “INTERRUPT_1” & “INTERRUPT_2” are equal. The output of the AND gate is the second input of the switch block.
  • The output from the switch block is “Output_Display”.

Under Requirement_No_1:-

3)Requirement Tagging:

all the requirements are tagged in order for better understandability, anyone who is reviewing the model or who is trying to update the model can get a clear idea of what logic is used in the system. from the requirement manager, we can see what are all are tagged and the description

Firstly I Create word file that is Requirement_For_Traffic_Jam_docx-->paste this requirement into this word file-->select the requirement no.1-->Right click on subsystem block that is Requirement no.1-->Requirement-->Link with selection in word--->That link with automatically And block is highlighted after link.

1)Select first requirement no.1 :

2)Link with subsystem of requirement 1:

3)Select first requirement no.2 :

4)Link with subsystem of requirement 2:

Reqirement Manager report:-

For this requirement manager I click on APPS-->requirement manager-->the new window of report will be open as follows.

4) Signal resolution for input and output:

the inputs and output signals are resolved so the signals will take the values from sldd and pass them to the logical blocks. Otherwise, it may take some junk values if it is unresolved.For this signal resolution I click on signal-->right click on it-->properties-->type signal name-->they alredy provide sldd signal click on required signal -->show signal name resolution.

I this way for all model I resolve and propogate signal for overall model.

5) Model Update.

The model update is done by Ctrl-D. this is done to check for any static errors. If there are no errors coming the model is working fine without any errors.

6) Simulation

The model is simulated too for checking for errors and warnings

7) Configuration Parameter Update

Various configuration parameters are updated as per the code generation the solver type should be fixed for code generation.For this configuration parameter I goes to Modelling-->click on gear box icon-->the following parameter I chnaged as follows:

i) Solver setting:

iii)Diagnostics:

iii) Code generation:

8) Model Advisor Report:

By running the model advisor tool, we can see commonly made modelling errors.For this report I click on modelling-->model advisor-->Maab--> generate report.

model advisor report:

9) Generating Code:

build a model for generating code For this generating code I click on APPS-->embedded coder-->Build-->code generate automatically.

10)Generated code:

/*
 * File: Traffic_Jam_Assistant_Feature_.c
 *
 * Code generated for Simulink model 'Traffic_Jam_Assistant_Feature_'.
 *
 * Model version                  : 1.18
 * Simulink Coder version         : 9.5 (R2021a) 14-Nov-2020
 * C/C++ source code generated on : Wed Feb  2 22:17:11 2022
 *
 * Target selection: ert.tlc
 * Embedded hardware selection: Intel->x86-64 (Windows64)
 * Code generation objectives: Unspecified
 * Validation result: Not run
 */

#include "Traffic_Jam_Assistant_Feature_.h"
#include "Traffic_Jam_Assistant_Feature__private.h"

/* Real-time model */
static RT_MODEL_Traffic_Jam_Assistan_T Traffic_Jam_Assistant_Featur_M_;
RT_MODEL_Traffic_Jam_Assistan_T *const Traffic_Jam_Assistant_Featur_M =
  &Traffic_Jam_Assistant_Featur_M_;

/* Model step function */
void Traffic_Jam_Assistant_Feature__step(void)
{
  uint8_T tmp;

  /* Switch: '/Switch' incorporates:
   *  Constant: '/Constant3'
   *  Constant: '/Constant4'
   *  Constant: '/Constant'
   *  Constant: '/Constant'
   *  Inport: '/Input_Switch'
   *  Inport: '/Input_Voltage'
   *  Logic: '/OR'
   *  Logic: '/AND'
   *  Logic: '/NOT'
   *  RelationalOperator: '/Relational Operator'
   *  RelationalOperator: '/Compare'
   *  RelationalOperator: '/Compare'
   */
  if (((Input_Voltage >= VOLTAGE_MAXIMUM_RANGE) || (Input_Voltage <=
        VOLTAGE_MINIMUM_RANGE)) && (!Input_Switch) && (INTERRUPT_1 ==
       INTERRUPT_2)) {
    /* Saturate: '/Saturation' incorporates:
     *  Inport: '/Enable_Display'
     */
    if (Enable_Display < 7) {
      tmp = Enable_Display;
    } else {
      tmp = 7U;
    }

    /* End of Saturate: '/Saturation' */

    /* MultiPortSwitch: '/Multiport Switch' */
    switch (tmp) {
     case 1:
      /* Switch: '/Switch' incorporates:
       *  Constant: '/Constant'
       */
      Output_Display = ON_MODE;
      break;

     case 2:
      /* Switch: '/Switch' incorporates:
       *  Constant: '/Constant'
       */
      Output_Display = ON_MODE;
      break;

     case 3:
      /* Switch: '/Switch' incorporates:
       *  Constant: '/Constant1'
       */
      Output_Display = OFF_MODE;
      break;

     case 4:
      /* Switch: '/Switch' incorporates:
       *  Constant: '/Constant1'
       */
      Output_Display = OFF_MODE;
      break;

     default:
      /* Switch: '/Switch' incorporates:
       *  Constant: '/Constant2'
       */
      Output_Display = STANDBY_MODE;
      break;
    }

    /* End of MultiPortSwitch: '/Multiport Switch' */
  } else {
    /* Switch: '/Switch' incorporates:
     *  Constant: '/Constant5'
     */
    Output_Display = NO_DISPLAY;
  }

  /* End of Switch: '/Switch' */
}

/* Model initialize function */
void Traffic_Jam_Assistant_Feature__initialize(void)
{
  /* (no initialization code required) */
}

/* Model terminate function */
void Traffic_Jam_Assistant_Feature__terminate(void)
{
  /* (no terminate code required) */
}

/*
 * File trailer for generated code.
 *
 * [EOF]
 */

Conclusion:

Thus for the above project, Simulink Data Dictionary has been created, and Model Advisor Report also created and done with verification and Generation of code.

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.