Professional Documents
Culture Documents
Implementation of A Pid Controller Embedded in A Fpga For Positioning A DC Motor
Implementation of A Pid Controller Embedded in A Fpga For Positioning A DC Motor
PID,
Control,
FPGA,
DE0-Nano,
1 INTRODUCTION
Nowadays FPGAs have increased their popularity
due the many ways to acquire it, reliability, and low
costs. As a consequence of that, we can see more
FPGAs applications in control systems.
2.2 GEARMOTOR
The
gearmotor
characteristics:
selected
have
2 MATERIALS
next
Torque 18Kg*cm
80RPM
Power supply 12Vdc
Quadrature encoder of 8384 pulses per round
3.3v.
the
3 BLOCK
DIAGRAM
CONTROLLER
OF
THE
2.4 H BRIDGE
In order to coupling the control circuit and power
circuit, a L293D H Bridge is the selected option, so in
that way the control circuit send digital signals to the chip
for select the rotation of the motor. [5]
4 PROGRAMMING
Once defined the strategy for the controller, we
proceed to program the algorithm in HDL Verilog, using
Quartus II. In this case we divided the entire Project in
different sub-modules that will allow us to interpret and
design in modular way, so that is going to be an
advantage at the moment of write and understand the
program lines.
8384
30
699
45
1048
90
2096
180
4192
270
6288
360
8384
360
8384
360
8384
360
8384
360
.
signed bit tells that the value its negative, do a twos
complement. The next figure shows a possible way to do
that: [8]
4.4 CONTROL
2
2
.
going to focus in the RS232 algorithm that is also
embedded in the FPGA. Another document will present
the steps of how to use and program a serial-USB
converter FT232.
5.1 TEST 1
Figure 13. Verilog algorithm for Anti-windup.
Parameters:
Input: Step
Kp=5
Ki=0
Kd=0
4.5 PWM
As we saw in figure 6, a PWM signal is going to be
associated to the controller, so the duty cycle of the
signal will change according to the value of m(k) that is
the result of the PID equation.
5.2 TEST 2
Parameters:
Input: Step
Kp=10
Ki=0
Kd=0
4.6 ROTATION
The rotation is given by the signal bit coming from
the error acquisition, depending of this value the PWM
signal will be assigned to one of the two controls pins of
the H Bridge. A hysteresis is added when the error is
close to cero in order to avoid oscillations.
5 IMPLEMENTATION
On this stage we will present a test of the algorithm
performance using labview and RS232 communication
for send the data to the pc. Due that the importance of
this document its to present the controller, we are not
5.3 TEST 3
5.5 TEST 5
Parameters:
Input: Step
Kp=5
Ki=3
Kd=0
Parameters:
Input: Step
Kp=10
Ki=17
Kd=0
6 ASSEMBLY IMAGES
5.4 TEST 4
Parameters:
Input: Step
Kp=10
Ki=3
Kd=0
Increasing the Kp value will make the response
faster, but also will increment the overshoot, as shown in
figure 20.
8 REFERENCES
[1] Allen Houng. Interfacing a DC Motor with an FPGA. Terasic
Technologies. Aug 10 , 2011
[2] Terasic Technologies. DE0-Nano Board. DE0-Nano
Development and Education Board [Online]. Available:
http://www.terasic.com.tw/cgibin/page/archive.pl?Language=English&CategoryNo=165&
No=593&PartNo=1
[3] Gearmotor,
[Online].
Available:
http://www.dynamoelectronics.com/components/com_virtue
mart/shop_image/product/Motoreductor_18K_4c73f49babdc
a.png
[4] LCD
monochromatic
display,
[Online].
Available
http://www.dynamoelectronics.com/components/com_virtue
mart/shop_image/product/04-0302%20LCD%2016x2%20verde.jpg
[5] SGS-Thomson Microelectronics. L293D Datasheet. [Online].
Available: www.datasheetcatalog.com
[6] FTDI. FT232RL. Datasheet. [Online]. Available:
http://www.ftdichip.com/Support/Documents/DataSheets/ICs
/DS_FT232R.pdf
[7] Jean P. Nicolle. Quadrature Decoder. Feb. 13 2008.
[Online]. Available:
http://www.fpga4fun.com/QuadratureDecoder.html
[8] Twos
Complement
Numbers
[Online].
Available:
http://www.vb-helper.com/tutorial_twos_complement.html
[9] Antonio Visioli. Practical PID control. Springer-Verlag
London Limited 2006
[10] BUSO, Simone y MATTAVELLI, PAOLO. Digital Control in
Power Electronics. Morgan & Claypool, 2006, pp. 13-31.
Links:
Video:
http://www.youtube.com/watch?v=tVvWEDh8Xc0
Project:
https://sites.google.com/site/semilleroadt/nivelavanzado-proyectos/control-motor-dc-pid
Figure 24. Serial-USB converter.
Autor:
Edgar Rodrigo Mancipe Toloza.
Electronic Engineer
Universidad Pontificia Bolivariana
Semillero ADT.
https://sites.google.com/site/semilleroadt/home
October 2011
7 CONCLUSION
In this project we saw that is viable the
implementation of a PID controller in a FPGA, and the
modular design allow us to think and resolve one
problem at once.
Trough the test made to the controller we manage
to saw the behavior of the controlled variable when we
change the values of the proportional an integral gains,
as we saw, the proportional gain will give more speed to
the controller but it also can increase the overshoot
percent, in other way the integral gain can give a more
accurate response getting closer to the set-point.
There were also a test changing the derivative gain,
however the response was always saturated because of
the noise derived, so still pending the implementation of
an additional filter to solve this problem.