Challenge

Project 1- Traffic Jam Assistant Feature

Question

Aim: To develop one specific requirement of the Traffic Jam Assistant algorithm with concepts of Model-Based Development in MATLAB Environment as per the given problem statement.

# Data Dictionary

Starting with linking and developing a new Data Dictionary for the model named "Project1_TJAF_dd.sldd".

The data dictionary Signals provided to us in the problem statement are as follows-

Input Signals (with Storage class as Imported Extern)-

Name of the Signal

Data Type

Range

Input_Voltage

uint8

0 - 255

Input_Switch

boolean

0 – 1

Enable_Display

uint8

0 - 255

Output Signal (with Storage class as ExportedGlobal)-

Name of the Signal

Data Type

Range

Output_Display

uint8

0 - 255

Calibration Signals (with Storage class as Volatile)-

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 (with Storage class as Locaziable)-

Name of the Signal

Data Type

Range

Optimum_Voltage

boolean

0 - 1


#Simulink Model

Developing the Simulink model as per the given 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”.

The 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”, and "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 pre – a defined set of values in a multiport switch. The total data ports in the multiport switch are 5.

Multiport switch inputs 1 & 2 is connected to calibration signal “ON_MODE”, Multiport switch inputs 3 & 4 are connected to calibration signal “OFF_MODE” while Multiport switch to 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 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”.

#Configuration Settings:

Updating some of the configuration settings like solver, diagnostics and code generation.

#Requirement Tagging:

Since we are provided with requirements we will tag both requirements with their respective subsystem blocks.

The subsystem "Requirement1" gets tagged.

Similarly, we will tag the requirement 2 subsystem named "DisplayUnit".

Requirement Tagging Report

#Model Advisor Report (MAAB Guidelines Settings)

Code Generation

To build and generate Code click Apps Tab-> Embedded Coder-> Build.

Code Generation Report

Result-

  • The model was developed in MATLAB Simulink as per MBD guidelines.
  • The Simulink Data Dictionary was created for the model & was linked to the model.
  • The Model Advisor Report followed by Code Generation in Embedded Coder was created.
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.