ray Posted June 1, 2017 Report Share Posted June 1, 2017 I am trying to retain the values of a PID structure but I do not know how to do it. Any ideas? Thank you. Quote Link to comment Share on other sites More sharing options...
RyanMcCarthy Posted June 1, 2017 Report Share Posted June 1, 2017 Hello Ray, It seems that you can't have the struct retain on its own. Alternatively, you should be able to STORE the information you want retained into placeholders. You could use the startup bit "General.Ladder Initial Cycle" and move that info back into the PID Config struct values you want to retain. I hope this helps! Best, Ryan Quote Link to comment Share on other sites More sharing options...
Ofir Posted June 2, 2017 Report Share Posted June 2, 2017 Hi, For PID there are 2 structs: PID Config - This is non retained struct which will be used for running the PID. PID AT Parmas - This struct can be marked as retained. Once you completed your manual tune or autotune, you need to use the Ladder element "save PID Autotune data" from the PID Config struct to the PID AT Parmas struct.- This will save the PID data into the retained struct. On power up you will use the ladder element "Load PID autotune data" from the PID AT Parmas struct to the PID Config struct. 1 Quote Link to comment Share on other sites More sharing options...
ofer.yishai Posted June 21, 2017 Report Share Posted June 21, 2017 Hi Ofir and all My problem is the the PID AT Parmas struct is not retaining although it is marked as retain. I am trying to find a workaround for that, and in addition to be able to save/load PID parameters from SD card. I define a user struct with exactly the same members like the system struct . this i wanted to use for indexed data-table that i can write one row into and save it as a UDTF file on the SD. my problem with that solution is that Copy struct function is not working with the system struct . The only thing is to to is to use few Store functions each for one PID value. My questions: Why the system struct PID AT Parmas struct is not retained as its set to be? Any way to copy a system struck valued to a user struct as a whole? Thanks Ofer Quote Link to comment Share on other sites More sharing options...
Ofir Posted June 27, 2017 Report Share Posted June 27, 2017 Hi, PID Config struct is non retained. Running PID will use PID Config struct. Once completing Autotune or manual tune, you can use the Save PID Autotune data ladder element. This will save the PID config struct to a PID AT params struct. Then on power up you can use the Ladder element Load PID Autotune data from PID AT params struct to PID config struct. Please make sure that the PID AT Params struct is checked as retained. Quote Link to comment Share on other sites More sharing options...
Robin P Posted November 26, 2017 Report Share Posted November 26, 2017 Hello Ofir. I have a client system using a PID loop for temperature control. To investigate a separate problem (as in D Green's recent FTP post) I would like to download and run a new, different, temporary project; and subsequently restore the original. I believe however this will destroy the original retained PID AT settings, which I would like to restore, possibly from a file, to avoid having to run the (lengthy) PID Autotune again. Is it possible save the PID AT params to a file on the SD card, as it is with any user-defined structure using a data table? Thanks Robin 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.