LinuxCNC Documentation
This page is 96% translated. Untranslated text is shown in English.

СИНТАКСИС

loadrt counter [num_chan=N]

ОПИС

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.

Звичайно, це корисно лише для однонаправленого шпинделя, оскільки неможливо визначити напрямок обертання.

counter conforms to the "canonical encoder" interface described in the HAL manual.

ФУНКЦІЇ

counter.capture-position (використовує числа з плаваючою комою)

Оновлює показники підрахунку, положення та швидкості на основі внутрішніх лічильників.

counter.update-counters

Вимірює входи фази A та фази Z та оновлює внутрішні лічильники.

ПІНИ

counter.N.phase-A bit in

Основний вхідний сигнал. Внутрішній лічильник збільшується на 1 з кожним наростаючим фронтом.

counter.N.phase-Z bit in

Вхідний сигнал індексу. Коли контакт index-enable має значення TRUE (істина) і спостерігається наростаючий фронт на phase-Z, index-enable встановлюється на FALSE (хибність), а внутрішній лічильник скидається до нуля.

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

Ці контакти функціонують відповідно до канонічного інтерфейсу цифрового енкодера.

counter.N.position-scale float rw

Цей параметр функціонує відповідно до канонічного інтерфейсу цифрового кодера.

counter.N.rawcounts signed ro

Значення внутрішнього підрахунку, оновлене з update-counters та відображене на вихідних контактах під час наступного виклику capture-position.

ДИВІТЬСЯ ТАКОЖ

encoder(9)