0
$\begingroup$

I have a discrete control system with known dead time and time constant, where a process variable is sampled at regular discrete time intervals and fed back to the controller. I want to find out an optimal, or at least good, sampling interval.

I came accross a few websites saying that "Sample time should be 10 times per process time constant or faster", e.g. sample-time-is-a-fundamental-design-and-tuning-specification/ But I cannot find any theory supporting this statement, so I guess it may be a rule of thumb.

Is this statement correct? and can someone explain it?

====Edit====

This Edit is after Jeffrey's answer.

I want to provide more details about my control system. It is a discrete system with a reference input. The goal is to keep the output close to the reference input (like a room temperature control system). The difference between the output and the reference input is the error fed to the controller, so the controller has control output accordingly. The system has a dead time, as well as a time constant, both at the scale of $1$ to $10\mu s$. The fastest sampling interval of the output is at the sacle of $0.1\mu s$.

My question is: is the fastest sampling rate good enough to achieve a stable control?

$\endgroup$
7
  • 1
    $\begingroup$ Note usually in practice the off-the-shelf hardware will offer capacity for sample rate several orders of magnitude higher than the time constant, and it absolutely doesn't hurt to keep it like that (possibly adding some smoothing if the input is noisy) - artificially reducing it to "optimal" value, whatever it would be, is just introducing an extra failure point. If your time constant is 10 seconds and your controller samples inputs at 1kHz out of the box, it's rarely beneficial to reduce that sample rate despite it being a total overkill. $\endgroup$ – SF. Nov 27 '19 at 16:03
  • $\begingroup$ The "or faster" is the key part to focus on here. @SF. explains why above. $\endgroup$ – Jonathan R Swift Nov 27 '19 at 17:33
  • $\begingroup$ @SF. pls take a look at my edit in the question. $\endgroup$ – Bloodmoon Nov 28 '19 at 2:30
  • $\begingroup$ yes, in your scenario, yours is a perfectly valid question. 10x will be sufficient for about all common control algorithms, that is not employing higher order derivatives - if you e.g. need to calculate jerk from displacement data, third derivative of position over time, that requires at least 4 data points and you're getting awfully close to the critical 2x sample rate, but a PID will run just fine. It may also depend on how noisy your input is and how accurately your output needs to follow. $\endgroup$ – SF. Nov 28 '19 at 6:52
  • $\begingroup$ @SF. In my question, the noisy of the input can be neglected, and the control accuracy is not very strict. But please forgive me to ask this question again, where does this "10x" rule-of-thumb come from? I searched over the Internet and could barely find it in any paper or textbook. $\endgroup$ – Bloodmoon Nov 28 '19 at 7:08
2
$\begingroup$

Take a perfect analog signal input. Use a perfect controller with a zero time constant, an infinite look-ahead perspective to predict the upcoming signal, and no time constant to respond. The Nyquist-Shannon sampling theorem sets the lower bounds to resolve features in the signal. We must sample the output at a rate no less than 2x the function period. State this as below with $f^\star_c$ as the sampling rate of the perfect controller and $f^\star_{fa}$ as the rate of the function variation in the analog signal (each in units of Hz for example).

$$f^\star_{c,min} = 2 f_{fa}$$

By example, an analog function with a cycle at 60 Hz requires a sampling rate of 120 Hz to capture correctly. Failing this metric, the perfect control system has a false representation of the true period of the signal to use to build its immediate response. Otherwise, the FFT of the incoming signal gives false representation for the otherwise perfect controller to use to predict where to go next.

In a domain where the input signal is digital, we cannot measure data points that do not exist. The lowest sampling rate is the rate of the digital period of the signal input to the controller. We cannot sample at anything above 1x the signal rate. Given a digital signal rate of $f_{dp}$, regardless of the function period, the smallest sampling rate we can use on a perfect controller is

$$f^\star_{c,max} = f_{dp}$$

When we have a digital signal that is running at 60 Hz, we can only sample at 60 Hz or below, never above. This is true regardless of the value of $f_f$, the frequency of the function in the signal itself.

The referenced example for the question shows a case for a pseudo-analog signal. In this case, the digital signal rate $f_{dp}$ is shown to be larger than the function rate $f_f$. By example, we have an example of a case with a 1 Hz square wave signal output as a digital signal with samples at 60 Hz. Each square wave period over 1 s has 60 digital points in it.

In this case, the minimum sample should default to the Nyquist-Shannon expression for the rate of the digital signal $f_{fd}$ and should also respect the digital signal rate $f_{dp}$

$$f^\star_{c,min} = 2 f_{fd}\ \ \ f^\star_{c, max} = f_{dp}$$

So, we should sample at least at 2 Hz and we cannot sample above 60 Hz.

How does the factor of 10x arise?

To carry this question further, we must assume that the frequency of the digital output is greater than the frequency of the underlying signal. We must either have a perfect analog signal fed to the controller or we must have $f_{dp} \gt f_{fp}$, perhaps at least by a factor of 10 or more.

Also, the reference that is quoted shows analysis only for "perfect" data with signal to noise $S/N = \infty$. In this case, we would expect only to need one data point per function cycle. We would resolve to the Nyquist–Shannon lower limit and the digital data rate upper limit. This has no factor of 10x anywhere.

Where else can we look for an answer?

Next, let's relax the assumption of perfect data.

In data with noise, a general rule of thumb from uncertainty analysis is that a lower limit of 10 measurements is a reasonable approximation to obtain a mean from results that is comparable to what is obtained when sampling for large population statistics. A review of the student t-test values for example shows the 90% confidence value to obtain the sample mean from noisy data is 1.372. This is a (1.372 - 1.282)/1.282 = 7% difference from the infinite population value (the true mean).

I posit that the 10x value for sampling theory is a comparable rule of thumb for good sampling statistics using controller with noisy digital input data. To obtain a working precision uncertainty of at least 7% from the controller that is sampling noisy data, sample at 10x over the function period. We might reason also that, as $S/N$ in the data increases, the sampling rate should be increased beyond 10x of the period rate in the input signal $f_{fp}$ (but can never exceed $f_{dp}$ itself).

We can next relax the assumption of a perfect controller. At that point, we should resolve the internal sampling of the system itself by similar uncertainty analysis rules. An uncertainty budget expression might be needed, and the outcome might be a comparable rule: The precision of the imperfect controller is affected by sampling rate in such a way that we state that 10x gives an acceptable controller precision even in the case of perfect input data (analog input with $S/N = \infty$).

Finally, here are references to well-structured discussions of sampling.

https://community.sw.siemens.com/s/article/digital-signal-processing-sampling-rates-bandwidth-spectral-lines-and-more

https://www.audiostream.com/content/sampling-what-nyquist-didnt-say-and-what-do-about-it-tim-wescott-wescott-design-services

$\endgroup$
8
  • 3
    $\begingroup$ Nyquist-Shanon is not applicable here, since the system is DT. $\endgroup$ – Sam Farjamirad Nov 27 '19 at 15:13
  • 3
    $\begingroup$ DT: Discrete time, at least in German and French literature. Assume you sample the discrete signal according to NS theorem, then you need to reconstruct it, however the Fourier transform of the discrete signal should and is exact, you've lost many information in the original signal, the reconstructed signal doesn't represent the original DT signal at all. $\endgroup$ – Sam Farjamirad Nov 27 '19 at 15:21
  • 2
    $\begingroup$ Sampling is a transformation of the continues time signal to a discrete time signal. Nyquist-Shanon theorem works for a continue signals. Assume the period is four, then according to NS minimum sample frequency is 0.5 Hz, how can we sample a discrete signal at 0.5 Hz ? $\endgroup$ – Sam Farjamirad Nov 27 '19 at 16:24
  • 2
    $\begingroup$ NS theorem, grantees that, we can collect all the info we need to reconstruct the signal. Try to find a periodic piecewise signal with two values 0 and 1, if you apply NS, then sometimes you stuck with only one of the values, 0 or 1, and you'll end op reconstructing a constant signal! $\endgroup$ – Sam Farjamirad Nov 27 '19 at 16:33
  • $\begingroup$ I memorialized this comments in my profile description ;) $\endgroup$ – Sam Farjamirad Nov 27 '19 at 17:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.