Project 1- Traffic Jam Assistant Feature
Traffic Jam Assistant Feature
Problem Statement:
To develop one specific requirement of Traffic Jam Assistant algorithm which would predominantly feature in the IPC algorithm.Please note that the whole Traffic Jam Assistant is a very huge algorithm & only one small part of the logic is implemented here. Idea is to familiarize with concepts of Model Based Development in MATLAB Environment. The Project must be done keeping in mind the following processes & steps.
This model must be developed in MATLAB Simulink as per MBD guidelines. Code Generation Profile must be in Embedded Coder.
Simulink Data Dictionary must be created for the model & must be linked to the model. Model Advisor Report is mandatory & this will be followed by Code Generation.







A Simulink data disctionary contain input, output, calibration values in form signals, parameters, etc.. to create SLDD first we need to go to "modeling" tab then click on "Link to data dictionary"
then click on new and make a new file
then after clicking on model explorer click on design data
where we can add signals, calibration value by adding and changing the data type.
Model Advisor check:
Before doing this we need to go in to solver configuration from model settings
then solver selection type given to fixed step and solver need to be discrete and fixed step size is given as 0.01 in code generation system target file is given as ert.tlc
then we can perform model advisor check but first for checking purpose of model we can refresh the model by clicking on ctrl+D
if we dont recieve any error or anything serious then we can do model advisor check A model advisor check is performed to check that there are no errors in model
here we are checking our model as per MAB guidelines (Mathworks Advisory Board) so, we can see that model advisor check is successfully completed without any error and i also tried to reduce the no. of warning so now we have only 13 warnings.
file:///C:/Users/dell/Desktop/slprj/modeladvisor/Traffic_Jam_Assist/report_1806.html
/*
* File: Traffic_Jam_Assist.c
*
* Code generated for Simulink model 'Traffic_Jam_Assist'.
*
* Model version : 3.0
* Simulink Coder version : 9.7 (R2022a) 13-Nov-2021
* C/C++ source code generated on : Mon Sep 12 15:36:25 2022
*
* Target selection: ert.tlc
* Embedded hardware selection: Intel->x86-64 (Windows64)
* Code generation objectives: Unspecified
* Validation result: Not run
*/
#include "Traffic_Jam_Assist.h"
#include "rtwtypes.h"
#include "Traffic_Jam_Assist_private.h"
/* Exported data definition */
/* Definition for custom storage class: ExportToFile */
uint8_T Output_Display; /* '<S2>/Switch' */
/* ConstVolatile memory section */
/* Definition for custom storage class: ConstVolatile */
const volatile boolean_T INTERRUPT_1 = true;/* Referenced by: '<S2>/Constant4' */
const volatile boolean_T INTERRUPT_2 = true;/* Referenced by: '<S2>/Constant5' */
const volatile uint8_T NO_DISPLAY = 0U;/* Referenced by: '<S2>/Constant3' */
const volatile uint8_T OFF_MODE = 2U; /* Referenced by: '<S2>/Constant1' */
const volatile uint8_T ON_MODE = 1U; /* Referenced by: '<S2>/Constant' */
const volatile uint8_T STANDBY_MODE = 3U;/* Referenced by: '<S2>/Constant2' */
const volatile uint8_T VOLTAGE_MAXIMUM_RANGE = 50U;/* Referenced by: '<S3>/Constant1' */
const volatile uint8_T VOLTAGE_MINIMUM_RANGE = 30U;/* Referenced by: '<S3>/Constant' */
/* Real-time model */
static RT_MODEL_Traffic_Jam_Assist_T Traffic_Jam_Assist_M_;
RT_MODEL_Traffic_Jam_Assist_T *const Traffic_Jam_Assist_M =
&Traffic_Jam_Assist_M_;
/* Model step function */
void Traffic_Jam_Assist_step(void)
{
/* local block i/o variables */
boolean_T Optimum_Voltage;
/* Logic: '<S3>/Logical Operator' incorporates:
* Constant: '<S3>/Constant'
* Constant: '<S3>/Constant1'
* Inport: '<Root>/Input_Voltage'
* RelationalOperator: '<S3>/Relational Operator'
* RelationalOperator: '<S3>/Relational Operator1'
*/
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>/Logical Operator'
* Logic: '<S2>/Logical Operator1'
* RelationalOperator: '<S2>/Relational Operator'
*/
if (Optimum_Voltage && (!Input_Switch) && (INTERRUPT_1 == INTERRUPT_2)) {
uint8_T tmp;
/* Saturate: '<S2>/Saturation' incorporates:
* Inport: '<Root>/Enable_Display'
*/
if (Enable_Display <= 7) {
tmp = Enable_Display;
} else {
tmp = 7U;
}
has popup
Conclusion:
Developed Traffic Jam Assistant Feature in MATLAB Simulink as per MBD guidelines.
Code Generation Profile be given as Embedded Coder.
Simulink Data Dictionary created for the model & linked to the model.
Model Advisor Report is created & this will be followed by Code Generation.