Jump to content

Recommended Posts

Hello everyone, I was trying to create PID bloc, but when i use it 2 times, it doesn't work with both values, it take only one value like i can use it one timeb but not 2times in paralleles. 

Anyone has an idea of how I  can make it work?

Link to comment
Share on other sites

Hi ORSO,
Sorry if i wasn't clear enough, I was trying to create my own PID, with inputs and outputs,  and i am trying to do a double regulation, so when i do this he is doing the calcualtion one time, so you can say that one of the values is crushed by the other.

Link to comment
Share on other sites

hi MELDAW,

each process has to have its own PID blocs (PID config and PID AT params) and each one has to run "individually"...or better you can create a generic FB that manage as FunctionIn the PID blocs.

what I usually did is create a DTI that contain exactly the PID parameters struct, and other informations, to store and upload when the autotune is performed or the PLC is reboot.

 

Link to comment
Share on other sites

Meldaw,

I had the same "issue"

I control 40 heaters with a pid, so I made 1 subroutine that i called 40 times with different parameters.....

DIDN'T work !!!!!

For each process, you have to use a different PID ! PID is running in background of PLC -> so you can't use 1 PID with different IO's....

Link to comment
Share on other sites

Hi MELDAW,

as i wrote in my previously post each "item" that you have to manage by the PID has to have its own PID blocs (PID config and PID AT params) ...this because these blocs have internaly an array of value that changes dduring th ePID calculation...than...that are corelated at the SP and PV ...so continuously modify the SP and the PV will not give you good result.

Link to comment
Share on other sites

22 hours ago, MELDAW said:

So you created 40 PID with diffrent parametres? 

yes I have (altough every PID uses the same pid auto_parameters)

for each PID i have to connect the proces value, set point,.... and run the PID

and this 40 times.....

I tried to make a subroutine with al these parameters as input variables and in the subroutine call PID -> not working

Link to comment
Share on other sites

  • 3 weeks later...
On 5/11/2023 at 2:33 AM, MELDAW said:

For now i needed only two PID but i will need 5 more so i think that's gonna be hard somehow.

Did you create unique PID structs in Global?

image.png.96607cae15462e325e6f3e0f1d80994e.png

In this image, I created 2 separate PID config structs with one common Autotune Parameters struct which (if you wanted to) you could use to for both PID:
image.thumb.png.63633b8ec6bb48ab42e15668b0416686.png 

Link to comment
Share on other sites

On 5/9/2023 at 4:40 AM, pascal said:

Meldaw,

I had the same "issue"

I control 40 heaters with a pid, so I made 1 subroutine that i called 40 times with different parameters.....

DIDN'T work !!!!!

For each process, you have to use a different PID ! PID is running in background of PLC -> so you can't use 1 PID with different IO's....

You could do it like this to make it more instantiable:
image.thumb.png.1632196d9a27d795cf0ec1ee82d24ca0.png

 

You pass in the reference to your PID instance, the setpoint, and the process variable and then operate the PID block.  The function block treats a struct input as a pointer reference so you should see your multiple PIDs working with very little code writing

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

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...