Skip to content

Commit 23f5b65

Browse files
Renamed at_pidv2 component and manual page to at_pid.
1 parent 646c668 commit 23f5b65

4 files changed

Lines changed: 64 additions & 68 deletions

File tree

Lines changed: 52 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
.TH PID "9" "2007-01-16" "LinuxCNC Documentation" "HAL Component"
1+
.TH AT_PID "9" "2007-01-16" "LinuxCNC Documentation" "HAL Component"
22

33
.SH NAME
4-
pid \- proportional/integral/derivative controller
4+
at_pid \- proportional/integral/derivative controller
55
.SH SYNOPSIS
6-
\fBloadrt pid [num_chan=\fInum\fB | names=\fIname1\fB[,\fIname2...\fB]] [\fBdebug=\fIdbg\fR]
6+
\fBloadrt at_pid [num_chan=\fInum\fB | names=\fIname1\fB[,\fIname2...\fB]] [\fBdebug=\fIdbg\fR]
77

88
.SH DESCRIPTION
99
\fBNOTE:\fR The auto-tuning part of this component have seen
1010
no development since 2011.
1111
.P
12-
\fBpid\fR is a classic Proportional/Integral/Derivative controller,
12+
\fBat_pid\fR is a classic Proportional/Integral/Derivative controller,
1313
used to control position or speed feedback loops for servo motors and
1414
other closed-loop applications.
1515
.P
16-
\fBpid\fR supports a maximum of sixteen controllers. The number that
16+
\fBat_pid\fR supports a maximum of sixteen controllers. The number that
1717
are actually loaded is set by the \fBnum_chan\fR argument when
1818
the module is loaded. Alternatively, specify names= and unique names
1919
separated by commas.
@@ -31,7 +31,7 @@ loops such as speed loops, torch height control, and others.
3131

3232
.P
3333
Each loop has a number of pins and parameters, whose names begin
34-
with 'pid.N.', where 'N' is the channel number. Channel numbers start
34+
with 'at_pid.N.', where 'N' is the channel number. Channel numbers start
3535
at zero.
3636
.P
3737
The three most important pins are 'command', 'feedback', and 'output'.
@@ -141,7 +141,7 @@ command line.
141141
\fBcommandDDD\fR 3rd derivative of the command
142142

143143
.P
144-
The PID loop calculations are as follows (see the code in pid.c for
144+
The PID loop calculations are as follows (see the code in at_pid.c for
145145
all the nitty gritty details):
146146
.IP
147147
.nf
@@ -189,78 +189,78 @@ Auto tuning can be aborted at any time by setting \fBenable\fR or
189189

190190
.SH NAMING
191191
The names for pins, parameters, and functions are prefixed as:
192-
\fBpid.N.\fR for N=0,1,...,num\-1 when using \fBnum_chan=num\fR
192+
\fBat_pid.N.\fR for N=0,1,...,num\-1 when using \fBnum_chan=num\fR
193193
\fBnameN.\fR for nameN=name1,name2,... when using \fBnames=name1,name2,...\fR
194194

195-
The \fBpid.N.\fR format is shown in the following descriptions.
195+
The \fBat_pid.N.\fR format is shown in the following descriptions.
196196

197197
.SH FUNCTIONS
198198

199-
\fBpid.\fIN\fB.do\-pid\-calcs\fR (uses floating-point)
199+
\fBat_pid.\fIN\fB.do\-pid\-calcs\fR (uses floating-point)
200200
Does the PID calculations for control loop \fIN\fR.
201201

202202
.SH PINS
203203

204204
.TP
205-
\fBpid.\fIN\fB.command\fR float in
205+
\fBat_pid.\fIN\fB.command\fR float in
206206
The desired (commanded) value for the control loop.
207207
.TP
208-
\fBpid.\fIN\fB.Pgain\fR float in
208+
\fBat_pid.\fIN\fB.Pgain\fR float in
209209
Proportional gain. Results in a contribution to the output that is the error
210210
multiplied by \fBPgain\fR.
211211
.TP
212-
\fBpid.\fIN\fB.Igain\fR float in
212+
\fBat_pid.\fIN\fB.Igain\fR float in
213213
Integral gain. Results in a contribution to the output that is the integral
214214
of the error multiplied by \fBIgain\fR. For example an error of 0.02 that
215215
lasted 10 seconds would result in an integrated error (\fBerrorI\fR) of 0.2,
216216
and if \fBIgain\fR is 20, the integral term would add 4.0 to the output.
217217
.TP
218-
\fBpid.\fIN\fB.Dgain\fR float in
218+
\fBat_pid.\fIN\fB.Dgain\fR float in
219219
Derivative gain. Results in a contribution to the output that is the rate of
220220
change (derivative) of the error multiplied by \fBDgain\fR. For example an
221221
error that changed from 0.02 to 0.03 over 0.2 seconds would result in an error
222222
derivative (\fBerrorD\fR) of of 0.05, and if \fBDgain\fR is 5, the derivative
223223
term would add 0.25 to the output.
224224
.TP
225-
\fBpid.\fIN\fB.feedback\fR float in
225+
\fBat_pid.\fIN\fB.feedback\fR float in
226226
The actual (feedback) value, from some sensor such as an encoder.
227227
.TP
228-
\fBpid.\fIN\fB.output\fR float out
228+
\fBat_pid.\fIN\fB.output\fR float out
229229
The output of the PID loop, which goes to some actuator such as a motor.
230230
.TP
231-
\fBpid.\fIN\fB.command\-deriv\fR float in
231+
\fBat_pid.\fIN\fB.command\-deriv\fR float in
232232
The derivative of the desired (commanded) value for the control loop. If no
233233
signal is connected then the derivative will be estimated numerically.
234234
.TP
235-
\fBpid.\fIN\fB.feedback\-deriv\fR float in
235+
\fBat_pid.\fIN\fB.feedback\-deriv\fR float in
236236
The derivative of the actual (feedback) value for the control loop. If no
237237
signal is connected then the derivative will be estimated numerically. When
238238
the feedback is from a quantized position source (e.g., encoder feedback
239239
position), behavior of the D term can be improved by using a better velocity
240240
estimate here, such as the velocity output of encoder(9) or hostmot2(9).
241241
.TP
242-
\fBpid.\fIN\fB.error\-previous\-target\fR bit in
242+
\fBat_pid.\fIN\fB.error\-previous\-target\fR bit in
243243
Use previous invocation's target vs. current position for error calculation,
244244
like the motion controller expects. This may make torque-mode position loops
245245
and loops requiring a large I gain easier to tune, by eliminating
246246
velocity\-dependent following error.
247247
.TP
248-
\fBpid.\fIN\fB.error\fR float out
248+
\fBat_pid.\fIN\fB.error\fR float out
249249
The difference between command and feedback.
250250
.TP
251-
\fBpid.\fIN\fB.enable\fR bit in
251+
\fBat_pid.\fIN\fB.enable\fR bit in
252252
When true, enables the PID calculations. When false, \fBoutput\fR is zero,
253253
and all internal integrators, etc, are reset.
254254
.TP
255-
\fBpid.\fIN\fB.index\-enable\fR bit in
256-
On the falling edge of \fBindex\-enable\fR, pid does not update the
255+
\fBat_pid.\fIN\fB.index\-enable\fR bit in
256+
On the falling edge of \fBindex\-enable\fR, at_pid does not update the
257257
internal command derivative estimate. On systems which use the encoder
258258
index pulse, this pin should be connected to the index\-enable signal.
259259
When this is not done, and FF1 is nonzero, a step change in the input
260260
command causes a single-cycle spike in the PID output. On systems which use
261261
exactly one of the \fB\-deriv\fR inputs, this affects the D term as well.
262262
.TP
263-
\fBpid.\fIN\fB.bias\fR float in
263+
\fBat_pid.\fIN\fB.bias\fR float in
264264
\fBbias\fR is a constant amount that is added to the output. In most cases
265265
it should be left at zero. However, it can sometimes be useful to compensate
266266
for offsets in servo amplifiers, or to balance the weight of an object that
@@ -269,36 +269,36 @@ just like all other components of the output. If a non-zero output is needed
269269
even when the PID loop is disabled, it should be added with an external HAL
270270
sum2 block.
271271
.TP
272-
\fBpid.\fIN\fB.FF0\fR float in
272+
\fBat_pid.\fIN\fB.FF0\fR float in
273273
Zero order feed-forward term. Produces a contribution to the output that is
274274
\fBFF0\fR multiplied by the commanded value. For position loops, it should
275275
usually be left at zero. For velocity loops, \fBFF0\fR can compensate for
276276
friction or motor counter-EMF and may permit better tuning if used properly.
277277
.TP
278-
\fBpid.\fIN\fB.FF1\fR float in
278+
\fBat_pid.\fIN\fB.FF1\fR float in
279279
First order feed-forward term. Produces a contribution to the output that
280280
is \fBFF1\fR multiplied by the derivative of the commanded value. For
281281
position loops, the contribution is proportional to speed, and can be used
282282
to compensate for friction or motor CEMF. For velocity loops, it is
283283
proportional to acceleration and can compensate for inertia. In both
284284
cases, it can result in better tuning if used properly.
285285
.TP
286-
\fBpid.\fIN\fB.FF2\fR float in
286+
\fBat_pid.\fIN\fB.FF2\fR float in
287287
Second order feed-forward term. Produces a contribution to the output that is
288288
\fBFF2\fR multiplied by the second derivative of the commanded value. For
289289
position loops, the contribution is proportional to acceleration, and can be
290290
used to compensate for inertia. For velocity loops, the contribution is
291291
proportional to jerk, and should usually be left at zero.
292292
.TP
293-
\fBpid.\fIN\fB.FF3\fR float in
293+
\fBat_pid.\fIN\fB.FF3\fR float in
294294
Third order feed-forward term. Produces a contribution to the output that is
295295
\fBFF3\fR multiplied by the third derivative of the commanded value. For
296296
position loops, the contribution is proportional to jerk, and can be
297297
used to compensate for residual errors during acceleration. For velocity
298298
loops, the contribution is proportional to snap(jounce), and should usually
299299
be left at zero.
300300
.TP
301-
\fBpid.\fIN\fB.deadband\fR float in
301+
\fBat_pid.\fIN\fB.deadband\fR float in
302302
Defines a range of "acceptable" error. If the absolute value of \fBerror\fR
303303
is less than \fBdeadband\fR, it will be treated as if the error is zero.
304304
When using feedback devices such as encoders that are inherently quantized,
@@ -309,112 +309,112 @@ than the deadband, the deadband value is subtracted from the error before
309309
performing the loop calculations, to prevent a step in the transfer function
310310
at the edge of the deadband. (See \fBBUGS\fR.)
311311
.TP
312-
\fBpid.\fIN\fB.maxoutput\fR float in
312+
\fBat_pid.\fIN\fB.maxoutput\fR float in
313313
Output limit. The absolute value of the output will not be permitted
314314
to exceed \fBmaxoutput\fR, unless \fBmaxoutput\fR is zero. When the output
315315
is limited, the error integrator will hold instead of integrating, to prevent
316316
windup and overshoot.
317317
.TP
318-
\fBpid.\fIN\fB.maxerror\fR float in
318+
\fBat_pid.\fIN\fB.maxerror\fR float in
319319
Limit on the internal error variable used for P, I, and D. Can be used to
320320
prevent high \fBPgain\fR values from generating large outputs under conditions
321321
when the error is large (for example, when the command makes a step change).
322322
Not normally needed, but can be useful when tuning non-linear systems.
323323
.TP
324-
\fBpid.\fIN\fB.maxerrorD\fR float in
324+
\fBat_pid.\fIN\fB.maxerrorD\fR float in
325325
Limit on the error derivative. The rate of change of error used by the
326326
\fBDgain\fR term will be limited to this value, unless the value is
327327
zero. Can be used to limit the effect of \fBDgain\fR and prevent large
328328
output spikes due to steps on the command and/or feedback. Not normally
329329
needed.
330330
.TP
331-
\fBpid.\fIN\fB.maxerrorI\fR float in
331+
\fBat_pid.\fIN\fB.maxerrorI\fR float in
332332
Limit on error integrator. The error integrator used by the \fBIgain\fR
333333
term will be limited to this value, unless it is zero. Can be used to prevent
334334
integrator windup and the resulting overshoot during/after sustained errors.
335335
Not normally needed.
336336
.TP
337-
\fBpid.\fIN\fB.maxcmdD\fR float in
337+
\fBat_pid.\fIN\fB.maxcmdD\fR float in
338338
Limit on command derivative. The command derivative used by \fBFF1\fR will
339339
be limited to this value, unless the value is zero. Can be used to prevent
340340
\fBFF1\fR from producing large output spikes if there is a step change on the
341341
command. Not normally needed.
342342
.TP
343-
\fBpid.\fIN\fB.maxcmdDD\fR float in
343+
\fBat_pid.\fIN\fB.maxcmdDD\fR float in
344344
Limit on command second derivative. The command second derivative used by
345345
\fBFF2\fR will be limited to this value, unless the value is zero. Can be
346346
used to prevent \fBFF2\fR from producing large output spikes if there is a
347347
step change on the command. Not normally needed.
348348
.TP
349-
\fBpid.\fIN\fB.maxcmdDDD\fR float in
349+
\fBat_pid.\fIN\fB.maxcmdDDD\fR float in
350350
Limit on command third derivative. The command third derivative used by
351351
\fBFF3\fR will be limited to this value, unless the value is zero. Can be
352352
used to prevent \fBFF3\fR from producing large output spikes if there is a
353353
step change on the command. Not normally needed.
354354
.TP
355-
\fBpid.\fIN\fB.saturated\fR bit out
355+
\fBat_pid.\fIN\fB.saturated\fR bit out
356356
When true, the current PID output is saturated. That is,
357357
.RS 12
358358
\fBoutput\fR = \(+- \fBmaxoutput\fR.
359359
.RE
360360
.TP
361-
\fBpid.\fIN\fB.saturated\-s\fR float out
361+
\fBat_pid.\fIN\fB.saturated\-s\fR float out
362362
.br
363363
.ns
364364
.TP
365-
\fBpid.\fIN\fB.saturated\-count\fR s32 out
365+
\fBat_pid.\fIN\fB.saturated\-count\fR s32 out
366366
When true, the output of PID was continually saturated for this many seconds
367367
(\fBsaturated\-s\fR) or periods (\fBsaturated\-count\fR).
368368

369369
.SS Additional auto tuning pins
370370
.TP
371-
\fBpid.\fIN\fB.tune\-mode\fR bit in
371+
\fBat_pid.\fIN\fB.tune\-mode\fR bit in
372372
When true, enables auto tune mode. When false, normal PID calculations are
373373
performed.
374374
.TP
375-
\fBpid.\fIN\fB.tune\-start\fR bit io
375+
\fBat_pid.\fIN\fB.tune\-start\fR bit io
376376
When set to true, starts auto tuning. Cleared when the auto tuning completes.
377377
.TP
378-
\fBpid.\fIN\fB.tune\-type\fR u32 rw
378+
\fBat_pid.\fIN\fB.tune\-type\fR u32 rw
379379
When set to 0, \fBPgain/Igain/Dgain\fR are calculated. When set to 1,
380380
\fBPgain/Igain/FF1\fR are calculated.
381381
.TP
382-
\fBpid.\fIN\fB.tune\-cycles\fR u32 rw
382+
\fBat_pid.\fIN\fB.tune\-cycles\fR u32 rw
383383
Determines the number of cycles to run to characterize the process.
384384
\fBtune\-cycles\fR actually sets the number of half cycles. More cycles results
385385
in a more accurate characterization as the average of all cycles is used.
386386
.TP
387-
\fBpid.\fIN\fB.tune\-effort\fR float rw
387+
\fBat_pid.\fIN\fB.tune\-effort\fR float rw
388388
Determines the effort used in setting up the limit cycle in the process.
389389
\fBtune\-effort\fR should be set to a positive value less than \fBmaxoutput\fR.
390390
Start with something small and work up to a value that results in a good
391391
portion of the maximum motor current being used. The smaller the value, the
392392
smaller the amplitude of the limit cycle.
393393
.TP
394-
\fBpid.\fIN\fB.ultimate\-gain\fR float ro (only if debug=1)
394+
\fBat_pid.\fIN\fB.ultimate\-gain\fR float ro (only if debug=1)
395395
Determined from process characterization. \fBultimate\-gain\fR is the ratio of
396396
\fBtune\-effort\fR to the limit cycle amplitude multiplied by 4.0 divided by Pi.
397397
.TP
398-
\fBpid.\fIN\fB.ultimate\-period\fR float ro (only if debug=1)
398+
\fBat_pid.\fIN\fB.ultimate\-period\fR float ro (only if debug=1)
399399
Determined from process characterization. \fBultimate\-period\fR is the period
400400
of the limit cycle.
401401

402402
.SH PARAMETERS
403403
.TP
404-
\fBpid.\fIN\fB.errorI\fR float ro (only if debug=1)
404+
\fBat_pid.\fIN\fB.errorI\fR float ro (only if debug=1)
405405
Integral of error. This is the value that is multiplied by \fBIgain\fR to produce the Integral term of the output.
406406
.TP
407-
\fBpid.\fIN\fB.errorD\fR float ro (only if debug=1)
407+
\fBat_pid.\fIN\fB.errorD\fR float ro (only if debug=1)
408408
Derivative of error. This is the value that is multiplied by \fBDgain\fR to produce the Derivative term of the output.
409409
.TP
410-
\fBpid.\fIN\fB.commandD\fR float ro (only if debug=1)
410+
\fBat_pid.\fIN\fB.commandD\fR float ro (only if debug=1)
411411
Derivative of command. This is the value that is multiplied by \fBFF1\fR to produce the first order feed-forward term of the output.
412412
.TP
413-
\fBpid.\fIN\fB.commandDD\fR float ro (only if debug=1)
413+
\fBat_pid.\fIN\fB.commandDD\fR float ro (only if debug=1)
414414
Second derivative of command. This is the value that is multiplied by
415415
\fBFF2\fR to produce the second order feed-forward term of the output.
416416
.TP
417-
\fBpid.\fIN\fB.commandDDD\fR float ro (only if debug=1)
417+
\fBat_pid.\fIN\fB.commandDDD\fR float ro (only if debug=1)
418418
Third derivative of command. This is the value that is multiplied by
419419
\fBFF3\fR to produce the third order feed-forward term of the output.
420420

@@ -424,7 +424,7 @@ treated as zero if it is within the deadband, and be unmodified if it is outside
424424
the deadband. This was not done because it would cause a step in the transfer
425425
function equal to the size of the deadband. People who prefer that behavior are
426426
welcome to add a parameter that will change the behavior, or to write their own
427-
version of \fBpid\fR. However, the default behavior should not be changed.
427+
version of \fBat_pid\fR. However, the default behavior should not be changed.
428428

429429
Negative gains may lead to unwanted behavior. It is possible in some
430430
situations that negative FF gains make sense, but in general all gains

src/Makefile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -894,8 +894,6 @@ obj-$(CONFIG_PID) += pid.o
894894
pid-objs := hal/components/pid.o $(MATHSTUB)
895895
obj-$(CONFIG_AT_PID) += at_pid.o
896896
at_pid-objs := hal/components/at_pid.o $(MATHSTUB)
897-
obj-$(CONFIG_AT_PIDV2) += at_pidv2.o
898-
at_pidv2-objs := hal/components/at_pidv2.o $(MATHSTUB)
899897
obj-$(CONFIG_PID) += threads.o
900898
threads-objs := hal/components/threads.o $(MATHSTUB)
901899
obj-$(CONFIG_SUPPLY) += supply.o
@@ -1228,7 +1226,6 @@ endif
12281226
../rtlib/pwmgen$(MODULE_EXT): $(addprefix objects/rt,$(pwmgen-objs))
12291227
../rtlib/siggen$(MODULE_EXT): $(addprefix objects/rt,$(siggen-objs))
12301228
../rtlib/at_pid$(MODULE_EXT): $(addprefix objects/rt,$(at_pid-objs))
1231-
../rtlib/at_pidv2$(MODULE_EXT): $(addprefix objects/rt,$(at_pidv2-objs))
12321229
../rtlib/pid$(MODULE_EXT): $(addprefix objects/rt,$(pid-objs))
12331230
../rtlib/threads$(MODULE_EXT): $(addprefix objects/rt,$(threads-objs))
12341231
../rtlib/supply$(MODULE_EXT): $(addprefix objects/rt,$(supply-objs))

src/Makefile.inc.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,6 @@ CONFIG_FREQGEN=m
190190
CONFIG_PWMGEN=m
191191
CONFIG_SIGGEN=m
192192
CONFIG_AT_PID=m
193-
CONFIG_AT_PIDV2=m
194193
CONFIG_PID=m
195194
CONFIG_SUPPLY=m
196195
CONFIG_CLASSICLADDER_RT=m

0 commit comments

Comments
 (0)