Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Kp Ki Kd calculator for PID controller on FPGA

Status
Not open for further replies.

shadeslayer

Member level 2
Joined
Mar 21, 2008
Messages
49
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,627
pid calculator

hi,, i want to implement Kp Ki Kd calculator on FPGA ,,,, how can i proced
 

kp ki kd

writing the VHDL code necessary to run the FPGA.
A PID controller, provides proportional, integral, and derivative compensation to an existing system. as PID control is overall complex.so implement the PID algorithm VHDLand will be
implemented on an FPGA
 

ki kd

I know that. But i want to calculate values
 

pid z transform

you cannot calculate everything, you have to try the
basic parameters. Take a look to your motor to determine
the speed loop first. What is the rpm/volt operating
voltage and what is your amplifier gain? This will
give a rough result for your proportional value.

No try to operate your system with this value and see,
that the result will be an oscillating system. Therefore
go down with the Kp value to about 1/2 or 1/10 of the
first estimated value. After this add more and more Ki
until the system does not oscillate any more. The more
Ki you have, the higher the gain is allowed. If operation is almost ok, you can try
to add KD to increase acceleration but you will see,
that high KD make the system unstable again.
 
ki and kd

@shadeslayer

Hi, this is a more interesting subject, also I like to see how to do that. May be the first step will be choose what type of structure use for the PID, e.g. make the continuous model and apply Z transform to discretize it?

Nice field of applications, I like to look if this thread go away...

Bye
Pow
 

fpga pid

i have the transfer function with me and planing to calculate the parameters using modified zigler nicol method and then i will use them with another controller implemented on same chip so it will make my structure more dynamic

Added after 1 minutes:

i m thinking of using that z tranform tech also but littel bit confused in implimentin
 

kp ki

Also as a first chance I've think to use the Z transform, when you split the function as y = F(x) you can see several term builded with sum and multiplication.
At first we can try to implement the discretized transfer function with similar block, sum and multiplier and store the filter coefficient into dedicated register that can be changed from external, e.g. by using a dedicated microcontroller with a serial port and a host PC program to tune the filter coefficient.

Another issue that I've see is about the filter coefficient value, may be we need to operate a rescaling before store it into the registers.

What is your think about this stuff?

Also I'm thinking that this work should be very useful if we can work on it and writing some tutorial from scratch, I'm beginning with VHDL, but I'd like to spent some time about working on this design from zero.
As a first point I think we've to define what type of discretization way we've to use (by using a real like transfer function like you've), then we can look at the coefficient stuff (rescaling to fit the integer register, number of bit 8 or 16 or more) and make some simulation of the discretized filter with Matlab/Simulink.
After this first analysis stage we can make further investigation around the right implementation (hardware structure) and then choose the right FPGA and go on... is just a idea, I also hope that some master on this forum can join this idea and give us a little help on the subject....

Anyway could you report your trasfer function F(s) and a hypotetic sampling time and method to make the discretized version F(z)?

Bye
Pow
 

kd calculator

see i am planing to make PID controller based on FPGA for multiple application i .e flexible structure.

for example

satelite motion control.
dc motor control
temp. control for biomedical aplications
or unmaned aircraft control etc etc...

for that i am planing to give s domain tranferfunction as a input to the my fpga kit and then in one part the fpga will caluclte the kp ki kd constants and then this valus i will give as a input to another part of fpga where this values will b stored and will be used to give the control action based on input ....


now what u want to say tell me .
 

ki vs kd

Well,
from my point of view what is interesting is the logical flow from the transfer function (no matter how we can derive it, this is a application related stuff) to the FPGA implementation (then deriving the coefficient and make a appropriate structure able to be implemented into a FPGA or CPLD).

Then I can start in writing some notes from scrath by starting to some F(s), e.g. for a DC motor control. Then we can talk about the function synthesis into the Z domain and how to scale the coefficient and also how rescaling the output of the scaled filter in order to meet the physical plant requirement. I think this is the central point, other developement is strictly related to the your application then I think is outside the FPGA implementation stuff, what I'm thinking to descrive is how to implement the PID by starting from a transfer function into the s domain.

I think that make the direct calculation of the coefficient into the FPGA will be not a easy task, I see more appropriate use a microcontroller or a dedicated PC program (coded e.g. in VB or VC) and send the coefficient to the microcontroller. Coefficient can be saved into a external EEPROM or into the microcontroller if this one have EEPROM (like PIC) or FLASH that can be used as EEPROM (like LPC210x from NXP or other type if you prefer), when the system is powered the firmware on the FPGA will be loaded and after that the microcontroller can start in writing the coefficient into some dedicated register inside the FPGA, after this initialization stage the filter is ready to work. I think that building the autotuning function directly inside the FPGA is not simple, more feasible by using a external microcontroller, but is just a my think...

Let me know what is your think about, I think this will be a great and very interesting work!

Thanks

Bye
Pow
 

calculate pid controller

Implementation of a PID controller in FPGA is particularly useful with high controller sampling rates, e. g. above several kHz, although signal processors can also do the job. Possible applications are high dynamic drives or power electronics.

The correspondence between time discrete (z-transform) and time continuous PID controllers can be found in control theory text books. Basically, you have a second order difference equation and some simple fomulas to calculate the z-domain parameters from time continuous PID parameters and sampling rate.

As suggested, it's useful for most applications, to supply the controller parameters and perform tasks as autotuning or control process identification by an external processor, cause these operations are very unhandy for an FPGA.
 

pid ki

I totaly agree wid u.we can use vb to take parameters.
 

pid controller basic code

Well, at this point I think we can set some point into the developing:

1. Define the PID controller transfer function by using the Ziegler-Nichols or Miller method
2. Discretization of the PID by using the ZOH (Zero Order Hold) approximation

also there is another point regarding the PID controller that we've not mentioned here and is about the anti-windup protection, I think that we've to add also this feature to have a more complete PID controller.

During the collecting stage of some PID paper and document over the web I've found some nice paper about the subject, I've attached it for further reading, hope these can be useful.

There is also another link about similar project:
http://cegt201.bradley.edu/projects/proj2002/toetruck/index.html

And some application notes from FPGA vendors:
http://www.actel.com/documents/PID_AN.pdf

Bye
Pow
 

fpga pid controller

i have seen all this documents earlier and gone through it ,,

here i m thinking that first in vb part we will give the transfer function and it will give that file to microcontroller then microcontroller will calculate the coeff. and will be stored inside it ,, that will be given to the pid controller based on fpga ,

Added after 6 minutes:

i have allready seen all this files ... actuly on theory part we are worknig from past 2 months ,,,
 

pid controller sample rate

Nice to know, if you can share your work this might be very interesting but I think that the really nice part, from a educational point of view, will be show how to implement a real PID transfer function into a suitable FPGA/CPLD. I can spent some time in writing a little tut if you can send to me some infos about the PID analogue function and the discretized one and then we can add more useful info following the work developing.

Bye
Pow
 

kp kd ki

wait for 2-3 days ,, i will finalize the basic things and will start coading then we can go on ,,, u till tht do a basic tut of pid including varius methods of pid tunnig and basic idea abt this project asi told u b4
 

kp ki kd calculation in pid

Nice, I'll wait for some other news.

Bye
Pow
 

i am trying to implement pi controller in fpga using VHDL coding. as i am a starter in this field i am finding it difficult to use the kp and ki values as they are( which are real ) so help me to find a way to resolve this.
 

Hi every one,


I am a new member of our forum. I have a FPGA - Nexys2 card and I'm looking to set up and control this card and connect to a computer by usb interface (and usb chip interface on this card is CY7C68013A). I am trying to design a measurement and control systems by this card and connect to computer with USB interface. I can use LabVIEW program, and I'm looking from your help?

Thanks so much!
 
  • Like
Reactions: jolly

    jolly

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top