You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+37-29Lines changed: 37 additions & 29 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,13 +4,13 @@ This is an open loop PID autotuner using a novel s-curve inflection point test m
4
4
5
5
#### Reaction Curve Inflection Point Tuning Method
6
6
7
-
This tuning method determines the process gain, dead time and time constant by doing a shortened step test that ends just after the [inflection point](http://en.wikipedia.org/wiki/Inflection_point) has been reached. From here, the apparent maximum PV (input) is mathematically determined and the controller's tuning parameters are calculated. Test duration is typically only ½Tau.
7
+
This tuning method determines the process gain, dead time, time constant and more by doing a shortened step test that ends just after the [inflection point](http://en.wikipedia.org/wiki/Inflection_point) has been reached. From here, the apparent maximum PV (input) is mathematically determined and the controller's tuning parameters are calculated. Test duration is typically only ½Tau.
8
8
9
9
- See [**WiKi**](https://github.com/Dlloydev/sTune/wiki) for test results and more.
10
10
11
11
#### Inflection Point Discovery
12
12
13
-
Accurate determination of the inflection point was given high priority for this test method. To accomplish this, a circular buffer for the input readings is created that's sized to 10% of samples. The buffer is used as a moving tangent line where the "head" of the tangent is based on the average of all readings in the buffer and the "tail" is based on the oldest instantaneous value in the buffer. The tangent line slides along the reaction curve where where the head (leading point) moves smoothly but with moderate response, and the tail (trailing point) may have some jitter due to being instantaneous and more easily influenced by noise and input resolution.
13
+
Accurate determination of the inflection point was given high priority for this test method. To accomplish this, a circular buffer for the input readings is created that's sized to 10% of samples. The buffer is used as a moving tangent line where the "head" of the tangent is based on the average of all readings in the buffer and the "tail" is based on the oldest instantaneous value in the buffer. The tangent line slides along the reaction curve where where the head (leading point) moves smoothly but with moderate response. The tail (trailing point) of the tangent line is represented by instantaneous input readings that have occurred in the past (oldest buffer data point).
14
14
15
15
The slope of the tangent line is checked at every sample. When the sign of the change in slope changes (i.e. slope goes from increasing to decreasing or from decreasing to increasing), this is the point of inflection ([where the tangent turns red here](https://en.wikipedia.org/wiki/Inflection_point#/media/File:Animated_illustration_of_inflection_point.gif)). After 1⁄16 samples has occurred with the new slope direction, then it's known that the point of inflection has been reached. Final calculations are made and the test ends.
16
16
@@ -25,7 +25,7 @@ The slope of the tangent line is checked at every sample. When the sign of the c
25
25
- The tuner action is set to `directIP` or `reverseIP`, then configure sTune:
- Its expected that the user is already familiar with the controller and can make a rough estimation of what the system's time constant would be. Use this estimate for the `testTimeSec` constant.
@@ -34,6 +34,12 @@ The slope of the tangent line is checked at every sample. When the sign of the c
34
34
35
35
-`settleTimeSec` is used to provide additional settling time prior to starting the test.
36
36
37
+
-`inputSpan` and `outputSpan` represent the maximum operating range of input and output. Examples:
38
+
39
+
- If your input works with temp readings of 20C min and 150C max, then `inputSpan = 130;`
40
+
If the output uses 8-bit PWM and your using its full range, then `outputSpan = 255;`
41
+
If the output is digital relay controlled by millis() with window period of 2000ms, then `outputSpan = 2000;`
42
+
37
43
-`outputStart` is the initial control output value which is used for the first 12 samples.
38
44
39
45
-`outputStep` is the stepped output value used for sample 13 to test completion.
-`action` provides choices for controller action (direct or reverse) and whether to perform a fast inflection point test (IP) or a full 5 time constant test (5T). Choices are `directIP`, `direct5T`, `reverseIP` and `reverse5T`.
68
74
-`serialMode` provides 6 choices for serial output as described in the table below.
0 commit comments