What is the configured cycle time of the SRTP instruction?
The cyclic time of the SRTP instruction is the same as cyclic time of the PID loop - 10 ms. It can bee seen in the SRTP parameters in the pdf file.
Actually 10ms (0.01s) is its
execution time; the PWM/TP
Cycle Time (from the PDF file, first page, second row: "Cycle Time") is 10s, or a thousand times the execution time, which is also a thousand times the PID loop update time.
Also, I notice that the MaxHeatTime is 1000.0, which is invalid, and causes a fault (rows InstructFault and MaxHeatTimeInv[alid]); what that fault means in SRTP operation is TBD.
This process moves slowly enough that that the PID Loop Update Time (LUT) of 10ms is pretty aggressive, and intuitively it makes sense that it be more in line with the SRTP cycle time or
vice versa; whether to increase the PID LUT, or decrease the SRTP Cycle Time, or both, is another discussion. That said, assuming the temperature updates are happening quickly enough, the PID algorithm is usually fairly robust so the timings may not matter.
The fact that the CV is spiking in the trends suggests to me the possibility that there are still spikes in the analog input from the thermocouple, but with a trend sampling time of 1s we do not see them in the trend; that is only a possibility though - if we see spikes in the CV then it seems statistically unlikely that we would not see spikes in the PV, which PV spikes presumably cause the CV spikes?
So the original question - why are there spikes in the thermocouple/PV readings - is still a mystery, but several electrical explanations have been suggested. I think it's likely that the spikes are not real, unless the thermocouple bead is in direct contact with the heating element, and even then they would not be "real" in the sense of being representative of the bulk temperature of the device being controlled.
Tuning is a separate issue; the temperature swings attenuate over several minutes, which may be acceptable as-is if a single run lasts a few hours or more, but it certainly could be better. The second thing I would do, after reducing gains as suggested by @JesperMP, is assign a value of 0.0 to the K
D gain, because those CV spikes may be indicative of derivative action. I'm not saying this process does not need derivative action, but removing it will provide an idea of the relative magnitudes of the relative responses of K
D vs. K
P; the 10ms (0.01s) LUT is in the denominator of the derivative term, so that 0.5 K
D may actually be more like 50 when comparing apples and apples wrt the proportional action (assuming the time units are seconds; if minutes then it would be 3000).
But better than that empirical/random approach would be characterizing the system with a manual step change in CV output, estimating deadtime and lag of the PV response, and basing the tuning parameters on that e.g. an analytical model (differential equations or Laplace transforms) if that is in your toolbox, or something like the Cohen-Coon approach.