Project 1- Traffic Jam Assistant Feature
1. Model Setup
- Use MATLAB Simulink and ensure compliance with MBD guidelines.
- Enable Embedded Coder for code generation.
- Create and link a Simulink Data Dictionary for managing calibration signals.
- Generate a Model Advisor Report before proceeding with code generation.
2. Implement Voltage Range Check (Requirement 1)
- Inputs:
Input_Voltage (uint8, Range: 0-255)VOLTAGE_MINIMUM_RANGE (uint8, Default: 30)VOLTAGE_MAXIMUM_RANGE (uint8, Default: 50)
- Logic:
- If
Input_Voltageis within the rangeVOLTAGE_MINIMUM_RANGE ≤ Input_Voltage ≤ VOLTAGE_MAXIMUM_RANGE, setOptimum_Voltage = 1 (true). - Otherwise, set
Optimum_Voltage = 0 (false).
- If
- Output:
Optimum_Voltage (boolean, 0-1)
3. Implement DisplayUnit Subsystem (Requirement 2)
- Inputs:
Optimum_Voltage (boolean, 0-1)Input_Switch (boolean, 0-1)Enable_Display (uint8, Range: 0-255) → Saturate to 0-7
- Calibration Signals:
ON_MODE = 1,OFF_MODE = 2,STANDBY_MODE = 3,NO_DISPLAY = 0INTERRUPT_1 = 1,INTERRUPT_2 = 1
- Logic Flow:
- Step 1: Saturate
Enable_Displaybetween0-7. - Step 2: Multiport Switch Logic
- Inputs 1 & 2 → ON_MODE
- Inputs 3 & 4 → OFF_MODE
- Input 5 → STANDBY_MODE
- Step 3: Switch Block Logic
- First Input: Output from Multiport Switch.
- Second Input:
- AND Gate checks:
NOT(Input_Switch)Optimum_VoltageINTERRUPT_1 == INTERRUPT_2
- AND Gate checks:
- Third Input:
NO_DISPLAY
- Output:
Output_Display (uint8, 0-255)
- Step 1: Saturate
4. Validation & Testing
- Run Model Advisor Checks to ensure MAAB guideline compliance.
- Simulate with different test cases:
Input_Voltageinside & outside range.Enable_Displaywith different values (0-7).Input_Switchtoggling.
- Check outputs & verify logic.
- Generate Embedded C code using Embedded Coder.
Deliverables
✅ MATLAB Simulink Model (.slx)
✅ Simulink Data Dictionary (.sldd)
✅ Model Advisor Report (PDF)
✅ Test Cases & Verification Report
✅ Generated C Code