MBD - 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.
Model
Requirement1
Requirement2

Explanation of Model
The given model has 3 input signals of which one is given to the requirement 1 and other two along with output of requirement 1 are given to requirement 2. The final output is taken from requirement 2.
In requirement 1, the input signal Input_Voltage is compared against two calibration values. Only when both the relational operators give true value we can say our Input_Voltage is with the desired range and hence we get the Optimum_Voltage.
In requirement 2, the input signal Enable_Display is given. It is saturated between 0 to 7 using saturation block and the output of the saturation block is given to a multiport switch control port. Port 1 & 2 are given ON_MODE calibration value, Port 3 & 4 are given OFF_MODE calibration value and port 5 is default port given a STANDBY_MODE calibration value. Therefore the input from Enable_Display ensures which mode will be chosen from these 3. The output of multiport switch is given to the true condition of switch.
The inversion of input signal Input_Switch and Optimum_Voltage is compared using AND logic. The calibration values INTERRUPT_1 & INTERRUPT_2 are compared using equal to operator while the output of this and the AND block are compared. Result of this is given to the control port of switch.
This indicates that the calibration values INTERRUPT_1 & INTERRUPT_2 must be equal and the the inversion of Input_Switch and Optimum_Voltage must be 1, only then the switch will take the results from the multiport switch else it will give calibration value NO_DISPLAY.
SLDD

Generated Code
/*
* File: trafficjam.c
*
* Code generated for Simulink model 'trafficjam'.
*
* Model version : 1.3
* Simulink Coder version : 9.5 (R2021a) 14-Nov-2020
* C/C++ source code generated on : Sat Nov 13 11:27:26 2021
*
* Target selection: ert.tlc
* Embedded hardware selection: Intel->x86-64 (Windows64)
* Code generation objectives: Unspecified
* Validation result: Not run
*/
#include "trafficjam.h"
#include "trafficjam_private.h"
/* Exported data definition */
/* Definition for custom storage class: ExportToFile */
uint8_T Output_Display; /* '/Switch' */
/* Const memory section */
/* Definition for custom storage class: Const */
const boolean_T INTERRUPT_1 = 1; /* Referenced by: '/Constant2' */
const boolean_T INTERRUPT_2 = 1; /* Referenced by: '/Constant1' */
const uint8_T NO_DISPLAY = 0U; /* Referenced by: '/Constant5' */
const uint8_T OFF_MODE = 2U; /* Referenced by: '/Constant3' */
const uint8_T ON_MODE = 1U; /* Referenced by: '/Constant' */
const uint8_T STANDBY_MODE = 3U; /* Referenced by: '/Constant4' */
const uint8_T VOLTAGE_MAXIMUM_RANGE = 50U;/* Referenced by: '/Constant1' */
const uint8_T VOLTAGE_MINIMUM_RANGE = 30U;/* Referenced by: '/Constant' */
/* Real-time model */
static RT_MODEL_trafficjam_T trafficjam_M_;
RT_MODEL_trafficjam_T *const trafficjam_M = &trafficjam_M_;
/* Model step function */
void trafficjam_step(void)
{
/* local block i/o variables */
boolean_T Optimum_Voltage;
uint8_T tmp;
/* RelationalOperator: '/Equal' incorporates:
* Constant: '/Constant'
* Constant: '/Constant1'
* Inport: '/Input_Voltage'
* RelationalOperator: '/GreaterThanOrEqual'
* RelationalOperator: '/LessThanOrEqual'
*/
Optimum_Voltage = ((Input_Voltage >= VOLTAGE_MINIMUM_RANGE) == (Input_Voltage <=
VOLTAGE_MAXIMUM_RANGE));
/* Switch: '/Switch' incorporates:
* Constant: '/Constant1'
* Constant: '/Constant2'
* Inport: '/Input_Switch'
* Logic: '/AND'
* Logic: '/AND1'
* Logic: '/NOT'
* RelationalOperator: '/Equal'
*/
if ((INTERRUPT_1 == INTERRUPT_2) && ((!Input_Switch) && Optimum_Voltage)) {
/* Saturate: '/Saturation' incorporates:
* Inport: '/Enable_Display'
*/
if (Enable_Display > 5) {
tmp = 5U;
} else if (Enable_Display < 1) {
tmp = 1U;
} else {
tmp = Enable_Display;
}
/* 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: '/Constant3'
*/
Output_Display = OFF_MODE;
break;
case 4:
/* Switch: '/Switch' incorporates:
* Constant: '/Constant3'
*/
Output_Display = OFF_MODE;
break;
default:
/* Switch: '/Switch' incorporates:
* Constant: '/Constant4'
*/
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 trafficjam_initialize(void)
{
/* (no initialization code required) */
}
/* Model terminate function */
void trafficjam_terminate(void)
{
/* (no terminate code required) */
}
/*
* File trailer for generated code.
*
* [EOF]
*/
Conclusion:
The model has been created as per the requirements and all the signals and parameters have been declared in Simulink data dictionary and it has been linked to the model.
The requirements have been tagged and the treacebility report is generated.
Model Advisor Check has been done and the Model Advisor Report has been generated.
The Code genartion is also done using Embedded Coder and the Code is submitted.