noob

Simple PID explanation

12 posts in this topic

I am using Cx-programmer version 9.4 and i was wondering if anyone could clarify how to use the PIDAT (191). Been searching online but im not really sure how to work it. im not sure how to implement all the parameters needed to use this function so if anyone can help me out that would be awesome. :helpme:

Share this post


Link to post
Share on other sites

First try reading manual!! Then come back with your questions! Note that PIDAT is the same as PID with the added Auto Tuning capability.

OMRON PID PIDAT.pdf

Share this post


Link to post
Share on other sites
Bits N Bytes is correct.... RTFM first.... and i think there is a PIDAT FB in the download section. as for the selection of the P I and D parameters and the T constant.. well i suggest getting an understanding of PID first... the one thing that Omron is a little different is that P is Proportional Band - in other PLCs P is Gain... the Proportional Band is the Inverse of Proportional Gain ie PB = 100/PG and PG=100/PB google PID and there is a wealth of info... if you are stuck at trying to determine a base P I D value then look at a Omron temp controller and look at the default settings for P I and D....

Share this post


Link to post
Share on other sites

i cannot find the "PIDAT" function block example in the download section.

Please share link.

thanks.

Share this post


Link to post
Share on other sites

Chou, there was issues with a recent site update.  I have added it back to the post for you.

Share this post


Link to post
Share on other sites

Dear Michael,

May i know why the PID is not function when i set the SETPOINT value to negative ? (let say -55)

thanks.

Chou

Share this post


Link to post
Share on other sites

Sorry arsenen8, I just saw this post.  Somehow I missed it.  The function block is designed to work with a positive feedback value (an analog input for instance) and is therefore looking for positive numbers.  If you treat -55 as an unsigned integer, it is 65481.  This number is likely larger than the number of bits that you have selected for your feedback, so it stops working.  As a fix to your issue, you could always apply an offset to your input and to your setpoint to compensate.  For instance, if your values range from -500 to 500, then you could add 500 to your feedback and then set your setpoint from 0 to 1000.

 

 

Share this post


Link to post
Share on other sites

@Michael Walsh can you elaborate further on you above post to eliminate any confusion ? Whether we have to use NEG instruction with PIDAT input word (PV) for getting negative values ? How we will add offset for pre-defined values.

Suppose if we required -20 for the set point, then we value we have to store in the DM for Set point ?

How the value would increase to negative (below 65535)  if the ERROR becomes 0 ?

Thanks

Edited by Abdul Wajid

Share this post


Link to post
Share on other sites

What I was referring to was the fact that if your analog input value coming in for the feedback dips below zero (when monitored as a signed integer), that would like a large number when monitored as an unsigned integer.  The input range is set in number of input data bits.  So, if your input data bits are set to 12 for example, then your input range is from 0  to (2^12-1) or from 0 to 4095.  Therefore your setpoint cannot be negative.  It also has to be between 0-4095.  If 0-4095 means -3 to +3  (units, whatever your units are).  You would need to scale your setpoint to 0-4095 to match your feedback.  I am not sure if this explanation is helping or not.

Maybe an example would help.  Lets assume the analog input is -4 to 4 units and it ranges from 0-8000.  You would scale your setpoint to work between 0 - 8000.  

Lets say your setpoint needs to be -2.5.  You are using an signed integer on your HMI such that -2.5 on the screen = -25 in D500.

You would need to run your setpoint through this equation in ladder:

scaled_sp = 100*sp +4000.  So, with sp = -25, scaled_sp = 1500

Then use scaled_sp as the setpoint in your PIDAT instruction.  1500 would be used as the setpoint for the PIDAT instruction.

The ladder would look like this:

scaledsp.jpg.0a881b5a273a162d0074b2d9379

 

You should also clamp your feedback just in case it dips below 0.  If the analog input comes into channel 2000 for instance, do this:

 

 

AnalogLimit.jpg

It is important that both of these be before the PIDAT instruction in the ladder order.

1 person likes this

Share this post


Link to post
Share on other sites

@Michael Walsh Thanks for the further clarification...

Based on your example, If the room temp (PV) is 0 deg then the temp sensor will start from 5V & PLC analog count would start from 4000 (5V/10mA for 0 to 10V/20mA range) and the count will decrease  for the -ve temp till PLC analog counts 0 (for 0 to 10V or mA range). Is it right?

-4 = 0V/0 or 4mA = 0 

0 = 5V/10mA= 4000

4 = 10V/20mA = 8000

PID instruction will only accept positive values as SP whether the temp is -ve or +ve and calculates the error based on PV.

Kindly calrify me if i misunderstood anything  wrong.

Thanks

Share this post


Link to post
Share on other sites

I think you understand correctly.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now