counter9
Counts input pulses (deprecated)
Usage
loadrt counter [num_chan=N]
Overview
counter is a deprecated HAL component and will be removed in a future release. Use the encoder component with encoder.X.counter-mode set to TRUE.
counter 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.
counter conforms to the "canonical encoder" interface described in the HAL manual.
Functions
counter.capture-position (uses floating-point)
|
Updates the counts, position and velocity outputs based on internal counters. |
|---|---|
|
Samples the phase-A and phase-Z inputs and updates internal counters. |
Pins
- counter.N.phase-A bit in
-
The primary input signal. The internal counter is incremented on each rising edge.
- counter.N.phase-Z bit in
-
The index input signal. When the
index-enablepin is TRUE and a rising edge onphase-Zis seen,index-enableis set to FALSE and the internal counter is reset to zero.
- counter.N.index-enable bit io
- counter.N.reset bit io
- counter.N.counts signed out
- counter.N.position float out
- counter.N.velocity float out
-
These pins function according to the canonical digital encoder interface.
- counter.N.position-scale float rw
-
This parameter functions according to the canonical digital encoder interface.
- counter.N.rawcounts signed ro
-
The internal counts value, updated from
update-countersand reflected in the output pins at the next call tocapture-position.
Releases
Unchanged in 2 releases since Debian 12 (Bookworm).