Implementation of PID Controller PWM Module On FPGA
Implementation of PID Controller PWM Module On FPGA
Implementation of PID Controller PWM Module On FPGA
Volume 7 Issue 5, September-October 2023 Available Online: www.ijtsrd.com e-ISSN: 2456 – 6470
I. INTRODUCTION
There are two main approaches to implementing be applied to first-order and second-order systems
digital control systems: software-based and hardware- with time delay and outperforms classic PID
based. optimized by PSO. Proper computation of thresholds
Software-based systems involve the interaction with low latency is crucial for the canny edge
between memory and processor, with tools such as detection algorithm's performance. A robust threshold
computation method with higher accuracy has been
PLCs, microcontrollers, microprocessors, DSPs, and
computers. Hardware-based systems use VLSI introduced, but it requires more resources and
devices, which are highly configurable ICs used to increases latency.
implement logic functions. They offer advantages II. DESIGN PID CONTROL PWM
such as ease of design, lower development costs, high MODULE
speed capabilities, and power efficiency. VLSI The objective of this study is to utilize FPGA
devices can be programmed using software provided technology to develop a PWM module for PID
by manufacturers, with Hardware Description control. FPGA-based implementation offers benefits
Languages like VHDL and Verilog used to such as parallel processing, low power consumption,
implement complex algorithmic logic. and complex functionality at high speeds. The design
To address the challenge of identifying and changing of the PID control PWM module was carried out
parameters for PID controllers, an intelligent PID using Quartus II programmable logic design software
control method is proposed. This approach uses PSO and tested on the DE0 Nano Board from Altera's
to optimize controller parameters based on system Cyclone IV FPGA family. Signal Tap II analyzer and
error, addressing issues like lag, time-variety, and RTL viewer were utilized for debugging and analysis,
nonlinearity. An evaluation function is defined that while Time Quest analyzer was used for proper
considers system adjusting time, rise time, overshoot, timing constraint and clock arrangement. The
and system error. The intelligent PID controller can simulation and hardware testing results demonstrate
@ IJTSRD | Unique Paper ID – IJTSRD59966 | Volume – 7 | Issue – 5 | Sep-Oct 2023 Page 499
International Journal of Trend in Scientific Research and Development @ www.ijtsrd.com eISSN: 2456-6470
that utilizing FPGA has several advantages, including
high speed, flexibility in design, and high reliability.
III. PID CONTROLLER IN A FPGA
The aim of this study is to develop a microclimate
monitoring system for precision agriculture using
Zigbee technology. This system consists of sensor
nodes that measure air temperature and humidity in a
large area. The nodes are connected in a cluster tree
topology, allowing for a long-distance Figure I. Block Diagram Using Data Input And
communication range of up to 1 mile. Each node Output Pwm Module
contains a microcontroller unit, air temperature and
humidity sensors, and a solar cell for energy supply. V. PROPOSED SYSTEM
An energy management scheme is implemented to To read eight digitized values from the LTC2308
optimize power use, and data is sent to a receiver ADC chip, the LTC2308 IP is used through a high-
every 8-30 minutes. The data is stored on a data- speed SPI bus. These values include one for the input
logging PC and displayed on a website for real-time power voltage and seven sensor values from the
monitoring. The use of Zigbee technology provides sensor board containing seven Photo Interrupters used
low cost, low power consumption, and flexible to track dark lines on a white background. Control
architecture for wireless networking of field sensors loops are used almost everywhere now a day.
in precision agriculture. Anytime we adjust our current works according to the
results obtained in previous results we form a control
IV. EXISTING SYSTEM loop. For example, when we feel cold and turn our
The purpose of this demonstration is to showcase the heater on we form a feedback loop, and when we
implementation of a PID controller in the Main.cpp press the accelerator of a car whenever we are getting
using C++ code on the Altera NIOS II Processor. The late we again for a control loop. Whenever we change
code utilizes the proportional and derivative modes of make any change in environment by sensing the
the PID controller to generate a new output value previous results of that process we form a closed
based on the error input. The output value is then control loop in our mind. Changing the speed of the
used to control the LeftSpeed and Right-Speed of the car is one of the best examples.
two motors on the A-Cute Car. The kp and kd values
are set to 1.0 and 8.0 respectively, with ki set to 0.0. The PWM IP controls the rotation speed and direction
of the DC motor, with each motor controlled by a
The LTC2308 IP is used to read eight digitized values PWM controller.
from the LTC2308 ADC chip through a high-speed
SPI bus. These values include one for the input power
voltage and seven sensor values from the sensor
board containing seven Photo Interrupters used to
track dark lines on a white background. The PWM IP
controls the rotation speed and direction of the DC
motor, with each motor controlled by a PWM
controller. The 1K waveform IP generates a 1M
frequency to drive the buzzer, and the associated
GPIO controls the beep sounds on or off switch. The
left and right lamps are directly controlled by the Figure II. Digital PWM Module
GPIO IP, while the IR receiver decodes received IR
signals transmitted from the Terasic remote
controller.
Overall, the PID controller is a widely used control
loop feedback mechanism in industrial control
systems that combines proportional, integral, and
derivative modes to correct errors between measured
process variables and desired set points.
@ IJTSRD | Unique Paper ID – IJTSRD59966 | Volume – 7 | Issue – 5 | Sep-Oct 2023 Page 500
International Journal of Trend in Scientific Research and Development @ www.ijtsrd.com eISSN: 2456-6470
PID Control System Design and Automatic Tuning VII. SOFTWARE IMPLEMENTATION
using MATLAB/Simulink introduces PID control MATLAB is used in every facet of computational
system structures, sensitivity analysis, PID control mathematics. Following are some commonly used
design, implementation with constraints, disturbance mathematical calculations where it is used most
observer-based PID control, gain scheduled PID commonly Dealing with Matrices and Arrays
control systems, cascade PID control systems, PID 2-D and 3-D Plotting and graphics Linear Algebra
control design for complex systems, automatic tuning Algebraic Equations
and applications of PID control to unmanned aerial Non-linear Functions
vehicles. It also presents resonant control systems
relevant to many engineering applications. The Statistics
implementation of PID control and resonant control Data Analysis
highlights how to deal with operational constraints. Calculus and Differential Equations
PID Control System Design and Automatic Tuning Numerical Calculations
using MATLAB/Simulink is intended for Integration
undergraduate electrical, chemical, mechanical, and Transforms
aerospace engineering students, and will greatly
Curve Fitting
benefit postgraduate students, researchers, and
industrial personnel who work with control systems Various other special functions
and their applications. MATLAB is a high-level language and interactive
environment for numerical computation,
visualization, and programming. Using MATLAB,
you can analyze data, develop algorithms, and create
models and applications. The language, tools, and
built-in math functions enable you to explore multiple
approaches and reach a solution faster than with
spreadsheets or traditional programming languages,
such as C/C++ or Java. You can use MATLAB for a
range of applications, including signal processing and
communications, image and video processing, control
systems, test and measurement, computational
finance, and computational biology.
Figure IV. PID Control of unmanned aerial
vehicles (UAVs)
VI. PWM MODULE
The purpose of this demonstration is to showcase the
use of PWM as a technique for delivering power to a
circuit in a precise and controlled manner. PWM
involves modulating the duty cycle of a signal source
to provide logic "1" and "0" for a controlled period of
time. The block diagram of the PWM generator is
shown above, with an N-bit data word as input
corresponding to the actual PWM duty cycle.
The register stores the input (set value) and outputs it Figure V. Matlab Window
when the load input is high. This output is then VIII. THE MATLAB ENVIRONMENT
compared with the N-bit counter value using a The MATLAB environment (on most computer
comparator. When these two values become equal, systems) consists of menus, buttons and a writing
the comparator output is used to reset the R/S latch area similar to an ordinary word processor. There are
output. When the counter overflows, the load signal plenty of help functions that you are encouraged to
goes high and the latch output is set to high. use. The writing area that you will see when you start
PWM is a widely used technique in various MATLAB is called the command window. In this
applications, including motor control, lighting window you give the commands to MATLAB. For
control, and power electronics. Its ability to provide example, when you want to run a program you have
precise and controlled power delivery makes it an written for MATLAB you start the program in the
essential tool for many industries. command window by typing its name at the prompt.
@ IJTSRD | Unique Paper ID – IJTSRD59966 | Volume – 7 | Issue – 5 | Sep-Oct 2023 Page 501
International Journal of Trend in Scientific Research and Development @ www.ijtsrd.com eISSN: 2456-6470
The command window is also useful if you just want manipulations, etc.). Unfortunately, MATLAB JIT
to use MATLAB as a scientific calculator or as a does not support MATLAB structures, therefore just a
graphing tool. If you write longer programs, you will simple bundling of various variables into a structure
find it more convenient to write the program code in a will come at a cost.
separate window, and then run it in the command
window (discussed in Intro to programming).
@ IJTSRD | Unique Paper ID – IJTSRD59966 | Volume – 7 | Issue – 5 | Sep-Oct 2023 Page 502
International Journal of Trend in Scientific Research and Development @ www.ijtsrd.com eISSN: 2456-6470
% s^3 + 24.95 s^2 + 99.53 s + 999 XI. CONCLUSION
The proposed system utilizes a FPGA-based design
Num2 = 1000; %Numerator Coeffcients
approach to create a temperature control system. This
Den3 = [1 22.5]; %Denominator factor 1 Coefficients approach streamlines the design process for
Den4 = [1 2.45 44.4]; %Denominator factor 2 embedded control designers, reducing development
Coefficients time for efficient embedded software. The system
allows for software modeling and simulation in an
Tofs2 = tf(Num2,conv(Den3,Den4)); environment such as Matlab/Simulink, hardware
%Creation of System implementation, and post synthesis simulation of the
entire system. Future work includes implementing a
figure(2) multiplierless digital PID controller using distributed
margin(Tofs2) %Plots the Bode Plot and also gives arithmetic architecture, offering high processing
the "Phase Crossover Frequency" speed, reduced power consumption, and hardware
compatibility for FPGA implementation.
XII. REFERENCE
[1] Wei Zhao, ByungHwa Kim, Amy C. Larson,
and Richard M. Voyles, “FPGA
Implementation of Closed loop control System
for Small Scale Robot”, In Proceedings., 12th
International conference on advanced robotics-
ICAR05, 2005, pp.70-77.
[2] Daijin Kim. “An implementation of Fuzzy
Logic Controller on the Reconfigurable FPGA
system”, IEEE transactions on Industrial
Figure VII. PID Controller Response Electronics, Vol.47, No.3, 2000.
[3] Y. F. Chang, M. Moallm and W. Way,
“Efficient PID Controller Using FPGA”, IEEE
transactions on Industrial Electronics, Vol.35,
pp. 119-125.
[4] L. Samet, N. Masmoudi, M. W. Kharrat and L.
Kamoun, “A Digital PID Controller for Real
time and Multi Loop Control: a comparative
study”, in proceedings of 1998 IEEE
international Conference on Electronics
Figure VIII. PID Controller Response Circuits and Systems, Vol.1, 1998, pp. 291-
296.
[5] Paul Leisher, Christopher Meyers. Dr. T.
Stewart and Dr. G. Dempsey, “FPGA
Implementation of a PID controller with DC
Motor Application”, Bradley University, a
project report, 2002.
[6] Stephen Brown, “Digital logic design”, Tata
Mechgraw Hill publications, India, 2002.
[7] Rajesh Nema, Rajeev Thakur, and Ruchi
Gupta, ― Design & Implementation of FPGA
Figure IX. Blode Diagram Based on PID Controller ‖, International Journal
of Inventive Engineering and Sciences (IJIES),
Volume-1, Issue-2, pp 14-16, January 2013.
@ IJTSRD | Unique Paper ID – IJTSRD59966 | Volume – 7 | Issue – 5 | Sep-Oct 2023 Page 503