Position compare – ADLINK HSL-4XMO User Manual

Page 93

Advertising
background image

Operation Theory

83

Note:

Only comparator 5 has the ability to trigger an output pulse

via the CMP.

Comparators 1 and 2 are used for soft limits. Refer to section 4.9.
Comparator 3 is used to compare with the position error counter. It
is useful for detecting if a stepping motor has lost any pulses. To
enable/disable the step-losing detection, or set the allowable toler-
ance use HSL_M_set_error_counter_check()

Comparator 4 is a general purpose comparator. The comparing
source counter can be any counter. The compared value, source
counter, comparing method, and reaction are set by the function
HSL_M_set_general_comparator().

Position Compare

The 5th comparator, whose comparing source is the feedback
position counter, performs the position compare function. Only the
first 2 axes (0 and 1) can do a position comparison. The position
comparison function triggers a pulse output via the CMP, when the
comparing condition comes into existence.

The comparing condition consists of 2 parts, the first is the value to
be compared, and the second is the comparing mode. Comparing
mode can be “>“, “=“ or “<“. The easiest way to use the position
comparison function is to call the function:

HSL_M_set_trigger_comparator (AxisNo, CmpSrc,

Method, Data)

The second parameter, “Method,” indicates the comparing
method, while the third parameter, “Data,” is for the value to be
compared. In continuous comparison, this data will be ignored
automatically since the compare data is built by other functions.

Comparator 4

Any counters

General-purpose

HSL_M_set_general_comparator

Comparator 5

(Only Axes 0 & 1)

Feedback posi-

tion counter

Position compare

function (Trigger)

HSL_M_set_trigger_comparator

HSL_M_build_compare_function

HSL_M_build_compare_table

HSL_M_set_auto_compare

Table 4-8: HSL-4XMO Comparators

Advertising