Notes on the documentation

This description is only intended for the use of trained specialists in control and automation engineering who are familiar with the applicable national standards.
It is essential that the following notes and explanations are followed when installing and commissioning these components.

The responsible staff must ensure that the application or use of the products described satisfy all the requirements for safety, including all the relevant laws, regulations, guidelines and standards.

Disclaimer

The documentation has been prepared with care. The products described are, however, constantly under development.
For that reason the documentation is not in every case checked for consistency with performance data, standards or other characteristics.
In the event that it contains technical or editorial errors, we retain the right to make alterations at any time and without warning.
No claims for the modification of products that have already been supplied may be made on the basis of the data, diagrams and descriptions in this documentation.

Trademarks

Beckhoff®, TwinCAT®, EtherCAT®, Safety over EtherCAT®, TwinSAFE® and XFC® are registered trademarks of and licensed by Beckhoff Automation GmbH.
Other designations used in this publication may be trademarks whose use by third parties for their own purposes could violate the rights of the owners.

Patent Pending

The TwinCAT Technology is covered, including but not limited to the following patent applications and patents:
EP0851348, US6167425 with corresponding applications or registrations in various other countries.

Copyright

© Beckhoff Automation GmbH & Co. KG, Germany.
The reproduction, distribution and utilization of this document as well as the communication of its contents to others without express authorization are prohibited.
Offenders will be held liable for the payment of damages. All rights reserved in the event of the grant of a patent, utility model or design.


Probe Analysis with AX2000-B200 (Lightbus)

TwinCAT NC Touch Probe

Probe Analysis with AX2xxx-B200 (Lightbus)

The AX2000 and AX2500 drive series with Lightbus interface (AX2xxx-B200) is able to latch position data using one of its digital inputs. To use this feature a few preparing steps inside the TwinCAT System Manager are required.

At first the Variable I/O Data flag has to be enabled on the drive's AX2xxx tab. Due to this flag the drive's I/O interface changes and some additional variables which are necessary for the probe function will be added. After setting this flag, the drive can be linked to a NC axis.

Keep the Optimized Telegram Count flag disabled in this case, otherwise the probe information will be removed from the data set again.

The AX2000 drive has 4 digital inputs but only digital input 2 can be used to trigger the latch. The digital input 2 has to be configured as a trigger input before. This can be done A) with the configuration software Drive, supplied with each drive, B) by using the AX2xxx-B200 Online tab in the TwinCAT System Manager or C) by ASCII commands when using the MS Windows HyperTerminal..

To enable the Position Latch mode submit the IN2MODE command with a parameter value of 26. After doing so, use the SAVE and COLDSTART command to store this data permanently in the EEPROM area of the drive.

PLC Program Sequence

The drive is now prepared for latching position data. The PLC program is supposed to handle a probing sequence using a set of NC ADS functions.

  1. Enable the probe function using an ADSWRITE command.
    The latch can be configured to wait for a rising edge or a falling edge of the trigger signal.
    Enable rising edge: ADS encoder function, IDXGRP 16#5200+EncoderID, IDXOFFS 16#201
    Enable falling edge: ADS encoder function, IDXGRP 16#5200+EncoderID, IDXOFFS 16#202
  2. Monitor the Latch Valid flag (bit 16) in the axis' cyclical interface which signals that the latch has been triggered. The flag can also be read using the library function AxisExternalLatchValid.
  3. After the latch got valid, read the probe value using and ADSREAD command.
    Read position value: ADS encoder state, IDXGRP 16#5100+ EncoderID , IDXOFFS 16#205
    Continue with step 1 to latch the next position value.

Keep in mind that an axis reset operation will deactivate the latch function. This is important while waiting for the Latch Valid flag. After an axis reset the valid flag will not turn on until the latch is enabled again. The Latch Enabled status can optionally be read from time to time while waiting for the Latch Valid flag (ADS encoder state, IDXGRP 16#5100+ EncoderID , IDXOFFS 16#201)

A typical PLC application uses port 500 to communicate with the NC via ADSREAD or ADSWRITE commands. For high speed applications port 501 of the NC-SAF task can be used as well. In case of using port 501 it is recommended to have a fast PLC task synchronized with the the NC-SAF cycle time (e. g. 2ms). Such a configuration can handle an ADS command in 2 to 3 cycles which typically means 4 to 6 ms.

PLC Function Block

The program sequence described above can be easily executed using the PLC function block MC_TouchProbe which is part of the TcMC.lib PLC library.


Probe Analysis with AX2000-B750 (SERCOS)

TwinCAT NC Touch Probe

Probe Analysis with AX2xxx-B750 (SERCOS)

The AX2000 and AX2500 drive series with SERCOS interface (AX2xxx-B750) is able to latch position data using one of its digital inputs. To use this feature, a few preparing steps inside the TwinCAT System Manager are required.

Adding Status Information To The SERCOS Actual Channel

IDN 130

Add IDN 130 to the drive's Actual Channel. Then link the drive to a logical NC axis. It is important to link the drive after adding IDN 130. When the drive was already linked before, remove the link and then link the NC axis again to the drive.

Alternatively, IDN 131, IDN 132 and IDN 133 can be added to the Actual Channel.

Setting SERCOS parameters

The configuration of the digital trigger input is done by parameterizing a set of SERCOS IDNs. These IDNs can be set in the SERCOS online menu of the drive or they can be downloaded on startup by adding them to the SERCOS "Startup" list like it is done below.

IDN 303

TwinCAT uses the real-time bit 2 for the latch function. IDN 303 (Allocation of real-time control bit 2) has to be set to 405 when probe 1 is used or to 406 when using probe 2.

IDN 307

IDN 307 (Allocation of real-time status bit 2) has to be set to 409 when probe 1 is used or to 411 when using probe 2.

IDN 169

The probe control parameter IDN 169 defines the trigger signal edge. The value written to IDN 169 is a binary combination of the lower 4 bits. A value of 1 defines a rising edge at probe 1.

IDN P3001

The AX2000 drive has 4 digital inputs but only digital input 2 can be used to trigger the latch. The digital input 2 has to be configured as a trigger input before. This can be done by setting IDN 3001 to a value of 26. P-0-3001 is not listed in the New.. SERCOS Value dialog box but it can be added manually as shown on the picture below.

PLC Program

The drive is now prepared for latching position data. The PLC program is supposed to handle a probing sequence using a set of NC ADS functions. The following procedure expects the SERCOS bus being in phase 4.

IDN 170

IDN 170 starts the probe procedure. A value written to IDN 170 cannot be stored permanently in the drive and it is not possible to add it to the SERCOS Startup list. The PLC program is supposed to download a value of 3 into this parameter.

Program Sequence

  1. Write a value of 3 into IDN 170 using the function block IOF_SER_IDN_Write. This step is necessary only once on startup.
  2. Enable the probe function using an ADSWRITE command with the NC port number.
    The latch can be configured to wait for a rising edge or to wait for a falling edge of the trigger signal.
    Enable rising edge: ADS encoder function, IDXGRP 16#5200+EncoderID, IDXOFFS 16#201
    Enable falling edge: ADS encoder function, IDXGRP 16#5200+EncoderID, IDXOFFS 16#202
  3. Monitor the Latch Valid flag in the axis' cyclical interface which signals that the latch has been triggered. The flag can also be read using the library function AxisExternalLatchValid.
  4. After the latch got valid, read the probe value using an ADSREAD command.
    Read position value: ADS encoder state, IDXGRP 16#5100+EncoderID, IDXOFFS 16#205
    Continue with step 3 to latch the next position value.

Keep in mind that an axis reset operation will deactivate the probe function. This is important while waiting for the Latch Valid flag. After an axis reset the valid flag will not turn on until the latch is enabled again. The Latch Enabled status can optionally be read from time to time while waiting for the Latch Valid flag (ADS encoder state, IDXGRP 16#5100+EncoderID, IDXOFFS 16#201).

A typical PLC application uses port 500 to communicate with the NC via ADSREAD or ADSWRITE commands. For high speed applications also port 501 of the NC-SAF task can be used. In case of using port 501 it is recommended to have a fast PLC task synchronized with the the NC-SAF cycle time (e. g. 2ms). Such a configuration can handle an ADS command in 2 to 3 cycles which typically means 4 to 6 ms.

PLC Function Block

The program sequence described above, except step 1 (writing of IDN 170), can be easily executed using the PLC function block MC_TouchProbe which is part of the TcMC.lib PLC library.