Challenge

Project 2-Highway Assistant-Lane Changing Assistant

Aim:

To develop a requirement of Highway Assistant – Lane Changing Assistant algorithm for one specific feature.

Objective:

  • To develop MATLAB Simulink model for requirements as per MBD guidelines.
  • To create Simulink Data Dictionary for the model.
  • To Map of simulink model to Autosar software component model. 
  • To Generate Model Advisor Report.
  • Code Generation.

Theory:

Introduction to the Feature:

The Highway Assistant supports the driver and takes over the longitudinal and lateral guidance of the vehicle in monotonous driving situations on highways. The partially automated function can automatically start, accelerate, brake as well as steer the vehicle to a certain extent. The driver has to permanently supervise the system and be ready to take over the complete control of the vehicle at any time.

Drivers are taught to assess surrounding traffic before changing lanes by checking their rearview and side mirrors and looking over each shoulder. However, even for those who follow this sequence of checks, the vehicle's blind spot – the area alongside and just behind the vehicle – is a constant source of danger and often the cause of serious accidents. Even vehicles approaching quickly from behind can pose a risk. To make changing lanes safer, this feature has been developed.

Basic Working Principle:

Highway Assistant is a partially automated driving function for a speed range of up to 180 km/h (112 mph) on highways. It combines the radar-based longitudinal guidance of Adaptive Cruise Control (ACC) with the video-based lateral guidance of lane keeping support in one system. Highway Assistant can be supplemented by an automatic lane change initiated and monitored by the driver in a speed range of 60 – 130 km/h (35 – 80 mph).

The lane Change Assistant works by using two mid-range radar sensors that are concealed in the rear bumper – one on the left, one on the right. These two sensors monitor the area alongside and behind the car. Powerful control software collates the sensor information to create a complete picture of all traffic in the area behind the vehicle.Whenever another vehicle approaches at speed from behind or is already present in the blind spot, a signal such as a warning light in the side mirror alerts the driver to the hazard. Should the driver still activate the turn signal with the intention of changing lanes, the system issues an additional acoustic and/or haptic warning.

Problem Statement:

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 part of the logic is implemented here. Idea is to familiarize with concepts of Autosar Software Component Development in MATLAB Environment by following the Model Based Development guidelines. The Project must be done keeping in mind the following processes & steps.

  • This model must be developed in MATLAB Simulink per MBD guidelines.
  • Code Generation Profile must be Autosar Coder.
  • Simulink Data Dictionary must be created for the model & must be linked to the model.
  • All the input & output signals must be mapped into the Autosar Editor.
  • Model Advisor Report is mandatory & this will be followed by Code Generation.

Input Signals:

Name of the Signal

Data Type

Range

Highway_Input_Signal

 uint8

0 - 255

Enable_Display

 uint8

0 – 255

Input_Switch

 uint8

0 – 255

Lane_Input_Signal

uint8

0 - 255

Local Signals:

Name of the Signal

Data Type

Range

Highway_Display_Mode_1

 uint8

0 - 255

Highway_Display_Mode_2

 uint8

0 – 255

Highway_Display_Mode_3

 uint8

0 – 255

Highway_Display_Mode_4

uint8

0 – 255

Lane_Display_Mode_1

uint8

0 – 255

Lane_Display_Mode_2

uint8

0 – 255

Lane_Display_Mode_3

uint8

0 – 255

Lane_Display_Mode_4

uint8

0 – 255

Output Signals:

Name of the Signal

Data Type

Range

Display_Mode_1

 uint8

0 - 255

Display_Mode_2

 uint8

0 – 255

Display_Mode_3

 uint8

0 – 255

Display_Mode_4

uint8

0 - 255

Requirement No 1 [Highway_DisplayUnit]:

Inputs to this particular subsystem are “Highway_Input_Signal”, “Enable_Display”, “Input_Switch”. These three input signals, when assigned to a particular value will give output signals of specific value. The output signals are “Highway_Display_Mode_1”, “Highway_Display_Mode_2”, “Highway_Display_Mode_3”, “Highway_Display_Mode_4”. The requirement must be implemented in the form of a Stateflow logic.

Condition

Action

Highway_Input_Signal = 1

Enable_Display = off

 Input_Switch = on

Highway_Display_Mode_1 = 232

Highway_Display_Mode_2 = 183

Highway_Display_Mode_3 = 41

Highway_Display_Mode_4 = 94

Highway_Input_Signal = 1

Enable_Display = on

Input_Switch = on

Highway_Display_Mode_1 = 213

Highway_Display_Mode_2 = 183

Highway_Display_Mode_3 = 9

Highway_Display_Mode_4 = 94

Requirement No 2 [Lane_DisplayUnit]:

Inputs to this particular subsystem are “Enable_Display”, “Input_Switch”, “Lane_Input_Signal”. These three input signals, when assigned to a particular value will give output signals of specific value. The output signals are “Lane_Display_Mode_1”, “Lane_Display_Mode_2”, “Lane_Display_Mode_3”, “Lane_Display_Mode_4”. The requirement must be implemented in the form of Stateflow logic.

Condition

Action

Lane_Input_Signal= 6

Enable_Display = off

Input_Switch = on

Lane_Display_Mode_1 = 132

Lane_Display_Mode_2 = 185

Lane_Display_Mode_3 = 54

Lane_Display_Mode_4 = 67

Lane_Input_Signal= 6

Enable_Display = on

Input_Switch = on

Lane_Display_Mode_1 = 127

Lane_Display_Mode_2 = 248

Lane_Display_Mode_3 = 186

Lane_Display_Mode_4 = 84

Requirement No 3:

Signals coming from both subsystems “Highway_Display_Mode_1” & “Lane_Display_Mode_1” are given as inputs to a switch block which will have input signal “Highway_Input_Signal” given as 2nd input to the switch block. Corresponding output from this particular switch block is output signal “Display_Mode_1”.

Signals coming from both subsystems “Highway_Display_Mode_2” & “Lane_Display_Mode_2” are given as inputs to a switch block which will have input signal “Highway_Input_Signal” given as 2nd input to the switch block. Corresponding output from this particular switch block is output signal “Display_Mode_2”.

Signals coming from both subsystems “Highway_Display_Mode_3” & “Lane_Display_Mode_3” are given as inputs to a switch block which will have input signal “Highway_Input_Signal” given as 2nd input to the switch block. Corresponding output from this particular switch block is output signal “Display_Mode_3”.

Signals coming from both subsystems “Highway_Display_Mode_4” & “Lane_Display_Mode_4” are given as inputs to a switch block which will have input signal “Highway_Input_Signal” given as 2nd input to the switch block. Corresponding output from this particular switch block is output signal “Display_Mode_4”.

Answer:

Step followed in completion of project,

  1. Creation of SLDD file.
  2. Development of Simulink Model as per the requirement document.
  3. Attaching Requirement document to specific requirement.
  4. AUTOSAR port mapping of functions, inport, outports, runnables etc. in order to map simulink model to AUTOSAR-SW component.  
  5. Model Advisory report.
  6. Code Genration.
  1. Creation of SLDD file.

1.1. Go to MODELING Tab --> click "Link to Data Dictionary" --> click on New --> Nevigate to specific folder --> save the sldd file with specific name --> click on add to path --> Uncheck Enable model access to base workspace --> click on Apply --> click on Ok.

1.2. Adding Signals and constant to SLDD.

Click on External Data --> Nevigate to Design Data --> click on add simulink signal --> Modify the signal name, datatype, range as per the requirement document given --> repeat procedure to add all input, output, local signals. 

After adding all signals the final sldd file will be,

  2. Development of Simulink Model as per the requirement document.

2.1 As per Requirement 1 (Highway_DisplayUnit), the logic is devloped in state machine(chart). Signals are resolved/propogated as per requirement.

2.1 As per Requirement 2 (Lane_DisplayUnit), the logic is devloped in state machine(chart). Signals are resolved/propogated as per requirement.

2.3 As per requirement 3, logic is devloped in seperate subsystem. The Signals are resolved/propogated as per need. 

Final Model Having all three requirements subsytems connected is as follows,

3. Attaching Requirement document to specific requirement.

Requirement document is attached each sub system.

The requirement details available in word document is selected→ in Simulink module right click on subsystem to which document is to be attached → click on "Requirements"→ click on "Link to Selection in Word". repeat the procedure for all subsystems.

 

4. AUTOSAR port mapping of functions, inport, outports, runnables etc. in order to map simulink model to AUTOSAR-SW component. 

4.1 As per naming standard, the model name is renamed with "SWC_" prefix.

4.2 The data dictinary signals storage class is set to "Auto" irrespective of its type(Input, Output or Lacalizable) .

4.3 In model settings ->code generation,  system target file is changed to autosar.tlc.

4.4 In App tab, click on open the AUTOSAR Component Designer app.

4.5 Interface changes to show Autosar Tab(at top Ribben) and Code mapping Tab(at bottom left corner).

4.6 Click on Code Mappings tab to, open AUTOSAR SW component Window.

4.7 click on "Configure AUTOSAR Dictionary tab.

This will open AUTOSAR dictionary where we have to map entry-point function, Inports, Outports, data elements, runnables etc.

 4.8 First of all, Interfaces are added with prefix "SRIf_" and the corresponding Data elements with Prefix "DE_" are also added.

4.9 Inports are added with prefix "Rp_".

4.10 Ouports are added with prefix "Pp_".

4.11  runnables are created, one for intializing and other for time event, event are also created as Init event and TimingEvent.

4.12  xml options are filled up as follows,

Following is the mapping of Functions, Inports and Outports.

4.13 Click on  "refresh tab" to refresh the code mapping.

4.14 click on "Validate Code Mapping". 

to validate code mappings, ones done following message will apear on screen.

5. Model Advisary report

After Corrective actions taken which are recommended in advisory report, wornings are reduced to 4.

_____________________________________________________________________________________________________________________________________________________________________________________________________________

6. Generate of the code

6.1 Go to AUTOSAR Tab, and click on "Quick Start".

Click on "Next".

Click on "Next".

Click on Next

Click on Next

Click on Next

Click on Next 

Click on Next

Click on Finish

 
 
 
 
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.