Quake

Members
  • Content Count

    5
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Quake

  • Rank
    Newbie
  1. Hello, I see your point. The multi-stepping can be implemented for greater control of the process and increased level of safety. For my application, I am using a PID temperature controller with Modbus communications and a built-in Alarm functionality. That controller does not have the profiling feature (or some companies call it "programmer" option, "segments", ramping to soak etc... many names of the same animal, where steps for the profiling cycle are user defined i.e step 1 - go to this setpoint at this rate, step 2 - soak there for this time. step 3 - go to another point...) In case there is any thermal runaway condition, I have means of protection via the Temperature Controller's built-in Alarm, and a redundant separate Limit Controller with a designated (separate) temperature sensor. The waituntil() while executing will lock the whole sequence until it's done, but for what I am doing it's fine, because the Temperature Controller's control loop handles the PID and controlling the process to setpoint, plus the last 10 readings must have been within the band for timing to start so it is unlikely anything funny will happen. To be ultra-safe, I could add in a separate sequence to start before waituntil() and stop after waituntil() that would monitor for runaway and stop the profiling sequence when necessary, or follow your suggestion with the "starttime". Also please note this sequence is not meant to be iterative. Once the calibration points and soak times are pre-defined and sequence is started, it should follow through all the steps and end the sequence without repeating.
  2. I looked at the provided suggestion, but I do not like the use of "startime" as a reference point. Because it would not ensure the temperature has stabilized and keep referring to the point in time the Setpoint was written (when it may take who knows how long for the temperature to climb/cool to set point, overshoot a bit, undershoot and finally be within the +3 -3 band) After many trials and errors and with friend's expertise, I finally have it working like a charm. The key things that were missing: 1. The "if" condition for moving to next step inside the "while"... -> When temperature would get out of while() condition, it would pause and wait for it to be back within the band. However, with the "if" statement completed and while() condition met, it kept repeating the first case...it wouldn't move to the next case...so: 2. Updated the "while" condition by adding "&& ProfileStep ==" -> this ensured the while() gets kicked out after the "if" statement completes writing ProfileStep that invalidates the while() Couple other nits and bits revised: the mean(channel[0,9]) is used instead of C1_PV[0]. It does the job well ensuring the temperature is within the band before starting timing soak. The profileStep numbering shifted from 0 to start from 1 for the coherence. Also "default" was added to case. Next steps on the list...adding ramp rate and step timer. Should be smooth sailing from here on!
  3. 1. I have implemented the first suggestion for "state" / step checks and it does help with cleaning the code tremendously. 2. To my understanding the second suggestion would act as a self-resetting timer performing a specific action every interval. I can't find use for it in this application since I am just going from step to step, and do not have an action to be run at exact specific interval (or, do it again in this many minutes) I re-wrote this sequence multiple times, and just can't get it right. I "dumbed" it down, skipped the "steptimer", skipped most of notifications. The sequence should -> Set the C1_SP (controller setpoint) to CAL"..." (calibration point) variable. -> Using "while", keep checking if it's within the band (the temperature needs to stabilize and it cannot start timing immediately). -> If it is within the band, time out the Soak time and move to the next profile step (or recipeState). If at any point the temperature gets out of the band, the "while" should stop executing and restart when it is back in the band For some reason in my sequence the "while" acts more like "if" ? Essentially - as long as the process value enters the band, it executes all statements under "while", even if the process value went out of the range for "while" condition before the "waituntil()" finished. For example, first calibration point is 100°C. Soak 1 value is 1 (1*10 = 10 seconds). Start off with simulated temperature 20°C. I begin sequence - it waits. I simulate 100, it completes all "while" steps including the proper Soak timing, but then keeps restarting the ProfileStep 0. Does not move to ProfileStep 1 If I start off again with 20°C and enter 200°C (just fly by the 100°C without stopping), the while executes, times out the soak and keeps repeating, even though the process value is 200°C...
  4. Hello, Thank you for looking into this! I will give it a go and rework the sequence, fingers crossed! -Jacob
  5. Hello! I have been attempting to write a sequence for a simple temperature control profile with different soak times at each step, to be used with a temperature calibration bath. For the most part, it is just a repeated code over the number of steps. In this example, I am trying four steps. Write to a setpoint, check if you are within +3 -3 range of process value, start timing the soak time, once complete, move to next step. The idea is this: I have a readout of a Process Value (C1_PV), and control an output to a Control Loop Setpoint (C1_SP) via channels. I have also declared global variables: CAL(1-4) - desired Calibration Point or, step SOAK(1-4) - desired soak time entered in Minutes I have also declared: Global variables "READY" (1-4), which will tell if the calibration point is reached/within range of -3 - +3 of the calibration point, and start a separate sequence "STEP_TIMER". Global variables "starttime" (1-4", which will store the time when did the step has started. Global variable "STEPTIME" which should store a product of "STEP_TIMER" sequence The other sequence "STEP_TIMER" should check for which "READY" variable is on, pick the appropriate "starttime" variable, compare it against SOAK time and write to "STEPTIME", ultimately used for counting down remaining time of the current step Profile sequence: Step Timer Sequence: This is my first journey with coding and been digging through DAQFactory forum implementing little bits here and there. Currently when I run this code with process value below Step 1 calibration point, it flies through step 1 immediately to step 2 and stays there. Once I input simulated C1_PV process value that matches CAL2 point, i get "Calibration Point 2 Reached. Starting Soak" and immediately restarts to "Calibration Point 1 Start" without soaking. Next, for testing.. I reduced simulated C1_PV process value to CAL1. I get "Calibration Point 1 Reached. Starting Soak". It waits the SOAK1 time, and after that it restarts back with "Calibration Point 1 Start" into "Calibration Point 1 Reached"... I guess I made some serious syntax errors. Even with calibration entered for point 3, It does not get there. It's as if its flip-flopping between Point 1 and 2. Any advice would be appreciated. I attached the template file. -Jacob Profiling Working File 2.ctl