RTC6 boards
Doc. Rev. 1.0.21 en-US
10 RTC6 Commands
633
Delayed Short
List Command
set_encoder_speed
Function Defines the target encoder speed and further parameters for encoder-speed-dependent
“Automatic Laser Control“.
Call
set_encoder_speed( EncoderNo, Speed, Smooth )
Parameters
EncoderNo
Number of the encoder counter to be used for speed measurement.
As an unsigned 32-bit value.
Allowed values:
= 0: Encoder counter “Encoder0”.
= 1: Encoder counter “Encoder1”.
= 2 and 3: Vectorial encoder velocity: a vectorial velocity is calculated
from both encoder speeds (by the pulse rates of both
encoder counters) for use with encoder-speed-dependent
automatic laser control in
Mode
= 5.
Higher bits are ignored.
Speed
Target encoder speed (counter pulse rate) in [counter pulses/ms].
As a 64-bit IEEE floating point value.
Allowed value range: [100.0…16000.0].
Out-of-range values are clipped to the boundary values.
Smooth
Smoothing factor for a 2-stage low-pass filter.
As a 64-bit IEEE floating point value.
Allowed value range: [0.0…1.0].
Larger values are clipped.
Comments • If
Smooth
= 0.0, then only the current encoder speed
CurrentSpeed
(based on counter
pulses received in the most recent 10 µs) is used; if
Smooth
= 1.0, then the speed from
the previous clock cycle
PreviousSpeed
. In general, the used speed is:
Speed =
PreviousSpeed
×
Smooth
+
CurrentSpeed
× (1.0 –
Smooth
).
• If
Speed
0.0 or
Smooth
< 0.0, then set_encoder_speed is, already during loading,
replaced by a list_nop (get_last_error return code
RTC6_PARAM_ERROR
).
• One encoder increment results in 4 counter pulses, see Section ”Input Ports for External
Encoder Signals”, page 299.
• The maximum value for
Speed
(16000.0) corresponds to a counting rate of 16 MHz. The
minimum value for
Speed
(100.0) corresponds to a counting rate of 1/(10 µs), that is,
one counter pulse per output period. Beware of the low resolution of encoder-speed-
dependent laser control for low speed values! Encoder-speed-dependent correction is
only recommended if substantially more than one counter pulse per output period
(10 µs) are received.
• See also Section ”Encoder-Speed-Dependent Laser Control”, page 204.