This content is not available in your preferred language.

The content is shown in another available language. Your browser may include features that can help translate the text.

How Can I Use an Absolute Encoder with NI SoftMotion?

Updated Apr 24, 2023

Environment

Hardware

  • NI-951X
  • NI-950X
  • Kollmorgen Drive and Motor Cable

Software

  • LabVIEW SoftMotion Module

I would like to use an absolute encoder for position feedback in my motion system.  How can I use this encoder with NI SoftMotion?

While NI SoftMotion's examples and the NI 951x C Series Drive Interface Modules only natively support incremental quadrature encoders, there are two methods of using an absolute encoder with your NI SoftMotion application. They are described in detail below.

Using Absolute Encoders with a SoftMotion User Defined Variable (UDV) Axis 

NI SoftMotion UDV axes allow the implementation of control loops, feedback, and I/O to be customized on the FPGA. Using hardware such as the NI 950x C Series Drive Modules which allow for direct connection to a compatible motor, the FPGA bitfile can be customized to accept absolute encoder feedback by changing the feedback loop, which is a quadrature encoder decoder in the examples. 

The screenshot below shows the encoder loop from the top-level FPGA VI in the NI 9502 Brushless Servo Position Setpoint sample project.  This project, as well as other NI SoftMotion sample projects, can be accessed by creating a new project from the LabVIEW splash screen when the NI SoftMotion module is installed and activated*. 



The logic in this loop is used to decode an incremental quadrature encoder signal into both position and velocity feedback. To use an absolute encoder instead, replace the I/O and logic in this loop with the I/O and logic used to decode the absolute encoder signal into the same position and velocity feedback signals.

Using Absolute Encoders with the Kollmorgen EtherCAT AKD Servo Drive 

The AKD will need to be properly configured to use the feedback source using Kollmorgen WorkBench. Once the feedback is configured, the AKD reports this position feedback using an EtherCAT object that can be read by your LabVIEW application. The EtherCAT master converts the object into a shared variable called Inputs-Position Actual Internal Value. The screenshot below shows the location of this variable in a LabVIEW project containing an EtherCAT AKD. 

Because the drive uses the absolute position for its internal control loops, you must ensure that the NI SoftMotion axis position is updated with this position. At application start up, the SoftMotion engine initializes the absolute position value for all axes to zero. However, as part of an application's initialization procedure, you can read the AKD's position object and reset the NI SoftMotion Axis position to that value. The code snippet below shows a simplified initialization procedure. 

*The NI SoftMotion sample projects are available in SoftMotion 2014 SP1 and later. If using an earlier version, similar examples can be found in the NI Example Finder.

Additional Information

SoftMotion User Defined Variable

Many absolute encoders report a position reading through a high speed serial interface, such as EnDat or BiSS C. Using LabVIEW FPGA and an appropriate C Series hardware module you can acquire and decode the encoder signal. A high speed digital I/O module, such as the NI 9411, would likely be appropriate; alternatively, S.E.A. developed custom cRIO I/O modules that allow direct reads of EnDat and BiSS C signals. Please refer to the related links section for more information on these third-party products and for a full list of third-party cRIO products. 

Absolute Encoders with the Kollmorgen EtherCAT AKD Servo Drive

Some smart drives, such as the Kollmorgen AKD, are capable of decoding a variety of position feedback types, including many common absolute encoder buses. For a full list of the AKD's supported feedback types, refer to the Feedback Connection section of the AKD Installation Manual in the related links below. 

Regardless of the type of feedback or custom scaled units in Kollmorgen WorkBench, the AKD will scale the units of Inputs-Position Actual Internal Value variable to 2^20 (or 1,048,576) counts per revolution. If using a linear permanent magnet motor, the units will be 2^20 counts per magnetic pole pitch. 

Note that if you want to alter the SoftMotion axis properties such that position is scaled to a unit other than counts (revolutions, centimeters, etc.), you will need to manually perform the same scaling to the value read from the Inputs-Position Actual Internal Value variable before using it to reset the SoftMotion axis position. This process ensures that the SoftMotion axis position matches the absolute position reported by the absolute encoder. From that point forward, the absolute position used by NI SoftMotion will match that of the absolute encoder.