Challenge

Project 1- Traffic Jam Assistant Feature

AIM: To develop a single feature of Traffic Jam Assistant algorithm using MATLAB & SIMULINK.

OBJECTIVE:

1. Model development as per MBD guidelines.

2. Creation of Simulink Data Dictionary (SLDD) file

3. Code Generation using Embedded Coder

4. Generate Model Advisor Report

INTRODUCTION:

Traffic Jam Assistant is one of the most common feature in Advanced Driver Assistance System. Traffic Jam Assistant helps the driver amive 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.

SOLUTION:

There are certain requirements given in the problem to implement the model Traffic Jam Assistant. The following are the steps followed :

1.Create the Simulink Data Dictionary(SLDD) file from given data, carefully declare the inputs and outputs in SLDD file.

SLDD File attached for refernce

2. As per REQUIREMENT -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 the subsystem "DisplayUnit".


It is implemented as:

Subsyatem consist of:

3. As per REQUIREMENT No 2 (Display Unit Subsystem).

  • Input Signals are "Optimum_Voltage, "Input SwitchEnable Display": Signal "Enable Display must be saturated between the range 7 Output signal from the subsystern is "Output Display.
  • Input Signal "Enable Display" is compared against pre-defined set of values in a multiport switch. Total data ports in the multport 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 " & "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"

It is implemented as:

Subsyatem consist of:

The model is simulated and and there are no error:

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 dreing 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 (PC) The Algorithm which the students need to implement here in this project is predominantly based on IPC units.

Now check the Model advisor and the report snap is as follows:

model advisor report attached in below.

For the model the Code generation is completed and it is as snap is given below:

c.code is:

.c file:
/*
* File: autosar_project.c
*
* Code generated for Simulink model 'autosar_project'.
*
* Model version : 1.2
* Simulink Coder version : 9.3 (R2020a) 18-Nov-2019
* C/C++ source code generated on : Thu Feb 3 21:51:01 2022
*
* Target selection: ert.tlc
* Embedded hardware selection: Intel->x86-64 (Windows64)
* Code generation objectives:
* 1. Execution efficiency
* 2. RAM efficiency
* Validation result: Not run
*/
include "autosar_project.h"
/* External inputs (root inport signals with default storage) */
ExtU rtU;
/* External outputs (root outports fed by signals with default storage) */
ExtY rtY;
/* Model step function */
void autosar_project_step(void)
{
/* Outport: '/Output_Display' incorporates:
* Inport: '/INTERRUPT_1'
* Inport: '/INTERRUPT_2'
* Inport: '/Input_Switch'
* Inport: '/Input_Voltage'
* Logic: '/AND'
* Logic: '/AND'
* Logic: '/AND1'
* Logic: '/NOT'
* RelationalOperator: '/Greater_Than_Equal_To'
* RelationalOperator: '/Less_Than_Equal_To'
* RelationalOperator: '/Equal'
* Switch: '/Switch'
*/
rtY.Output_Display = ((rtU.Input_Voltage >= rtU.VOLTAGE_MINIMUM_RANGE) &&
(rtU.Input_Voltage <= rtU.VOLTAGE_MAXIMUM_RANGE) &&
(!rtU.Input_Switch) && (rtU.INTERRUPT_1 ==
rtU.INTERRUPT_2));
}
/* Model initialize function */
void autosar_project_initialize(void)
{
/* (no initialization code required) */
}
/*
* File trailer for generated code.
*
* [EOF]
*/
.h file:
/*
* File: autosar_project.h
*
* Code generated for Simulink model 'autosar_project'.
*
* Model version : 1.2
* Simulink Coder version : 9.3 (R2020a) 18-Nov-2019
* C/C++ source code generated on : Thu Feb 3 21:51:01 2022
*
* Target selection: ert.tlc
* Embedded hardware selection: Intel->x86-64 (Windows64)
* Code generation objectives:
* 1. Execution efficiency
* 2. RAM efficiency
* Validation result: Not run
*/
#ifndef RTW_HEADER_autosar_project_h_
#define RTW_HEADER_autosar_project_h_
#ifndef autosar_project_COMMON_INCLUDES_
# define autosar_project_COMMON_INCLUDES_
#include "rtwtypes.h"
#endif /* autosar_project_COMMON_INCLUDES_ */
/* Model Code Variants */
/* Macros for accessing real-time model data structure */
/* External inputs (root inport signals with default storage) */
typedef struct {
real_T Input_Voltage; /* '/Input_Voltage' */
real_T VOLTAGE_MINIMUM_RANGE; /* '/VOLTAGE_MINIMUM_RANGE' */
real_T VOLTAGE_MAXIMUM_RANGE; /* '/VOLTAGE_MAXIMUM_RANGE' */
boolean_T Input_Switch; /* '/Input_Switch' */
real_T INTERRUPT_1; /* '/INTERRUPT_1' */
real_T INTERRUPT_2; /* '/INTERRUPT_2' */
real_T Enable_Display; /* '/Enable_Display' */
} ExtU;
/* External outputs (root outports fed by signals with default storage) */
typedef struct {
real_T Output_Display; /* '/Output_Display' */
} ExtY;
/* External inputs (root inport signals with default storage) */
extern ExtU rtU;
/* External outputs (root outports fed by signals with default storage) */
extern ExtY rtY;
/* Model entry point functions */
extern void autosar_project_initialize(void);
extern void autosar_project_step(void);
/*-
* The generated code includes comments that allow you to trace directly
* back to the appropriate location in the model. The basic format
* is /block_name, where system is the system number (uniquely
* assigned by Simulink) and block_name is the name of the block.
*
* Use the MATLAB hilite_system command to trace the generated code back
* to the model. For example,
*
* hilite_system('') - opens system 3
* hilite_system('/Kp') - opens and selects block Kp which resides in S3
*
* Here is the system hierarchy for this model
*
* '' : 'autosar_project'
* '' : 'autosar_project/Subsystem'
* '' : 'autosar_project/Subsystem1'
*/
#endif /* RTW_HEADER_autosar_project_h_ */
/*
* File trailer for generated code.
*
* [EOF]
*/
Thus the code generation for model.


Conclusion:

Thus, a Simulink Data Dictionary file has been created for the given signals and calibration data, an algorithm has been developed for one the features of Traffic Jam Assistance, a Model Advisor report has been generated as per the MAAB guidelines, and a C code has been generated and verified for the required feature using Simulink.

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.