Project 1- Traffic Jam Assistant Feature
Project 1- Traffic Jam Assistant Feature
AIM:
To develop the algorithm for one of the main ADAS features “ Traffic Jam Assistance” algorithm which would predominantly feature in the IPC algorithm. The whole Traffic Jam assistance is a huge algorithm and only a small part of the logic is implemented here. The following process is followed to implement this logic:
- Model is developed in Simulink environment as per the given requirement.
- Simulink data dictionary(SLDD) is created linked to the model and run the simulation.
- Model Advisor check is done as per MAAB guidelines and generated Model advisor report.
- Finally, code generation is done and generated the report.
CONTENTS:
- Introduction to ADAS and its application
- Traffic Jam feature
- Project Requirements
- Simulink model and its subsystem
- Linking the model with the data dictionary and SLDD creation
- Model advisor check and its report
- Code generation and generated code report
ATTACHEMENTS CONTAINS:
- Model .slx file
- Model .sldd file
- Model advisor report
- Code generated report (ert_main file, .c file and .h file)
INTRODUCTION TO ADAS AND THEIR APPLICATION:
ADAS (Advanced Driving Assistance System) provides assistance to the driver and improves the driving experience and its primary function is to ensure the driving safety of both vehicle and driver. It has so many features in the Driving assistance system. In fact, ADAS is the kickstart for autonomous vehicles. It uses many sensors which with increased use of complex processing algorithms to detect and evaluate the vehicle environment based on the data collected by the sensors. Some spectrum of DAS and ADAS features are as follows:

The typical hardware architecture of the ADAS system is a closed-loop system that consists of sensor units, processing units, and actuator units. The typical hardware architecture of the ADAS system is as follows:

Some of the examples of ADAS sensors are:

TRAFFIC JAM FEATURE:
Traffic Jam Assistant is one of the most common features in the 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 the same lane.
PROJECT REQUIREMENT:
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 to the subsystem “DisplayUnit”.
REQUIREMENT 2:
- Input Signals are “Optimum_Voltage”, “Input_Switch”, “Enable_Display”. Signal “Enable_Display” must be saturated between the range 0 – 7. The output signal from the subsystem is “Output_Display”.
- Input Signal “Enable_Display” is compared against a pre-defined set of values in a multiport switch. The total data ports in the multiport switch are 5.
- Multiport switch inputs 1 & 2 are connected to calibration signal “ON_MODE”, Multiport switch inputs 3 & 4 are connected to calibration signal “OFF_MODE” while Multiport switch input 5 is connected to calibration signal “STANDBY_MODE”.
- The output from the 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 the value of the input signal “Input_Switch” is compared in an AND gate against the 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”.
Simulink model and its subsystem:
According to the given requirement, the Simulink model is created as shown below for the overall requirement of the Traffic Jam feature:

The subsystem for the Traffic Jam feature for requirement 1 and requirement 2 is as follows:

The requirement 1 block is as follows:

The display unit for Requirement 2 is as follows:

Linking the model with the data dictionary and SLDD creation:
After the model is created, linking the Simulink data with the data dictionary to store design data of the models that define the behavior of the model.
The SLDD file was created as shown below:

Model advisor check and its report:
The model advisor check is performed for the given model and it is passed and the model advisor report is generated. The model advisor check report is shown as:

Code generation and generated code report:
The code is generated for the given model after the Model advisor check and the generated code is as follows:
Traffic_jam_.c file:
|
#include "Traffic_Jam_model.h" |
|
|
19 |
|
|
20 |
/* External inputs (root inport signals with default storage) */ |
|
21 |
ExtU rtU; |
|
22 |
|
|
23 |
/* External outputs (root outports fed by signals with default storage) */ |
|
24 |
ExtY rtY; |
|
25 |
|
|
26 |
/* Model step function */ |
|
27 |
void Traffic_Jam_model_step(void) |
|
28 |
{ |
|
29 |
uint8_T tmp; |
|
30 |
|
|
31 |
/* Switch: '<S3>/Switch' incorporates: |
|
32 |
* Inport: '<Root>/Input_Voltage' |
|
33 |
* Inport: '<Root>/Input_switch' |
|
34 |
* Logic: '<S2>/OR' |
|
35 |
* Logic: '<S3>/AND' |
|
36 |
* Logic: '<S3>/NOT' |
|
37 |
* RelationalOperator: '<S2>/GreaterThan' |
|
38 |
* RelationalOperator: '<S2>/Less Than' |
|
39 |
*/ |
|
40 |
if ((!rtU.Input_switch) && ((rtU.Input_Voltage >= 30) || (rtU.Input_Voltage <= |
|
41 |
50))) { |
|
42 |
/* Saturate: '<S3>/Saturation' incorporates: |
|
43 |
* Inport: '<Root>/Enable_display' |
|
44 |
*/ |
|
45 |
if (rtU.Enable_display < 7) { |
|
46 |
tmp = rtU.Enable_display; |
|
47 |
} else { |
|
48 |
tmp = 7U; |
|
49 |
} |
|
50 |
|
|
51 |
/* End of Saturate: '<S3>/Saturation' */ |
|
52 |
|
|
53 |
/* MultiPortSwitch: '<S3>/Multiport Switch' */ |
|
54 |
switch (tmp) { |
|
55 |
case 1: |
|
56 |
/* Outport: '<Root>/Output_display' incorporates: |
|
57 |
* Constant: '<S3>/ON_MODE' |
|
58 |
*/ |
|
59 |
rtY.Output_display = 1U; |
|
60 |
break; |
|
61 |
|
|
62 |
case 2: |
|
63 |
/* Outport: '<Root>/Output_display' incorporates: |
|
64 |
* Constant: '<S3>/ON_MODE' |
|
65 |
*/ |
|
66 |
rtY.Output_display = 1U; |
|
67 |
break; |
|
68 |
|
|
69 |
case 3: |
|
70 |
/* Outport: '<Root>/Output_display' incorporates: |
|
71 |
* Constant: '<S3>/OFF_MODE' |
|
72 |
*/ |
|
73 |
rtY.Output_display = 2U; |
|
74 |
break; |
|
75 |
|
|
76 |
case 4: |
|
77 |
/* Outport: '<Root>/Output_display' incorporates: |
|
78 |
* Constant: '<S3>/OFF_MODE' |
|
79 |
*/ |
|
80 |
rtY.Output_display = 2U; |
|
81 |
break; |
|
82 |
|
|
83 |
default: |
|
84 |
/* Outport: '<Root>/Output_display' incorporates: |
|
85 |
* Constant: '<S3>/STANDBY_MODE' |
|
86 |
*/ |
|
87 |
rtY.Output_display = 3U; |
|
88 |
break; |
|
89 |
} |
|
90 |
|
|
91 |
/* End of MultiPortSwitch: '<S3>/Multiport Switch' */ |
|
92 |
} else { |
|
93 |
/* Outport: '<Root>/Output_display' incorporates: |
|
94 |
* Constant: '<S3>/NO_DISPLAY' |
|
95 |
*/ |
|
96 |
rtY.Output_display = 0U; |
|
97 |
} |
|
98 |
|
|
99 |
/* End of Switch: '<S3>/Switch' */ |
|
100 |
} |
|
101 |
|
|
102 |
/* Model initialize function */ |
|
103 |
void Traffic_Jam_model_initialize(void) |
|
104 |
{ |
|
105 |
/* (no initialization code required) */ |
|
106 |
} |
|
107 |
|
|
108 |
/* |
|
109 |
* File trailer for generated code. |
|
110 |
* |
|
111 |
* [EOF] |
|
112 |
*/ |
CONCLUSION:
Thus the Traffic Jam feature is implemented and the following operations are performed from the model:
- Model-Based Development.
- Linking to the data dictionary and creating SLDD
- Performing model advisor check as per MAAB guidelines
- Code generation.