summaryrefslogtreecommitdiff
path: root/docs/man/man9/counter.9
blob: a40b19e2707812aa49c528165ef541954b02f759 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
.TH COUNTER "9" "2007-01-19" "LinuxCNC Documentation" "HAL Component"
.de TQ
.br
.ns
.TP \\$1
..

.SH NAME

counter \- counts input pulses \fB(DEPRECATED)\fB

.SH SYNOPSIS
.B loadrt counter [num_chan=\fIN\fB]
.SH DESCRIPTION
\fBcounter\fR is a deprecated HAL component and will be removed in a future
release.  Use the \fBencoder\fR component with encoder.X.counter-mode set to
TRUE.

\fBcounter\fR is a HAL component that provides software-
based counting that is useful for spindle position sensing and
maybe other things.  Instead of using a real encoder that outputs
quadrature, some lathes have a sensor that generates a simple pulse
stream as the spindle turns and an index pulse once per revolution.
This component simply counts up when a "count" pulse (phase-A)
is received, and if reset is enabled, resets when the "index"
(phase-Z) pulse is received.

This is of course only useful for a unidirectional spindle, as it
is not possible to sense the direction of rotation.

\fBcounter\fR conforms to the "canonical encoder" interface described
in the HAL manual.
.SH FUNCTIONS
.TP
.B \fBcounter.capture-position\fR (uses floating-point)
Updates the counts, position and velocity outputs based on internal counters.
.TP
.B \fBcounter.update-counters\fR
Samples the phase-A and phase-Z inputs and updates internal counters.


.SH PINS
.TP
.B \fBcounter.\fIN\fB.phase-A\fR bit in
The primary input signal.  The internal counter is incremented on each
rising edge.
.TP
.B \fBcounter.\fIN\fB.phase-Z\fR bit in
The index input signal.  When the \fBindex-enable\fR pin is TRUE and a rising
edge on \fBphase-Z\fR is seen, \fBindex-enable\fR is set to FALSE and the
internal counter is reset to zero.
.TP
.B \fBcounter.\fIN\fB.index-enable\fR bit io
.TQ
.B \fBcounter.\fIN\fB.reset\fR bit io
.TQ
.B \fBcounter.\fIN\fB.counts\fR signed out
.TQ
.B \fBcounter.\fIN\fB.position\fR float out
.TQ
.B \fBcounter.\fIN\fB.velocity\fR float out
These pins function according to the canonical digital encoder interface.
.TP
.B \fBcounter.\fIN\fB.position-scale\fR float rw
This parameter functions according to the canonical digital encoder interface.
.TP
.B \fBcounter.\fIN\fB.rawcounts\fR signed ro
The internal counts value, updated from \fBupdate-counters\fR and reflected
in the output pins at the next call to \fBcapture-position\fR.
.SH SEE ALSO
\fBencoder(9)\fR. in the LinuxCNC documentation.