6
 International Journal of Advan ced Engineering Science and Information Techno logy (IJAESIT) Vol.1, Issue 1, January 2014  12 Design and Simulation of DA based PID Controller using Verilog Coding J. Jerald Linus Kumar 1 , Dr. V. Je yalakshmi 2  P.G. Scholar 1 , Assistant Professor 2 [email protected] M.E. Final Year (Applied Electronics) V.L.B. Janakiammal College of Engineering and Technology, Coimbatore. Abstract: A Proportional Integral Derivative (PID) controller is a generic control loop feed back mechanism widely used in control systems. A PID controller attempts to correct the error between a measured process variable and the desired set point by calculating and then putting a corrective action that can adjust the process accordingly to reach the set point. FPGA (field  programmable gate array) can be very effectively used for control purposes in  process demanding very high loop cycle time. The implementation of a digital (PID) controller in a FPGA can  be parallel, resulting in very high speed of operation. This fact enables FPGA’s to score over general purpose computing chips like DSP chips, which have a limited number of multipliers accumulator (MAC) units that can be used for the controller design. This makes use of the look up table (LUT) rich characteristics of the FPGA. This work looks at the serial and  parallel implementation of PID controller on a FPGA. A more efficient implementation of a PID using Distributed Arithmetic (DA) was looked in the implementation. 1. INTRODUCTION The proportional integral derivative controller is one of the most common type of feedback controllers that are used in dynamic systems. This controller has been widely used in many different areas, such as aerospace, process control, manufacturing, robotics, automation and transportation systems. Implementation of PID controller has gone through several stages of evolution, from early mechanical and  pneumatic designs of microprocessor  based system. In a control system, one of the main components is the controller (control element). It is the component required to generate the appropriate control signal applied to the physical system. It measures the error or difference between the output and the desired output. The output signal of controller regulates the system  performance. 2. PID CONTROLLER A Proportional-Integral-Derivative (PID) controller is a common feedback loop component in industrial control systems. The controller takes a measured value from a process or other apparatus and compares it with a reference set point value. The difference is then used to adjust some input to the process in order to bring the process measured value back to its desired set point. Unlike simpler controllers, the PID can adjust process outputs based on the history and rate of change of the error signal, which gives more accurate and stable control. PID controllers do not require advanced mathematics to

Design and Simulation of DA Based PID Controller Using Verilog Coding

Embed Size (px)

Citation preview

Page 1: Design and Simulation of DA Based PID Controller Using Verilog Coding

8/11/2019 Design and Simulation of DA Based PID Controller Using Verilog Coding

http://slidepdf.com/reader/full/design-and-simulation-of-da-based-pid-controller-using-verilog-coding 1/6

 International Journal of Advanced Engineering Science and Information Technology

(IJAESIT)

Vol.1, Issue 1, January 2014 

12

Design and Simulation of DA based PID Controller using Verilog

CodingJ. Jerald Linus Kumar 1, Dr. V. Jeyalakshmi2 

P.G. Scholar 1, Assistant Professor 2

[email protected]

M.E. Final Year (Applied Electronics)

V.L.B. Janakiammal College of Engineering and Technology, Coimbatore.

Abstract:A Proportional Integral Derivative

(PID) controller is a generic control

loop feed back mechanism widely usedin control systems. A PID controller

attempts to correct the error between a

measured process variable and the

desired set point by calculating and

then putting a corrective action that can

adjust the process accordingly to reach

the set point. FPGA (field

 programmable gate array) can be very

effectively used for control purposes in

 process demanding very high loop

cycle time. The implementation of adigital (PID) controller in a FPGA can

 be parallel, resulting in very high speed

of operation. This fact enables FPGA’s

to score over general purpose

computing chips like DSP chips, which

have a  limited number of multipliers

accumulator (MAC) units that can be

used for the controller design. This

makes use of the look up table (LUT)

rich characteristics of the FPGA. This

work looks at the serial and  parallelimplementation of PID controller on a

FPGA. A more efficient

implementation of a PID using

Distributed Arithmetic (DA) was

looked in the implementation.

1.  INTRODUCTIONThe proportional integral

derivative controller is one of the most

common type of feedback controllers

that are used in dynamic systems. Thiscontroller has been widely used in

many different areas, such as

aerospace, process control,

manufacturing, robotics, automation

and transportation systems.Implementation of PID controller has

gone through several stages of

evolution, from early mechanical and

 pneumatic designs of microprocessor

 based system.

In a control system, one of the

main components is the controller

(control element). It is the component

required to generate the appropriate

control signal applied to the physical

system. It measures the error ordifference between the output and the

desired output. The output signal of

controller regulates the system

 performance.

2. PID CONTROLLERA Proportional-Integral-Derivative

(PID) controller is a common feedback

loop component in industrial control

systems. The controller takes a

measured value from a process or otherapparatus and compares it with a

reference set point value.

The difference is then used to

adjust some input to the process in

order to bring the process measured

value back to its desired set point.

Unlike simpler controllers, the PID can

adjust process outputs based on the

history and rate of change of the error

signal, which gives more accurate and

stable control. PID controllers do notrequire advanced mathematics to

Page 2: Design and Simulation of DA Based PID Controller Using Verilog Coding

8/11/2019 Design and Simulation of DA Based PID Controller Using Verilog Coding

http://slidepdf.com/reader/full/design-and-simulation-of-da-based-pid-controller-using-verilog-coding 2/6

 International Journal of Advanced Engineering Science and Information Technology

(IJAESIT)

Vol.1, Issue 1, January 2014 

13

design and can be easily adjusted (or

"tuned") to the desired application,

unlike more complicated controlalgorithms based on optimal control

theory.[Stephen et.al (1996)]

Figure 1: Traditional PID Controller

2.1 Control Loop BasicsIntuitively, the PID loop tries to

automate what an intelligent operator

with a gauge and a control knob woulddo. The operator would read a gauge

showing the output measurement of a

 process, and use the knob to adjust the

input of the process until the process's

output measurement stabilizes at the

desired value on the gauge.

In older control literature this

adjustment process is called a "reset"

action. The position of the needle on

the gauge is a "measurement", "process

value" or "process variable". Thedesired value on the gauge is called a

"set point" (also called "set value").

The difference between the gauge's

needle and the set point is the "error”.

[Wei zhao et.al (2005)]

A control loop consists of three parts1.

 

Measurement by a sensor

connected to the process (or the

"plant"),

2. 

Decision in a controller

element,

3.  Action through an output

device ("actuator") such as a

control valve.As the controller reads a sensor,

it subtracts this measurement from the

"set point" to determine the "error". It

then uses the error to calculate a

correction to the process input variable

(the "action") so that this correction

will remove the error from the

 processes output measurement. [Wei

zhao et.al(2005)]

In a PID loop, correction iscalculated from the error in three

ways

  Cancel out the current error

directly (Proportional),

  The amount of time the error

has continued uncorrected

(Integral),

  Anticipate the future error from

the rate of change of the error

over time (Derivative).

A PID controller can be used to

control any measurable variable which

can be affected by manipulating some

other process variable. It can be used to

control temperature, pressure, flow

rate, chemical composition, speed, or

other variables. Automobile cruise

control is an example of a process

outside of industry which utilizes crude

PID control.

Some control systems arrange PIDcontrollers in cascades or networks.

That is, a "master" control produces

signals used by "slave" controllers.

One common situation is motor

controls: one often wants the motor to

have a controlled speed, with the

"slave" controller (often built into a

variable frequency drive) directly

managing the speed based on a

 proportional input.

2.2 PID Functional Blocks 

Page 3: Design and Simulation of DA Based PID Controller Using Verilog Coding

8/11/2019 Design and Simulation of DA Based PID Controller Using Verilog Coding

http://slidepdf.com/reader/full/design-and-simulation-of-da-based-pid-controller-using-verilog-coding 3/6

 International Journal of Advanced Engineering Science and Information Technology

(IJAESIT)

Vol.1, Issue 1, January 2014 

14

The PID loop adds positive

corrections, removing error from the

 process's controllable variable (itsinput). Differing terms are used in the

 process control industry: The "process

variable" is also called the "process's

input" or "controller's output." The

 process's output is also called the

"measurement" or "controller's input."

This "up a bit, down a bit" movement

of the process's input variable is how

the PID loop automatically finds the

correct level of input for the process.

"Turning the control knob" reduces

error, adjusting the process's input to

keep the process's measured output at

the set point. The error is found by

subtracting the measured quantity from

the set point. "PID" is named after its

three correcting calculations, whose

sum constitutes the output of the PID

controller. [Joao lima et.al(2006)]

1. Proportional - To handle theimmediate error, the error is multiplied

 by a constant p (for "proportional"),

and added to the controlled quantity. P

is only valid in the band over which a

controller's output is proportional to

the error of the system.

For example,  for a heater, a

controller with a proportional band of

10 °c and a set point of 20 °c would

have an output of 100% at 10 °c, 50%

at 15 °c and 10% at 19 °c. Note thatwhen the error is zero, a proportional

controller's output is zero. [Jomo lima

et.al(2006)]

2. Integral -  To learn from the past,

the error is integrated (added up) over

a period of time, and then multiplied

 by a constant i (making an average),

and added to the controlled quantity. A

simple proportional system either

oscillates, moving back and forth

around the set point because there'snothing to remove the error when it

overshoots, or oscillates and/or

stabilizes at a too low or too high

value. By adding a proportion of theaverage error to the process input, the

average difference between the process

output and the set point is continually

reduced. Therefore, eventually, a well-

tuned PID loop's process output will

settle down at the set point. As an

example, a system that has a tendency

for a lower value (heater in a cold

environment), a simple proportional

system would oscillate and/or stabilize

at a too low value because when zero

error is reached p is also zero thereby

halting the system until it again is too

low.

3. Derivative -  To handle the future,

the first derivative (the slope of the

error) over time is calculated, and

multiplied by another constant d, and

also added to the controlled quantity.

The derivative term controls the

response to a change in the system.The larger the derivative term, the

more rapidly the controller responds to

changes in the process's output.

A PID controller is called a PI,

PD, or P controller in the absence of

respective control actions. It may be

noted that EWMA (exponential

weighted moving average) controller is

equivalent to pi controller.

The generic transfer function for a PIDcontroller of the interacting form is

given in Equation 1.

Where C is a constant which depends

on the bandwidth of the controlled

system.

Page 4: Design and Simulation of DA Based PID Controller Using Verilog Coding

8/11/2019 Design and Simulation of DA Based PID Controller Using Verilog Coding

http://slidepdf.com/reader/full/design-and-simulation-of-da-based-pid-controller-using-verilog-coding 4/6

 International Journal of Advanced Engineering Science and Information Technology

(IJAESIT)

Vol.1, Issue 1, January 2014 

15

Traditionally, the output of the

controller (i.e. The input to the

 process) is given by Equation 2.

where Pcontrib, Icontrib, and Dcontrib are the

feedback contributions from the PID

controller, defined in Equations 3 to 5.

1. K  p : Proportional gain -larger K  p 

typically means faster response since

the larger the error, the larger the

feedback to compensate.

2. K i : Integral gain –  larger K i impliessteady state errors are eliminated

quicker. The trade off is larger

overshoot: any negative error

integrated during transient response

must be integrated away by positive

error before we reach steady state.

3. K d : Derivative gain - larger K d 

decreases overshoot, but slows down

transient response. [Joao limaet.al(2006)]

3. LITERATURE SURVAY

3.1 PID CONTROL ALGORITHMThe PID control algorithm is one

of the most commonly used control

algorithms in industry. The controller

output is computed in continuous time

in Equation (6).

Where K P is the proportional gain, Ti is

the reset time and Td  is the derivative

time. The above Equation (6) isdiscretized and the following Equation

(7) is obtained.

Where K i  = K  pT/Ti  is the integral

coefficient and K d  = K  pTd/T is the

derivative coefficient. This form is

called the position form of the PID

algorithm. [Wai zhao et.al(2005)]

An alternative method for discrete

would be to compute u(n) based on

 past output u(n-1) and correction term

u(n). This approach is often called as

the velocity form of the PID algorithm.

The first step in this regard would be to

calculate u (n-1) based on Equation 8.

Then calculate correction term as

Equation 9 and 10

Where

The current control output is calculated

as

Page 5: Design and Simulation of DA Based PID Controller Using Verilog Coding

8/11/2019 Design and Simulation of DA Based PID Controller Using Verilog Coding

http://slidepdf.com/reader/full/design-and-simulation-of-da-based-pid-controller-using-verilog-coding 5/6

 International Journal of Advanced Engineering Science and Information Technology

(IJAESIT)

Vol.1, Issue 1, January 2014 

16

Figure 2: Distributed Scheme

From the above explanation the

DA based PID controller has more

compact, power efficiency, less

hardware utilization and provide high

speed capabilities as compared to other

methods. So, in this work DA is

 proposed to achieve. [Daijin

et.al(2007)]

Da Multiplier

By Pass Multiplier

Fig 3: Simulation Result

4. CONCLUSIONAn FPGA-based digital feedback

control system using a novel DA-based

PID controller was proposed. Based on

the LUT scheme, the proposed PID

controller reduces the cost of theFPGA design. In addition, due to the

flexibility of the LUT in the FPGA,

this FPGA-based PID controller can be

easily extended to incorporate other

algorithms, such as antiwindup

 protection or adaptive schemes. This

design approach would specifically be

suitable for the next generation of

FPGA chips, in which ADC and DAC

converter are built inside the chip. In

such a case, the proposed structure

would be more efficient in terms of

hardware resources and control

 performance compared with the

standard microcontroller IP cores.

The complete system was designed

using a modular approach and

integrated and downloaded into both

xilinx and altera FPGA chips. The

system was tested by simulations and

experiments, demonstrating goodclosed-loop stability and performance.

The controller modules are reusable

and reconfigurable, which can be

 ported into matlab/simulink as

simulink blocks for hardware/software

cosimulation and can be utilized in

other embedded control applications.

REFERENCES:

1. Y.F.Chan M. Moallem W.

Wang,December 14-17,(2004)

‘Efficient Implimentation of

PID Control Algorithm using

FPGA Technology’ 43rd  IEEE

Conference on Decision and

Control, Atlatis, Paradise

Island.

2. Daijin Kim,(2007). ‘An

implementation of fuzzy logic

controller on the reconfigurablefigurable FPGA system’. IEEE

Page 6: Design and Simulation of DA Based PID Controller Using Verilog Coding

8/11/2019 Design and Simulation of DA Based PID Controller Using Verilog Coding

http://slidepdf.com/reader/full/design-and-simulation-of-da-based-pid-controller-using-verilog-coding 6/6

 International Journal of Advanced Engineering Science and Information Technology

(IJAESIT)

Vol.1, Issue 1, January 2014 

17

Transaction on industrial

electronics, vol 47 No 3.

3. G.Frantz, Nov(2000). ‘Digitalsignal Processor trends’. IEEE-

MICRO,20,Page 52-59.

4. S.Ferreira, F. Haffner, L.F.

Pereira, and F. Moraes, sep

(2003).’Design and Prototyping

of direct torque control of

induction motors in FPGAs,’ in

 proc. IEEE Symp. Integr.

Circuits and Syst. Des., pp.

105-110.

5. Joao Lima, Ricardo Menotti,

Joao M.P. Cardoso, and

Eduardo Marques. Oct (2006).

‘A Methodology to Design

FPGA based PID Controllers’.

‘IEEE Trans., pp 120-132.

6. S. L. Jung, M. Y. Chang, J. Y.

Jyang, L.C. Yeh, and Y.Y.

Tzou,May (1999). ’Design and

implementation of an FPGA

 based control IC for AC-voltage regulation, ‘IEEE

Trans. Power Electron., vol. 14,

no.3, pp. 522-532.

7. National Instruments:

http://www.ni.com., ’FPGA

 based control: Millions of

transistors at your command’.