Real-Time Hardware-In-The-Loop Simulation (HILS) Using VISSIM Tutorial
Real-Time Hardware-In-The-Loop Simulation (HILS) Using VISSIM Tutorial
Real-Time Hardware-In-The-Loop Simulation (HILS) Using VISSIM Tutorial
8/31/06
Once VISSIM is open, browse to the VISSIM file “US12_3rdSt.inp” in the directory
shown to you in lab.
1
CE 474
8/31/06
Note: You need to define all controller parameters such phase timing and detector options
in a real controller unit. You need to define the traffic simulation network in VISSIM
such as geometry , traffic volumes and turning movements, signal heads, and detectors.
VISSIM HILS includes the controller interface device (CID), an actual traffic controller
unit, and a simulation network in VISSIM run on a computer. These three devices are set
up as shown in Figure 2.
The CID acts as an interface between the computer running the simulation network and a
real traffic controller unit. It relays detector actuations from the computer to the real
controller unit and relays phase status from the real controller unit to the computer. It
allows actual traffic controller units to replace emulated controllers in simulation models
by exchanging information between simulation model and actual traffic controller unit
through two-way communication channels. A VISSIM simulation network with multiple
intersections can be connected to multiple CIDs and controller units.
HILS needs to be run in real-time to coordinate VISSIM simulation and real controller
units, which means the simulation speed in VISSIM should be set as 1 simulation second
per second.
2
CE 474
8/31/06
Note: CID files are text files (*.cid), which can be opened using a text editor.
Figure 3 shows the intersection for this laboratory. The CID file shown in this tutorial
corresponds to the US12 and 3rd Street intersection.
Figure 4 shows the general content of a CID file, which has five sections. These five
sections do the following:
1. associate a VISSIM intersection with a CID and controller;
2. associate phases in a VISSIM intersection with phases in a controller;
3. associate detectors in a VISSIM intersection with detectors in a controller;
4. configure communication channels; and
5. define data communication resolution as a frequency (Hz).
3
CE 474
8/31/06
Each of the five sections in the CID file is described in more detail in the following
sections of the discussion.
4
CE 474
8/31/06
Each phase needs a separate line in this section of a CID file. A good way to map
VISSIM phases with controller phases is to follow NEMA conventions in both the
VISSIM intersection and controller unit. If there is an intersection with eight phases, then
this section of a CID file can be written as shown in Figure 4. For example, defining the
connection between the VISSIM signal group 2 for intersection 1 and phase 2 in the
controller would be (1, 2, 2).
5
CE 474
8/31/06
6
CE 474
8/31/06
7
CE 474
8/31/06
1. Click on the browse button for the “Program File” field and select C:\Program
Files\PTV_Vision\VISSIM410\Exe\cid.exe.
2. Click on the browse button for the “Interstages File” field, go to the folder for this
laboratory, and key in “US12.cid” in the “File name” field, hit the enter key, and
close this window.
3. Click on the browse button for the “Logic File” field, go to the folder for this
laboratory, and key in “US12.cid” in the “File name” field, hit the enter key and
close this window.
8
CE 474
8/31/06
9
CE 474
8/31/06
The colors indicate the current state of the signal control. The current simulation time step is on
the right. If detectors are shown in the signal times table, the following colors indicate the
detector occupancy conditions:
► Change from empty (black line) to light blue: A vehicle passes the detector within one time
step resulting in an impulse increase and decrease within one simulation second.
► Change from dark blue to light blue: A vehicle leaves the detector and a new vehicle is
detected within the same time step resulting in an impulse decrease and increase within the same
simulation second.
► Multiple seconds of light blue: multiple events similar to the color change black to light blue.
► Dark blue: A vehicle is detected at the end of the time step. Therefore, a change from empty
(black) to dark blue represents an arriving vehicle that does not leave the detector within the same
simulation second; a longer dark blue bar represents a vehicle waiting on top of the detector. This
corresponds to the ‘|’ symbol in the Signal/Detector record
To create or edit a signal timing table file, open the tab “SigTimTbl Config” in the
“Signal Control” window as shown in Figure 10. The “SigTimTbl Config” appears as
shown in Figure 13.
1
VISSIM 4.10 User Manual, PTV Vision
10
CE 474
8/31/06
Two main lists are visible in the “SigTimTbl Config” tab. One is the “Layout of Lines”
list and the other is “Type (Category)”. There is an additional list on the right side of the
“Type (Category)” list. The list “Type (Category)” contains all available variables that
can be added to the list “Layout of Lines”. The “Layout of Lines” is a list of all the
variables that will be displayed during the simulation. The additional list on the right side
of the “Type (Category)” list has available records for a selected variable. For example, if
“State Det” is selected in the “Type (Category)” list, then the list on the right shows “Det
No.” 1 through 8.
To add a new column to the list “Layout of Lines”, select the desired record in the “Type
(Category)” list and select the desired data in the neighboring list if applicable. Then
click on the double arrow button to add the selected variable to the “Layout of Lines” list.
If you’d like to remove a line in the “Layout of Lines” list, select the line and press
“Delete” key on your keyboard.
The bottom field of the “Signal Control” window specifies the name and location of the
configuration file (*.szp), which contains a specified layout of lines. An existing
configuration file automatically saves the most recently specified layout of lines after you
click “OK” at the bottom of the “Signal Control” window.
If you need to create a new configuration file, click the browse button, go to a desired
folder, fill in a file name, and click “Save”.
After you’re done with configuring the signal times table, click “OK” to close the “Signal
Control” window.
11
CE 474
8/31/06
12
CE 474
8/31/06
In this step, you need to configure some controller parameters and settings. They include:
1. Phase parameters including minimum green time, maximum green time, passage time,
yellow clearance time, and all-red clearance time;
2. Phasing and sequence; and
3. Detectors and options.
13
CE 474
8/31/06
Go over the data input keyboard and become familiar with the different pushbuttons and
where they are located.
Note: if the display window is dark, press the “Display Light” pushbutton on the upper
right side of the data input keyboard and press “Display Contrast” pushbutton to adjust
the display contrast if necessary.
14
CE 474
8/31/06
Define phases in use and phase sequence
Before programming a controller unit, there are several notes that you need to be aware
of.
Note 1: if you need help with any command, press the “Help” pushbutton on the data
input keyboard while the display window is showing that specific command. Use the
“PgDn” or “PgUp” to page down or up as needed. After you’re done with reading the
help, press the “Help” pushbutton to return to the command status.
Note 2: At any time, press the “Prior Menu” to go back to the immediate upper level of
command menu and press the “Main Menu” pushbutton to go back to the main menu.
Note 3: You need to press the “Enter” pushbutton on the data input keyboard to confirm a
setting that you have defined right before leaving a command window. Otherwise, the
last setting that you have defined will be lost.
Phase timing
Follow commands listed below:
1. Press the “Main Menu” pushbutton;
2. Press the “2” pushbutton to select “2.PROGRAM/READ MODE”;
3. Press the “2” pushbutton to select “2. CONTROLLER”;
4. Press the “2” pushbutton to select “2.PHASE TIMING”;
5. The first line shows different phases. Use arrow pushbuttons to move the cursor
around;
6. Press numeric pushbutton on the data input keyboard to assign values to phase timing
parameters. The parameters that you need to define are:
a. “MGR”: minimum green;
b. “PSG”: passage time;
c. “YEL”: yellow clearance interval;
d. “RED”: all-red clearance interval;
e. “MX1”: maximum green 1; and
f. Set all other parameters as zero in the “PHASE TIMING” command window.
15
CE 474
8/31/06
Detectors/Options
Follow commands listed below:
1. Press the “Main Menu” pushbutton;
2. Press the “2” pushbutton to select “2.PROGRAM/READ MODE”;
3. Press the “2” pushbutton to select “2. CONTROLLER”;
4. Press the “6” pushbutton to select “6. DETECTORS/OPTIONS”;
5. Press the “6” pushbutton to select “6. DETECTORS”:
6. There are three sub-commands in the “DETECTORS” command menu. You need to
use the first two sub-commands to assign detectors to phases and define detector
options, which will be explained in the subsequent steps.
7. Press the “1” pushbutton to select “1. MEMORY/CALL/EXTEND”;
8. There are four rows in the command menu. The first row “DET INP” is the detector
numbers. The second row “MEMORY” defines whether a detector is configured as
memory locking or non-locking. Press the “1” pushbutton corresponding to a detector
to turn its memory off (non-locking) and press the “2” pushbutton corresponding to a
detector to turn its memory on (locking). The third row “CALL PH” defines the
phase that a detector calls. The fourth row “EXT/SW” defines the phase that a
detector extends or switches. Note: put in 0 if no phase is called, extended or
switched. The phase that a detector switches is an alternative phase that the detector
extends if its extended phase is not currently on. Some examples for “EXT/SW”
settings are2 :
• 0/0 = no extension phase, no switch phase;
• 1/1 = normal. Since the extend and switch phase are the same, the detector would operate
normally;
• 1/6 = extend phase 1 if phase 1 is green. Switch to phase 6 if it is green only (phase 1 is
not green).
9. Press the “Prior Menu” pushbutton to go back to the “DETECTORS” command menu;
10. Press the “2” pushbutton to select “2. DELAY/STR/DIS”;
11. There are four rows in the command menu. The first row “DET INP” is the detector
numbers. The second row “DELAY” is the time period in seconds during which a
detector must be continuously occupied for a call to be placed on the corresponding
phase. The third row “STR/DIS” defines two functions which are dependent on the
detector options of a detector. If the extend/switch option of a detector is set as true in
command 7 listed above, “STR/DIS” defines the time period during which a detector
actuation pulse is retained once it is gone. If a detector is set as call only, then the
third row “STR/DIS” defines whether the detector responds to further vehicles once
the passage timer times out on this detector. You should fill in the corresponding
phase number for a call only detector. For the last row “MODE”, fill in 0 to define a
detector to be in the normal stretch mode and fill in 9 to define a detector to be in the
disconnect mode. 1 through 8 means the delay timer only times if the enabled phase
for a detector is green. This is usually used with a protected/permissive left turning
phase to enable the delay only when the opposite through phase is in green. For an
example, if detector 5 is assigned to call northbound left turning phase and phase 6
2
Operation Manual – LMD 9100/9200 Menu Driven Actuated controller Units, Peek Traffic Systems, Inc.,
1994.
16
CE 474
8/31/06
(southbound through) is filled in as the enabled phase under the “MODE” row, then
the call to phase 5 is only delayed when phase 6 is in green.
Econolite ASC2
Note: If you are using a PEEK LMD controller, please skip this part and go to PEEK
LMD Instructions .
Go over the data input keyboard and become familiar with where different keyss are
located. On the right side of the keyboard are numbers 0 through 9, which can be used for
data entry, selecting an option, and placing simulated calls. The “0” key can also be used
to toggle between yes and no or “X” (on) and blank (off). The “SPEC FUNC” and
“CLEAR” keys are not relevant to this laboratory. Two keys are in the middle of the
keyboard, which are the cursor arrows key and enter key. The cursor arrows key is used
to control the movement and positioning of the screen cursor. It also confirms a data
entry similar to an enter key. The enter key is used to confirm data entry or execute
commands. Some keys on the left side of the keyboard have the following meanings:
• “MAIN MENU”: press this key to go to the main menu;
• “SUB MENU”: press this key to go back to the immediate upper level command
menu;
• “DISPLAY ADJUST”: adjust the display contrast of the display window;
• “STATUS DISPLAY”: press this key and the display window shows phase status,
detector actuation status, the reasons why phases terminate (phase termination status),
and other relevant information;
• “NEXT SCREEN”: press this key, then press the cursor arrows key corresponding to
the desired direction;
• “NEXT DATA”: press this key to search for non-zero data and goes to that field;
• “NEXT PAGE”: press this key to go to the next page. Press the cursor arrows key to
indicate the desired direction; and
• “HELP”: press this key for help information for any command or function that is
displayed in the display window. Press the “HELP” key or “CLEAR” to exit the help
status.
17
CE 474
8/31/06
1. Press the “MAIN MENU” key;
2. Press the “8” key to select “8. UTILITIES”;
3. Press the “2” key to select “MEMORY CLEAR”; and
4. Press the “0” key to toggle between selecting an item to clear or not. After selection,
press the “ENTER” to begin clearing.
Phase timing
Follow procedures listed below:
1. Press the “MAIN MENU’ key to go back to the main menu;
2. Press the “2” key to select “2. CONTROLLER”;
3. Press the “1” key to select “1. TIMING DATA”;
4. Fill in data entry for required parameters, which include:
a. “MIN GRN.”: minimum green time;
b. “VEHI EXT.”: passage time;
c. “MAX1”: maximum green time 1;
d. “YELLOW”: yellow clearance interval; and
e. “RED CLR.”: all-red clearance interval;
5. Set all other parameters to zero except the pedestrian clearance time (“PED CLR.”),
whose minimum value is 7 seconds.
Detectors/Options
Assign detector to phases:
1. Press the “MAIN MENU’ key to go back to the main menu;
2. Press the “6” key to select “6. DETECTORS”;
3. Press the “2” key to select “2. PHASE ASSIGN”;
4. Press the “0” key to assign detectors to desired phase;
3
Press the “HELP” key for definitions for each column.
18
CE 474
8/31/06
3. Select detector type (0 -9) under the “TYPE” column (See class handout or press the
“HELP” key on the keyboard for definitions for different types). Note: ten types of
detector are available, which offers many options. However, this is also confusing.
You can try the following examples to set several different types of detector:
• Call only: select type 6;
• Extend only: select type 1 and input 200 seconds under the “DELAY” column;
• Extend and call: select type 1 and input the extend and delay times as needed.
4. Specify a detector to be memory locking (X) or non-locking (.) under the “LOCK”
column;
5. Input the extend time if needed under the “EXTEND” column. Extend time is the
time during which a call is held, which begins timing when the call is dropped;
6. Input the delay time if needed under the “DELAY” column. Delay is the time during
which a detector must be continuously occupied before a call is placed on a phase;
7. Use the “0” key to specify whether a detector resets vehicle extension.
8. Specify actuations on a detector to be recorded in data logging under the “SYSLOG
ENABLE” column.
19
CE 474
8/31/06
Note: please do NOT change simulation speed in order to keep the VISSIM simulation
and the controller unit synchronized. The simulation speed needs to be 1 simulation
second per second.
After you’re done, click “OK” to close the “Simulation Parameters” window. And click
on the play button on the toolbar to run the simulation.
20
CE 474
8/31/06
The following indicators for timing intervals might appear in the display window:
• MGRN = Minimum green timer timing;
4
Advanced System Controller ASC/2 Family Programming Manual, Econolite Control Products, Inc.
21
CE 474
8/31/06
• MAX1 = Maximum timer timing;
• YEL = Yellow clearance interval timing;
• VEXT = passage timer timing;
• RED = All-red clearance interval timing;
• GRN HOLD = Phase in hold in green; and
• GRN REST = Phase is rest in green.
Other indicators in the display window are not relevant to this laboratory. Please refer to
the provided Econolite controller manual for more details.
22
CE 474
8/31/06
STEP 7: Finish the Following Tasks After Completing the Tutorial.
1. Set the stop bar detector locking/non-locking setting to locking for the eastbound
and westbound right-turn lane.
2. Set the detector delay for the same lane as above to zero.
3. Run the simulation, verifying that your changes have taken effect by viewing the
animations of the simulation run. You will need to make two simulation runs, one
with the detectors set to non-locking and the detector delay set to a value that
seems appropriate to you and the other after having made the changes described
in tasks 1 and 2.
4. Use the node file to access the average delays for each of the turning movements
for both runs. You should see that the delays are different between the two runs.
Explain the differences in terms of the detector settings, traffic operations, and the
resulting controller operations.
5. Evaluate the intersection detection configuration and settings as shown in
VISSIM using Parsonson's six criteria.
23