All Courses
All Courses
Courses by Software
Courses by Semester
Courses by Domain
Tool-focused Courses
Machine learning
POPULAR COURSES
Success Stories
Aim :- Traffic Jam Assistant Feature Objective :- This model must be developed in MATLAB Simulink as per MBD guidelines according to the requirements given. Tag the requirements to the Simulink model, Requirements 1 & Requirement 2 are tagged into their corresponding subsystems. Creation of Simulink Data Dictionary…
SIDDHESH PARAB
updated on 05 Feb 2022
Aim :- Traffic Jam Assistant Feature
Objective :-
Theory on Traffic Jam Assistant Feature :-
Working Principle of Traffic Jam Assistant Feature :
Development of Traffic Jam Assistant Feature :-
Main Model :-
fig. Traffic Jam Assistance Model
Fig. 2 Requirement 1 & Requirement2 Subsystem
Requirement no.1 Subsystem :-
Fig.3 Requirement 1 subsystem
Requirement No 2 (DisplayUnit Subsystem):
Fig.4 Requirement 2 subsystem
Then, we have changed the configuration parameters by firstly, changed the solver settings by clicking on 'Model Settings'. After opening the 'Model Settings', converting the type as fixed step and solver as discrete (no continous)and changed the sample time as 0.01 sec.
Then, we have changed the System Target File to 'ert.tlc' under code generation section as under;
Creation of Simulink Data Dictonary :-
A Simulink Data Dictionary (SLDD) file is created so that it contains input, output signals and caliberation parameters used in the given model instead of using Init file for initilalizing caliberation values everytime.
Step 1 :-
We have to go under Modelling section and select on 'Link to Data Dictionary' as under;
Step 2 :-
Create a new data directory in the given folder and named it by giving .sldd extension.
Step 3 :-
We have given the input signal, output signal and Caliberation values/ constant and the same are as under;
Input Signals:
Name of the Signal |
Data Type |
Range |
Input_Voltage |
uint8 |
0 - 255 |
Input_Switch |
boolean |
0 – 1 |
Enable_Display |
uint8 |
0 - 255 |
Output Signal:
Name of the Signal |
Data Type |
Range |
Output_Display |
uint8 |
0 - 255 |
Calibration Signals:
Name of the Signal |
Data Type |
Range |
Initial Value |
VOLTAGE_MINIMUM_RANGE |
uint8 |
0 – 255 |
30 |
VOLTAGE_MAXIMUM_RANGE |
uint8 |
0 – 255 |
50 |
OFF_MODE |
uint8 |
0 – 255 |
2 |
ON_MODE |
uint8 |
0 – 255 |
1 |
STANDBY_MODE |
uint8 |
0 – 255 |
3 |
INTERRUPT_1 |
boolean |
0 – 1 |
1 |
INTERRUPT_2 |
boolean |
0 - 1 |
1 |
NO_DISPLAY |
uint8 |
0 – 255 |
0 |
Local Signal:
Name of the Signal |
Data Type |
Range |
Optimum_Voltage |
boolean |
0 - 1 |
Accordingly, we have created the Simulink Data Dictionary (SLDD) by clicking on file name i.e traffic_jam_assistance_model_sldd.sldd and select Design data. Then, we have to select add signal and add simulink parameter depending on whether the values are input signal, output signal or constant/caliberation values.
Requirement Tagging of Simulink Model:-
Steps for tagging a requirement in Simulink model :-
We have considered above steps while tagging the Requirement1 and Requirement2 and the same are as under;
Tagging for Requirement1 :-
Tagging for Requirement2 :-
Steps for Checking MAB Guidelines in Model Advisor :-
Step 1:-
We have to go into 'Modelling option' and then select 'Model Advisor'
Step 2:-
We have to choose the system for checking Mathworks Automotive Advisory Board (MAB or MAAB) guidelines. In this case, we are checking full system check as under as per MAB guidelines;
Step 3 :-
Therafter, below screen appears. In this, we have to select as per Modelling standards for MAB guidelines.
Then, we have to click on 'Run Selected Check' option as under;
After running the model as per MAB Guidelines, we observed that it is sucessfully passed with value of 125 and total 19 nos. of warnings. However, there is no fail condition. Hence, we can conclude that above model is technically/logically correct.
After successful running of model as per MAB guidelines, we observed that guideline report is generated in the same Matlab folder path. (The same is attached)
The screenshot for Model Advisor Report as per MAB guidelines/rules are as under;
Steps for Generation of Code from model:-
Step 1 :-
Go to Apps section and under Code Generation section, select Embedded Coder option.
Step 2 :-
Then, under Embedded C Code section, Click on Generate Code option as under;
Step 3 :-
In the generation of code, there is one main c file, 4 nos. of model files, 2 data files, 1 one utility file is generated as under;
The code file generated is as under;
Code Generation Report :-
After sucessful completion of Code generation, traffic_jam_assistance_model_ert_rtw folder is created in the Matlab path as under;
The generated full C Code for traffic_jam_assistance_model.c is as under;
/*
* File: traffic_jam_assistance_model.c
*
* Code generated for Simulink model 'traffic_jam_assistance_model'.
*
* Model version : 1.14
* Simulink Coder version : 9.5 (R2021a) 14-Nov-2020
* C/C++ source code generated on : Sat Feb 5 23:50:14 2022
*
* Target selection: ert.tlc
* Embedded hardware selection: Intel->x86-64 (Windows64)
* Code generation objectives: Unspecified
* Validation result: Not run
*/
#include "traffic_jam_assistance_model.h"
#include "traffic_jam_assistance_model_private.h"
/* Real-time model */
static RT_MODEL_traffic_jam_assistan_T traffic_jam_assistance_model_M_;
RT_MODEL_traffic_jam_assistan_T *const traffic_jam_assistance_model_M =
&traffic_jam_assistance_model_M_;
/* Model step function */
void traffic_jam_assistance_model_step(void)
{
/* local block i/o variables */
boolean_T Optimum_Voltage;
uint8_T tmp;
/* Logic: '<S3>/AND' incorporates:
* Constant: '<S3>/Constant'
* Constant: '<S3>/Constant2'
* Inport: '<Root>/Input_Voltage'
* RelationalOperator: '<S3>/GreaterThanOrEqual'
* RelationalOperator: '<S3>/GreaterThanOrEqual1'
*/
Optimum_Voltage = ((Input_Voltage >= VOLTAGE_MINIMUM_RANGE) && (Input_Voltage <=
VOLTAGE_MAXIMUM_RANGE));
/* Switch: '<S2>/Switch' incorporates:
* Constant: '<S2>/Constant4'
* Constant: '<S2>/Constant5'
* Inport: '<Root>/Input_Switch'
* Logic: '<S2>/AND'
* Logic: '<S2>/NOT'
* RelationalOperator: '<S2>/Equal'
*/
if (Optimum_Voltage && (!Input_Switch) && (INTERRUPT_1 == INTERRUPT_2)) {
/* Saturate: '<S2>/Saturation' incorporates:
* Inport: '<Root>/Enable_Display'
*/
if (Enable_Display < 7) {
tmp = Enable_Display;
} else {
tmp = 7U;
}
/* End of Saturate: '<S2>/Saturation' */
/* MultiPortSwitch: '<S2>/Multiport Switch' */
switch (tmp) {
case 1:
/* Switch: '<S2>/Switch' incorporates:
* Constant: '<S2>/Constant'
*/
Output_Display = ON_MODE;
break;
case 2:
/* Switch: '<S2>/Switch' incorporates:
* Constant: '<S2>/Constant'
*/
Output_Display = ON_MODE;
break;
case 3:
/* Switch: '<S2>/Switch' incorporates:
* Constant: '<S2>/Constant1'
*/
Output_Display = OFF_MODE;
break;
case 4:
/* Switch: '<S2>/Switch' incorporates:
* Constant: '<S2>/Constant1'
*/
Output_Display = OFF_MODE;
break;
default:
/* Switch: '<S2>/Switch' incorporates:
* Constant: '<S2>/Constant2'
*/
Output_Display = STANDBY_MODE;
break;
}
/* End of MultiPortSwitch: '<S2>/Multiport Switch' */
} else {
/* Switch: '<S2>/Switch' incorporates:
* Constant: '<S2>/Constant3'
*/
Output_Display = NO_DISPLAY;
}
/* End of Switch: '<S2>/Switch' */
}
/* Model initialize function */
void traffic_jam_assistance_model_initialize(void)
{
/* (no initialization code required) */
}
/* Model terminate function */
void traffic_jam_assistance_model_terminate(void)
{
/* (no terminate code required) */
}
/*
* File trailer for generated code.
*
* [EOF]
*/
Leave a comment
Thanks for choosing to leave a comment. Please keep in mind that all the comments are moderated as per our comment policy, and your email will not be published for privacy reasons. Please leave a personal & meaningful conversation.
Other comments...
Project 2-Highway Assistant-Lane Changing Assistant
Aim :- Model Based Development of Highway Assistant – Lane Changing Assistant Objective :- To develop one specific requirement of Highway Assistant – Lane Changing Assistant algorithm. Please note that the whole Highway Assistant – Lane Changing Assistant is a very huge algorithm & only one small…
14 Feb 2022 04:19 PM IST
Project 1- Traffic Jam Assistant Feature
Aim :- Traffic Jam Assistant Feature Objective :- This model must be developed in MATLAB Simulink as per MBD guidelines according to the requirements given. Tag the requirements to the Simulink model, Requirements 1 & Requirement 2 are tagged into their corresponding subsystems. Creation of Simulink Data Dictionary…
05 Feb 2022 06:55 PM IST
Design of an Electric Vehicle
AIM:- Create a MATLAB model of an electric car that uses a battery and a DC motor. Choose suitable blocks from the Powertrain block set. Prepare a report about your model including the following: ABSTRACT:- In this project, we going to build the MATLAB model of ELECTRIC CAR by using a DC motor and a suitable battery for…
01 Feb 2022 06:47 AM IST
Project 2 Adaptive Cruise Control
Aim :- Develop a MATLAB Simulink Model for Adaptive Cruise Control feature used in Automotive Vehicle Objective:- To develop a Adaptive Cruise Control feature as per the Requirement Document using MATLAB Simulink. While Developing the Adaptive Cruise Control Simulink Model, we have follow all the MBD related processes…
22 Jan 2022 08:13 AM IST
Related Courses
8 Hours of Content
Skill-Lync offers industry relevant advanced engineering courses for engineering students by partnering with industry experts.
© 2025 Skill-Lync Inc. All Rights Reserved.