MELDAW Posted May 2 Report Share Posted May 2 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? Quote Link to comment Share on other sites More sharing options...
ORSO2001 Posted May 2 Report Share Posted May 2 hi MELDAW sorry but I am not sure to have properly understood what you mean...please can you explain in other way or with an example? Quote Link to comment Share on other sites More sharing options...
MELDAW Posted May 2 Author Report Share Posted May 2 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. Quote Link to comment Share on other sites More sharing options...
ORSO2001 Posted May 2 Report Share Posted May 2 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. Quote Link to comment Share on other sites More sharing options...
MELDAW Posted May 3 Author Report Share Posted May 3 Hi ORSO, Did you mean you created your own PID? Cause that's what i did i created my own PID, with my own parametres. Quote Link to comment Share on other sites More sharing options...
pascal Posted May 9 Report Share Posted May 9 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.... Quote Link to comment Share on other sites More sharing options...
MELDAW Posted May 9 Author Report Share Posted May 9 So you created 40 PID with diffrent parametres? Quote Link to comment Share on other sites More sharing options...
ORSO2001 Posted May 9 Report Share Posted May 9 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. Quote Link to comment Share on other sites More sharing options...
pascal Posted May 10 Report Share Posted May 10 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 Quote Link to comment Share on other sites More sharing options...
MELDAW Posted May 11 Author Report Share Posted May 11 (edited) For now i needed only two PID but i will need 5 more so i think that's gonna be hard somehow. Edited May 11 by MELDAW Letter missing Quote Link to comment Share on other sites More sharing options...
curtharrington1 Posted May 31 Report Share Posted May 31 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? 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: Quote Link to comment Share on other sites More sharing options...
curtharrington1 Posted May 31 Report Share Posted May 31 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: 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.