This lesson provides a comprehensive guide to implementing high-speed encoder feedback on Micro800 series PLCs.

You will learn the entire workflow from physical installation and proper shielding to configuring the High-Speed Counter (HSC) in Connected Components Workbench, while also covering the practical math required to calculate speed and the necessary programming logic to handle data rollover during continuous operation.

1. Hardware Setup and Signal Logic

The Micro850 utilizes built-in high-speed inputs (HSI), while the Micro820 requires a 2080-MOT-HSC module. Encoders must be wired using shielded cables to maintain signal integrity. Encoders generate two signals, A and B, which are phase-shifted by 90 degrees. The PLC uses this phase shift to distinguish between forward and reverse rotation, allowing for accurate position tracking.

2. HSC Configuration and Programming

Within Connected Components Workbench (CCW), you must enable the HSC function and choose your operating mode (e.g., Pulse/Direction or Quadrature). Input filtering should be configured to eliminate noise without sacrificing the high-frequency pulse data. Once configured, you can process the data using Function Blocks or Structured Text. Using Structured Text is often more efficient for arithmetic operations, such as scaling or calculating the rate of change.

3. Calculating Rate of Change

To determine speed, you must measure the change in pulses over a fixed time interval. By storing the "previous count" in a variable and performing a subtraction against the "current count" every scan, you can derive velocity. The formula is:

Rate Calculation Formula:

Rate =
ΔCount
ΔTime
× Scaling Factor

Delta Logic Layout:

ΔCount = CurrentCount - PreviousCount

ΔTime = SampleTime - LastSampleTime

4. Managing Encoder Rollover

Every counter has a finite limit based on its data type (e.g., 32-bit signed integer). When the encoder reaches this limit, it will "roll over" to zero or the maximum negative value.

  • The Problem: If your code assumes a linear, ever-increasing number, a rollover will cause your machine to lose its position reference or trigger a false fault.

  • The Solution: You must program logic to detect this jump. In Structured Text, you can compare the current count to the previous one; if the change is physically impossible based on your expected maximum speed, the code can recognize the rollover and adjust the cumulative position tracking variable accordingly, ensuring seamless operation.