Project 1- Traffic Jam Assistant 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.
Advantages :-
- Optional front corner radars help to improve detection of vehicles cutting in.
- The driver is required to monitor both surrounding traffic and system status and can override the system at anytime (SAE level 2 automation).
- Traffic Jam Assist's longitudinal, Stop-and-Go control function can manage vehicle speed and help maintain safe distance to the leading vehicle; actuation is performed electronicaly controlled braking systems or integrated brake control in the case of vacuum less braking systems.
- The lateral control function can help maintain vehicle position in the lane; actuation is performed by ZF's well-established, high bandwidth belt drive or column drive electric powered steering products.
- Helps dramatically reduce the efforts and stress of highway driving in congested traffic.
- Helps enhance vehicle and occupant safety.
Simulink Model:-

REQUIREMENT 1:-
”
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”

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
SLDD creat :-

so for this model the simulink data dictionary should be creat
Model advisor report
MODELLING -Model advisor report creat and in the by task check the MAAB Guidlines as belows

Requirement Tagging & Traceability :-
1.) To create the Word file for Requirement Tagging in Model.

2.) Highlight the contain which we have to tag for subsytem.

3.Right Click on subsytem and selecte Requirement option and selecte Link To Selection in Word

Code generation:-

Code generation report as

File: TRAFFIC_JAM_ASSIST.c
1 /*
2 * File: TRAFFIC_JAM_ASSIST.c
3 *
4 * Code generated for Simulink model 'TRAFFIC_JAM_ASSIST'.
5 *
6 * Model version : 1.2
7 * Simulink Coder version : 9.3 (R2020a) 18-Nov-2019
8 * C/C++ source code generated on : Tue May 24 10:29:35 2022
9 *
10 * Target selection: ert.tlc
11 * Embedded hardware selection: Intel->x86-64 (Windows64)
12 * Code generation objectives: Unspecified
13 * Validation result: Not run
14 */
15
16 #include "TRAFFIC_JAM_ASSIST.h"
17 #include "TRAFFIC_JAM_ASSIST_private.h"
18
19 /* Exported data definition */
20
21 /* Definition for custom storage class: ExportToFile */
22 uint8_T Output_Display; /* '<S2>/Switch' */
23
24 /* ConstVolatile memory section */
25 /* Definition for custom storage class: ConstVolatile */
26 const volatile uint8_T INTERRUPT_1 = 1U;/* Referenced by: '<S2>/Constant4' */
27 const volatile uint8_T INTERRUPT_2 = 1U;/* Referenced by: '<S2>/Constant5' */
28 const volatile uint8_T NO_DISPLAY = 0U;/* Referenced by: '<S2>/Constant3' */
29 const volatile uint8_T OFF_MODE = 2U; /* Referenced by: '<S2>/Constant1' */
30 const volatile uint8_T ON_MODE = 1U; /* Referenced by: '<S2>/Constant' */
31 const volatile uint8_T STANDBY_MODE = 3U;/* Referenced by: '<S2>/Constant2' */
32 const volatile uint8_T VOLTAGE_MAXIMUM_RANGE = 50U;/* Referenced by: '<S3>/Constant1' */
33 const volatile uint8_T VOLTAGE_MINIMUM_RANGE = 30U;/* Referenced by: '<S3>/Constant' */
34
35 /* Real-time model */
36 RT_MODEL_TRAFFIC_JAM_ASSIST_T TRAFFIC_JAM_ASSIST_M_;
37 RT_MODEL_TRAFFIC_JAM_ASSIST_T *const TRAFFIC_JAM_ASSIST_M =
38 &TRAFFIC_JAM_ASSIST_M_;
39
40 /* Model step function */
41 void TRAFFIC_JAM_ASSIST_step(void)
42 {
43 uint8_T tmp;
44
45 /* Switch: '<S2>/Switch' incorporates:
46 * Constant: '<S2>/Constant3'
47 * Constant: '<S2>/Constant4'
48 * Constant: '<S2>/Constant5'
49 * Constant: '<S3>/Constant'
50 * Constant: '<S3>/Constant1'
51 * Inport: '<Root>/Input_Switch'
52 * Inport: '<Root>/Input_Voltage'
53 * Logic: '<S2>/AND'
54 * Logic: '<S2>/AND1'
55 * Logic: '<S2>/NOT'
56 * Logic: '<S3>/AND'
57 * RelationalOperator: '<S2>/Relational Operator'
58 * RelationalOperator: '<S3>/GreaterThan'
59 * RelationalOperator: '<S3>/GreaterThan1'
60 */
61 if ((!Input_Switch) && ((Input_Voltage >= VOLTAGE_MINIMUM_RANGE) &&
62 (Input_Voltage <= VOLTAGE_MAXIMUM_RANGE)) &&
63 (INTERRUPT_1 == INTERRUPT_2)) {
64 /* Saturate: '<S2>/Saturation' incorporates:
65 * Inport: '<Root>/Enable_Display'
66 */
67 if (Enable_Display < 7) {
68 tmp = Enable_Display;
69 } else {
70 tmp = 7U;
71 }
72
73 /* End of Saturate: '<S2>/Saturation' */
74
75 /* MultiPortSwitch: '<S2>/Multiport Switch' incorporates:
76 * Constant: '<S2>/Constant'
77 * Constant: '<S2>/Constant1'
78 * Constant: '<S2>/Constant2'
79 */
80 switch (tmp) {
81 case 1:
82 Output_Display = ON_MODE;
83 break;
84
85 case 2:
86 Output_Display = ON_MODE;
87 break;
88
89 case 3:
90 Output_Display = OFF_MODE;
91 break;
92
93 case 4:
94 Output_Display = OFF_MODE;
95 break;
96
97 default:
98 Output_Display = STANDBY_MODE;
99 break;
100 }
101
102 /* End of MultiPortSwitch: '<S2>/Multiport Switch' */
103 } else {
104 Output_Display = NO_DISPLAY;
105 }
106
107 /* End of Switch: '<S2>/Switch' */
108 }
109
110 /* Model initialize function */
111 void TRAFFIC_JAM_ASSIST_initialize(void)
112 {
113 /* (no initialization code required) */
114 }
115
116 /* Model terminate function */
117 void TRAFFIC_JAM_ASSIST_terminate(void)
118 {
119 /* (no terminate code required) */
120 }
121
122 /*
123 * File trailer for generated code.
124 *
125 * [EOF]
126 */
127