Jump to content

understanding FPGA PID VI


Dan_Mc

Recommended Posts

Problem understanding FPGA PID VI


The integral and derivative actions of PID do not seem to track equations shown in documentation.


Derivative – PV set using triangle wave 0 – 10 – 0 at approx. 1 Hz the derivative of PV should alternate between +20 v/s and -20 v/s. The PID output maxes out at +/- 1 when Kd is set to 128. (Kp = Ki = 0.) Based on documentation the PID output should be +/- 20 when Kd = 1, and then 20*128 = 2560 when Kd = 128. Not sure why the effective gain is so small.


Integral – The error is set by setting SP = constant = 10, and varying PV using triangle signal noted above. The error is then a triangle that varies from +10 to 0, again over ½ second. The integral, therefore, should be varying from +2.50 to -2.50 over the complete cycle.


 Issue 1: The integral effect on PID output does not change sign when error integral goes negative. It appears that there is some absolute value function that only allows positive integral action regardless of error integration.  Likewise, if Ki is set to negative number the integral PID action only goes in negative direction. This implies that as the PV crosses over the SP level the integral action will keep adding to PID output that will then drive PV further past SP.


Issue 2: Unlike the derivative effective small gain, the effective integral gain is very large. With the Ki set to the smallest number available using FP 16.8, (approx. .0039). the PID output varies from 0 – 12.5 with the actual integral varying from -2.5 to +2.5. Not sure why the effective gain is so large.


Link to comment
  • 2 weeks later...

Hey, I know this is a crosspost as well, but I will be glad to get help either way asap. I have a deadline for tomorrow morning.

 

I am using the FPGA(PID) VI too. I ran into some issues lately.

I am streaming the Process Variable over the internet via a udp connection. My manipulated variable is supposed to be the current that is being varied from the C/AO0 of the RIO FPGA functionality.

Problem is when I run the program and I probe the global variables PV: Kinect Data and MV: Current (mA) in the top while loop, I can read the data. Not so in the PID Processing Loop.

Can anyone tell me what I am missing?

 

Link to comment

You mean read the MV variable inside the bottom loop? You seem to be suggesting I should ignore the shift register altogether. Either way, the PV would not update inside the loop as well. Could it be 'cause I'm streaming the PV from a UDP connection? If this is so, what would be the viable alternative to communicating between real time and the fpga mode?

Link to comment

Maybe you could clarify your question. You wrote that you can't read the values in the Processing Loop. I don't even see the PV: Kinect Data variable anywhere in the processing loop. As I mentioned, you only read the MV variable once. When you put a probe on these wires, is the problem that no data ever arrives at the probe, or that you see a value but it doesn't update, or something else? Also, this question has absolutely nothing to do with the original thread since it isn't at all specific to the FPGA PID function; you might want to start a new thread elsewhere.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.