Elevator Behavioral Requirements

18-649 Distributed Embedded Systems Project

Spring 2007

Last Updated: March 16, 2008

Elevator Top-Level Requirements

Note:
The full set of example requirements provided should result in an elevator with safe behavior that meets top-level requirements other than having poor optimization of performance.  While it is obvious that the Dispatcher behavior can be optimized, there are also other, more subtle, behavioral optimizations possible as well.

Notation:

The Building the elevator is in has floors numbered from 1 .. MaxFloor.  "f" refers to any floor

The setup of hallway entrances is as follows:
Floor #
1 FH and BH
2 BH
3 FH
4 FH
5 FH
6 FH
7 FH and BH
8 FH

MaxFloor is 8 for our building.

"FH" is a shorthand for front hallway, and "BH" is a shorthand for back hallway

f ranges from 1 .. MaxFloor

Floor #1 is the Lobby.

"[...]" indicates an array of objects or values.   There are 10 valid hallways, and so there are 17 separate and distinct HallCall[f, b, d] sensors -- 2 of them at each valid hallway, except for the top and bottom floors which only have 1 sensor per valid hallway.
"(...)" indicates a list of values associated with a sensor/actuator.  Single-valued inputs/outputs can have the "(" and ")" omitted as a notational convenience.

The suffices "_up", "_down", "_front", and "_back" may be used in lieu of a direction subscript, to make things more readable. e.g.:
        HallCall_up[f, b] means HallCall[f, b, up]
        HallCall_down[f, b] means HallCall[f, b, down]
        HallCall_front[f, d] means HallCall[f, front, d]
        HallCall_back[f, d] means HallCall[f, back, d]
        HallCall_up_front[f] means HallCall[f, front, up]
        and so on...
(Note that in the above examples, "f" is a floor number (1 ... MaxFloor), "b" is a hallway (front or back), and "d" is a direction (up or down))

Similarly, subscripting may be eliminated in general if desired using an underscore notation. e.g.:
        CarLantern_down

Multi-attributed items may have a particular state referred to by concatenating elements, e.g.: Motor might have state FastUp or SlowDown. ("StopStop" can always be abbreviated by "Stop")

Single attributes of a multi-attribute item are referred to using "." notation.  For example DesiredFloor.f refers to attribute "f" of "DesiredFloor".

If a letter instead of a value is used in a subscript, it is assumed that it can take any valid value.  If the same letter is used in multiple clauses within a single requirement element, it is assumed that the letter takes the same value in all instances.  For example, in the phrase:
 "AtFloor[f, b] ... CarCall[f, b]  ...  HallCall[g, b, d]"
The Floor f and Hallway b for AtFloor and CarCall can be any valid floor and valid hallway, but would have to be the same floor and hallway.  However, the floor for HallCall might or might not be the same floor as for AtFloor and CarCall since it is a different symbolic letter.

Replication is a problem in UML Sequence Diagrams. Rather than introducing an attempt at formal notation (which gets very confusing quickly), we will resort to using comments when multiple instances of something are supposed to be coordinated (e.g., "wait for all doors to close" will be a text comment in Sequence Diagrams, but shall be represented rigorously in behavioral requirements).

Car refers to the elevator Car that travels in a hoistway.  The movement of the Car itself is hidden within the environment model and thus only indirectly observable/controllable by the control system via sensors and actuators.

Because ultimately we will do this all in simulation, we're going to make your life easy by telling you the initial state of the system (the "initialization" state) such as putting the elevator car at the lobby floor.  In a real elevator the controllers have to figure out the system state for themselves when power is applied.

The following letters are used as subscripts for replicated objects, and have meanings as defined:
f - floor number (integer 1...MaxFloor)
b - front/back hallway {Front, Back}
r - right/left {Right, Left}
d - direction {Up, Down}

System Sensors:

These sensor values are available for use by the control system.  The below-listed values will correspond to network messages in the implementation phase.

Environmental-Only Sensors:

These are pseudo-sensor values created to explain behavior of objects external to the control system.  They are not accessible to the control system, but have been used as the specifications for building the simulation system.

System Actuators:

The below-listed values will correspond to network messages in the implementation phase.  All actuators are assumed to "remember" their last commanded value and stay there unless commanded otherwise or forced otherwise by system/environment constraints.

Environmental-Only Actuators:

Control System State

The below-listed values will correspond to network messages in the implementation phase.

Environmental Objects

These objects exist in the simulator, but are only accessible to the control system indirectly via manipulation of actuators.  (These are partial specifications; internal book-keeping such as keeping track of where a passenger is and knowing the weight of the car based on passenger count to model acceleration is not visible to the simulation.)

The objects associated with the following sensors and actuators are considered simple and are not described in detail beyond definitions provided in the preceding system sensor/actuator lists.  In each case, interfaces consist solely of the relevant sensor/actuator state and any obvious interactions with the environment.

AtFloor[f, b]
CarLevelPosition
CarCall[f, b]
DoorClosed[b, r]
DoorOpened[b, r]
DoorReversal[b, r]
HallCall[f, b, d]
HoistwayLimit[d]
DoorPosition[b, r]
CarLantern[d]
CarLight[f, b]
CarPositionIndicator
HallLight[f, b, d]
EmergencyBrake
CarPosition
CarWeight
CarWeightAlarm

Complex sensor, actuator, and environmental objects are discussed in the following sections.

1. Passenger[p]  (environmental object)

Replication:

Instantiation:

Assumptions:

Input Interface:

Output Interface:

State:

CONSTRAINTS:

1.1    Passengers shall not enter a Car already containing 15 or more passengers.
1.2    Passengers are prevented from entering or exiting the Car whenever the appropriate doors are not far enough opened.
1.2.1    The value constituting the minimum acceptable total opening distance ranges from 20% to 45% open, with the percentage randomly selected for each Passenger.

BEHAVIORS:

1.3    A Passenger p at hallway [f, b] where HallLight[f, b, P_DIR[p]] is Off shall press HallCall[f, b, P_DIR[p]].
1.3.1    Time to complete this behavior is stochastic, ranging from 400 msec to 3000 msec.
1.3.2    Each Passenger p shall press the button between 1 and 3 times inclusive (stochastic) while the appropriate hall light is Off.  Each time that appropriate hall light transitions from On to Off, an additional 1-3 maximum presses per passenger is started in a similar manner.
1.4    A Passenger p at hallway [f, b] where CarLantern[P_DIR[p]] is On shall attempt to enter the Car if unblocked and if the appropriate doors are sufficiently far open.
1.4.1    Additionally, a Passenger p at hallway [f, b] where all CarLantern[*]s are Off shall attempt to enter the Car if unblocked and if the appropriate doors are sufficiently far open.
1.4.2    A passenger shall take 1 to 2 seconds (stochastic) to enter a Car once unblocked and the appropriate doors are sufficiently far open to permit entry.
1.5    A Passenger p in Car where CarLight[P_DEST_F[p], P_DEST_H[p]] is Off shall press CarCall[P_DEST_F[p], P_DEST_H[p]].
1.5.1    Time to complete this behavior is stochastic, ranging from 200 msec to 1000 msec.
1.5.2    Each Passenger p shall press CarCall[P_DEST_F[p], P_DEST_H[p]] between 1 and 3 times inclusive (stochastic) while the appropriate car light is Off.  Each time the appropriate car light transitions from On to Off, an additional 1-3 maximum presses per passenger is started in a similar manner.
1.6    A Passenger p in the Car where CarPositionIndicator is P_DEST_F[p] shall attempt to exit the Car if unblocked and if the appropriate doors are sufficiently far open.
1.6.1    A passenger shall take 1 to 2 seconds (stochastic) to exit a Car once unblocked and the appropriate doors are sufficiently far open to permit exit.
1.7    A passenger entering the Car shall wait until all passengers desiring to exit the Car at that hallway have exited.  (i.e., all entering passengers are blocked while there exist exiting passengers for that same hallway)
1.8    If doors become so far closed that an already-entering or already-exiting Passenger would have been prevented from entering or exiting by door position, and doors do not start opening within 100 msec, the passenger aborts entering/exiting the Car.
1.8.1    This abort process takes an additional 2 to 4 seconds (stochastic amount) to return the Passenger to the position held before starting the enter/exit process.
1.8.2    This passenger blocks all other passengers during this process.
1.8.3    This passenger retains queue position, and thus normally retries entry/exit immediately if possible.
1.8.4    This passenger activates both DoorReversal[b, r]  for whichever hallway [f, b] the passenger was attempting to enter or exit.
1.9    If the CarWeightAlarm is On, the last passenger to enter the elevator will exit the elevator from the same hallway.

2. Safety  (environmental object)

Replication:

Instantiation:

Assumptions:

Input Interface:

Output Interface:

State:

None

TIME-TRIGGERED BEHAVIORS:

2.1    If all mAtFloor[f, b]s are False and any mDoorClosed[b, r] is False, set EmergencyBrake to on.
2.2    If any mDoorReversal[b, r] is True and any mDoorMotor[b, r] is anything other than open for greater than 200msec (accumulated while mDoorReversal[b, r] remains True), set EmergencyBrake to on. 
2.3    If any HoistwayLimit[d] is True, set EmergencyBrake to on.
2.4    If a mDrive command is not "adjacent to" or the same as the current mDriveSpeed value for a period of longer than 100 msec, set EmergencyBrake to on.
2.4.1    The following pairs of {DriveSpeed, Drive} values are considered "adjacent":
{FastUp, SlowUp}, {SlowUp, FastUp},
{SlowUp, Stop}, {Stop, SlowUp },
{Stop, SlowDown }, {SlowDown, Stop},
{SlowDown, FastDown}, {FastDown, SlowDown}.
2.5    If mCarWeight > MaxCarCapacity and mDriveSpeed(s, d) is not mDriveSpeed(0, d) or mDriveSpeed(s, Stop), set EmergencyBrake to on.
2.6    If CarPosition is greater than or equal to the position of the HoistwayLimit[Up] switch, mHoistwayLimit[Up] shall be set to True and remain True.
2.7    If CarPosition is less than or equal to the position of the HoistwayLimit[Down] switch, mHoistwayLimit[Down] shall be set to True and remain True.

3. Drive  (environmental object)

Replication:

Instantiation:

Assumptions:

Input Interface:

Output Interface:

State:

CONSTRAINTS:

3.1    If the EmergencyBrake is activated, it shall stop the Car regardless of Drive speed and direction.

BEHAVIORS:

3.2    Drive(Stop,d) and Drive(s,Stop) shall stop the Car regardless of values for s or d.
3.2.1    The time to Stop the Car from Fast speed depends on the Car speed before Stop is commanded and is determined by an acceleration profile.
3.2.2    The time to Stop the Car from Slow speed shall be less than or equal to 250 msec.
3.3    Drive(Slow,d), where d is not Stop, shall move the elevator at a slow speed in the appropriate direction.
3.3.1    The time to achieve Slow speed depends on speed preceding the Slow movement command and is determined by an acceleration profile.
3.3.2    The actual velocity at Slow speed depends on the drive equipment installed.
3.4    Drive(Fast,d), where d is not Stop, shall move the elevator at maximum possible speed in the appropriate direction as determined by a velocity profile.
3.5    CarPosition and shall be updated according to integration of Car speed as determined by Drive() commands and an acceleration profile.

4. DoorMotor[b, r]

Replication:

Instantiation:

Assumptions:

None

Input Interface:

Output Interface:

State:

CONSTRAINTS:

4.1    D_position shall be thresholded to the range 0..500 regardless of DoorMotor[b, r] commands.
4.2    The DoorMotors[b, r] themselves shall not activate DoorReversal[b, r] sensors.
4.3    DoorMotors[b, r] shall operate properly even if transitioned between Open and Close in either direction without an intermediate Stop command.

BEHAVIORS:

4.4    DoorMotor[b, r](Stop) shall stop changes in door position within 100 msec.
4.5    DoorMotor[b, r](Open) and DoorMotor[b, r](Close) shall cause door[b, r] to Open and Close respectively according to a velocity profile.
4.6    D_position shall be kept updated by a physical model to indicate current positions of simulated doors.

5. DoorControl[b, r]

Replication:

Instantiation:

Assumptions:

Input Interface:

Output Interface:

State:

CONSTRAINTS:

5.1    DoorClosed[b, *] shall be True when there is no mAtFloor[f, b] that is True.
5.2    Any DoorReversal_Front[r] shall not be True for more than an accumulated time of 50 msec without causing all DoorControllers_Front[r] to perform an Open command. Similarly, any DoorReversal_Back[r] shall not be True for more than an accumulated time of 50 msec without causing all DoorControllers_Back[r] to perform an Open command.
5.3    Doors keep moving in desired direction unless commanded otherwise, subject to the constraints of the door object.
5.4    All doors should be commanded to identical positions at all times.
5.5    If CarWeight(x) >= MaxCarCapacity, the doors shall be commanded to open and stop until the car is no longer overloaded.

TIME-TRIGGERED BEHAVIORS:

5.6    If all mAtFloor_Front[f] are False, Cycles_Front[r] shall be set to zero. Similarly, if all mAtFloor_Back[f] are False, Cycles_Back[r] shall be set to zero.
5.7    If mDoorReversal[b, r] is True then: both DoorMotor[b, *] shall be commanded to Open; both Cycles[b, *] shall be incremented; Dwell[b] should be set to an appropriate value.
5.8    If any mAtFloor[f, b] is True and f equals mDesiredFloor.f, and mDriveSpeed = (0, d) or mDriveSpeed = (s, Stop), and Cycles[b, *] is zero then: both DoorMotor[b, *] shall be commanded to Open; both Cycles[b, *] shall be incremented; Dwell[b] should be set to an appropriate value.
5.9    When mDoorOpened[b, r] becomes True, CountDown[b, r] shall be set to Dwell[b]; DoorMotor[b, r] should be commanded to Stop.
5.10    When mDoorClosed[b, r] becomes True, DoorMotor[b, r] should be commanded to Stop and Cycles[b, r] should be decremented.
5.11    When CountDown[b, r] transitions to zero, DoorMotor[b, r] should be commanded to Close.
5.12 If mCarWeight(g) > MaxCarCapacity, and mDoorOpened[b, r] is False, DoorMotor[b, r] shall be commanded to Open.
5.13 If mCarWeight(g) > MaxCarCapacity, and mDoorOpened[b, r] are True, DoorMotor[b, r] shall be commanded to Stop. 

6. DriveControl

Replication:

Instantiation:

Assumptions:

Input Interface:

Output Interface:

State:

CONSTRAINTS:

6.1    Drive shall have been commanded to Stop whenever any mDoorClosed[b, r] is False.
6.2    Drive shall have been commanded to Stop whenever any mDoorMotor[b, r] is commanded to Open.
6.3    The commanded value of Drive shall either be the same as or "adjacent to" the value of DriveSpeed.
6.3.1    The following pairs of {DriveSpeed, Drive} values are considered "adjacent":
{FastUp, SlowUp}, {SlowUp, FastUp},
{SlowUp, Stop}, {Stop, SlowUp },
{Stop, SlowDown }, {SlowDown, Stop},
{SlowDown, FastDown}, {FastDown, SlowDown}.
6.4    Drive should be Stopped whenever mEmergencyBrake is activated.
6.5    If mCarWeight(x) >= MaxCarCapacity, the drive shall be commanded to {Stop, Stop} until the car is no longer overloaded.

EVENT-TRIGGERED BEHAVIORS:


7. LanternControl[d]

Replication:

Instantiation:

Assumptions:

Input Interface:

Output Interface:

State:

CONSTRAINTS:

7.1    Both CarLanterns[d] shall not be On at the same time.

EVENT-TRIGGERED BEHAVIORS:


8. HallButtonControl[f, b, d]

Replication:

Instantiation:

Assumptions:

None

Input Interface:

Output Interface:

State:

CONSTRAINTS:

None

EVENT-TRIGGERED BEHAVIORS:


9. CarButtonControl[f, b]

Replication:

Instantiation:

Assumptions:

None

Input Interface:

Output Interface:

State:

CONSTRAINTS:

None

EVENT-TRIGGERED BEHAVIORS:


10. CarPositionControl

Replication:

Instantiation:

Assumptions:

None

Input Interface:

Output Interface:

State:

CONSTRAINTS:

10.1    The Car can be at only one position at a time.
10.2    The CarPositionIndicator shall display the current floor whenever any of the doors are open.
10.3    The floor indicated by the car position indicator shall only change by one floor in either direction per update cycle, and should be a close approximation to the car's actual position.  The direction of change shall be in the same direction the Drive is moving. By "close approximation" we mean within stopping distance in the direction of motion.

EVENT-TRIGGERED BEHAVIORS:

10.4     Whenever any mAtFloor[f, b] is True, CarPositionIndicator shall be commanded to display CurrentFloor. 

11. Dispatcher

Replication:

Instantiation:

Assumptions:

Input Interface:

Output Interface:

State:

CONSTRAINTS:

11.1    Target shall be a valid Floor number from 1 .. MaxFloor inclusive.
11.2    The desired direction d of mDesiredFloor(f, b, d) shall not be Up when d = MaxFloor .
11.3    The desired direction d of mDesiredFloor(f, b, d) shall not be Down when d = 1.

EVENT-TRIGGERED BEHAVIORS:

11.4    mDesiredFloor.f shall always be set to Target.
11.5    mDesiredFloor.d shall always be set to Stop.
11.6    Whenever any mDoorClosed [b, r] is False, Target shall be set equal to ((f mod MaxFloors) + 1), mDesiredFloor.b shall be set to b, and temporary variable DoorClosed[b,r] shall be set to False, where f, b is whichever mAtFloor[f, b] is True
11.6.1   If two temporary variable AtFloor[f, b] values are True with the same value f, then mDesiredFloor.b shall be set to Both.
11.7    mDesiredDwell shall always be set to a constant appropriate value for door open dwell.
11.8    Whenever any mAtFloor[f,b] are False, temporary variable AtFloor[f,b] shall be set to False.
11.9    Whenever any mAtFloor[f,b] are True, temporary variable AtFloor[f,b] shall be set to True.
11.10    Whenever any mDoorClosed[b,r] are True, temporary variable DoorClosed[b,r] shall be set to True.