EL7062

Scope

Use this page for EL7062-specific behavior such as warnings, open-loop counter issues, autotuning, and touch-probe/index homing setup.

Topics

  1. Error/warning
  2. Open-loop counter jump
  3. Tuning
  4. Home on index pulse of incremental encoder
  5. Diagnostics

Error/warning

If the drive is in error/warning state and cannot be enabled, see drive refuses to enable.

The most common reason for this error is:

  • motor is not connected
  • (PSI specific): motor cable in wrong connector (at PSI motor and limits have the same 5pin M12 connector)
  • drive has no motor voltage
  • (PSI specific): EL9227-5500 feeding the I/O bus is not initiated (at first power on the switches on the terminal needs to be engaged)

Open-loop counter jump

The EL7062 has a firmware bug if configured to run in open loop CSV.

When disabling the amplifier, the open-loop counter jumps to the nearest full-turn value. Upgrade the terminal firmware if a fixed firmware is available for the installed hardware revision. See Firmware Update Over FoE for the update procedure.

Use CSP mode until the terminal has firmware where the CSV bug is fixed.

Tuning

Motor might move during tuning sequence

If tuning is off an autotune sequence can be executed from the hardware expert panel. The auto tuning sequence measures coil resistance and inductance and sets initial values for control loop parameters:

  • Coil resistance
  • Coil inductance
  • Current loop proportional gain
  • Current loop integration time
  • Velocity loop proportional gain
  • Velocity loop integration time
  • Position loop proportional gain (used in CSP only)

The autotune process also creates a MACROS string that can be used with ecmccomp to set the parameters at startup.

Requirements for successful tuning:

  • Drive must be in OP mode
  • Drive must not be enabled
  • Drive must have motor power

For more info, see Beckhoff docs.

Sometimes further fine-tuning of the parameters might be needed.

Motor might move during tuning sequence

Home on index pulse of incremental encoder

The incremental interface of the EL7062 works in a similar way to EL72xx servos and is different from the EL5101 interface. For EL7062, the latch functionality is called touch probes. Each drive channel is equipped with two touch probes, which can be configured to latch on a digital input or on the index pulse of the incremental encoder. The encoder source of the touch probes can also be configured as open-loop counter or incremental encoder (secondary encoder).

SDO configs

Configure touch probe to latch on encoder index pulse

The following commands can be used (see Beckhoff manual for more info):

# CH1 Set touch probe to latch on index pulse
ecmcConfigOrDie "Cfg.EcAddSdo(${ECMC_EC_SLAVE_NUM},0x8001,0x11,5,2)"

# CH2 Set touch probe to latch on index pulse
ecmcConfigOrDie "Cfg.EcAddSdo(${ECMC_EC_SLAVE_NUM},0x8101,0x11,5,2)"

Configure touch probe encoder source

# CH1 Set touch probe source 01 to secondary encoder
ecmcConfigOrDie "Cfg.EcAddSdo(${ECMC_EC_SLAVE_NUM},0x8001,0x15,1,2)"

# CH2 Set touch probe source 01 to secondary encoder
ecmcConfigOrDie "Cfg.EcAddSdo(${ECMC_EC_SLAVE_NUM},0x8101,0x15,1,2)"

Using ecmccomp

These commands are also accessible via the Encoder-Generic-INC component of ecmccomp:

The following macros are implemented:

TP1_POS_SRC   : Touchprobe 1 source
                  PRIM: primary encoder (open loop counter)
                  SEC: secondary encoder (incremental encoder)
TP2_POS_SRC   : Touchprobe 2 source
                  PRIM: primary encoder (open loop counter)
                  SEC: secondary encoder (incremental encoder)
TP1_TRG       : Touchprobe 1 trigger
                  TPBI: touch probe input 1
                  INDEX: encoder index pulse
TP2_TRG       : Touchprobe 2 trigger
                  TPBI: touch probe input 2
                  INDEX: encoder index pulse
Example:
${SCRIPTEXEC} ${ecmccfg_DIR}applyComponent.cmd "COMP=Encoder-Generic-INC,          CH_ID=2, MACROS='ST_ENC_RES=4000,TP1_POS_SRC=SEC,TP1_TRG=INDEX'"

Arm latch

Arming a latch/touch probe is a bit more complex than when using EL5101 and is done by the touch probe control word (covering both touch probes):

bittp chdesc
01enable touch probe
11enable continuous latching
21trig mode B1
31trig mode B2
41latch on positive edge
51latch on negative edge
61reserved
71reserved
82enable touch probe
92enable continuous latching
102trig mode B1
112trig mode B2
122latch on positive edge
132latch on negative edge
142reserved
152reserved

The ecmc parameter for accessing the control word is:

  • CH1: ec0.s$(ENC_SID).touchProbeControl01
  • CH2: ec0.s$(ENC_SID).touchProbeControl02

As an example, arming the touch probe for the following scenario:

  • Drive channel 1
  • Touch probe 1
  • latching positive edge

would require the following bits in ec0.s$(ENC_SID).touchProbeControl01 to be set:

  • 0: enable
  • 2: trig mode B1
  • 4: latch on positive edge or 0b10001 = 17 dec

When setting up homing for an encoder in ecmccfg, the latch/touch probe then needs to be configured in the following way:

encoder:
  desc: Inc RS422
  numerator: 360                                       # Scaling numerator example 1 mm/rev
  denominator: 1048576                                 # Scaling denominator example 4096 ticks per 360 degree
  type: 0                                              # Type: 0=Incremental, 1=Absolute
  bits: 32                                             # Total bit count of encoder raw data
  absBits: 0                                           # Absolute bit count (for absolute encoders) always least significant part of 'bits'
  position: ec0.s$(ENC_SID).positionActual${ENC_CH=01}_2 # Ethercat entry for actual position input (encoder)
  status: ec0.s$(ENC_SID).touchProbeStatus${ENC_CH=01}         # mandatory only if 'warning' or 'error' are used
  control: ec0.s$(ENC_SID).touchProbeControl${ENC_CH=01}
  primary: True
  latch:
    position: ec0.s$(ENC_SID).touchProbePositionPos$(ENC_CH=01)_1 # Link to latched value 1
    timestamp: ec0.s$(ENC_SID).touchProbeTimestampPos$(ENC_CH=01)_1 # 32-bit DC time of the same positive edge
    control:  0                                        # Bit in encoder control word to arm latch.
    status: 1                                          # Bit in encoder status word for latch triggered status.
    armCmd: 17                                         # Arm command, 0b10001 for EL7062 touch probe 1 positive edge
    armBits: 5                                         # Arm command bit size, 5 bits for EL7062 touch probes
  homing:
    type: 12                                           # Homing sequence type
    position: 0                                        # Position to reference encoder to
    velocity:
      to: 30                                           # Velocity to cam/sensor (used for some homing seqs)
      from: 20                                          # Velocity from cam/sensor (used for some homing seqs)
    acceleration: 20                                   # Acceleration during homing
    deceleration: 100                                  # Deceleration during homing
    latchCount: 1                                      # latch number to ref on (1=ref on first latch)

Here the following controls the arming of the latch:

  • encoder.control: touchprobe control word.
  • encoder.latch.control: start bit in touchprobe control word to write “encoder.latch.armBits” bits of arm command (encoder.latch.armCmd)
  • encoder.latch.armCmd: Decimal value of bit pattern to arm touch probe
  • encoder.latch.armBits: Bit length of encoder.latch.armCmd to write into encoder.control (starting at bit position encoder.latch.control) and status/result:
  • encoder.latch.status bit of encoder.status word toggles when a new touchprobe latches
  • encoder.latch.position: the latched position
  • encoder.latch.timestamp: optional DC timestamp captured for the same edge

encoder.latch is still the correct section when the latch is owned by a homing sequence. If the same hardware touch-probe should be used as a separate runtime feature, configure the same style of entries under encoder.touchProbe instead. That keeps normal homing latch behavior separate from the touch-probe API:

encoder:
  touchProbe:
    position: ec0.s$(ENC_SID).touchProbePositionPos$(ENC_CH=01)_1
    timestamp: ec0.s$(ENC_SID).touchProbeTimestampPos$(ENC_CH=01)_1
    control: ec0.s$(ENC_SID).touchProbeControl${ENC_CH=01}
    controlBit: 0
    status: ec0.s$(ENC_SID).touchProbeStatus${ENC_CH=01}
    statusBit: 1
    armCmd: 17
    armBits: 5

For the ED7062 timestamp fields, load HW_DESC=ED7062_TPDC. The normal ED7062/EL7062 descriptors are unchanged. The touch-probe API belongs to the axis; the encoder mapping above is the hardware adapter. Encoder numbers are one-based in these commands:

AxisTouchProbeArm(axis,encoder,1)
AxisPrintTouchProbe(axis,encoder)
AxisTouchProbeArm(axis,encoder,0)

Without timestamp, the result remains usable but is marked cycle-bounded. With a 32- or 64-bit timestamp it is marked hardware-timestamped. Positive position and positive timestamp must be paired (or both negative) so they describe the same physical edge.

DC/SYNC shift note

The EL7062/ED7062 touch-probe timestamp gives the event time, but the normal encoder PDO still has to be sampled and transferred at a stable point in the EtherCAT cycle. The configured DC/SYNC shift can therefore affect the stability of position reconstruction and position-compare tests.

In one EL7062 test setup, moving the DC shift into the approximately 200 us range gave more stable results than the previous phase. Treat this as a setup hint, not a universal default: the useful margin depends on cycle rate, cable topology, frame length and which terminals are present. After changing the topology or EtherCAT rate, re-check the timing with EcPrintSlaveConfig, EcPrintControlTiming and a touch-probe/position-compare test.

Startup file example

require ecmccfg "ENG_MODE=1"

${SCRIPTEXEC} ${ecmccfg_DIR}addSlave.cmd,      "SLAVE_ID=3,HW_DESC=EL7062_CSP"
${SCRIPTEXEC} ${ecmccfg_DIR}applyComponent.cmd "COMP=Motor-Generic-2Phase-Stepper, CH_ID=1, MACROS='I_MAX_MA=1000, I_STDBY_MA=100, U_NOM_MV=24000,L_COIL_UH=3050,R_COIL_MOHM=2630'"
${SCRIPTEXEC} ${ecmccfg_DIR}applyComponent.cmd "COMP=Drive-Generic-Ctrl-Params,    CH_ID=1, MACROS='I_TI=12,I_KP=58,V_TI=150,V_KP=176,P_KP=10'"
# configure touch probe to latch on index pulse of secondary encoder (incremental)
${SCRIPTEXEC} ${ecmccfg_DIR}applyComponent.cmd "COMP=Encoder-Generic-INC,          CH_ID=1, MACROS='ST_ENC_RES=4000,TP1_POS_SRC=SEC,TP1_TRG=INDEX'"
epicsEnvSet(DRV_SID,${ECMC_EC_SLAVE_NUM})

# Configure axis and open loop encoder
${SCRIPTEXEC} ${ecmccfg_DIR}loadYamlAxis.cmd,   "FILE=./cfg/axis.yaml,          DEV=${IOC}, AX_NAME=M1, AXIS_ID=1, DRV_SID=${DRV_SID}, ENC_SID=${DRV_SID}, ENC_CH=01"

# Configure incremental encoder
${SCRIPTEXEC} ${ecmccfg_DIR}loadYamlEnc.cmd,    "FILE=./cfg/enc_inc.yaml, DEV=${IOC}, ENC_SID=${DRV_SID},ENC_CH=02"

Diagnostics

See the hardware diagnostics page.