Challenge

Project 1- Traffic Jam Assistant Feature

PROJECT 1: TRAFFIC ASSISTANT FEATURE

Aim:

Implementing the algorithm of Traffic Assitant which based on the sensorhelps the driver arrives more relaxed at destination, even in dense traffic or in traffic jam.

Objective:

  • 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.

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”.

Subsystem:

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”.

Subsystem: DisplayUnit

Subsystem 1:

Subsystem 2:

Subsystem 3:

Creating Total Model:

Final Model:

Requirement Word file and Report (Attached)

Simulink Data Dictionary file (Project1_TJA.dd) attached

Model Advisor Report (attached)

AUTOSAR Dictionary

C code(AUTOSAR code Generation) attached

/*
 * File: Project1_TJA.c
 *
 * Code generated for Simulink model 'Project1_TJA'.
 *
 * Model version                  : 1.30
 * Simulink Coder version         : 9.5 (R2021a) 14-Nov-2020
 * C/C++ source code generated on : Sat Dec 25 21:45:58 2021
 *
 * Target selection: autosar.tlc
 * Embedded hardware selection: Intel->x86-64 (Windows64)
 * Code generation objectives:
 *    1. Execution efficiency
 *    2. RAM efficiency
 * Validation result: Not run
 */

#include "Project1_TJA.h"

/* Model step function */
void Project1_TJA_Step(void)
{
  uint8 rtb_Switch2;

  /* Outputs for Atomic SubSystem: '<Root>/Traffic_Jam_Assistant' */
  /* RelationalOperator: '<S3>/Less Than' incorporates:
   *  Inport: '<Root>/Input_Voltage'
   *  RelationalOperator: '<S3>/GreaterThanOrEqual'
   */
  rtb_Switch2 = Rte_IRead_Project1_TJA_Step_Input_Voltage_Input_Voltage();

  /* Switch: '<S6>/Switch' incorporates:
   *  Constant: '<S3>/Constant'
   *  Constant: '<S3>/Constant1'
   *  Inport: '<Root>/Input_Switch'
   *  Inport: '<Root>/Input_Voltage'
   *  Logic: '<S3>/AND'
   *  Logic: '<S4>/AND'
   *  Logic: '<S4>/NOT'
   *  RelationalOperator: '<S3>/GreaterThanOrEqual'
   *  RelationalOperator: '<S3>/Less Than'
   */
  if ((!Rte_IRead_Project1_TJA_Step_Input_Switch_Input_Switch()) &&
      ((rtb_Switch2 <= 50) && (rtb_Switch2 >= 30))) {
    /* RelationalOperator: '<S7>/LowerRelop1' incorporates:
     *  Inport: '<Root>/Enable_Display'
     *  Switch: '<S7>/Switch'
     *  Switch: '<S7>/Switch2'
     */
    rtb_Switch2 = Rte_IRead_Project1_TJA_Step_Enable_Display_Enable_Display();

    /* Switch: '<S7>/Switch2' incorporates:
     *  Constant: '<S5>/Constant3'
     *  Inport: '<Root>/Enable_Display'
     *  RelationalOperator: '<S7>/LowerRelop1'
     */
    if (rtb_Switch2 > 7) {
      rtb_Switch2 = 7U;
    }

    /* MultiPortSwitch: '<S5>/Multiport Switch' */
    switch (rtb_Switch2) {
     case 0:
      /* Outport: '<Root>/Output_Display' incorporates:
       *  Constant: '<S5>/Constant2'
       */
      Rte_IWrite_Project1_TJA_Step_Output_Display_Output_Display(3U);
      break;

     case 1:
      /* Outport: '<Root>/Output_Display' incorporates:
       *  Constant: '<S5>/Constant'
       */
      Rte_IWrite_Project1_TJA_Step_Output_Display_Output_Display(1U);
      break;

     case 2:
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.

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.