Basic Principles
In general, two TwinCAT software modules are required for controlling the AX5000: TwinCAT NC PTP and TwinCAT PLC.
TwinCAT NC is a closed software module whose features the user can only influence via parameters. The TwinCAT NC parameters can be set in the TwinCAT System Manager.
TwinCAT PLC is an interpreter for a program code which the user creates in the PLC Control development environment.
Structure of TwinCAT NC PTP
TwinCAT NC has 2 tasks:
- NC task 1 SPP (Set PreParation task)
- NC task 1 SEC (Set ExeCution task)
The SPP task is responsible for planning the requested traversing task. The SEC task is responsible for maintaining this path.
The traversing task leaves the PLC in the direction of the ADS router with destination NC-Task 1 SVB (NC task 1 SPP). The router relays the telegram to this task.
The NC accepts or rejects the message. The response arrives back at the calling block in the PLC via the same route. Instructions are issued based on blocks contained in TCMC.lib. Once the NC has accepted the instruction, the system tries to calculate a solution taking into account the boundary conditions (max. velocity, acceleration, deceleration, and jerk).
If a solution exists, a table containing the position (s) velocity (v), acceleration/deceleration (a) and jerk (j) for the whole travel time within the sampling time of the SEC task is transferred to the SEC.
If no solution exists, the system deviates downwards based on maximum jerk, maximum acceleration, and maximum velocity (in this order).
Actual and set values shown in the diagram are served by the 1_Enc axis and 1_Drive axis components.
Since the AX5000 is known to the system as a slave, linking can take place automatically if required. In the event of problems the link can be checked by the user.
NC set values | AX5000 set values | NC actual values | AX5000 Actual values |
---|---|---|---|
axis n_Drive / outputs/axis n_DriveOut / nOutData1 | MDT n / position set value (option) | axis n_Enc / inputs / axis 1_Enc_In / nInData1 | AT n / actual position value sensor 1 |
axis n_Drive / outputs/axis n_DriveOut / nOutData2 | MDT n / velocity set value |
|
|
axis n_Drive / outputs/axis n_DriveOut / nCtrl1 | MDT n / master control word (Hi-byte) | axis n_Drive / inputs/axis n_DriveIn / nStatus1 & nStatus2 | AT n / drive status word |
|
| axis n_Drive / inputs/axis n_DriveIn / nStatus4 | WcState' / WcState |
Structure of the AX5000 slave in the TwinCAT System Manager.
The AX5000 parameter management is based on the Sercos profile. The parameter description is based on a standardised structure.
Element 1: IDN (required)
IDN description. Bit 15 distinguishes between standard parameters (S-0-nnnn) and manufacturer-specific parameters (P-0-mmmm).
Bit | Value | Description |
---|---|---|
15 | 0 | S-0-nnnn (standard parameter) |
1 | P-0-mmmm (manufacturer-specific parameter) | |
12-14 |
| product data (manufacturer-specific) |
0-11 | 0...4095 | block number |
Element 2: Name (optional)
The name includes a brief description of the parameter in text form.
Byte 1,2 | Byte 3,4 | Byte 5, max. 64 |
---|---|---|
Current length of the name in characters (1 character = 1 byte) | maximum length of the name in characters (1 character = 1 byte) | name (max. 60 characters) |
Element 3: Attributes (required)
This double word describes the IDN properties (write protection, data type, decimal places).
Bit | Value | Description | |
---|---|---|---|
31 | - | Reserved | |
30 | 1 / 0 | Write protection in Op phase / no write protection in Op phase | |
29 | 1 / 0 | Write protection in SaveOp phase / no write protection in SaveOp phase | |
28 | 1 / 0 | Write protection in PreOp phase / no write protection in PreOp phase | |
24-27 | 0000 - 1111 | Number of decimal places for floating point numbers | |
23 | - | Reserved | |
20-22 | Value | Data type | Represented as |
000 | Binary | Binary | |
001 | Unsign Integer | Unsigned decimal | |
010 | Sign Integer | Sign decimal | |
011 | Unsign Integer | Hexadecimal | |
100 | Character string | Text | |
101 | Unsign Integer | IDN | |
110 | Floating point number | Sign decimal with exponent | |
111 | Reserved |
| |
19 | 1 / 0 | Command / Parameter. A command executes an assigned function | |
16-18 | 000 | Reserved | |
001 | Length: 2 bytes | ||
010 | Length: 4 bytes | ||
011 | Length: 8 bytes | ||
100 |
| ||
101 |
| ||
110 |
| ||
111 |
|
Element 4: Units (optional)
Byte 1,2 | Byte 3,4 | Byte 5, max. 16 |
---|---|---|
Current length of the name in characters (1 character = 1 byte) | maximum length of the name in characters (1 character = 1 byte) | Physical units max. 12 characters. |
Element 5 & 6: Min. & max. values (optional)
The limits for the associated IDN entries are specified here.
Element 7: Value (required)
Four different memory lengths are used.
- Fixed length of 2 bytes
- Fixed length of 4 bytes
- Fixed length of 8 bytes
- Variable length of up to 65532 bytes
With this variables IDN structure different data types can be stored, displayed and managed. These parameters specify the controller characteristics:
- Motor data
- Feedback data
- Controller settings
- Special functions
These data are not stored in the controller but in the TwinCAT configuration. The following diagram illustrates how the data configured in the TcDriveManager are stored.
Once the parameters have been set in the TcDriveManager they can be transferred to the Startup list.
After the data have been transferred to the Startup list, they are downloaded to the controller after configuration has been saved and TwinCAT has been restarted.
Some parameter can simply be transferred temporarily into the controller RAM. These parameters are lost during a restart or a power failure.
Inactive write protection is a prerequisite for a successful download. Write protection is set for some parameters when the EtherCAT slave reaches the SafeOP or OP state.
An attempt to change a read-only parameter results in the following error message.
In this case the only available procedure is as follows:
- Parameter transfer to the Startup list
- Saving the configuration
- Restart TwinCAT