Jurnal Rev Asdaper Translating
Jurnal Rev Asdaper Translating
Abstract
There are two approaches in the implementation of digital
controller, The first method, commonly used method is Sp(t) e(t) u(t)
software approach with utilize microprocessor/microcontroller (Controller) Actuator
device. The second method is hardware approach with CPLD +
and FPGA device, this approach has advantages in speed and - Plant
y(t)
parallel processing. sensor
3. Design of Plant
To get the dynamic characteristic then need to designed
Figure 3. Digital Controller with DE0-Nano Module
a plant which later can be controlled using universal
digital controller for observed dynamic response and for
Digital controller is part of digital control system, in this
the controller validation process that designed to made
study digital controller is implemented with using
temperature control system, which have been made
hardware approach, namely using DE0-Nano module
previously [6][7].
which integrated components of S/H and ADC.
A plant is built using mica or acrylics material which
As in the picture 3, DE0-Nano module connected with
is shaped beam as in figure.4
button device is used to raising and lowering value of
reference signal (sp) as well as the parameter that
required selected controllers, dip switch is used to select
signal value and the parameter will be set, the working
mode and to select type of digital controller that desired,
3
Seminar Teknik Komputer, Kendali dan Elektronika Juni 2014
Fan
Heater Sensor
Equation 1 is the ideal condition of an On/Off
controller, to reduce the process of changing condition
of on and off that fast then need additional parameters
such as hysteresis (h), thus obtained the equation 2:
Figure 4: Construction Temperature Control 𝑢(𝑘) = 𝑆0 𝑓𝑜𝑟 𝑣𝑎𝑙𝑢𝑒 𝑜𝑓 𝑒(𝑘) > +ℎ𝑡𝑜𝑝
𝑢(𝑘) = 𝑆1 𝑓𝑜𝑟 𝑣𝑎𝑙𝑢𝑒 𝑜𝑓 𝑒(𝑘) < −ℎ𝑑𝑜𝑤𝑛
Variable state of plant is Tud (air temperature in the 𝑢(𝑘) = 𝑓𝑖𝑥𝑒𝑑 𝑜𝑛 𝑆0 𝑜𝑟 𝑆1 (2)
box) and Tm ( the temperature of mica box), the hot 𝑓𝑜𝑟 𝑣𝑎𝑙𝑢𝑒 𝑜𝑓 |𝑒(𝑘)| < (ℎ𝑡𝑜𝑝 dan ℎ𝑑𝑜𝑤𝑛 )
input to system Q(t) is given by the heater in the form of
an incandescent light bulb and the outside air
temperature (Tul), it raises the heat transfer to the mica Based on the above equation can be made into
box as a material that isolate inside and outside
temperature, the plant which in figure 4, have two finite state machine as in figure 6.
actuators: the heating with incandescent lamp of
5W/12Vdc and cooling using fan of 12Vdc/0,12W
which will be governed by controller to keep in order to reset
the temperature inside the box according with reference 𝑒(𝑘) < ℎ𝑑𝑜𝑤𝑛
signal.
S0 S1
𝑇𝑒𝑚𝑝𝑒𝑟𝑎𝑡𝑢𝑟𝑒
5. The Design of Digital PID Controller with the value of u(k) will be latched by Reg3 so
PID controller is a controller that perform the
become u(k-1). The diagram in the figure 7 is a
calculation process with 3 parameters, namely diagram of parallel design which further
proportional, integral and derivative, to implement PID implemented into FPGA chip. Digital PID controller
controller there are 3 algorithms that can be with incremental Algorithm is able to avoid to
implemented, namely velocity Algorithm, positional occur signal accumulation e(k) as well as can
algorithm and incremental algorithm [8] [10] [11]. In switch from manual mode to automatic mode
this study used an incremental algorithm with the
algorithm as in equation 5.
operation is more subtle [11].
6. Universal Digital Controller
𝑢(𝑘) = 𝑢(𝑘 − 1) + 𝐾0 𝑒(𝑘) + 𝐾1 𝑒(𝑘 − 1)
(5) Implementation
+ 𝐾2 (𝑘 − 2)
Implementation of digital controller of the design
with the constant value of K0, K1, K2 is PID
result need other component to complete so can
controller parameters value of incremental
be operated in real, the overall design of the
algorithm that obtained from equation of
system that made reference to the figure 3.
positional Algorithm with relationship in equation
module is used DE0-Nano from Terrasic which
6
includes are already equipped a Cyclone FPGA
𝐾0 = 𝑘𝑝 + 𝑘𝑖 + 𝑘𝑑 chip of EP4C22F17C6 and 12-bit ADC component
𝐾1 = −𝑘𝑝 − 2𝑘𝑑 (6) of ADC128S022, 2 pushbuttons and 4 DIP switchs,
to equip it is added hardware that function as
𝐾2 = 𝑘𝑑 user interface, namely : LCD 16X2, DIP switch,
kp, ki, kd are constants value of positional additional push button and RS-232 converter
Algorithm for proportional ,integral and using MAX232, Other components are heater and
derivative parameters. Based on equation 5 and 6 cooling driver. To operate the device then need to
then architecture of PID controller as in figure 7. be made interface module that implemented into
a FPGA so in it architecture form of universal
digital controller system is able to accommodate
e(k) e(k-1) e(k-2) controller of digital on-off and digital PID
Reg2
Reg1
can be done, namely functional simulation and timing controller is built one clock signal to ensure that
simulation [12][13]. physic time limit can be fulfilled that mean next
clock cycle is done if the entire gate had
Figure 9. Shows Functional testing method
completed its function and digital controller is at
againts DUT (Device Under Test) device, in the
steady state conditions [3] [11].
study is on-off digital controller and PID.
Functional testing is done by to build testbench
component that gives signal to DUT that further
Register
DUT
Wire
responce of DUT is read a net variable in the form
of wire.
Gambar 8. Diagram RTL Viewer sistem keseluruhan pengendali digital universal dengan pengendali on-off
6.1. Implementation of digital on-off Clk signal is signal for synchronization operations of
controller all components, rst (reset) signal is used to put back
On-off controller had been made before implementation digital on-off controller to state0. Err is error signal,
into FPGA then need to performed simulation while bts_up and bts_down are value of histeresys that
functional testing to get information, whether digital desired.
controller operates with desired logic and timing By providing as in Table 3 and Table 4 then response
simulation to get maximum clock frequency results obtained from digital on-off controller for error
information that can be given to digital controller. signal conditions and reset signal which is performed
changing conditions.
Timing Simulation is done by using TimeQuest timing
analyzer that provided by Quartus II from results Table 3: Stimulus and on-off Digital Controller
simulation obtained the maximum frequency of Response for the conditions of error value changed
Rst Err Bts_up Bts_bwh State (heater/fan)
723.07MHz (1,38 ns period), next step is done 0 6 1 -1 S0 1/0
simulation function with make hardware testbench that 1 6 1 -1 S0 1/0
to give stimulus to digital on-off controller in form clk, 1 5 1 -1 S0 1/0
rst, err, bts_up and bts_down signal. 1 4 1 -1 S0 1/0
1 3 1 -1 S0 1/0
1 2 1 -1 S0 1/0
6
Seminar Teknik Komputer, Kendali dan Elektronika Juni 2014
1 1 1 -1 S0 1/0
1 0 1 -1 S0 1/0 Function simulation in figure 10 was done the
1 -1 1 -1 S1 0/1
1 -2 1 -1 S1 0/1
conditions of to rst signal = 0 given on controlling
1 -1 1 -1 S1 0/1 conditions was operating. At the beginning of the rst
1 0 1 -1 S1 0/1 conditions = 0 and err = 6 that give controller output
1 1 1 -1 S0 1/0 response ie heater = 1 and fan = 0 or controller
1 2 1 -1 S0 1/0 conditions lies on state 0 so occur operation of the
1 1 1 -1 S0 1/0
heating to plant, while still being in the state 0 then
1 0 1 -1 S0 1/0
occur rst signal = 0 then the controller toward the state
0 because of plant condition shows signal condition of
By using SIM model of Altera 6.6 obtained functional
bts_down ≤ e(k) ≤ bts_up then the state still remains in
testing results shown in figure 9.
state 0.
How in case of rst conditions = 0 with the controller
Function simulation in figure 9, for error signal
lies on state 1, the conditions based on Tabel 3 that the
conditions was changed resembles the actual plant
state will move from state 1 to state 0 during rst signal
response. Showed the initial condition stimulus signal
= 0, if rst signal = 1 and signal condition of bts_down ≤
namely : err = 0, bts_up = 1 dan bts_down = -1 then
e(k) ≤ bts_up still fulfilled then the controller will return
digital on-off controller gives the response to heater
to the state 1.
output = 1 or ON and fan = 0 or OFF, this conditions
already fulfil finite state machine like the design in
Table 4: Stimulus and on-off digital controller response
figure 6, where after occur reset then the controller
to the conditions performing a reset
toward the state 0. The next step rst signal given value Rst Err Bts_up Bts_bwh State (heater/fan)
equal 1 cause the controller starts working by 0 6 1 -1 S0 1/0
comparing the value of error signal e(k) with bts_up 1 6 1 -1 S0 1/0
and bts_down. From table 2 known that the state 0 5 1 -1 S0 1/0
change when err value = -1 from state 0 to state 1 with 1 4 1 -1 S0 1/0
1 3 1 -1 S0 1/0
the condition of the heater = 0 or OFF and condition
1 2 1 -1 S0 1/0
of fan = 1 or ON in accordance with the design in 1 1 1 -1 S0 1/0
figure 6, ie be at state 1 where err < bts_down 1 0 1 -1 S0 1/0
changing state also occur when err > bts_up ie from 1 -1 1 -1 S1 0/1
state 1 to state 0. The state will not change when signal 0 -2 1 -1 S0 1/0
value of bts_down ≤ e(k) ≤ bts_up accordance with the 1 -1 1 -1 S1 0/1
1 0 1 -1 S1 0/1
conditions of previous state. 1 1 1 -1 S0 1/0
1 2 1 -1 S0 1/0
Functional simulation further is done to know whether 1 1 1 -1 S0 1/0
the function of rst signal can restore the controller of 1 0 1 -1 S0 1/0
digital on-off so can operate as planned in figure 6 ie
each occur rst = 0 then the state back to the state 0.
Testing is done by providing rst signal = 0. By The results of simulation function testing and timing
providing stimulus signal as in Table 4, ie gives rst simulation obtained that the controller working as
signal = 0 when the controller was operating. design of finite state machine in figure 6.
Figure 9: Results of Functional Testing to on-off digital controller conditions that it changed value of errors
7
Seminar Teknik Komputer, Kendali dan Elektronika Juni 2014
Figure 10: Results of Testing from digital on-off controller by the changing value of reset
7. CONCLUSION [5] Kuo, Benjamin C, Teknik kontrol automatic jilid I
Universal digital controller can be implemented using (Jakarta: Prenhallindo, 1998).
hardware such as FPGA Altera Cyclone IVE with type [6] Suryadi, “Perancangan dan implementasi modul
of EP4CE22F17C6N that contained in DE0-Nano kontrol temperature berbasis mikrokontroler
module that it is made by Terrasic.corp with ADC PIC16F877”, Skripsi Sarjana Fisika, ITB, 2005.
addition device while to user interface using push [7] Suryadi, Suryadi, dan Khairurijal, “ Implementasi
button and switch as input and LCD 16x2 as display. modul kontrol temperatur menggunakan digital PI
From the results of the study have been built interface controller”, Prosiding seminar Nasional Teknologi dan
user system that is used by us to do parameters Rekayasa Industri SNTRI 07 (Serpong, 11-12 April
configuration and type of desired controller, interface 2007), pp.TI-17-1-TI-17-4,2007.
user system is capable of producing 4 constants of [8] Astrom. K, Hagglund. T, PID controllers: theory
controller and 4 types of controllers. The results of design and tuning (Research Triangle Park, NC:
testing for functional and timing simulation obtained of Instrument Society, 1995).
digital on-off controller, ie the results of functional [9] Terrasic, DE0-Nano user manual (Taiwan, Terrasic
simulation had been worked as expected in the design Technologies.inc, 2003).
while the results of timing obtained maximum [10] Ogata, Katsuhiko, Discrete time control signal
frequency of 723,07 MHz that can be used by on-off second edition (Englewood Cliffs, NJ: Prentice Hall,
digital controller so it has a minimum operating period 1995).
of 1,38ns. [11] Khan, Hammad, PID Controller: Comparative
10. REFERENCES Analysis and Design of Diverse Realizations
[1] Ogata, Katsuhiko, Teknik kontrol automatic jilid I (Saarbrucken, Germany: LAP LAMBERT Academic,
edisi kedua(Jakarta: Erlangga, 1996). 2012).
[2] Basri, Muh, Pengendali Digital Universal, Teknik [12] Brown. Stephen, Vranesic. Zvonko, Fundamentals
Elektro Universitas Hasanuddin, Makassar, 2011. of Digital Logic with Verilog Design (Avenue of
[3] Triyanto, Dedy. Perancangan Pengendali PID Americas, NY: McGraw-Hills, 2003).
Digital dan Implementasinya Menggunakan FPGA, [13] Chu. Pong P, FPGA Prototyping by Verilog
Sekolah Teknik Elektro dan Informatika ITB, Bandung, Examples (Hoboken, NJ: John Wiley and Sons, 2008).
2008.
[4] Abdelati, Mohamed, FPGA-Based PID Controller
Implementation, The Islamic University of Gaza, Gaza.