Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

Where possible try to be efficient (i.e. if it can be done in 10 states or in 5, try doing it in less than 10).

But when in doubt, give priority to being right (not efficient).


If you think something is not clear, or if you have doubts, write a sentence to explain what you understood
(i.e. ``I am not sure whether you want me to do this in parallel or one after the other, I think you mean parallel
and that is what I modelled’’). That way I at least know what you tried to model.

Exercice Elevator (State Diagram)


We are building an elevator system. The elevator is only going to move between an upper
floor and a lower floor, so it only has two stops (top and bottom).
 Elevator position: If the elevator is at the upper floor the sensor (SU) is sending the
signal 1, if it is at the lower floor the sensor (SD) is sending the signal 1.
 Doors: The elevator has manually operated doors (i.e. there is no motor to open or
close them) and if the doors are closed the sensor (SDoor) sends the signal 1.
 Elevator control: In the elevator are two buttons: UP and DOWN, while at either floor
there is a call button to call the elevator (CallUp on top, CallDown on the bottom).
 Movement: The elevator is moved by two motors, MU and MD (for up or down).

The elevator is supposed to work as follows:


 Doors: The elevator can only move from one floor if the doors are closed (and we
have a mechanism that prevents anyone from opening the doors when the elevator is
moving between floors so you do not have to worry about that.)
 Controlling the elevator from inside:
o If the elevator is on the top floor and someone presses the button DOWN, then
(but only if the doors are closed) the elevator will go to the bottom floor. The
same works using the UP button to go up (again, only if the doors are closed).
o If the elevator is already on the top floor when someone presses the UP button
nothing happens (and the same is happening at the bottom floor for DOWN).
o While the elevator is moving it will not / cannot change direction!
 Controlling the elevator from the floors:
o If the elevator is on the top floor and someone on the bottom floor is calling it
by pressing the CallDown button, the elevator will move down (but, only if
the doors are closed). As before, the reverse works for calling the elevator up.
o If the elevator is currently moving or if the doors are open nothing happens.
 When the elevator is moving, a corresponding light (LUP or LDOWN) is activated.

Think about this before you start modeling. There is nothing in this exercise that makes it
especially hard and there is a very elegant solution if you can find it. NOTE that you should
not need very many states, if your machine has more than 10 then you are probably over-
thinking this. If you can think of more than one way, note them both for discussion in class.

Requirements:
1. List all inputs and outputs, use the variable names used in the text.
2. Draw the State Diagram that models the described process. Use the correct notation!
3. NOTE: You may decide what the initial state should be.
4. HINT: this can be done with very few states. Think about how many different states
the elevator can be in (then simply connect these with transitions).

You might also like