MELDAW Posted May 2, 2023 Report Share Posted May 2, 2023 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 More sharing options...
ORSO2001 Posted May 2, 2023 Report Share Posted May 2, 2023 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? Link to comment Share on other sites More sharing options...
MELDAW Posted May 2, 2023 Author Report Share Posted May 2, 2023 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 More sharing options...
ORSO2001 Posted May 2, 2023 Report Share Posted May 2, 2023 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 More sharing options...
MELDAW Posted May 3, 2023 Author Report Share Posted May 3, 2023 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. Link to comment Share on other sites More sharing options...
pascal Posted May 9, 2023 Report Share Posted May 9, 2023 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 More sharing options...
MELDAW Posted May 9, 2023 Author Report Share Posted May 9, 2023 So you created 40 PID with diffrent parametres? Link to comment Share on other sites More sharing options...
ORSO2001 Posted May 9, 2023 Report Share Posted May 9, 2023 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 More sharing options...
pascal Posted May 10, 2023 Report Share Posted May 10, 2023 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 More sharing options...
MELDAW Posted May 11, 2023 Author Report Share Posted May 11, 2023 (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, 2023 by MELDAW Letter missing Link to comment Share on other sites More sharing options...
curtharrington1 Posted May 31, 2023 Report Share Posted May 31, 2023 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: Link to comment Share on other sites More sharing options...
curtharrington1 Posted May 31, 2023 Report Share Posted May 31, 2023 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 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now