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 documentation and the following notes and explanations are followed when installing and commissioning the components.

It is the duty of the technical personnel to use the documentation published at the respective time of each installation and commissioning.

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.
We reserve the right to revise and change the documentation at any time and without prior announcement.
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®, EtherCAT G®, EtherCAT G10®, EtherCAT P®, Safety over EtherCAT®, TwinSAFE®, XFC®, XTS® and XPlanar® 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 EtherCAT Technology is covered, including but not limited to the following patent applications and patents:
EP1590927, EP1789857, EP1456722, EP2137893, DE102015105702
with corresponding applications or registrations in various other countries.

EtherCAT® is registered trademark and patented technology, licensed by Beckhoff Automation GmbH, Germany.

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.


Installation Sequence

Minimum Requirements:

  • Beckhoff TwinCAT 2.9 Build 1025
  • Beckhoff TwinCAT DriveCOM OPC Server 4.0.0.60
  • Beckhoff FC310x Profibus Master with Firmware 2.56
    or
    Beckhoff CX1500-M310 Profibus Master with Firmware 2.57
  • Siemens SimoComU 08.01.03 to access Siemens SimuDrives 611U drives
    or
    Siemens DriveMonitor V5.3 SP3 to access Siemens MasterVC Plus drives
  • Siemens 611u with firmware version 07.01.03

Installation sequence overview

1. Install TwinCAT

2. Install TwinCAT DriveCom OPC Server

3. Install SimoComU software

4. Add and configure the Profibus Master in the System Manager
(See TwinCAT Profibus Master Configuration)

5. Add and configure the ProfiDrives in the System Manager
(See TwinCAT ProfiDrive Configuration)

6. Add and configure the NC-Axes in the System Manager
(See TwinCAT NC Configuration)

7. Activate configuration

8. Configure the TwinCAT DriveCOM OPC server
(See TwinCAT DriveCOM OPC Configuration)

9. Configure the SimoComU software to work with TwinCAT DriveCOM OPC
(See SimoComU OPC Configuration)

10. Configure the ProfiDrive in SimoComU via OPC
(See SimoComU ProfiDrive Configuration)


Beckhoff TwinCAT

TS6370 | TwinCAT DriveCOM OPC Server

Overview

TwinCAT DriveCOM : The wish

TwinCAT DriveCOM : The specs

TwinCAT DriveCOM : The Profibus DPV1 OPC server spec

TwinCAT DriveCOM : The existing solution 1/2

TwinCAT DriveCOM : The existing solution 2/2


TwinCAT NC Configuration

TwinCAT NC - Configuration for ProfiDrives

1. Add NC axis

Add to the NC axes a "Continuous Axis" for each ProfiDrive, e.g. the NC-Task 1 has to be added if it is not yet there.

2. Select Axis Type

Select the Axis Type "ProfiDrive MC".

3. Link NC Axis to ProfiDrive

Link each NC Axis to a ProfiDrive (Double drives have one axis number but two channels, first "A" and second "B").

4. Necessary Encoder Settings

4.1 Encoder Scaling

Setup the NC Scaling Factor to a value that represents the amount of mm that the load moves with one encoder increment (Position feedback over the Profibus). The gearbox and the spindle pitch can be setup in the drive (see Mechanics of SimoComU ProfiDrive Configuration) or be part of the NC encoder scaling factor, but only in one place.

The NC-Axis Encoder-Scaling-factor can be calculated with the following formula:

          Scaling
factor = 1 / (Increments Per Revolution / feedconstant)

Example:

    feedconstant              = 10 mm/rev

    Increments per Revolution = 2097152 INC/rev

Scaling factor = 1 / (2097152[INC/rev] / 10[mm/rev]) =
0.00000476837158203 [mm/INC]

See chapter "5. NC ProfiDrive Settings" for calculation of increments per revolution.

4.2 Encoder Bit Rejection Filter Mask

The position feedback is smoothed by rejecting (ignoring) the lowest 11bits of the position feedback. The smoothing algorithm uses the "Encoder bit rejection filter mask" with the default value 0x7FFh for that. This is only useful for Encoders with a high number of lines (i.e. 1024, 2048) plus 11 bit of fine resolution.

When using encoders with a low number of lines (i.e. 32) or a smaller fine resolution, this filter mask value has to be set to a lower value (i.e. 0). If to many bits are rejected, the the NC sees steps in the position feedback. This causes a bigger following error (lag distance) and the axis might vibrate violently, especially in combination with telegram type 5 or 105 (Dynamic Stiffness Control).

4.3 Encoder Reference System

The 611u can report two position feedbacks per encoder, the incremental position value is always reported in Gx_XIST1, the absolute position value is on demand reported in Gx_XIST2. When using an absolute encoder, then the reference system has to be set to ABS or ABS_MODULO, otherwise to INC. In case of ABS or ABS_MODULO the NC is requesting the absolute position value from the drive.

With INC the drive resets the position to 0 after powerup regardless of the physically position of the axis. This is a pure incremental behavior. All overflows of the 32bit position feedback (hard increments) are counted and added to the 64bit encoder soft incremets.

With ABS the real absolute position (hard increments) is used in the NC and directly extended to 64bits encoder soft incremets. The overflow of the hard increments causes a maximum following error of 32bits and is not permitted.

With ABS_MODULO the NC keeps track of the overflows of the 32bit position value (hard increments) and extends it properly to 64bits. Multiple overflows are possible. This mode is similar to the SERCOS position feedback. Attention: If the NC (TwinCAT System) is stopped the it always starts up as if there was no overflow. If the hard increment is between 0x80000000 and 0xFFFFFFFF then the NC takes it as a negative position and sets the overflow counter to -1.

E.g. the "Expert Mode (IQ)" of the System Manager has to be activated to see the Encoder Bit Rejection Filter Mask parameter.

5. NC ProfiDrive Settings

5.1 Using an Encoder

The encoder setup for ProfiDrives is done on the NC axis ProfiDrive tab. When using an encoder, then the radio button "Encoder (P1005)" has to be selected. By this selection the multiplier for the encoder lines is automatically preset with 0x0800 (dec. 2048). This factor (fine resolution, P1043) might be different for other drives then the 611u.

Additionally the amount of encoder lines has to be set up for the calculation of the ProfiDrive Encoder Scaling. The amount of encoder lines is located in the drive parameter P1005. The value of parameter P1005 can be looked up on the Drive Online tab and has to be entered into the edit box beside "Incs/Rot (P1005):".

The ProfiDrive Velocity Scaling is located in the drive parameter P880 and tells the NC about how to scale the velocity setpoint. The value of parameter P880 can be looked up on the Drive Online taband has to be entered into the edit box beside "Speed evaluation (P0880)".

The System Manager currently calculates the output scaling according to the following formula:

      Output Scale := 60        /
((P1005 * 0x0800) /
(0x40000000 / P880     ))
[sec/Inc]    := [sec/min]
/ (([Inc/rot])      / (         1 / [rot/min]))

To prove the output scale that the System Manager has calculated, the steps in the chapters 5.1.1 to 5.1.3 should be executed. If this leeds to a different result, then the output scale on the ProfiDrive tab has to be overwritten with the manually calculated value. But any change of the parameters in the formula on the ProfiDrive tab forces automatically a new calculation of the output scale with the formula above. A manually entered output scale will be overwritten.

5.1.1 Calculate increments per revolution

The parameter P979 Encoder Format contains the information needed, to calculate the increments per revolution. To choose the proper sub index, it has to be destinguished between "IM" inderect measurement (on the motor, uses G1) and "DM" direct measuurement (on the load, uses G2) and if the NC Reference System is set to "INC" incremental (uses XIST1) or "ABS"/"ABS MODULO" absolut (uses XIST2).

For simplification the following assumption are made:
- Gearbox ratio in the 611u is set 1:1 (P237, P238)
- XIST3 is not used

Depending on these two selections the formular to calculate the increments per revolution looks like one of the following:

Encoder on the motor:

    Incremental Position (G1_XIST1)

        Increments per revolution = Encoder Resolution P979:3  * 2^
Shift Factor Signal P979:4

    Absolut Position (G1_XIST2)

        Increments per revolution = Encoder Resolution P979:3  * 2^
Shift Factor Abs P979:5

Encoder on the load:

    Incremental Position (G2_XIST1)

        Increments per revolution = Encoder Resolution P979:13 * 2^
Shift Factor Signal P979:14

    Absolut Position (G2_XIST2)

        Increments per revolution = Encoder Resolution P979:13 * 2^
Shift Factor Abs P979:15

Encoder with 2048 lines on the motor, incremental value, 11bit fine
resolution (P979:4 = 11):

        Increments per revolution = Encoder Resolution P979:3  * 2^
Shift Factor Signal P979:4

        Increments per revolution = 0x00000800 * 2^11    = 2^11 *
2^11 = 2^22 = 4194304 = 0x00400000

5.1.2 Calculate output scaling

The output scaling on the ProfiDrive tab can be calculated in the following way:

          Output
Scale = 60[s/min] / (IncPerRev / (0x40000000 /Speed Evaluation P880
[rev/min]))

          Example

    Speed Evaluation P880 = 16384 = 0x00004000

    Increments per revolution = 4194304 = 0x00400000 INC/rev

            Output
Scale

          = 60[s/min] / (0x00400000[INC/rev] /
(0x40000000 / 0x00004000[rev/min]))

            Output Scale

          =
60[s/min] /  64[INC/min] = 0.9375 [s/INC]

5.1.3 Check output scaling

The test can only be done if the axis can move a short distance with constant velocity. Attention, if the scaling is wrong or the tuning is to agressive, the axis might take off fast and slamm hard into the bumper!

To check the output scale the NC axis has carefully to be moved by the NC with a slow speed, with no proportional gain in the NC (Kv = 0). If the axis can follow the setpoint speed without increasing following error, then the output scaling is set properly.

            Example

    Increments per revolution = 4194304 [INC/rev]

    Output Scaling = 0.9375 [s/INC]

    Feed constant = 10mm/rev

        Setpoint speed of 10 mm/s = 1rps  =  60rpm

        NSOLL_B = 0x003C0000 =  3932160

        3932160 / 0.9375 [s/INC] =  4194304 [INC/s] =  1 * 2^22 =
 1rps =  10mm/s

5.2 Using a Resolver

The encoder setup for ProfiDrives is done on the NC axis ProfiDrive tab. When using a resolver, then the radio button "Resolver (P1018)" has to be selected. By this selection the multiplier for the encoder lines is automatically preset with 0x0400 (dec. 1024). This factor (fine resolution, P1043) might be different for other drives then the 611u.

Additionally the amount of pole pairs has to be set up for the calculation of the ProfiDrive Encoder Scaling. The amount of pole pairs is located in the drive parameter P1018. The value of parameter P1018 can be looked up on the Drive Online tab and has to be entered into the edit box beside "Incs/Rot (P1018):".

The ProfiDrive Velocity Scaling is located in the drive parameter P880 and tells the NC about how to scale the velocity setpoint. The value of parameter P880 can be looked up on the Drive Online taband has to be entered into the edit box beside "Speed evaluation (P0880)".

The System Manager currently might calculate the output scaling according to the following wrong formula:

      Output Scale := 60        /
((P1018 * 0x0400) /
(0x40000000 / P880     ))
[sec/Inc]    := [sec/min]
/ (([Inc/rot])      / (         1 / [rot/min]))

This automatically calculated output scale, has to be overwritten manually. Follow the steps in the chapters 5.2.1 to 5.2.3, then overwrite the output scale on the ProfiDrive tab with the manually calculated value. But any change of the parameters in the formula on the ProfiDrive tab forces automatically a new calculation of the output scale with the formula above. A manually entered output scale will be overwritten.

5.2.1 Calculate increments per revolution

The parameter P979 Encoder Format contains the information needed, to calculate the increments per revolution. To choose the proper sub index, it has to be destinguished between "IM" inderect measurement (on the motor, uses G1) and "DM" direct measuurement (on the load, uses G2) and if the NC Reference System is set to "INC" incremental (uses XIST1) or "ABS"/"ABS MODULO" absolut (uses XIST2).

For simplification the following assumption are made:
- Gearbox ratio in the 611u is set 1:1 (P237, P238)
- XIST3 is not used

Depending on these two selections the formular to calculate the increments per revolution looks like one of the following:

Resolver on the motor:

    Incremental Position (G1_XIST1)

        Increments per revolution = Encoder Resolution P979:3  * 2^
Shift Factor Signal P979:4

    Absolut Position (G1_XIST2)

        Increments per revolution = Encoder Resolution P979:3  * 2^
Shift Factor Abs P979:5

Resolver on the load:

    Incremental Position (G2_XIST1)

        Increments per revolution = Encoder Resolution P979:13 * 2^
Shift Factor Signal P979:14

    Absolut Position (G2_XIST2)

        Increments per revolution = Encoder Resolution P979:13 * 2^
Shift Factor Abs P979:15

Example Resolver 12bit (P1011.2 = 0) on the motor, incremental
value, 11bit fine resolution (P979:4 = 11):

        Increments per revolution = Encoder Resolution P979:3  * 2^
Shift Factor Signal P979:4

        Increments per revolution = 0x00000400 * 2^11    = 2^10 *
2^11 = 2^21 = 2097152 = 0x00200000

Example Resolver 14bit (P1011.2 = 1) on the motor, incremental
value, 11bit fine resolution (P979:4 = 11):

        Increments per revolution = Encoder Resolution P979:3  * 2^
Shift Factor Signal P979:4

        Increments per revolution = 0x00001000 * 2^11    = 2^12 *
2^11 = 2^23 = 8388608 = 0x00800000

5.2.2 Calculate output scaling

The output scaling on the ProfiDrive tab can be calculated in the following way:

        Output
Scale = 60[s/min] / (IncPerRev / (0x40000000 /Speed Evaluation P880
[rev/min]))

        Example

    Speed Evaluation P880 = 16384 = 0x00004000

    Increments per revolution = 8388608 = 0x00800000 INC/rev

          Output
Scale

        = 60[s/min] / (0x00800000[INC/rev] /
(0x40000000 / 0x00004000[rev/min]))

          Output Scale

        = 60[s/min] /
128[INC/min] = 0.46875 [s/INC]

Example

    Speed Evaluation P880 = 16384 = 0x00004000

    Increments per revolution = 4194304 = 0x00400000 INC/rev

          Output
Scale

        = 60[s/min] / (0x00400000[INC/rev] /
(0x40000000 / 0x00004000[rev/min]))

          Output Scale

        = 60[s/min] /
64[INC/min] = 0.9375 [s/INC]

5.2.3 Check output scaling

The test can only be done if the axis can move a short distance with constant velocity. Attention, if the scaling is wrong or the tuning is to agressive, the axis might take off fast and slamm hard into the bumper!

To check the output scale the NC axis has carefully to be moved by the NC with a slow speed, with no proportional gain in the NC (Kv = 0). If the axis can follow the setpoint speed without increasing following error, then the output scaling is set properly.

        Example

    Increments per revolution = 2097152 [INC/rev]

    Output Scaling = 1.875 [s/INC]

    Feed constant = 10mm/rev

        Setpoint speed of 10 mm/s = 1rps  =  60rpm

        NSOLL_B = 0x003C0000 =  3932160

        3932160 / 1.875 [s/INC] =  2097252 [INC/s] =  1 * 2^21 =
1rps  =  10mm/s

        Example

    Increments per revolution = 8388608 [INC/rev]

    Output Scaling = 0.46875 [s/INC]

    Feed constant = 10mm/rev

        Setpoint speed of 10 mm/s = 1rps  =  60rpm

        NSOLL_B = 0x003C0000 =  3932160

        3932160 / 0.46875 [s/INC] =  8388608 [INC/s] =  1 * 2^23 =
 1rps =  10mm/s

6. Telegram Types 3, 5 (DSC) and 0 (Configurable)

6.1 Position Loop in the NC (Telegram 3 or 102)

The position loop gain is setup as Controller Kv-Factor on the NC axis online tab. For a closed position loop this parameter has to be bigger than 0.

6.2 Position Loop in the Drive (Telegram 5 or 105 with Dynamic Stiffness Control)

In Telegram 5 or 105 there are the following error (position lag) and a position gain setpoint value parts of the setpoint telegram. The Dynamic Stiffness Control of the ProfiDrive uses those parameters to minimize the position error and to close the position loop in the drive.

If the ProfiDrive Position Gain (KPC) is set to 0 then the DSC mode is switched off. If the ProfiDrive Position Gain (KPC) is bigger than the DSC mode is switched on. The KPC has to be setup carefully becaus if the gain is too big, then the axis can start to vibrate violently. This could harm the operator or destroy the attached hardware.

To get a stiffer position control and a better positioning this KPC has to be increased.

If the secondary encoder on the load is used (G2_XISTx) then the scaling factor for the following error Xerr has to be setup properly since the drive internally has to convert the NC position to an internal scaling. If the primary encoder is used (on the motor shaft) then the scaling factor for the following error Xerr has to be 1.

The NC runs open loop. The Controller Kv-Factor on the NC axis online tab can be set to 0. The position control is done in the drive.

6.3 Configurable Telegram 0

The telegram 0 should only be used to extend the standard telegrams 3 or 5 with additional cyclic data. In this case see for information in the chapters 6.1 (Telegram 3) or 6.2 (Telegram 5) above.

Information about setting up the configurable telegram in TwinCAT is located in chapter "5. Configurable Telegram" of TwinCAT ProfiDrive Configuration.

Information about setting up the configurable telegram in SimoComU is located in chapter "Telegram Type 0" in SimoComU ProfiDrive Configuration.

The Profibus telegram has to be setup in TwinCAT and SimoComU to the same content. The Profibus equidistant time has to be recalculated after all changes to the telegram, see TwinCAT Profibus Master Configuration.


TwinCAT Profibus Master Configuration

TwinCAT IO - Configuration of the Profibus Master

1. Add Profibus Master FC310x

2. Setup Profibus Master Card

Select Operation Mode "DP/MC (Equidistant)" with 12 MBaud, e.g. Search for the IO address of the FC310x card.
The FC310x firmware version must be 2.56 (or higher).

If drives are added or removed or the telegram type is changed, the the button Calculate MC-Times needs to be pressed. The button Activate DRIVECOM server generats a XML file for the OpcDriveCom server. Additionally the configuration tool for the OpcDriveCom server can be used. The FC3101 should be Sync Master unless there is a FC7501 Sercos Master in the I/O Configuration. In this case Sercos needs to be Sync Master and the Sync Mode has to be disabled for the FC3101. The flag Reduced MC-Jitter needs to be selected to keep the GC-Jitter below 1000ns (see MC-Diag tab).

3. ADS-NetID

The ADS NetID is used for ADS communication to the Profibus card (e.g. from the PLC or OPC).


TwinCAT Profibus Master Diagnostic

TS6370 | TwinCAT DriveCOM OPC Server

TwinCAT IO - Diagnostic of the Profibus Master

Check for the box state "No error" for each drive once the TwinCAT System is running. The status is not updated automatically, therefore press the Refresh button for an update.

Check for Profibus MC problems on the Equi-Diag tab.


TwinCAT ProfiDrive Configuration

TwinCAT IO - Configuration of ProfiDrives

1. Append a Box to the Profibus Master

2. Select the proper ProfiDrive

Choose either a single ProfiDrive MC or a double ProfiDrive MC form the Siemens AG folder.

3. ProfiBus Setup

Set the Profibus node address of the Profidrive and enable "DPV1-Class 2" service (for OPC).

4. Configure the Drive

Enable the PKW interface (needed for parameter access from PLC or OPC). This is one setting for both drives of a double drive.

Attention, the NC axis is automatically unlinked if the telegram type changes and has to be relinked, see TwinCAT NC Configuration.

4.1 Cannel A Setup

Select the telegram type for Channel A (first drive of a dual drive), i.e. Standard Telegram 5 (DSC). The parameters of the nominal channel (P915) and of the actual value channel (P916) are modified automatically. Telegram type 0 allows for a user defined telegram but STW1 and ZSW1 are mandatory as first parameter in any case.

4.2 Cannel B Setup

Select the telegram type for Channel B (second drive of a dual drive), i.e. Standard Telegram 3. The parameters of the nominal channel (P915) and of the actual value channel (P916) are modified automatically. Telegram type 0 allows for a user defined telegram but STW1 and ZSW1 are mandatory as first parameter in any case.

5. Configurable Telegram

5.1 Extend Telegrams

Add the additional parameters (like moment reduction and actual torque) to the drive with SimoComU first (see SimoComU ProfiDrive Configuration). Then check for for the Siemens parameter number online in the System Manager (i.e 50116 = actual torque).

Change the telegram type from 3 to 0. Than the "Add..." buttons for the Nominal and the Actual Values are automatically enabled.

Press "Add..." of the Nominal Values and add parameter MOMRED (101). This parameter is in the list.

The channel identifier "A_" or "B_" and the 50000 to the parameter number are added automatically after pressing OK.

Press "Add..." of the Actual Values and add parameter TORQUE_IST (116). The proper data type has to be selected. Look for parameter number and data type in SimoComU.

The channel identifier "A_" or "B_" and the 50000 to the parameter number are added automatically after pressing OK.

5.2 Extended Telegram 3

5.3 Extended Telegram 5

5.4 New cyclic Interface

Now the cyclic interface of the ProfiDrive contains the new data (i.e for torque limiting and actual torque). These values can now be linked to the PLC.


TwinCAT ProfiDrive Diagnostic

TwinCAT IO - Diagnostic of ProfiDrives

Check for the box state "No error", e.g. press refresh to update the information.

To check or modify drive parameters online, TwinCAT needs the Firmware description file xxxx.acc, i.e. for firmware version 6.1.3 the file "V_611U_060103.ACC" in the folder "C:\TwinCAT\Io\Profibus\611u". If there is no file for the actual drive firmware, then this file is generated while going online to the drive with SimoComU (see "C:\Program Files\Siemens\SimoComU\Siemens\Acc" ).

Check for parameters of drive A online.

Check for parameters of drive B online.


TwinCAT OPC Configuration

TwinCAT DriveCOM OPC-Configuration

For requirements see Installation Sequence.

Creating a configuration for the TwinCAT DriveCOM OPC Server

General the TwinCAT DriveCOm OPC Server requires a XML based configuration file which contains information about available 611U drives.

The TwinCAT DriveCOM Configurator allows to scan the currently activated TwinCAT system for Siemens 611U drives and to create the XML configuration file for the DriveCom OPC Server. The DriveCOM configurator also supports the OLE-interface which allows other applications to remotely handle the functionality DriveCom Configurator.

Requirements :

  • FC310x Profibus Interface card and 611U drives are configurated in TwinCAT System Manager
  • The System Manager configuration is activated

Quick start

Three steps to do in the DriveCOM configurator

  • Start the TwinCAT DriveCom Configurator
  • Select [image] "ScanCurrentConfig". The configurator will scan the current activated TwinCAT system configuration "Currentconfig.xml" file for 611U drives and will display the results.
  • Select [image] "Save As.." to save the scan-result in an TwinCAT DriveCOM-OPC-XML configuration file. The configurator will ask if this new created xml-file should be activated for the TwinCAT DriveCOM OPC Server.
    The new OPC DriveCOM configuration gets valid with the next TwinCAT DriveCOM-OPC-Server start.

If different TwinCAT DriveCOM XML configuration files are existing a specific file can be activated with a click on [image] "Activate".

The TreeView :

Use the tree view to select Devices or Axes. When Selected, you can check and edit the items properties (Displayed in the right pane).
When selecting the root iten ("I/O Devices"), you can choose to register the DriveCom Product.

The Right Pane :

Use the Right Pane to view or edit Item Properties or register the DriveCom product.

The Toolbar :

New File. Closes the current Document and creates a new one
Import. Opens an Existing OPC Server configuration.
Export. Creates an OPC Server configuration file.
ScanCurrentConfig. Scans the current TwinCat Configuration.
Activate. Choose an existing OPC Configuration and activate it.


Automation Interface

TcOPCDriveComCfg provides an Automation Interface to its Document, to expose its basic functionalities. The ProgId of the implementing class is "TcDriveComConfig.Document".

This interface inherits from IDispatch and is accessible both from full featured languages (e.g. VB or C++) and script languages (e.g. VBscript or Javascript).

Methods in VTable Order

TcDriveComConfig.Document Methods | Description
ScanTwinCATConfig() | Scan the current TwinCAT configuration. Returns S_OK if successfull or E_FAIL if an error occured
OpenConfiguration(BSTR* Filename) | Open an existing configuration. Returns the number of imported items or -1 if an error occured
SaveConfiguration(BSTR* Filename) | Exports the current Document to an OPC Server configuration. Returns the number of items exported or -1 if an error occured
ActivateConfiguration(BSTR* Filename) | Activates an existing configuration file. True if succeeded, or False otherwise

VB Sample

Dim Filename As String
Filename = "C:\configuration.xml"
Set TcDrvComCfg = CreateObject("TcDriveComCfg.Document")
Call TcDrvComCfg.ScanTwinCATConfig
Call TcDrvComCfg.SaveConfiguration(Filename)
Call TcDrvComCfg.ActivateConfiguration(Filename)


Description and sample TwinCAT DriveCOM OPC configuration file

A sample device block for a ProfiDrive with Profibus address 10 looks like this:

<TcOpcConfiguration
xmlns="www.beckhoff.com/Schemas/TwinCAT/Opc/TcOpcSvrCfg">

    <Namespace>
        <Devices>
          <Device>
            <Name>dp2://brd0/seg0/dev10</Name>
            <AdsNetId>172.16.3.42.3.1</AdsNetId>
            <AdsPort>4106</AdsPort>
            <AutoCfg>9</AutoCfg>
         </Device>
       </Devices>
   </Namespace>
</TcOpcConfiguration>
Tag | Data | End Tag | Description
<Name> | dp2://brd0/seg0/dev10 | </Name> | dev10 stands for the ProfiDrive with Profibus node address 10
<AdsNetId> | 172.16.3.42.3.1 | </AdsNetId> | ADS Net ID of the Profibus Master card, see ADS tab in TwinCAT Profibus Master Configuration
<AdsPort> | 4106 | </AdsPort> | ADS port of the drive, this is: = 0x1000h + Profibus Node Address = 4096 + 10 = 4106
<AutoCfg> | 9 | </AutoCfg> | 9: Siemens 611U Device activated for OPC 0: Siemens 611U Device deactivated for OPC

A sample device block for a ProfiDrive with Profibus address 11 looks like this:

<TcOpcConfiguration
xmlns="www.beckhoff.com/Schemas/TwinCAT/Opc/TcOpcSvrCfg">

    <Namespace>
        <Devices>
          <Device>
            <Name>dp2://brd0/seg0/dev11</Name>
            <AdsNetId>172.16.3.42.3.1</AdsNetId>
            <AdsPort>4107</AdsPort>
            <AutoCfg>9</AutoCfg>
         </Device>
       </Devices>
   </Namespace>
</TcOpcConfiguration>
Tag | Data | End Tag | Description
<Name> | dp2://brd0/seg0/dev11 | </Name> | dev11 stands for the ProfiDrive with Profibus node address 11
<AdsNetId> | 172.16.3.42.3.1 | </AdsNetId> | ADS Net ID of the Profibus Master card, see ADS tab in TwinCAT Profibus Master Configuration
<AdsPort> | 4107 | </AdsPort> | ADS port of the drive, this is: = 0x1000h + Profibus Node Address = 4096 + 11 = 4107
<AutoCfg> | 9 | </AutoCfg> | 9: Siemens 611U Device activated for OPC 0: Siemens 611U Device deactivated for OPC

Sample

A complete sample for the XML-File may look like this.
NOTE : Additional, not documented informations in the XML file are just optional for the DriveCom configurator.

<TcOpcConfiguration
xmlns="www.beckhoff.com/Schemas/TwinCAT/Opc/TcOpcSvrCfg">

    <Namespace>
        <Devices>
            <Device>
                <Name>dp2:/brd0/seg0/dev11</Name>

<AdsNetId>172.16.3.42.3.1</AdsNetId>
                <AdsPort>4107</AdsPort>
                <AutoCfg>9</AutoCfg>
                <ExName>Device 2
(FC310x)</ExName>
                <Type>38</Type>
                <Box>
                    <Name>Box 1 (ProfiDrive2
MC)</Name>
                    <Type>1012</Type>
                </Box>
            </Device>
    </Devices>
</Namespace></TcOpcConfiguration>


SimoComU ProfiDrive Configuration

SimoComU - ProfiDrive Configuration

Main Configuration

Profibus Address

The Profibus node address of the 611u ProfiDrive is setup on the Configuration tab. A double ProfiDrive has only one Profibus node address.

Encoder Type

The encoder type is shown on the Configuration tab. In case of an encoder, the number of encoder lines is shown on this screen and also setup in P1005. In case of a resolver is P1005 set to 0.

Expert List

The Expert List of SimoComU (Windows-Key + E, Startup | Additional Parameters | Expert List) can be used to determine the parameters P880 (Speed Evaluation) and P1005 (IM Encoder Pulse Number). Those two parameters have to be entered in the NC ProfiDrive Configuration (see TwinCAT NC Configuration).

Gearbox and Spindle Pitch

The gearbox between motor and load can be setup on the Mechanics screen. The spindle pitch is only available for linear axes.

The Gearbox and the spindle pitch must be setup only in one place, either in the drive Mechanics screen or through the NC Encoder Scaling Factor (see TwinCAT NC Configuration).

Profibus Telegram Selection

Telegram 5 (DSC)

With telegram type 5 the drive closes the position loop using the NC following error (lag) and a position gain KPC in the cyclic interface. The NC runs open loop in this case.

Telegram 3

With telegram type 3 the drive closes the velocity loop using. The NC closes the position loop in this case.

Telegram Type 0

Telegram type 0 can be used to add parameters to telegram type 3 or 5. The telegram type can be changed with the Frame Selection on the Profibus Parameterization tab. The previous content of the cyclic profibus interface remains the same. After changing the telegram type, the EEPROM has to be saved and the drive to be reset.

Now the new data can be added to the nominal values (Received Data) or to the actual values (Sent Data).

Telegram 3 to 0

Telegram 5 to 0

Auto Tuning

The ProfiDrive supports an auto tuning mechanism. For this purpose the control has to be switched to [PC!], which means the drive ignores the cyclic Profibus interface and uses a terminal signal simulation.

The auto tuning is wizard guided.

At the end of the tuning the tuning parameters have to be saved to the EEPROM.


SimoComU OPC Configuration

SimoComU - OPC Configuration

For requirements see Installation Sequence.

After the SimoComU installation the following changes have to be made:

1. Start TwinCAT with the valid Profibus configuration

2. Start SimoComU

3. Configure the OPC server communication in SimoComU (Options|Setting|Communication)

4. Select "BECKHOFF.TwinCATDriveComServerDA"

5. Search online for ProfiDrives in SimoComU

6. Configure the ProfiDrive in SimoComU via OPC


SimoComU ProfiDrive Diagnostic

SimoComU - ProfiDrive Diagnostic

Profibus Diagnostic

The Profibus diagnostics dialog shows online the incoming and outgoing telegrams incl. their data.

Telegram 3.

Telegram 0 (extended telegram 3)

Telegram 0 (extended telegram 5)

Trace

The SimoComU Trace allows to scope internal data of the drive.


RemoteSetupOnPC

Remote Setup of PC

The CX1000 has to be added to the list of remote devices of the programming PC. This is also a requirement for the remote access of the System Manager or the Plc Control. The CX1000 might already be in the list of remote devices. If not then the TwinCAT System Manager can be used to add the CX1000 as a remote device to the PC.

  • Use the button "Choose Target" in the System Configuration of the System Manager.
  • Press "Search".
  • Browse via "Broadcast Search" on the Ethernet network, if it is not found, browse once more.
  • Select the particular CX1000 (like CX_007630)
  • Add the new route (with WinCE no password is required, with XP an Administrator account with a password is required (e.g. 1).

If the CX1000 is not found, then the TwinCAT System on the PC and the TwinCAT System on the CX1000 might not be in Config Mode.

The CX1500-M310 Profibus master has also to be added to the list of remote devices of the programming PC. This can only be done via the TwinCAT Properties page of the TwinCAT icon in the Windows status bar.

  • Open the TwinCAT Properties page.
  • Select the AMS Router tab.
  • Press the Add button in the Remote Computers group box.
  • Type a new name for the connection (like CX_PBMaster).
  • Add the NetID of the CX1500-M310 Profibus Master (see System Manager file of the CX1000).
  • Add the address of the CX1000 (like CX_007630 or the TCP/IP address).
  • Select the transportation type TCP/IP.
  • Close the dialog with OK
  • Restart the TwinCAT System on the PC in Config Mode. The restart in Config Mode is required.

After all the Remote setup should look like this.

The details are shown below.

The NetID and the name of the CX1000 is automatically generated and maybe different from the picture. The NetID of CX1500-M310 Profibus Master is configured in the System Manager file of the CX1000. The fifth byte of the NetID of the Profibus Master differs from the NetID of the CX1000 and depends on the amount of devices on the CX1000.


IOConfigForCX1000

eckhoff

TwinCAT Configuration for CX1000

The CX1000 is configured remotely on the PC. The easiest way to configure the I/O is to scan devices and scan boxes in Config Mode. After scanning the Profibus Master the Operating Mode of the Profibus has to be changed to DP/MC Equidistant. In order to use Profidrives on a CX1000 it is requiered to have firmware v2.57 or higher on the profibus master.

If the 611u drives report the error "life counter set to zero" once they have been enabled, then it might be because of failed profibus cycles.

One cause is if the NC access time for the Profibus card is to low. The standard setup is 15% (= 300us at 2ms Cycle Time), this is too low for the CX-Profibus Master. The Task Access Time/Task Cycle Time should be increased. The reason for this is the TwinCAT jitter on the CX1000. Additionally the Reduced MC-Jitter flag needs to be activated and the Sync-Master for the CX1500-M1500 has to be selected. After setting up and checking the MC configuration it is required to Calculate the MC-Times.

The ADS NetID is set automatically by TwinCAT.

The profibus node address of the 611u drive is automatically scanned in.

For asynchronous communication it is required to activate the PKW interface. For the propper function of the profibus it is important to setup the telegram type of the 611u in the System Manager as it is setup in the drive. If the telegreram type is changed then this has to be done and saved in the drive and in the System Manager and the NC axes needs to be linked to the drive again. On a double drive also the telegram type of the B drive needs to be adjusted.

The Pll Window for the synchronization in the drive is set to 12 bit-times = 1us, which is the standard setup for a 611u.

The CX1500-M310 requires that the latency warning is activated. The TwinCAT jitter is higher then usual, if Profibus MC is used because TwinCAT has to adjust to the Profibus Master (Sync Master Mode). The latency warning should be set to a large value like 200us.

At the end activate the configuration on the CX1000 and start the TwinCAT System.


DriveComConfigForCX1000

eckhoff

Get the TwinCAT Configuration of the CX1000

The TcDriveComCfg tool can be used to configure the OPCDriveCOM-Server. Since the server and the configuration tool are installed on the PC it is necessary to get the CX1000-configuration file to the PC.

Put the local TwinCAT System on the PC to Config Mode and chhose either A) or B) to get the CX1000 configuration to the PC.

A) Use a memory stick or network drive to copy the C:\TwinCAT\Coot\CurrentConfig.xml and C:\TwinCAT\Coot\CurrentConfig.tsm from the CX1000 to the same folder on the PC.

B) Use the System Manager

  • Open the System Manager with a new project
  • Select the CX1000 as the target system (System Configuration | Choose Target)
  • Choose "File | Open from target", now the CX1000 configuration appears.
    The System Manager status bar shows in red "CX_00xxxxx".
  • Choose the local system as target (System Configuration | Choose Target).
    The System Manager status bar shows in gray "local".
  • Activate the CX1000 configuration to the local PC but DO NOT START the local system, press cancel when asked to restart the TwinCAT runtime system.

Now after having the CX1000 configuration on the PC in the C:\TwinCAT\Boot folder, it is not permitted to start the local system. Stay in Config Mode.

Configure the OPCDriveCom-Server

Start the TcDriveComCfg tool. Use "File | Read TwinCAT Configuration" or the Scan Configuration button in the toolbar to read the configuration data. The configuration tool now shows the CX1500-M310 Profibus Master with the propper AdsNetID and the attached drive with the propper Profibus node address. Increase the Ads Timeout to 5000ms = 5s and apply.

Save the file and activate the configuration.

Now the OPCDriveCom-Server is activated on the PC and allows for accessing the parameters of the drive by SimoComU via OPC.

Configure SimoComU

Start SimoComU and open the communication setup (Options | Settings | Communication).

All communication goes over Profibus, therefore TwinCAT System on the CX1000 needs to be running with the attached Profibus. The 611u drive needs to be running (operational) and communication with the CX1500-M310 without errors.

Choose "Communication via OPC server" and select the "BECKHOFF.TwinCATDriveComServerDA". If the server does not appear, it has to be registered. In order to register the OPCDriveCom-Server run the batch file "C:\TwinCAT\OPC\DRIVECOM Server\RegisterServer.BAT".

Search for drives online with "Go Online".

In case of problems with communication via OPC ensure that the OpcDriveCom server is stopped when the SimuComU is stopped and started when the SimuComU is started. Additionally the TcOpcClient can be used to check the access via OPC.

In case of a bad connection it is recommended to close the TwinCAT System Manager.