Using Counters

Both the Communication Digital I/O and Sensor Digital I/O modules are equipped with quadrature and edge counters. Only one counter on the entire motion control module can be enabled at a time. That is, if an edge counter on the Communication Digital I/O is enabled, then no counters on the other module can be enabled.

 

Edge Counters Explained

An edge counter counts the rising and falling edges of an incoming square wave. Therefore, if the input wave has a frequency of 1000Hz (has a rising edge 1000 times a second), then an edge counter will register 2000 counts per second (because it counts both rising and falling edges). An edge counter cannot determine direction as a quadrature counter can.

On this motion controller, the input for an edge counter is input 17 on both digital I/O modules.

Note: Because of the 250µs filter on input 17, the maximum input frequency is 2000Hz. This translates to 4000 counts per second using the edge counter.

 

Quadrature Counters Explained

A quadrature counter counts transitions on two square waves. The inputs, labeled A and B, are 90 degrees out of phase. If the input A phase is leading the B phase, then this counter increases, and if the B phase leads the A phase, then the counter decreases. This type of counter is often used on belts to determine both the speed and direction of a belt. If the A and B signals have a frequency of 1000Hz (they each have 1000 rising edges a second), then the quadrature counter will register 4000 counts per second (because it counts both rising and falling edges on both signals).

On the RMC, inputs A and B are inputs 16 and 17 respectively on both digital I/O module.

Note: Because of the 250µs filter on inputs 16 and 17, the maximum input frequency is 2000Hz. This translates to 8000 counts per second using the quadrature counter.

 

Using Counters

There are currently two primary uses for counters on the motion controller:

  1. They can be used to delay based on an input when using the Event Step table using the DelayTicks (d) link type.

  2. They can be used to move through Splines.

 

Enabling a Counter

Counters are configured as described below. Notice that for the Communication Digital I/O, you must not be using Parallel Position mode. The current counter configuration is stored in the Flash and is only read from the Flash on power-up.

To enable or disable a counter:

  1. On the Tools menu, click Module Configuration.

  2. In the Slots list, click the DI/O item you wish to edit. This may be either a Communication or Sensor DI/O.

  3. Click Slot options.

  4. Under Counter type, click the appropriate option. Notice that this area will be unavailable if the Communication DI/O is in Parallel Position mode as counters are not supported in that case.

  5. Click Update RMC.

  6. The Update Module Configuration dialog box will be displayed to indicate the progress. If the module could not be reset automatically, you may be prompted to reset the module manually.

 


Copyright (c) 1997-2015 by Delta Computer Systems, Inc.