Scroll to navigation

COUNTER(9) HAL Component COUNTER(9)

NAME

counter - counts input pulses (DEPRECATED)

SYNOPSIS

loadrt counter [num_chan=N]

DESCRIPTION

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

Updates the counts, position and velocity outputs based on internal counters.
Samples the phase-A and phase-Z inputs and updates internal counters.

PINS

The primary input signal. The internal counter is incremented on each rising edge.
The index input signal. When the index-enable pin is TRUE and a rising edge on phase-Z is seen, index-enable is set to FALSE and the internal counter is reset to zero.




These pins function according to the canonical digital encoder interface.
This parameter functions according to the canonical digital encoder interface.
The internal counts value, updated from update-counters and reflected in the output pins at the next call to capture-position.

SEE ALSO

encoder(9). in the LinuxCNC documentation.

2007-01-19 LinuxCNC Documentation