Challenge

Project 1- Traffic Jam Assistant Feature

Aim Of The Project:

Implementation of the Traffic Jam Assistant algorithm which would predominantly feature in the IPC algorithm.

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.

AIM

  • This model must be developed in MATLAB Simulink as per MBD guidelines.
  • Code Generation Profile must be in Embedded Coder.
  • Simulink Data Dictionary must be created for the model & must be linked to the model.
  • Model Advisor Report is mandatory & this will be followed by Code Generation.

Overall Model of Traffic Jam Assistant Feature

Requirement 1

Requirement 2

C code Build

/*
 * File: TrafficJamAssistantFeature.c
 *
 * Code generated for Simulink model 'TrafficJamAssistantFeature'.
 *
 * Model version                  : 1.1
 * Simulink Coder version         : 9.7 (R2022a) 13-Nov-2021
 * C/C++ source code generated on : Thu Sep  8 14:24:28 2022
 *
 * Target selection: ert.tlc
 * Embedded hardware selection: Intel->x86-64 (Windows64)
 * Code generation objectives: Unspecified
 * Validation result: Not run
 */

#include "TrafficJamAssistantFeature.h"
#include "rtwtypes.h"
#include "TrafficJamAssistantFeature_private.h"

/* Exported data definition */

/* Definition for custom storage class: ExportToFile */
uint8_T Output_Display;                /* '<S3>/Switch' */

/* Const memory section */
/* Definition for custom storage class: Const */
const boolean_T INTERRUPT_1 = true;    /* Referenced by: '<S3>/Constant4' */
const boolean_T INTERRUPT_2 = true;    /* Referenced by: '<S3>/Constant5' */
const uint8_T NO_DISPLAY = 0U;         /* Referenced by: '<S3>/Constant3' */
const uint8_T OFF_MODE = 2U;           /* Referenced by: '<S3>/Constant1' */
const uint8_T ON_MODE = 1U;            /* Referenced by: '<S3>/Constant' */
const uint8_T STANDBY_MODE = 3U;       /* Referenced by: '<S3>/Constant2' */

/* Real-time model */
static RT_MODEL_TrafficJamAssistantF_T TrafficJamAssistantFeature_M_;
RT_MODEL_TrafficJamAssistantF_T *const TrafficJamAssistantFeature_M =
  &TrafficJamAssistantFeature_M_;

/* Model step function */
void TrafficJamAssistantFeature_step(void)
{
  /* Switch: '<S3>/Switch' incorporates:
   *  Constant: '<S3>/Constant4'
   *  Constant: '<S3>/Constant5'
   *  Constant: '<S4>/Constant'
   *  Constant: '<S5>/Constant'
   *  Inport: '<Root>/Input_Switch'
   *  Inport: '<Root>/Input_Voltage'
   *  Logic: '<S2>/AND'
   *  Logic: '<S3>/AND'
   *  Logic: '<S3>/NOT'
   *  RelationalOperator: '<S3>/Relational Operator'
   *  RelationalOperator: '<S4>/Compare'
   *  RelationalOperator: '<S5>/Compare'
   */
  if ((Input_Voltage >= 30) && (Input_Voltage <= 30) && (!Input_Switch) &&
      (INTERRUPT_1 == INTERRUPT_2)) {
    uint8_T tmp;

    /* Saturate: '<S3>/Saturation' incorporates:
     *  Inport: '<Root>/Enable_Display'
     */
    if (Enable_Display <= 1) {
      tmp = Enable_Display;
    } else {
      tmp = 1U;
    }

    /* End of Saturate: '<S3>/Saturation' */

    /* MultiPortSwitch: '<S3>/Multiport Switch' */
    if (tmp == 1) {
      /* Switch: '<S3>/Switch' incorporates:
       *  Constant: '<S3>/Constant'
       */
      Output_Display = ON_MODE;
    } else {
      /* Switch: '<S3>/Switch' incorporates:
       *  Constant: '<S3>/Constant2'
       */
      Output_Display = STANDBY_MODE;
    }

    /* End of MultiPortSwitch: '<S3>/Multiport Switch' */
  } else {
    /* Switch: '<S3>/Switch' incorporates:
     *  Constant: '<S3>/Constant3'
     */
    Output_Display = NO_DISPLAY;
  }

  /* End of Switch: '<S3>/Switch' */
}

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

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

/*
 * File trailer for generated code.
 *
 * [EOF]
 */
Definition
Function defined in TrafficJamAssistantFeature.c

Conclusion:

The model corresponding to Traffic Jam Assistant feature is successfully implemented. All the compliant changes pertaining to MBD, linking of the model to the SLDD, Code generation and ultimately generation of the Model Advisor Report is presented with detailed analysis.

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.