Compare Engines View

The AKD2G Compare Engines provides a fast, accurate, and flexible mechanism for indicating the state of positions and other values through digital outputs. The AKD2G supports several independent compare engines (CMP1, CMP2).

  1. Source
  2. Sampled value
  3. Phase Advance
  4. Modulo switch
  5. Modulo configuration
  6. Sampled value after modulo
  7. Link to detailed configuration
  8. Output

About Compare Channels

Compare channels provides the ability to quickly set digital outputs based on feedback positions, timers, and other signals that have values of interest. Compare channels operate at sub-microsecond hardware execution rates, allowing them to detect when changing signals cross specific values, and to control digital outputs, with high precision.

In addition to speed and precision, compare channels provide a number of benefits:

  • Up to 8 setpoint comparisons can be configured for each channel, allowing detection and digital output switching in multiple position ranges.
  • Channels can be set up for detection of raw feedback device values, in addition to scaled axis position feedbacks.
  • Setpoints can be configured to detect directional position changes, or changes in either direction.
  • Digital outputs can be switched on for a specified time duration, or for a value range.
  • Channels can be set up to work on modulo values, allowing for cyclically repeating outputs, and avoiding the need to configure position modulo in firmware.
  • Each channel can drive an arbitrary number of digital outputs, which can be either DOUT pins or bidirectional DIO pins configured as outputs.
  • Advance compensation can be used to correct for delays in mechanical components that are controlled by digital outputs.

Reference

Compare Engines Overview

Element Graphic Description Command
Compare Engine Source The sampled value of the compare channel source. CMP#.SOURCEVAL
Phase Advance Set a time value to account for compensate for slow output devices such as relays or mechanical devices. The value of this parameter determines how long in advance the compare engine will trigger to compensate for a slow output. CMP#.ADVANCET
Modulo Clicking on the switch enables or disables Modulo. A modulo range may be added to the compare engine. Set beginning and ending range values. The sampled value after modulo is displayed (CMP#.VAL). CMP#.MODEN, CMP#.MODVAL1, CMP#.MODVAL2
Link to configuration Clicking this item will open the specific Compare Engine configuration. n/a
Output for compare result Click the Plus button to add and configure the Digital Output. More than one output may be defined. Click the Minus button to remove the output. Clicking on the name of an output opens the associated view. DOUTx or DIOx

Configure Digital Output

This window is opened when the Plus button is clicked in the Compare Engines view, enabling you to define the output type and the specific output.

Element Description Command
Choose Output Type Select Output to use DOUT or Bidirectional to use DIO. n/a
Choose Digital Output Select an available ID n/a
Source Displays the source based on the output selected. DOUT#.SOURCE or DIO#.SOURCE
Source ID Displays the source based on the output selected. DOUT#.SOURCEID or DIO#.SOURCEID
Configure Digital Output Direction Shown when using a Bidirectional output type. DIO#.DIR

Configure Compare Engine #

Each compare engine may be set with up to eight comparator properties which get fed into the output. The view for each engine shows the

  1. Current position with modulo
  2. Comparison value
  3. Pulse width
  4. Edit comparator properties
Element Graphic Description Command
Edit Comparator Properties         Clicking this button shows the Comparator Configuration. The graphic displays the Mode at the top with Single Shot (), or Continuous (), or Continuous with armed setpoint () and the Direction at the bottom with Increasing Velocity (), Decreasing Velocity () or Both ().  
Comparator Configuration Mode

Sets the automatic rearming behavior for the setpoint. It determines whether CMP#.ARM resets to:

  • 0 - Disable rearming after a compare event

  • 1 - Enable continuous rearming

  • 2 - Enable continuous autoarrm (continuous rearming plus arming of the setpoint on startup)

CMP#.REARM
Direction Sets the direction the source value must change through the setpoint start value in order to satisfy the comparison and set the digital output. CMP#.DIR
Setpoint Specifies the starting value for the setpoint. CMP#.STARTVAL
Pulse Type Set the width-type for a Compare setpoint. The width-type determines whether the width of the Compare pulse is in position counts or units of time (milliseconds). CMP#.WIDTHTYPE
Pulse Width

This field sets the duration of the output pulse generated by the setpoint. It is specified as a time duration or as a value (position) width, depending on the Pulse Type setting:

  • Pulse Type = 0 - Source: The pulse remains active until the Compare Engine Source value changes by Pulse Width. The units of Pulse Width are the same as those of the Compare Engine Source.

  • Pulse Type = 1 - Time: The pulse remains active for the time duration specified by Pulse Width.

"CMP#.WIDTHVAL" or CMP#.WIDTHT
Arm State Arm or disarm a Compare setpoint. The setpoint value will only be compared against the Compare source if that setpoint is armed. If they match, an output pulse will be generated. CMP#.ARM
Arm All Clicking this button readies all of the configured compartors n/a
Output for compare result Click the Plus button to add and configure the Digital Output. More than one output may be defined. Click the Minus button to remove the output. Clicking on the name of an output opens the associated view. DOUTx or DIOx