EtherCAT:EC INSTALL STX CDHD

From SoftMC-Wiki
Revision as of 12:53, 4 January 2015 by Nigeller (talk | contribs)
Jump to: navigation, search

Description

CDHD drive functionality is configured by calling the subroutine EC_INSTALL_STX_CDHD.
This article describes the configuration steps performed by this subroutine.

IMPORTANT.svgIMPORTANT
To configure the CDHD drive, you must globally load the library EC_CDHD.LIB


CDHD can be configured to work in different OpModes that require different PDO mapping of PCMD and VCMD.
Optional PDO mappings are as follows:

Synchronous Position Mode - PCMD is mapped to 0x607A and VCMD is mapped to 0x6081
Position Profile Mode - PCMD is mapped to 0x60C1
Synchronous Velocity Mode - VCMD is mapped to 0x60FF

OpMode is set by passing the argument <motion_opmode> with one of the following constants:
CDHD_OPMODE_SYNC_VELOCITY = 7
CDHD_OPMODE_SYNC_POSITION = 8
CDHD_OPMODE_VELOCITY = 3

Input

Drive address - Position of the drive in the physical topology, where the first drive is assigned drive address 1, etc...
Vendor ID - There are a few custom brands of STX CDHD drive, therefore the EtherCAT setup might run into several Vendor ID's
Motion Opmode - Elaborated below
Micro Interpolation - Micro Interpolation mode of the drive, this argument is passed as 2 by default

Output

None

Return Value

None

Declaration

public sub EC_INSTALL_STX_CDHD(byval drive_addr as long, byval vendor_id as long, byval motion_opmode as long, byval micro_interpolation as long)

Syntax

call EC_INSTALL_STX_CDHD(<drive address>, <vendor_id>, <motion opmode>, <micro interpolation mode>)

Examples

call EC_INSTALL_STX_CDHD(2, SERVOTRONIX_VENDOR_ID_0X2E1, CDHD_OPMODE_SYNC_POSITION, 2) ' mic_int = 2

Installation Process

The first step is creating the PDO mapping. Different motion operational modes in the drive use different PDO mappings; therefore, before starting the EtherCAT setup procedure, you must decide whether the system will work in either Synchronous Position Mode or Synchronous Velocity Mode.

Once EtherCAT has started, it is not possible to switch between Sync Position and Sync Velocity. Switching modes requires stopping the EtherCAT communication and restarting with a new PDO setup. In most instances, however, Synchronous Position Mode is suitable.

The PDO mapping in different operation modes is as follows:
Sync Position - PCMD is mapped to 0x607A and VCMD is mapped to 0x6081
Position - PCMD is mapped to 0x60C1
Sync Velocity - VCMD is mapped to 0x60FF

The operation mode is set by passing the argument <motion_opmode> to the subroutine EC_INSTALL_STX_CDHD with one of the following constants:
CDHD_OPMODE_SYNC_VELOCITY = 7
CDHD_OPMODE_SYNC_POSITION = 8
CDHD_OPMODE_VELOCITY = 3


The next step is notifying the EtherCAT master that a specific address contains a motion drive. This is done by calling the subroutine EC_USE_SLAVE.

call EC_USE_SLAVE(drive_addr, SERVOTRONIX_VENDOR_ID_0X2E1, STX_CDHD_PRODUCT_CODE_0X0, "ECAT_AXIS_SLAVE")

Set the Micro-Interpolation mode:

'  Micro Interpolation
call EC_SDO_WRITE(drive_addr, 0x60C0, 0, 16, micro_interpolation)

The next step is reading PNUM / PDEN from the drive in order to calculate the Position Factor.

PNUM = EC_SDO_READ(drive_addr, 0x6092, 1)
Pos_Units[drive_addr] = (PNUM / EC_SDO_READ(drive_addr, 0x6092, 2)) * (EC_SDO_READ(drive_addr, 0x6091, 1) / EC_SDO_READ(drive_addr, 0x6091, 2))

If the motor is linear, read the pitch, and add it to the position factor calculation.

if EC_SDO_READ(drive_addr, 0x2024, 0) = 2 then
	Pos_Units[drive_addr] = Pos_Units[drive_addr] / EC_SDO_READ(drive_addr, 0x207d, 0)
end if


See Also