Design and Implementation of A Statechart Based Reconfigurable Elevator Controller
Design and Implementation of A Statechart Based Reconfigurable Elevator Controller
net/publication/224909540
CITATIONS READS
8 950
3 authors:
SEE PROFILE
All content following this page was uploaded by Sunil Gamini Abeyratne on 02 January 2015.
Abstract- This paper presents a simple and clear method to with some specified inputs and outputs, can be implemented
design and implement a reconfigurable elevator controller using simply by changing a variable N corresponding to number of
an FPGA, which can be implemented for an elevator with any
(N) number of floors, with specified inputs and outputs. A model floors.
based design approach was followed. We started from a state When designing controls for any event driven, complex
chart model developed for a prototype elevator with three floors. reactive systems, development of a method for formal
Extension of the model for a variable number of floors was specification of the control at the initial stage facilitates easy
considered. Controller for the prototype system was implementation in later stages. Therefore such an approach is
implemented in ladder logic on a PLC and the limitations of that
approach with regard to re-configurability were identified: viz., essential in developing controls for a system like the elevator
in the extension of elevator controller for ‘N’ no of floors. Next which has a fairly large number of sensors and which needs
VHDL code was developed for a reconfigurable elevator to continuously react to several inputs. This becomes more
controller where, by changing a variable corresponding to the pronounced for systems with large numbers of floors, for the
required number of floors, the suitable code can be generated. added complexity. Therefore, this elevator controller was also
The controller thus generated can be implemented in an FPGA.
The method was successfully tested on a Xilinx Spartan 3AN developed using a model based design approach, in which a
FPGA. statechart model was developed for the prototype elevator at
the initial stage. A verification of the design can also be done
Index Terms- Elevator, FPGA, PLC, Reconfigurable, State at the development stage with this approach.
Chart, VHDL
The objectives of the research presented in the current
I. INTRODUCTION paper are:
1. Demonstrate the development of a statechart model for
In control and automation industry, Programmable Logic
the prototype elevator that permits extension of the model for
Controllers (PLCs) are commonly used to implement controls
‘N’ number of floors and simulate in MATLAB SIMULINK
for complex reactive systems, primarily because of their easy
STATEFLOW, to validate the architecture.
programming environments based on IEC-61131-3. However,
2. Implementation of a controller for the prototype system
they are meant for sequential event processing and not for
using a Programmable Logic Controller (PLC) and
hard real-time reactive environments which require parallel
development of a methodology to extend the controller for
processing capabilities. In contrast, Field Programmable Gate
any number of floors in a user friendly manner: using IEC-
Arrays (FPGAs), which are inherently parallel, can be used to
61131-3 languages.
develop controls for more complex systems with large
3. Validate the reconfigurable design process through
number of inputs and outputs. In addition to reconfigurability,
implementation of the reconfigurable controller using a
it consumes less power and it can provide comparatively low
FPGA in a convenient and user friendly approach: with
response times and flexibility in expansion of designs.
VHDL (IEC 61691) as the HDL.
This paper presents the work carried out to design and
implement a reconfigurable elevator controller, which can be
implemented for an elevator with any number of floors (N) in II. DEVELOPMENT OF PROPOSED STATECHART MODEL
a simple and user friendly manner. With this design, which A. Statechart Design
was implemented using a Field Programmable Gate Array a Following our model based design approach, at the initial
controller suitable for an elevator with any number of floors, stage we developed a state chart model for the prototype
elevator and simulated it with MATLAB SIMULINK
H.P.A.P. Jayawardana, H.W.K.M. Amarasekara, P.T.S. Peelikumbura,
and W.A.K.C. Jayathilaka are final year undergraduates in the Department of
STATEFLOW, which permitted us to verify the design at the
Electrical, Electronic Engineering, Faculty of Engineering, University of development stage, before going for costly and time
Peradeniya, Sri Lanka. consuming hardware implementation. With that simulation,
Dr. S.G. Abeyaratne is a Senior Lecturer in the department of Electrical,
which clearly indicates the state transitions of the system, it
Electronic Engineering, Faculty of Engineering, University of Peradeniya,
Sri Lanka was easy to identify the system behavior. Thereafter, we
Dr. S.D. Dewasurendra, MIMechE is a Senior Lecturer in the department investigated the extension of this model to ‘N’ no of floors so
of Computer Engineering, Faculty of Engineering, University of Peradeniya, that the behavior of such system could be understood clearly.
Sri Lanka.
IV. CONTROLLER DEVELOPMENT WITH PLC Fig 7: Ladder for Overall System Forward Motion
A. Implementation of a controller for the prototype elevator
As most real time systems are commonly implemented B. Extension of the Controller for ‘N’ no of Floors
using PLCs, in the first stage of our work we tried to develop After implementation of the controller for prototype
the controller using a PLC. For that we used, elevator, we studied about extension of the controller for an
TWDLCDE40DRF Telemachanique PLC. Initially we tried elevator with any number of floors. For that we will consider
to develop a controller for the prototype elevator using ladder the following inputs;
diagrams. We identified that we have to basically develop Car Buttons : CCB0,CCB1,…CCB(N-1)
two kinds of ladder diagrams for the forward and reverse Hall Call Buttons:
motion of the elevator car, in addition to other features like HCB0U,HCB1D,HCB1U,…..,HCB(N-1)D
door and lights. Proximity Sensor Inputs:
To illustrate the logic behind that, let us consider the ladder PROX0,PROX1,…….,PROX(N-1)
diagrams we developed for the forward motion of the Similar to the way that we developed the ladders for
prototype elevator. As shown in Fig 6, we develop a separate prototype elevator, we have to basically consider forward and
rung for forward motion from floor0 to floor1, and another reverse motion of the car.
for forward motion from floor 0 to floor2 and floor1 to floor2. To illustrate the method for extension, let us again consider
According to the motion required by the passenger, a memory the forward motion. Similar to the method for prototype
bit is set and all those outputs are considered for overall elevator, two types of ladders has to be developed.
system forward motion of the car as shown in the ladder As shown in the Fig 8, a separate ladder diagram is needed
shown in Fig 7. Similarly, we have to develop sixteen rungs for the forward motion to (N-1) floor. In addition, (N-2) no
for the development of a controller for prototype elevator of ladder diagrams have to be drawn for the forward motion
with three floors. We programmed the PLC using the to floor 1,….,(N-2), as shown in Fig 9. At the same time,
developed ladder program and we successfully implemented overall system Ladder has to be edited as shown in Fig 10.
the controller.
floors. We can accomplish that task in a simple way using an
FPGA. In addition to its reconfigurablity, FPGAs also
provide reduced response times and flexibility in expansion.
V. IMPLEMENTATION OF A RECONFIGURABLE
CONTROLLER FOR AN ELEVATOR WITH ‘N’ NO OF FLOORS
VII. CONCLUSION
We could only simulate the state chart model that we have
developed for the prototype elevator. If the simulation can be
extended for ‘N’ no of floors, the controller development in
later stages may be very much easier. In addition, further
Fig 11. Logic of VHDL Code Development for reconfigurable Controller.
research can be done on formal verification of these models.
compare the proximity sensor input vector and common In our controller implementation with PLC and study on
vector for button inputs. feasibility for extension, we only tried it with Ladder
diagrams. But further research can be done on
Proximity sensor input vector – ‘001’ implementation of it using some other PLC programming
Proximity sensor input vector – ‘001’ languages such as Sequential Function Charts.(SFC).
Button input vector - ‘100’ In this research, we focus only on the extension of basic
In order to compare these vectors we convert these binary functions of the elevator with a reconfigurable controller. But,
vectors to integers and then compare the integer values if this is going to be implemented for a particular elevator
assigning them into variables which can be updated with the with some additional features the code has to be edited to suit
changing of proximity sensor input vector when moving the them, extending the method proposed in this paper for basic
elevator car. features.
B <= conv_integer (BTNS_in); This effort was mainly aimed for the design of the
P := conv_integer (PROX_in); controller when number of floors goes to ‘N’, but there is still
space for research on how hardware configurations and
Let’s go back to the example if the proximity sensor input limitations should be varied when the number of floors goes
vector is ‘001’ then P will be 1 and since button input vector to ‘N’.
is ‘100’ , B will be 4. Then we use the program and give the
output for moving forward in order to make P = B and to stop
the car.
ACKNOWLEDGMENT HCBTNS_in := HCBTNS ;
CCBTNS_in := CCBTNS ;
We acknowledge with gratitude the Peradeniya University
for i in 0 to n-1 loop
Research Grant RG/2006/32/E awarded by University of
BTNS(i) := HCBTNS_in(i) or CCBTNS_in(i);
Peradeniya as seed money for building the elevator system,
end loop;
the help received from Electrical & Electronic Engineering
BTNS_in := BTNS;
staff and Sub-warden of Ramanathan Hall of Residence, the
B <= conv_integer(BTNS_in);
numerous helps extended by colleagues from CECB and
end if;
Schneider Electric Co. Ltd. We also acknowledge valuable
end if;
discussions with PhD student Mr. A.C. Vidanapathirana who
if status=1 then
works on formal verification/validation of the elevator control
B<=0;
system.
end if;
REFERENCES end process;
process(clk,PROX)
[1] D. Harel,” Statecharts: A Visual Formalism for Complex Systems”, variable PROX_in:std_logic_vector (n-1 downto 0);
Science of Computer Programming, vol. 8, (3), pp.231-274, 1987.
[2] Y-S. Huang, S-L. Chung, and M-D. Jeng ,”Modeling and Control of variable P:integer range 0 to 100 ;
Elevators by Statecharts”, Asian Journal of Control,Vol. 6, No. 2, pp. begin
242-252, June 2004 if (clk'event and clk='1') then
[3] V. A. Pedroni, “Circuit Design With VHDL”, MIT Press Cambridge,
2004 if PROX>0 then
[4] P. Bhaduri and S. Ramesh, “Model checking of statechart models: PROX_in := PROX ;
survey and research directions”, ArXiv Computer Science e-prints, July P := conv_integer(PROX_in);
2004.
[5] D. Dewasurendra, “Statecharts for Reconfigurable Modular Control of if (P=B) then
Complex Reactive Systems: a new formal verification methodology”, status<= 1;
in Proceedings of ICIIS 2006, Peradeniya, Sri Lanka, August 2006. elsif (B>P and B/=0)then
status <= 2;
APPENDIX elsif (B<P and B/=0) then
status <= 3;
Total VHDL program developed for an elevator with ‘N’ no else
of floors is as follows. status <=0;
end if;
entity n_floor is end if;
generic (n : integer := 3); end if;
port( end process;
PROX:in std_logic_vector(n-1 downto 0); process(clk)
HCBTNS:in std_logic_vector(n-1 downto 0); begin
CCBTNS:in std_logic_vector(n-1 downto 0); if clk'event and clk='1' then
INV1F : out std_logic; case status is
INV1R : out std_logic; when 1 =>
BRAKE : out std_logic; INV1F <='0';
clk : in std_logic); INV1R <='0';
end n_floor; BRAKE <='0';
when 2 =>
architecture Behavioral of n_floor is INV1F <='1';
signal status : integer range 0 to 20; BRAKE <='1';
signal B : integer range 0 to 100 ; when 3 =>
begin INV1R <='1';
BRAKE <='1';
process(clk,HCBTNS,CCBTNS) when others =>
variable BTNS:std_logic_vector(n-1 downto 0); INV1F <='0';
variable HCBTNS_in:std_logic_vector(n-1 downto 0); INV1R <='0';
variable CCBTNS_in:std_logic_vector(n-1 downto 0); BRAKE <='0';
variable BTNS_in:std_logic_vector(n-1 downto 0); end case;
begin end if;
if (clk'event and clk='1') then end process;
if ( HCBTNS > 0 or CCBTNS > 0 ) then end Behavioral;