Advanced Search

Search Results (Searched for: halpin)

  • ShemJ
  • ShemJ's Avatar
03 Oct 2025 16:06 - 03 Oct 2025 16:15

EL8 - Rehoming axis goes max speed ignores machine and driver limits

Category: EtherCAT

I have EL8 drivers and I have an issue that gave me a serious startle.

I am using internal homing (-4) which is working exactly as expected. However, if I rehome all (axis) or Ref any axis or rehome (Probe basic), the drive shoots back to the homing position at what I believe is top speed for the servo. This ignores both the machine limits and the limits I have set in the parameters (POE.31-36).

I have set homing limits on the driver, but also control them via HAL. As a stopgap, I also tried adding a max velocity parameter (bold), but it errors out. I tried adding a max velocity pin. I am not sure how to limit the speed of the drive using motion control yet.  Any takers?

          <pdoEntry idx="6098" subIdx="00" bitLen="8"  halPin="home-mode" halType="s32"/>
          <pdoEntry idx="6099" subIdx="01" bitLen="32" halPin="home-hi-speed" halType="u32"/>
          <pdoEntry idx="6099" subIdx="02" bitLen="32" halPin="home-lo-speed" halType="u32"/>
          <pdoEntry idx="609A" subIdx="00" bitLen="32" halPin="home-acc" halType="u32"/>
          <pdoEntry idx="6080" subIdx="00" bitLen="32" halPin="max-velocity" halType="u32"/>

and in HAL
#limit max velocity in rev/min
setp lcec.0.0.max-velocity 1000

This is a safety risk for now.  I'd like to get around this issue if possible. 

Good god, this HTML editor is horrific.
  • peterpan
  • peterpan
25 Sep 2025 18:23
Replied by peterpan on topic Trouble with Cia402 drive configuration

Trouble with Cia402 drive configuration

Category: EtherCAT

After adding the rest of the pdo entries on pg 9 and 10 the drive still stays in PREOP
<masters>
  <master idx="0" appTimePeriod="1000000" refClockSyncCycles="5">
    <slave idx="0" type="EK1100" />
    <slave idx="1" type="EL1008" />
    <slave idx="2" type="EL2008" />
    <slave idx="3" type="generic" vid="0x00000c96" pid="0x00000001" configPdos="true">
      <dcConf assignActivate="300" sync0Cycle="*1" sync0Shift="700000" />
      <syncManager idx="2" dir="out">
            <pdo idx="1600">
               <pdoEntry idx="6040" subIdx="00" bitLen="16" halPin="cia-controlword" halType="u32" />
               <pdoEntry idx="6060" subIdx="00" bitLen="8" halPin="opmode" halType="s32" />
               <pdoEntry idx="6071" subIdx="00" bitLen="16" halPin="target-torque" halType="s32" />
               <pdoEntry idx="607A" subIdx="00" bitLen="32" halPin="target-position" halType="s32" />
               <pdoEntry idx="60FE" subIdx="00" bitLen="32" halPin="digital-outputs" halType="u32" />
               <pdoEntry idx="60FF" subIdx="00" bitLen="32" halPin="target-velocity" halType="s32" />
            </pdo>
         </syncManager>
         <syncManager idx="3" dir="in">
            <pdo idx="1a00">
  <pdoEntry idx="603F" subIdx="00" bitLen="16" halPin="error-code" halType="u32" />
               <pdoEntry idx="6041" subIdx="00" bitLen="16" halPin="cia-statusword" halType="u32" />
               <pdoEntry idx="6061" subIdx="00" bitLen="8" halPin="opmode-display" halType="s32" />
               <pdoEntry idx="6064" subIdx="00" bitLen="32" halPin="actual-position" halType="s32" />
               <pdoEntry idx="606C" subIdx="00" bitLen="32" halPin="actual-velocity" halType="s32" />
               <pdoEntry idx="6077" subIdx="00" bitLen="32" halPin="actual-torque" halType="s32" />
               <pdoEntry idx="60F4" subIdx="00" bitLen="32" halPin="follow-error" halType="s32" />
               <pdoEntry idx="60FD" subIdx="00" bitLen="32" halPin="digital-inputs" halType="u32" />
            </pdo>
         </syncManager>
      </slave>
  </master>
</masters>

The dmesg:
[100592.236726] EtherCAT DEBUG 0-3: 9936 ns difference after 400 ms.
[100592.236728] EtherCAT DEBUG 0-3:    ref_time=812139542737448000
[100592.236729] EtherCAT DEBUG 0-3:    app_time=812139546509016167
[100592.236730] EtherCAT DEBUG 0-3:  start_time=812139546609016167
[100592.236731] EtherCAT DEBUG 0-3:       cycle=1000000
[100592.236732] EtherCAT DEBUG 0-3:  shift_time=700000
[100592.236733] EtherCAT DEBUG 0-3:   remainder=568167
[100592.236734] EtherCAT DEBUG 0-3:        start=812139546610148000
[100592.236735] EtherCAT DEBUG 0-3: Setting DC cyclic operation start time to 812139546610148000.
[100592.238726] EtherCAT DEBUG 0-3: Setting DC AssignActivate to 0x0300.
[100592.241726] EtherCAT ERROR 0-3: Failed to set SAFEOP state, slave refused state change (PREOP + ERROR).
[100592.242726] EtherCAT ERROR 0-3: AL status message 0x001E: "Invalid input configuration".
[100592.244725] EtherCAT 0-3: Acknowledged state PREOP.
[100592.465795] EtherCAT WARNING 0: 1 datagram UNMATCHED!
[100592.489802] EtherCAT WARNING: Datagram 0000000070b69bf8 (master-fsm) was SKIPPED 1 time.
  • farmer_mike
  • farmer_mike
14 Sep 2025 04:59
Replied by farmer_mike on topic Getting (hopefully) close to an Rtelligent build

Getting (hopefully) close to an Rtelligent build

Category: EtherCAT

I halved the SDO values one more time and the servos are nice and quiet now. I will have to look at the HAL Oscilloscope to see how the tune is, but for now the tune is quiet and on scale.

Here are the files below. I used an ECT60 paired with a precision planetary gearbox for the Z axis of my milling machine. The X and Y axis are controlled by RS750E drives with a slight belt reduction.

Emergency stop button is wired into the ECT60 on input number 6. From the input of the ECT60, I mapped the E stop over to the HALUI emergency stop. Without the HALUI mapping, the drives would start back up as soon as the physical E stop was released. The limit switches and homing switches for the Z axis were straight forward.

Limit switches and homing switches for the RS750E drives were a little more complicated. I converted the drive input tags from s32 to u32 then bit sliced the u32 to break out the switches. I bet all the slicing could have been done in the XML file, but I could not figure that out.

When I first started the project, my plan was to run everything off of a laptop. I have since switched to a raspberry pi 4.

I still have a bit of work to do, but I want to thank everyone for their help so far.
###########################################################
#
# CIA 402 example snippet Hal
#
###########################################################

###########################################################
# Setup
###########################################################

loadrt [KINS]KINEMATICS
loadrt [EMCMOT]EMCMOT servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[KINS]JOINTS


loadusr -W lcec_conf ethercat-conf.xml
#loadusr -W /home/cnc/linuxcnc/configs/linuxcnc-cia402-single/python_control.py

loadrt lcec
loadrt cia402 count=3
loadrt pid names=0-pid,1-pid,2-pid

loadrt bitslice count=6 personality=32,32,32,32,32,32
addf bitslice.0 servo-thread
addf bitslice.1 servo-thread
addf bitslice.2 servo-thread
addf bitslice.3 servo-thread
addf bitslice.4 servo-thread
addf bitslice.5 servo-thread

loadrt conv_s32_u32 count=6
addf conv-s32-u32.0 servo-thread
addf conv-s32-u32.1 servo-thread
addf conv-s32-u32.2 servo-thread
addf conv-s32-u32.3 servo-thread
addf conv-s32-u32.4 servo-thread
addf conv-s32-u32.5 servo-thread



###########################################################
# Functions servo-thread
###########################################################

addf lcec.read-all servo-thread
addf cia402.0.read-all servo-thread
addf cia402.1.read-all servo-thread
addf cia402.2.read-all servo-thread

addf motion-command-handler servo-thread
addf motion-controller servo-thread

addf 0-pid.do-pid-calcs servo-thread
addf 1-pid.do-pid-calcs servo-thread
addf 2-pid.do-pid-calcs servo-thread

addf cia402.0.write-all servo-thread
addf cia402.1.write-all servo-thread
addf cia402.2.write-all servo-thread
addf lcec.write-all servo-thread


#########################################
#nets
#########################################
net emc-enable => iocontrol.0.emc-enable-in
sets emc-enable 1

#config

 
#
# Joint 0
#
setp cia402.0.csp-mode 1
setp cia402.0.pos-scale 786432


#from servo(ethercat) to cia402
net 0-statusword      lcec.0.0.cia-statusword => cia402.0.statusword
net 0-opmode-display  lcec.0.0.opmode-display => cia402.0.opmode-display
net 0-drv-act-pos     lcec.0.0.actual-position => cia402.0.drv-actual-position
net 0-drv-act-velo    lcec.0.0.actual-velocity => cia402.0.drv-actual-velocity

#from motion to cia

net 0-enable     <= joint.0.amp-enable-out => cia402.0.enable
net 0-amp-fault  => joint.0.amp-fault-in   <= cia402.0.drv-fault
net 0-pos-cmd    <= joint.0.motor-pos-cmd  => cia402.0.pos-cmd
net 0-pos-fb     => joint.0.motor-pos-fb   <= cia402.0.pos-fb


#from cia402 to servo(ethercat)
net 0-controlword         cia402.0.controlword => lcec.0.0.cia-controlword
net 0-modes-of-operation  cia402.0.opmode => lcec.0.0.opmode
net 0-drv-target-pos      cia402.0.drv-target-position => lcec.0.0.target-position
net 0-drv-target-velo     cia402.0.drv-target-velocity => lcec.0.0.target-velocity


net my-out-0 conv-s32-u32.0.in <= lcec.0.0.digitalinputs
net my-in-0 conv-s32-u32.0.out => bitslice.0.in
net my-bit-0 bitslice.0.out-00 joint.0.neg-lim-sw-in

net my-out-0 conv-s32-u32.1.in <= lcec.0.0.digitalinputs
net my-in-1 conv-s32-u32.1.out => bitslice.1.in
net my-bit-1 bitslice.1.out-01 joint.0.pos-lim-sw-in

net my-out-0 conv-s32-u32.2.in <= lcec.0.0.digitalinputs
net my-in-2 conv-s32-u32.2.out => bitslice.2.in
net my-bit-2 bitslice.2.out-02 joint.0.home-sw-in


#
# Joint 1
#
setp cia402.1.csp-mode 1
setp cia402.1.pos-scale -786432

#from servo(ethercat) to cia402
net 1-statusword      lcec.0.1.cia-statusword => cia402.1.statusword
net 1-opmode-display  lcec.0.1.opmode-display => cia402.1.opmode-display
net 1-drv-act-pos     lcec.0.1.actual-position => cia402.1.drv-actual-position
net 1-drv-act-velo    lcec.0.1.actual-velocity => cia402.1.drv-actual-velocity

#from cia402 to servo(ethercat)
net 1-controlword         cia402.1.controlword => lcec.0.1.cia-controlword
net 1-modes-of-operation  cia402.1.opmode => lcec.0.1.opmode
net 1-drv-target-pos      cia402.1.drv-target-position => lcec.0.1.target-position
net 1-drv-target-velo     cia402.1.drv-target-velocity => lcec.0.1.target-velocity

#from motion to cia
net 1-enable    <= joint.1.amp-enable-out => cia402.1.enable
net 1-amp-fault => joint.1.amp-fault-in   <= cia402.1.drv-fault
net 1-pos-cmd   <= joint.1.motor-pos-cmd  => cia402.1.pos-cmd
net 1-pos-fb    => joint.1.motor-pos-fb   <= cia402.1.pos-fb


net my-out-1 conv-s32-u32.3.in <= lcec.0.1.digitalinputs
net my-in-3 conv-s32-u32.3.out => bitslice.3.in
net my-bit-3 bitslice.3.out-00 joint.1.pos-lim-sw-in

net my-out-1 conv-s32-u32.4.in <= lcec.0.1.digitalinputs
net my-in-4 conv-s32-u32.4.out => bitslice.4.in
net my-bit-4 bitslice.4.out-01 joint.1.neg-lim-sw-in

net my-out-1 conv-s32-u32.5.in <= lcec.0.1.digitalinputs
net my-in-5 conv-s32-u32.5.out => bitslice.5.in
net my-bit-5 bitslice.5.out-02 joint.1.home-sw-in


#
# Joint 2
#
setp cia402.2.csp-mode 1
setp cia402.2.pos-scale 96000

#from servo(ethercat) to cia402
net 2-statusword      lcec.0.2.cia-statusword => cia402.2.statusword
net 2-opmode-display  lcec.0.2.opmode-display => cia402.2.opmode-display
net 2-drv-act-pos     lcec.0.2.actual-position => cia402.2.drv-actual-position
net 2-drv-act-velo    lcec.0.2.actual-velocity => cia402.2.drv-actual-velocity

#from cia402 to servo(ethercat)
net 2-controlword         cia402.2.controlword => lcec.0.2.cia-controlword
net 2-modes-of-operation  cia402.2.opmode => lcec.0.2.opmode
net 2-drv-target-pos      cia402.2.drv-target-position => lcec.0.2.target-position
net 2-drv-target-velo     cia402.2.drv-target-velocity => lcec.0.2.target-velocity

#from motion to cia
net 2-enable    <= joint.2.amp-enable-out => cia402.2.enable
net 2-amp-fault => joint.2.amp-fault-in   <= cia402.2.drv-fault
net 2-pos-cmd   <= joint.2.motor-pos-cmd  => cia402.2.pos-cmd
net 2-pos-fb    => joint.2.motor-pos-fb   <= cia402.2.pos-fb

net  2-CCW-limit lcec.0.2.in-3 => joint.2.neg-lim-sw-in
net  2-CW-limit lcec.0.2.in-4 => joint.2.pos-lim-sw-in
net  2-in-home lcec.0.2.in-5 => joint.2.home-sw-in
net  2-in-6 lcec.0.2.in-6 => halui.estop.activate


#net spindle_speed     spindle.0.speed-out => python_control.rpm_in
# This config file was created 2020-08-14 17:19:37.621705 by the update_ini script
# The original config files may be found in the /home/demo/linuxcnc/configs/et-3ax/et_3ax_CIA402.old directory

[EMC]
# The version string for this INI file.
VERSION = 1.1

MACHINE = EtherCAT Machine
DEBUG = 1

[DISPLAY]
DISPLAY = axis
EDITOR = gedit

#PYVCP = pyvcp_panel.xml

# places the pyvcp panel at the bottom of the Axis window
PYVCP_POSITION = RIGHT

# Cycle time, in seconds, that display will sleep between polls
CYCLE_TIME =            0.100

# Path to help file
HELP_FILE =             doc/help.txt

# Initial display setting for position, RELATIVE or MACHINE
POSITION_OFFSET = RELATIVE
POSITION_FEEDBACK = ACTUAL
MAX_FEED_OVERRIDE = 1
# Prefix to be used
PROGRAM_PREFIX = /home/demo/linuxcnc/nc_files
INTRO_GRAPHIC = linuxcnc.gif
INTRO_TIME = 0
INCREMENTS = 1in .5in .25in .125in .0625in .025in .05in
#INCREMENTS = 5mm 1mm .5mm .1mm .05mm .01mm .005mm

[FILTER]
PROGRAM_EXTENSION = .png,.gif,.jpg Greyscale Depth Image
PROGRAM_EXTENSION = .py Python Script
png = image-to-gcode
gif = image-to-gcode
jpg = image-to-gcode
py = python
nc = /usr/bin/axis

[RS274NGC]

PARAMETER_FILE = linuxcnc.var

[EMCMOT]

EMCMOT = motmod
COMM_TIMEOUT = 1.0
BASE_PERIOD =  0
SERVO_PERIOD = 1000000

[TASK]
TASK = milltask
CYCLE_TIME = 0.005

[HAL]
HALFILE = cia402.hal
#SHUTDOWN = shutdown.hal
HALUI = halui

[HALUI]

[TRAJ]

HOME = 16 12 7
COORDINATES = XYZ
LINEAR_UNITS = in
ANGULAR_UNITS = deg
DEFAULT_LINEAR_VELOCITY = .25
MAX_LINEAR_VELOCITY = .5
MIN_LINEAR_VELOCITY = .01
DEFAULT_ANGULAR_VELOCITY = 360
MAX_ANGULAR_VELOCITY = 720
POSITION_FILE = position.txt

[EMCIO]

# Name of IO controller program, e.g., iov2 has tool changer stuff
EMCIO =         iov2

CYCLE_TIME =    0.100

# tool table file
TOOL_TABLE =    cia402.tbl
TOOL_CHANGE_POSITION = 0 0 50.8
#RANDOM_TOOLCHANGER = 1


[KINS]
JOINTS = 3
KINEMATICS = trivkins kinstype=both coordinates=xyz


[AXIS_X]
MIN_LIMIT = 0.1
MAX_LIMIT = 17.9
MAX_VELOCITY = .5
MAX_ACCELERATION = 10
BACKLASH = 0.0000

[JOINT_0]
TYPE = LINEAR
MAX_VELOCITY = .5
MAX_ACCELERATION = 10

# The values below should be 25% larger than MAX_VELOCITY and MAX_ACCELERATION
# If using BACKLASH compensation STEPGEN_MAXACCEL should be 100% larger.
# is this applicable for ethercat????
#STEPGEN_MAXVEL = 1.25
#STEPGEN_MAXACCEL = 1.25
SCALE = 1
FERROR = 200
MIN_FERROR = 50
MIN_LIMIT = 0
MAX_LIMIT = 18
HOME                    = 16
HOME_OFFSET                = 16
HOME_SEQUENCE            = 0

HOME_SEARCH_VEL = -.125
HOME_LATCH_VEL = -.125
HOME_USE_INDEX = NO
HOME_IGNORE_LIMITS        = NO





[AXIS_Y]
MIN_LIMIT = 0.1
MAX_LIMIT = 12.9
MAX_VELOCITY = .5
MAX_ACCELERATION = 10
BACKLASH = 0.0000


[JOINT_1]
TYPE = LINEAR
MAX_VELOCITY = .5
MAX_ACCELERATION = 10


# The values below should be 25% larger than MAX_VELOCITY and MAX_ACCELERATION
# If using BACKLASH compensation STEPGEN_MAXACCEL should be 100% larger.
# is this applicable for ethercat????
#STEPGEN_MAXVEL = 1.25
#STEPGEN_MAXACCEL = 1.25
STEP_SCALE = 1
FERROR = 2
MIN_FERROR = 20
MIN_LIMIT = 0
MAX_LIMIT = 13

HOME                    = 12
HOME_OFFSET                = 12
HOME_SEQUENCE            = 1

HOME_SEARCH_VEL = .125
HOME_LATCH_VEL = .125
HOME_USE_INDEX = NO
HOME_IGNORE_LIMITS        = NO


[JOINT_2]
TYPE = LINEAR
MAX_VELOCITY = .5
MAX_ACCELERATION = 10
# The values below should be 25% larger than MAX_VELOCITY and MAX_ACCELERATION
# If using BACKLASH compensation STEPGEN_MAXACCEL should be 100% larger.
# is this applicable for ethercat????
STEPGEN_MAXVEL = 1.25
STEPGEN_MAXACCEL = 1.25
STEP_SCALE = 1
FERROR = 200
MIN_FERROR = 20
MIN_LIMIT = 3.4
MAX_LIMIT = 8.1
HOME                    = 7
HOME_OFFSET                = 7
HOME_SEQUENCE            = 2

HOME_SEARCH_VEL = .125
HOME_LATCH_VEL = .125
HOME_USE_INDEX = NO
HOME_IGNORE_LIMITS    = NO



[AXIS_Z]
MIN_LIMIT = 3.5
MAX_LIMIT = 8
MAX_VELOCITY = .5
MAX_ACCELERATION = 10
BACKLASH = 0.0000

<masters>
  <master idx="0" appTimePeriod="1000000" refClockSyncCycles="5">
     
    
  <slave idx="0" type="generic" vid="00000A88" pid="0a880013" configPdos="true">
   <!-- Joint 0 -->
   
  <sdoConfig idx="2009" subIdx="1"><sdoDataRaw data ="00 32"/></sdoConfig> <!-- position p gain default is 1000 -->
  <sdoConfig idx="2009" subIdx="2"><sdoDataRaw data ="00 08"/></sdoConfig> <!-- velocity p gain default is 256 -->
  <sdoConfig idx="2009" subIdx="3"><sdoDataRaw data ="00 01"/></sdoConfig> <!-- position i gain default is 200 -->
   
   
   <syncManager idx="0" dir="out"> </syncManager>
   <syncManager idx="1" dir="out"> </syncManager>
   <syncManager idx="2" dir="out">
    <pdo idx="1600">
     <pdoEntry idx="6040" subIdx="00" bitLen="16" halPin="cia-controlword" halType="u32"/>
     <pdoEntry idx="607a" subIdx="00" bitLen="32" halPin="target-position" halType="s32"/>
     <pdoEntry idx="60b8" subIdx="00" bitLen="16" halPin="touchprobefunction0" halType="bit"/>
    </pdo>
    <pdo idx="1601">
     <pdoEntry idx="6081" subIdx="00" bitLen="32" halPin="profile-velocity" halType="u32"/>
     <pdoEntry idx="6083" subIdx="00" bitLen="32" halPin="target-accel" halType="u32"/>
     <pdoEntry idx="6084" subIdx="00" bitLen="32" halPin="target-decel" halType="u32"/>
     <pdoEntry idx="6060" subIdx="00" bitLen="8" halPin="opmode" halType="s32"/>
    </pdo>
    <pdo idx="1602">
     <pdoEntry idx="60ff" subIdx="00" bitLen="32" halPin="target-velocity" halType="s32"/>
    </pdo>
   </syncManager>
   <syncManager idx="3" dir="in">
    <pdo idx="1a00">
     <pdoEntry idx="603f" subIdx="00" bitLen="16" halPin="errorcode" halType="bit"/>
     <pdoEntry idx="6041" subIdx="00" bitLen="16" halPin="cia-statusword" halType="u32"/>
     <pdoEntry idx="6061" subIdx="00" bitLen="8" halPin="opmode-display" halType="s32"/>
     <pdoEntry idx="6064" subIdx="00" bitLen="32" halPin="actual-position" halType="s32"/>
     <pdoEntry idx="60b9" subIdx="00" bitLen="16" halPin="touchprobestat" halType="bit"/>
     <pdoEntry idx="60ba" subIdx="00" bitLen="32" halPin="touchprobe1pos" halType="s32"/>
     <pdoEntry idx="60fd" subIdx="00" bitLen="32" halPin="digitalinputs" halType="s32"/>
    </pdo>
    <pdo idx="1a01">
     <pdoEntry idx="606c" subIdx="00" bitLen="32" halPin="actual-velocity" halType="s32"/>
    </pdo>
   </syncManager>
   <dcConf assignActivate="300" sync0Cycle="1000000"/>
  </slave>
 
 
  <slave idx="1" type="generic" vid="00000A88" pid="0a880013" configPdos="true">
   <!-- Joint 1 -->
   
     
   <sdoConfig idx="2009" subIdx="1"><sdoDataRaw data ="00 32"/></sdoConfig> <!-- position p gain default is 1000 -->
  <sdoConfig idx="2009" subIdx="2"><sdoDataRaw data ="00 08"/></sdoConfig> <!-- velocity p gain default is 256 -->
  <sdoConfig idx="2009" subIdx="3"><sdoDataRaw data ="00 01"/></sdoConfig> <!-- position i gain default is 200 -->
 
   
   <syncManager idx="0" dir="out"> </syncManager>
   <syncManager idx="1" dir="out"> </syncManager>
   <syncManager idx="2" dir="out">
    <pdo idx="1600">
     <pdoEntry idx="6040" subIdx="00" bitLen="16" halPin="cia-controlword" halType="u32"/>
     <pdoEntry idx="607a" subIdx="00" bitLen="32" halPin="target-position" halType="s32"/>
     <pdoEntry idx="60b8" subIdx="00" bitLen="16" halPin="touchprobefunction0" halType="bit"/>
    </pdo>
    <pdo idx="1601">
     <pdoEntry idx="6081" subIdx="00" bitLen="32" halPin="profile-velocity" halType="u32"/>
     <pdoEntry idx="6083" subIdx="00" bitLen="32" halPin="target-accel" halType="u32"/>
     <pdoEntry idx="6084" subIdx="00" bitLen="32" halPin="target-decel" halType="u32"/>
     <pdoEntry idx="6060" subIdx="00" bitLen="8" halPin="opmode" halType="s32"/>
    </pdo>
    <pdo idx="1602">
     <pdoEntry idx="60ff" subIdx="00" bitLen="32" halPin="target-velocity" halType="s32"/>
    </pdo>
   </syncManager>
   <syncManager idx="3" dir="in">
    <pdo idx="1a00">
     <pdoEntry idx="603f" subIdx="00" bitLen="16" halPin="errorcode" halType="bit"/>
     <pdoEntry idx="6041" subIdx="00" bitLen="16" halPin="cia-statusword" halType="u32"/>
     <pdoEntry idx="6061" subIdx="00" bitLen="8" halPin="opmode-display" halType="s32"/>
     <pdoEntry idx="6064" subIdx="00" bitLen="32" halPin="actual-position" halType="s32"/>
     <pdoEntry idx="60b9" subIdx="00" bitLen="16" halPin="touchprobestat" halType="bit"/>
     <pdoEntry idx="60ba" subIdx="00" bitLen="32" halPin="touchprobe1pos" halType="s32"/>
     <pdoEntry idx="60fd" subIdx="00" bitLen="32" halPin="digitalinputs" halType="s32"/>
    </pdo>
    <pdo idx="1a01">
     <pdoEntry idx="606c" subIdx="00" bitLen="32" halPin="actual-velocity" halType="s32"/>
    </pdo>
   </syncManager>
   <dcConf assignActivate="300" sync0Cycle="1000000"/>
  </slave>
 
     <!-- Joint 2 -->
    <slave idx="2" type="generic" vid="00000a88" pid="0a880002" configPdos="true">
      <dcConf assignActivate="300" sync0Cycle="*1" sync0Shift="0"/>
      <sdoConfig idx="2000" subIdx="0"><sdoDataRaw data ="88 13"/></sdoConfig>  <!-- Max motor current (5.0) -->
      <sdoConfig idx="2007" subIdx="3"><sdoDataRaw data ="01"/></sdoConfig>     <!-- Input 3 - CCW Limit -->
      <sdoConfig idx="2007" subIdx="4"><sdoDataRaw data ="02"/></sdoConfig>     <!-- Input 4 - CW Limit -->
      <sdoConfig idx="2007" subIdx="5"><sdoDataRaw data ="03"/></sdoConfig>     <!-- Input 5 - Home Function -->
      <sdoConfig idx="2007" subIdx="6"><sdoDataRaw data ="05"/></sdoConfig>     <!-- Input 6 - Emergency Stop -->
      <sdoConfig idx="2011" subIdx="0"><sdoDataRaw data ="01 00"/></sdoConfig>  <!-- Closed loop -->
      <sdoConfig idx="6098" subIdx="0"><sdoDataRaw data ="11 00"/></sdoConfig>  <!-- Home mode 17 -->
      <sdoConfig idx="607C" subIdx="0"><sdoDataRaw data ="00 00"/></sdoConfig>  <!-- Home offset 0  -->
      <sdoConfig idx="609A" subIdx="0"><sdoDataRaw data ="F4 01"/></sdoConfig>  <!-- Home accelleration 500 -->
      <sdoConfig idx="6099" subIdx="01"><sdoDataRaw data ="C4 09"/></sdoConfig>  <!-- Home fast speed 2500-->
      <sdoConfig idx="6099" subIdx="02"><sdoDataRaw data ="F4 01"/></sdoConfig>  <!-- Home slow speed 500 -->
      <syncManager idx="2" dir="out">
        <pdo idx="1600">
          <pdoEntry idx="6040" subIdx="00" bitLen="16" halPin="cia-controlword" halType="u32"/>
          <pdoEntry idx="6060" subIdx="00" bitLen="8" halPin="opmode" halType="s32"/>
          <!-- Target Position -->
          <pdoEntry idx="607A" subIdx="00" bitLen="32" halPin="target-position" halType="s32"/>
          <!-- Target Velocity -->
          <pdoEntry idx="60FF" subIdx="00" bitLen="32" halPin="target-velocity" halType="s32"/>
          <!-- Digtial Outputs (manufacturer's extension ECT86/ECT60)-->
          <pdoEntry idx="204A" subIdx="0" bitLen="16" halType="complex">
            <complexEntry bitLen="1" halPin="out-1" halType="bit"/>
            <complexEntry bitLen="1" halPin="out-2" halType="bit"/>
            <complexEntry bitLen="14"/>
          </pdoEntry>
        </pdo>
      </syncManager>
      <syncManager idx="3" dir="in">
        <pdo idx="1a00">
          <pdoEntry idx="6041" subIdx="00" bitLen="16" halPin="cia-statusword" halType="u32"/>
          <pdoEntry idx="6061" subIdx="00" bitLen="8" halPin="opmode-display" halType="s32"/>
          <pdoEntry idx="6064" subIdx="00" bitLen="32" halPin="actual-position" halType="s32"/>
          <pdoEntry idx="606C" subIdx="00" bitLen="32" halPin="actual-velocity" halType="s32"/>
          <pdoEntry idx="6077" subIdx="00" bitLen="32" halPin="actual-torque" halType="s32"/>
          <!-- Digtial_inputs (cia402 compatible) -->
          <pdoEntry idx="60FD" subIdx="0" bitLen="32" halType="complex">
            <complexEntry bitLen="1" halPin="CW-limit" halType="bit"/>
            <complexEntry bitLen="1" halPin="CCW-limit" halType="bit"/>
            <complexEntry bitLen="1" halPin="in-home" halType="bit"/>
            <complexEntry bitLen="13"/>
            <complexEntry bitLen="1" halPin="in-1" halType="bit"/>
            <complexEntry bitLen="1" halPin="in-2" halType="bit"/>
            <complexEntry bitLen="1" halPin="in-3" halType="bit"/>
            <complexEntry bitLen="1" halPin="in-4" halType="bit"/>
            <complexEntry bitLen="1" halPin="in-5" halType="bit"/>
            <complexEntry bitLen="1" halPin="in-6" halType="bit"/>
            <complexEntry bitLen="10"/>
          </pdoEntry>          
        </pdo>
      </syncManager>
    </slave>
 
 
 
  </master>
</masters>

 
  • farmer_mike
  • farmer_mike
12 Sep 2025 13:35 - 13 Sep 2025 01:36
Replied by farmer_mike on topic Getting (hopefully) close to an Rtelligent build

Getting (hopefully) close to an Rtelligent build

Category: EtherCAT

I have made some big progress lately. I have the limit switches and homing switches working. I also have the E stop working.

My issue is the RS750E AC servos shake quite a bit. Without the drive belts installed, the servos will sit and shake after completing a move. With the drive belts on, the system moves in the correct direction, but does so in a shaky manner.

My hypothesis is too much integral gain. I believe the problem is because I started with the stepper motor examples. Maybe there are some PID gains inside the drive that I need to configure.

I think what I need are the drive gains set with the SDO parameters inside the XML file.

Thanks for all the help

###########################################################
#
# CIA 402 example snippet Hal
#
###########################################################

###########################################################
# Setup
###########################################################

loadrt [KINS]KINEMATICS
loadrt [EMCMOT]EMCMOT servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[KINS]JOINTS


loadusr -W lcec_conf ethercat-conf.xml
#loadusr -W /home/cnc/linuxcnc/configs/linuxcnc-cia402-single/python_control.py

loadrt lcec
loadrt cia402 count=3
loadrt pid names=0-pid,1-pid,2-pid

loadrt bitslice count=6 personality=32,32,32,32,32,32
addf bitslice.0 servo-thread
addf bitslice.1 servo-thread
addf bitslice.2 servo-thread
addf bitslice.3 servo-thread
addf bitslice.4 servo-thread
addf bitslice.5 servo-thread

loadrt conv_s32_u32 count=6
addf conv-s32-u32.0 servo-thread
addf conv-s32-u32.1 servo-thread
addf conv-s32-u32.2 servo-thread
addf conv-s32-u32.3 servo-thread
addf conv-s32-u32.4 servo-thread
addf conv-s32-u32.5 servo-thread



###########################################################
# Functions servo-thread
###########################################################

addf lcec.read-all servo-thread
addf cia402.0.read-all servo-thread
addf cia402.1.read-all servo-thread
addf cia402.2.read-all servo-thread

addf motion-command-handler servo-thread
addf motion-controller servo-thread

addf 0-pid.do-pid-calcs servo-thread
addf 1-pid.do-pid-calcs servo-thread
addf 2-pid.do-pid-calcs servo-thread

addf cia402.0.write-all servo-thread
addf cia402.1.write-all servo-thread
addf cia402.2.write-all servo-thread
addf lcec.write-all servo-thread


#########################################
#nets
#########################################
net emc-enable => iocontrol.0.emc-enable-in
sets emc-enable 1

#config


#
# Joint 0
#
setp cia402.0.csp-mode 1
setp cia402.0.pos-scale 786432


#from servo(ethercat) to cia402
net 0-statusword lcec.0.0.cia-statusword => cia402.0.statusword
net 0-opmode-display lcec.0.0.opmode-display => cia402.0.opmode-display
net 0-drv-act-pos lcec.0.0.actual-position => cia402.0.drv-actual-position
net 0-drv-act-velo lcec.0.0.actual-velocity => cia402.0.drv-actual-velocity

#from motion to cia

net 0-enable <= joint.0.amp-enable-out => cia402.0.enable
net 0-amp-fault => joint.0.amp-fault-in <= cia402.0.drv-fault
net 0-pos-cmd <= joint.0.motor-pos-cmd => cia402.0.pos-cmd
net 0-pos-fb => joint.0.motor-pos-fb <= cia402.0.pos-fb


#from cia402 to servo(ethercat)
net 0-controlword cia402.0.controlword => lcec.0.0.cia-controlword
net 0-modes-of-operation cia402.0.opmode => lcec.0.0.opmode
net 0-drv-target-pos cia402.0.drv-target-position => lcec.0.0.target-position
net 0-drv-target-velo cia402.0.drv-target-velocity => lcec.0.0.target-velocity


net my-out-0 conv-s32-u32.0.in <= lcec.0.0.digitalinputs
net my-in-0 conv-s32-u32.0.out => bitslice.0.in
net my-bit-0 bitslice.0.out-00 joint.0.neg-lim-sw-in

net my-out-0 conv-s32-u32.1.in <= lcec.0.0.digitalinputs
net my-in-1 conv-s32-u32.1.out => bitslice.1.in
net my-bit-1 bitslice.1.out-01 joint.0.pos-lim-sw-in

net my-out-0 conv-s32-u32.2.in <= lcec.0.0.digitalinputs
net my-in-2 conv-s32-u32.2.out => bitslice.2.in
net my-bit-2 bitslice.2.out-02 joint.0.home-sw-in


#
# Joint 1
#
setp cia402.1.csp-mode 1
setp cia402.1.pos-scale -786432

#from servo(ethercat) to cia402
net 1-statusword lcec.0.1.cia-statusword => cia402.1.statusword
net 1-opmode-display lcec.0.1.opmode-display => cia402.1.opmode-display
net 1-drv-act-pos lcec.0.1.actual-position => cia402.1.drv-actual-position
net 1-drv-act-velo lcec.0.1.actual-velocity => cia402.1.drv-actual-velocity

#from cia402 to servo(ethercat)
net 1-controlword cia402.1.controlword => lcec.0.1.cia-controlword
net 1-modes-of-operation cia402.1.opmode => lcec.0.1.opmode
net 1-drv-target-pos cia402.1.drv-target-position => lcec.0.1.target-position
net 1-drv-target-velo cia402.1.drv-target-velocity => lcec.0.1.target-velocity

#from motion to cia
net 1-enable <= joint.1.amp-enable-out => cia402.1.enable
net 1-amp-fault => joint.1.amp-fault-in <= cia402.1.drv-fault
net 1-pos-cmd <= joint.1.motor-pos-cmd => cia402.1.pos-cmd
net 1-pos-fb => joint.1.motor-pos-fb <= cia402.1.pos-fb


net my-out-1 conv-s32-u32.3.in <= lcec.0.1.digitalinputs
net my-in-3 conv-s32-u32.3.out => bitslice.3.in
net my-bit-3 bitslice.3.out-00 joint.1.pos-lim-sw-in

net my-out-1 conv-s32-u32.4.in <= lcec.0.1.digitalinputs
net my-in-4 conv-s32-u32.4.out => bitslice.4.in
net my-bit-4 bitslice.4.out-01 joint.1.neg-lim-sw-in

net my-out-1 conv-s32-u32.5.in <= lcec.0.1.digitalinputs
net my-in-5 conv-s32-u32.5.out => bitslice.5.in
net my-bit-5 bitslice.5.out-02 joint.1.home-sw-in


#
# Joint 2
#
setp cia402.2.csp-mode 1
setp cia402.2.pos-scale 96000

#from servo(ethercat) to cia402
net 2-statusword lcec.0.2.cia-statusword => cia402.2.statusword
net 2-opmode-display lcec.0.2.opmode-display => cia402.2.opmode-display
net 2-drv-act-pos lcec.0.2.actual-position => cia402.2.drv-actual-position
net 2-drv-act-velo lcec.0.2.actual-velocity => cia402.2.drv-actual-velocity

#from cia402 to servo(ethercat)
net 2-controlword cia402.2.controlword => lcec.0.2.cia-controlword
net 2-modes-of-operation cia402.2.opmode => lcec.0.2.opmode
net 2-drv-target-pos cia402.2.drv-target-position => lcec.0.2.target-position
net 2-drv-target-velo cia402.2.drv-target-velocity => lcec.0.2.target-velocity

#from motion to cia
net 2-enable <= joint.2.amp-enable-out => cia402.2.enable
net 2-amp-fault => joint.2.amp-fault-in <= cia402.2.drv-fault
net 2-pos-cmd <= joint.2.motor-pos-cmd => cia402.2.pos-cmd
net 2-pos-fb => joint.2.motor-pos-fb <= cia402.2.pos-fb

net 2-CCW-limit lcec.0.2.in-3 => joint.2.neg-lim-sw-in
net 2-CW-limit lcec.0.2.in-4 => joint.2.pos-lim-sw-in
net 2-in-home lcec.0.2.in-5 => joint.2.home-sw-in
net 2-in-6 lcec.0.2.in-6 => halui.estop.activate


#net spindle_speed spindle.0.speed-out => python_control.rpm_in
[code]# This config file was created 2020-08-14 17:19:37.621705 by the update_ini script
# The original config files may be found in the /home/demo/linuxcnc/configs/et-3ax/et_3ax_CIA402.old directory

[EMC]
# The version string for this INI file.
VERSION = 1.1

MACHINE = EtherCAT Machine
DEBUG = 1

[DISPLAY]
DISPLAY = axis
EDITOR = gedit

#PYVCP = pyvcp_panel.xml

# places the pyvcp panel at the bottom of the Axis window
PYVCP_POSITION = RIGHT

# Cycle time, in seconds, that display will sleep between polls
CYCLE_TIME =            0.100

# Path to help file
HELP_FILE =             doc/help.txt

# Initial display setting for position, RELATIVE or MACHINE
POSITION_OFFSET = RELATIVE
POSITION_FEEDBACK = ACTUAL
MAX_FEED_OVERRIDE = 1
# Prefix to be used
PROGRAM_PREFIX = /home/demo/linuxcnc/nc_files
INTRO_GRAPHIC = linuxcnc.gif
INTRO_TIME = 0
INCREMENTS = 1in .5in .25in .125in .0625in .025in .05in
#INCREMENTS = 5mm 1mm .5mm .1mm .05mm .01mm .005mm

[FILTER]
PROGRAM_EXTENSION = .png,.gif,.jpg Greyscale Depth Image
PROGRAM_EXTENSION = .py Python Script
png = image-to-gcode
gif = image-to-gcode
jpg = image-to-gcode
py = python
nc = /usr/bin/axis

[RS274NGC]

PARAMETER_FILE = linuxcnc.var

[EMCMOT]

EMCMOT = motmod
COMM_TIMEOUT = 1.0
BASE_PERIOD =  0
SERVO_PERIOD = 1000000

[TASK]
TASK = milltask
CYCLE_TIME = 0.005

[HAL]
HALFILE = cia402.hal
#SHUTDOWN = shutdown.hal
HALUI = halui

[HALUI]

[TRAJ]

HOME = 16 12 7
COORDINATES = XYZ
LINEAR_UNITS = in
ANGULAR_UNITS = deg
DEFAULT_LINEAR_VELOCITY = .25
MAX_LINEAR_VELOCITY = .5
MIN_LINEAR_VELOCITY = .01
DEFAULT_ANGULAR_VELOCITY = 360
MAX_ANGULAR_VELOCITY = 720
POSITION_FILE = position.txt

[EMCIO]

# Name of IO controller program, e.g., iov2 has tool changer stuff
EMCIO =         iov2

CYCLE_TIME =    0.100

# tool table file
TOOL_TABLE =    cia402.tbl
TOOL_CHANGE_POSITION = 0 0 50.8
#RANDOM_TOOLCHANGER = 1


[KINS]
JOINTS = 3
KINEMATICS = trivkins kinstype=both coordinates=xyz


[AXIS_X]
MIN_LIMIT = 0.1
MAX_LIMIT = 17.9
MAX_VELOCITY = .5
MAX_ACCELERATION = 10
BACKLASH = 0.0000

[JOINT_0]
TYPE = LINEAR
MAX_VELOCITY = .5
MAX_ACCELERATION = 10

DEADBAND = 0.01
P=1
I=0
D=0

# The values below should be 25% larger than MAX_VELOCITY and MAX_ACCELERATION
# If using BACKLASH compensation STEPGEN_MAXACCEL should be 100% larger.
# is this applicable for ethercat????
#STEPGEN_MAXVEL = 1.25
#STEPGEN_MAXACCEL = 1.25
SCALE = 1
FERROR = 200
MIN_FERROR = 50
MIN_LIMIT = 0
MAX_LIMIT = 18
HOME                    = 16
HOME_OFFSET                = 16
HOME_SEQUENCE            = 0

HOME_SEARCH_VEL = -.125
HOME_LATCH_VEL = -.125
HOME_USE_INDEX = NO
HOME_IGNORE_LIMITS        = NO





[AXIS_Y]
MIN_LIMIT = 0.1
MAX_LIMIT = 12.9
MAX_VELOCITY = .5
MAX_ACCELERATION = 10
BACKLASH = 0.0000


[JOINT_1]
TYPE = LINEAR
MAX_VELOCITY = .5
MAX_ACCELERATION = 10

DEADBAND = 0.01
P=1
I=0
D=0


# The values below should be 25% larger than MAX_VELOCITY and MAX_ACCELERATION
# If using BACKLASH compensation STEPGEN_MAXACCEL should be 100% larger.
# is this applicable for ethercat????
#STEPGEN_MAXVEL = 1.25
#STEPGEN_MAXACCEL = 1.25
STEP_SCALE = 1
FERROR = 2
MIN_FERROR = 20
MIN_LIMIT = 0
MAX_LIMIT = 13

HOME                    = 12
HOME_OFFSET                = 12
HOME_SEQUENCE            = 1

HOME_SEARCH_VEL = .125
HOME_LATCH_VEL = .125
HOME_USE_INDEX = NO
HOME_IGNORE_LIMITS        = NO


[JOINT_2]
TYPE = LINEAR
MAX_VELOCITY = .5
MAX_ACCELERATION = 10
# The values below should be 25% larger than MAX_VELOCITY and MAX_ACCELERATION
# If using BACKLASH compensation STEPGEN_MAXACCEL should be 100% larger.
# is this applicable for ethercat????
STEPGEN_MAXVEL = 1.25
STEPGEN_MAXACCEL = 1.25
STEP_SCALE = 1
FERROR = 200
MIN_FERROR = 20
MIN_LIMIT = 3.4
MAX_LIMIT = 8.1
HOME                    = 7
HOME_OFFSET                = 7
HOME_SEQUENCE            = 2

HOME_SEARCH_VEL = .125
HOME_LATCH_VEL = .125
HOME_USE_INDEX = NO
HOME_IGNORE_LIMITS    = NO



[AXIS_Z]
MIN_LIMIT = 3.5
MAX_LIMIT = 8
MAX_VELOCITY = .5
MAX_ACCELERATION = 10
BACKLASH = 0.0000

[/code]
[code][code]<masters>
  <master idx="0" appTimePeriod="1000000" refClockSyncCycles="1">
     
    
  <slave idx="0" type="generic" vid="00000A88" pid="0a880013" configPdos="true">
   <!-- Joint 0 -->
   <syncManager idx="0" dir="out"> </syncManager>
   <syncManager idx="1" dir="out"> </syncManager>
   <syncManager idx="2" dir="out">
    <pdo idx="1600">
     <pdoEntry idx="6040" subIdx="00" bitLen="16" halPin="cia-controlword" halType="u32"/>
     <pdoEntry idx="607a" subIdx="00" bitLen="32" halPin="target-position" halType="s32"/>
     <pdoEntry idx="60b8" subIdx="00" bitLen="16" halPin="touchprobefunction0" halType="bit"/>
    </pdo>
    <pdo idx="1601">
     <pdoEntry idx="6081" subIdx="00" bitLen="32" halPin="profile-velocity" halType="u32"/>
     <pdoEntry idx="6083" subIdx="00" bitLen="32" halPin="target-accel" halType="u32"/>
     <pdoEntry idx="6084" subIdx="00" bitLen="32" halPin="target-decel" halType="u32"/>
     <pdoEntry idx="6060" subIdx="00" bitLen="8" halPin="opmode" halType="s32"/>
    </pdo>
    <pdo idx="1602">
     <pdoEntry idx="60ff" subIdx="00" bitLen="32" halPin="target-velocity" halType="s32"/>
    </pdo>
   </syncManager>
   <syncManager idx="3" dir="in">
    <pdo idx="1a00">
     <pdoEntry idx="603f" subIdx="00" bitLen="16" halPin="errorcode" halType="bit"/>
     <pdoEntry idx="6041" subIdx="00" bitLen="16" halPin="cia-statusword" halType="u32"/>
     <pdoEntry idx="6061" subIdx="00" bitLen="8" halPin="opmode-display" halType="s32"/>
     <pdoEntry idx="6064" subIdx="00" bitLen="32" halPin="actual-position" halType="s32"/>
     <pdoEntry idx="60b9" subIdx="00" bitLen="16" halPin="touchprobestat" halType="bit"/>
     <pdoEntry idx="60ba" subIdx="00" bitLen="32" halPin="touchprobe1pos" halType="s32"/>
     <pdoEntry idx="60fd" subIdx="00" bitLen="32" halPin="digitalinputs" halType="s32"/>
    </pdo>
    <pdo idx="1a01">
     <pdoEntry idx="606c" subIdx="00" bitLen="32" halPin="actual-velocity" halType="s32"/>
    </pdo>
   </syncManager>
   <dcConf assignActivate="300" sync0Cycle="1000000"/>
  </slave>
 
 
  <slave idx="1" type="generic" vid="00000A88" pid="0a880013" configPdos="true">
   <!-- Joint 1 -->
   <syncManager idx="0" dir="out"> </syncManager>
   <syncManager idx="1" dir="out"> </syncManager>
   <syncManager idx="2" dir="out">
    <pdo idx="1600">
     <pdoEntry idx="6040" subIdx="00" bitLen="16" halPin="cia-controlword" halType="u32"/>
     <pdoEntry idx="607a" subIdx="00" bitLen="32" halPin="target-position" halType="s32"/>
     <pdoEntry idx="60b8" subIdx="00" bitLen="16" halPin="touchprobefunction0" halType="bit"/>
    </pdo>
    <pdo idx="1601">
     <pdoEntry idx="6081" subIdx="00" bitLen="32" halPin="profile-velocity" halType="u32"/>
     <pdoEntry idx="6083" subIdx="00" bitLen="32" halPin="target-accel" halType="u32"/>
     <pdoEntry idx="6084" subIdx="00" bitLen="32" halPin="target-decel" halType="u32"/>
     <pdoEntry idx="6060" subIdx="00" bitLen="8" halPin="opmode" halType="s32"/>
    </pdo>
    <pdo idx="1602">
     <pdoEntry idx="60ff" subIdx="00" bitLen="32" halPin="target-velocity" halType="s32"/>
    </pdo>
   </syncManager>
   <syncManager idx="3" dir="in">
    <pdo idx="1a00">
     <pdoEntry idx="603f" subIdx="00" bitLen="16" halPin="errorcode" halType="bit"/>
     <pdoEntry idx="6041" subIdx="00" bitLen="16" halPin="cia-statusword" halType="u32"/>
     <pdoEntry idx="6061" subIdx="00" bitLen="8" halPin="opmode-display" halType="s32"/>
     <pdoEntry idx="6064" subIdx="00" bitLen="32" halPin="actual-position" halType="s32"/>
     <pdoEntry idx="60b9" subIdx="00" bitLen="16" halPin="touchprobestat" halType="bit"/>
     <pdoEntry idx="60ba" subIdx="00" bitLen="32" halPin="touchprobe1pos" halType="s32"/>
     <pdoEntry idx="60fd" subIdx="00" bitLen="32" halPin="digitalinputs" halType="s32"/>
    </pdo>
    <pdo idx="1a01">
     <pdoEntry idx="606c" subIdx="00" bitLen="32" halPin="actual-velocity" halType="s32"/>
    </pdo>
   </syncManager>
   <dcConf assignActivate="300" sync0Cycle="1000000"/>
  </slave>
 
     <!-- Joint 2 -->
    <slave idx="2" type="generic" vid="00000a88" pid="0a880002" configPdos="true">
      <dcConf assignActivate="300" sync0Cycle="*1" sync0Shift="0"/>
      <sdoConfig idx="2000" subIdx="0"><sdoDataRaw data ="88 13"/></sdoConfig>  <!-- Max motor current (5.0) -->
      <sdoConfig idx="2007" subIdx="3"><sdoDataRaw data ="01"/></sdoConfig>     <!-- Input 3 - CCW Limit -->
      <sdoConfig idx="2007" subIdx="4"><sdoDataRaw data ="02"/></sdoConfig>     <!-- Input 4 - CW Limit -->
      <sdoConfig idx="2007" subIdx="5"><sdoDataRaw data ="03"/></sdoConfig>     <!-- Input 5 - Home Function -->
      <sdoConfig idx="2007" subIdx="6"><sdoDataRaw data ="05"/></sdoConfig>     <!-- Input 6 - Emergency Stop -->
      <sdoConfig idx="2011" subIdx="0"><sdoDataRaw data ="01 00"/></sdoConfig>  <!-- Closed loop -->
      <sdoConfig idx="6098" subIdx="0"><sdoDataRaw data ="11 00"/></sdoConfig>  <!-- Home mode 17 -->
      <sdoConfig idx="607C" subIdx="0"><sdoDataRaw data ="00 00"/></sdoConfig>  <!-- Home offset 0  -->
      <sdoConfig idx="609A" subIdx="0"><sdoDataRaw data ="F4 01"/></sdoConfig>  <!-- Home accelleration 500 -->
      <sdoConfig idx="6099" subIdx="01"><sdoDataRaw data ="C4 09"/></sdoConfig>  <!-- Home fast speed 2500-->
      <sdoConfig idx="6099" subIdx="02"><sdoDataRaw data ="F4 01"/></sdoConfig>  <!-- Home slow speed 500 -->
      <syncManager idx="2" dir="out">
        <pdo idx="1600">
          <pdoEntry idx="6040" subIdx="00" bitLen="16" halPin="cia-controlword" halType="u32"/>
          <pdoEntry idx="6060" subIdx="00" bitLen="8" halPin="opmode" halType="s32"/>
          <!-- Target Position -->
          <pdoEntry idx="607A" subIdx="00" bitLen="32" halPin="target-position" halType="s32"/>
          <!-- Target Velocity -->
          <pdoEntry idx="60FF" subIdx="00" bitLen="32" halPin="target-velocity" halType="s32"/>
          <!-- Digtial Outputs (manufacturer's extension ECT86/ECT60)-->
          <pdoEntry idx="204A" subIdx="0" bitLen="16" halType="complex">
            <complexEntry bitLen="1" halPin="out-1" halType="bit"/>
            <complexEntry bitLen="1" halPin="out-2" halType="bit"/>
            <complexEntry bitLen="14"/>
          </pdoEntry>
        </pdo>
      </syncManager>
      <syncManager idx="3" dir="in">
        <pdo idx="1a00">
          <pdoEntry idx="6041" subIdx="00" bitLen="16" halPin="cia-statusword" halType="u32"/>
          <pdoEntry idx="6061" subIdx="00" bitLen="8" halPin="opmode-display" halType="s32"/>
          <pdoEntry idx="6064" subIdx="00" bitLen="32" halPin="actual-position" halType="s32"/>
          <pdoEntry idx="606C" subIdx="00" bitLen="32" halPin="actual-velocity" halType="s32"/>
          <pdoEntry idx="6077" subIdx="00" bitLen="32" halPin="actual-torque" halType="s32"/>
          <!-- Digtial_inputs (cia402 compatible) -->
          <pdoEntry idx="60FD" subIdx="0" bitLen="32" halType="complex">
            <complexEntry bitLen="1" halPin="CW-limit" halType="bit"/>
            <complexEntry bitLen="1" halPin="CCW-limit" halType="bit"/>
            <complexEntry bitLen="1" halPin="in-home" halType="bit"/>
            <complexEntry bitLen="13"/>
            <complexEntry bitLen="1" halPin="in-1" halType="bit"/>
            <complexEntry bitLen="1" halPin="in-2" halType="bit"/>
            <complexEntry bitLen="1" halPin="in-3" halType="bit"/>
            <complexEntry bitLen="1" halPin="in-4" halType="bit"/>
            <complexEntry bitLen="1" halPin="in-5" halType="bit"/>
            <complexEntry bitLen="1" halPin="in-6" halType="bit"/>
            <complexEntry bitLen="10"/>
          </pdoEntry>          
        </pdo>
      </syncManager>
    </slave>
 
 
 
  </master>
</masters>
[/code]


[/code]
  • Kuzma30
  • Kuzma30
08 Sep 2025 10:24
Replied by Kuzma30 on topic AMSAMOTION IO module

AMSAMOTION IO module

Category: EtherCAT

I change name for IN OUT and add halType="bit"
<masters>
  <master idx="0">
    <slave idx="0" type="generic" vid="0x00000b95" pid="0x00001101" name="D1">
      <!--EC3A-IO1632-->
      <syncManager idx="0" dir="in"/>
      <syncManager idx="1" dir="out"/>
      <syncManager idx="2" dir="out">
        <pdo idx="1600">
          <!--DOOutputs process data mapping-->
          <pdoEntry idx="7000" subIdx="01" bitLen="16" halPin="EC3A-do" halType="bit"/>
        </pdo>
      </syncManager>
      <syncManager idx="3" dir="in">
        <pdo idx="1a00">
          <!--DIInputs process data mapping-->
          <pdoEntry idx="6000" subIdx="01" bitLen="16" halPin="EC3A-di" halType="bit"/>
        </pdo>
      </syncManager>
    </slave>
  </master>
</masters>

Now I want run ladder for this module (to make plc program).
cat ec3a.hal ec3a.ini
# Load real-time components
loadrt threads name1=servo-thread period1=1000000  # 1ms servo thread (matches XML appTimePeriod)

# Load EtherCAT driver with config XML
loadusr -W lcec_conf ec3a_io_hal.xml
loadrt lcec

# Load ClassicLadder (nogui mode, loading your project file)
#loadusr -W classicladder --nogui ec3a_ladder.clp

loadrt classicladder_rt
addf classicladder.0.refresh servo-thread

# Connect example I/O pins to ClassicLadder (map %I0-%I3 to inputs, %Q0-%Q3 to outputs)
# Expand to all 16 as needed
#net input-0 classicladder.0.in-00 <= lcec.0.0.EC3A-di.0
#net input-1 classicladder.0.in-01 <= lcec.0.0.EC3A-di.1
#net input-2 classicladder.0.in-02 <= lcec.0.0.EC3A-di.2
#net input-3 classicladder.0.in-03 <= lcec.0.0.EC3A-di.3

#net output-0 classicladder.0.out-00 => lcec.0.0.EC3A-do.0
#net output-1 classicladder.0.out-01 => lcec.0.0.EC3A-do.1
#net output-2 classicladder.0.out-02 => lcec.0.0.EC3A-do.2
#net output-3 classicladder.0.out-03 => lcec.0.0.EC3A-do.3[EMC]
# The version string for this INI file.
VERSION = 1.1

MACHINE = EtherCAT Machine
DEBUG = 1

[DISPLAY]
DISPLAY = axis
EDITOR = gedit

#PYVCP = pyvcp_panel.xml

# places the pyvcp panel at the bottom of the Axis window
PYVCP_POSITION = RIGHT

# Cycle time, in seconds, that display will sleep between polls
CYCLE_TIME =            0.100

# Path to help file
HELP_FILE =             doc/help.txt

# Initial display setting for position, RELATIVE or MACHINE
POSITION_OFFSET = RELATIVE
POSITION_FEEDBACK = ACTUAL
MAX_FEED_OVERRIDE = 1.2
# Prefix to be used
PROGRAM_PREFIX = /home/cnc/linuxcnc/nc_files
INTRO_GRAPHIC = linuxcnc.gif
INTRO_TIME = 0
INCREMENTS = 5mm 1mm .5mm .1mm .05mm .01mm .005mm

[FILTER]
PROGRAM_EXTENSION = .png,.gif,.jpg Greyscale Depth Image
PROGRAM_EXTENSION = .py Python Script
png = image-to-gcode
gif = image-to-gcode
jpg = image-to-gcode
py = python
nc = /usr/bin/axis

[RS274NGC]

PARAMETER_FILE = linuxcnc.var

#[EMCMOT]

#EMCMOT = motmod
#COMM_TIMEOUT = 1.0
#BASE_PERIOD =  0
#SERVO_PERIOD = 1000000

[TASK]
TASK = milltask
CYCLE_TIME = 0.005

[HAL]
HALFILE = ec3a.hal
#SHUTDOWN = shutdown.hal
#HALFILE = custom.hal
#POSTGUI_HALFILE = pyvcp_panel.hal
HALUI = halui

#[HALUI]

[KINS]
KINEMATICS = trivkins coordinates=
JOINTS = 0

[TRAJ]
COORDINATES =
LINEAR_UNITS = mm
ANGULAR_UNITS = degree
DEFAULT_LINEAR_VELOCITY = 1.0
MAX_LINEAR_VELOCITY = 1.0

I have not motion axies. I get such errors during start
linuxcnc ec3a.ini
LINUXCNC - 2.9.4
Machine configuration directory is '/home/cnc/Завантажене'
Machine configuration file is 'ec3a.ini'
Starting LinuxCNC...
[EMCIO] CYCLE_TIME not found in /home/cnc/Завантажене/ec3a.ini; using default 0.100000
halui: no [TRAJ]COORDINATES specified, enabling all axes
linuxcnc TPMOD=tpmod HOMEMOD=homemod EMCMOT=motmod
Note: Using POSIX realtime
Found file(REL): ./ec3a.hal
creating ladder-state
emcTrajSetJoints failing: joints=0
emcMotionInit: emcTrajInit failed
Missing [TRAJ]COORDINATES
Shutting down and cleaning up LinuxCNC...
USRMOT: ERROR: command timeout
HAL: ERROR: exit called before init
<commandline>:0: waitpid failed milltask inihal

<commandline>:0: milltask exited without becoming ready
Note: Using POSIX realtime
LinuxCNC terminated with an error.  You can find more information in the log:
    /home/cnc/linuxcnc_debug.txt
and
    /home/cnc/linuxcnc_print.txt
as well as in the output of the shell command 'dmesg' and in the terminal


cat /home/cnc/linuxcnc_debug.txt
Can not find -sec TRAJ -var COORDINATES -num 1
3767
3797
Stopping realtime threads
Unloading hal components
cnc@cnc:~/Завантажене$ cat /home/cnc/linuxcnc_print.txt
RUN_IN_PLACE=no
LINUXCNC_DIR=
LINUXCNC_BIN_DIR=/usr/bin
LINUXCNC_TCL_DIR=/usr/lib/tcltk/linuxcnc
LINUXCNC_SCRIPT_DIR=
LINUXCNC_RTLIB_DIR=/usr/lib/linuxcnc/modules
LINUXCNC_CONFIG_DIR=
LINUXCNC_LANG_DIR=/usr/lib/tcltk/linuxcnc/msgs
INIVAR=inivar
HALCMD=halcmd
LINUXCNC_EMCSH=/usr/bin/wish8.6
INIFILE=/home/cnc/Завантажене/ec3a.ini
VERSION=1.1
PARAMETER_FILE=linuxcnc.var
TPMOD=
HOMEMOD=
TASK=milltask
HALUI=halui
DISPLAY=axis
COORDINATES=
KINEMATICS=trivkins coordinates=
Starting LinuxCNC server program: linuxcncsvr
Loading Real Time OS, RTAPI, and HAL_LIB modules
Starting LinuxCNC IO program: io
Starting HAL User Interface program: halui
Starting TASK program: milltask
Starting DISPLAY program: axis
Removing HAL_LIB, RTAPI, and Real Time OS modules
Removing NML shared memory segments


Is it possible run linuxcnc without axies (or with simulated axies)?
  • Leo90
  • Leo90
14 Aug 2025 07:48 - 14 Aug 2025 07:52

EL2502 and EL2535 PWM Ethercat BECKHOFF Modules

Category: EtherCAT

So I took some time and created a generic driver for EL2502 that works for me. I can control frequency and duty cycle with two seperate 16bit integers. This has been tested only in one channel but for second channel, PDOs should be 1603 with the same sub indexes as for the first. 
SDO index 02 is to set control number from SINT16 to UINT16 and index 07 to change operation mode to frequency AND duty cycle.
I hope this helps you.
    <slave idx="4" type="generic" vid="00000002" pid="09c63052" configPdos="true">
<sdoConfig idx="8000" subIdx="02">
<sdoDataRaw data="01"/>
</sdoConfig>
<sdoConfig idx="8000" subIdx="07">
<sdoDataRaw data="01"/>
</sdoConfig>
      <syncManager idx="2" dir="out">
        <pdo idx="1602">
          <pdoEntry idx="1602" subIdx="01" bitLen="16" halPin="Duty-ch1" halType="u32"/>
          <pdoEntry idx="1602" subIdx="02" bitLen="16" halPin="PWM-out-ch1" halType="u32"/> 
        
        </pdo>
      </syncManager>
    </slave>
 
  • Hakan
  • Hakan
14 Aug 2025 07:14

New EtherCAT Slave Devices REAL data to HAL

Category: EtherCAT

The boards looks nice, is it a hobby or are you going to sell them?

I guess you already know this but just in case, here is how you create individual pins for i/o
   <pdoEntry idx="6002" subIdx="00" bitLen="8" halType="complex">
            <complexEntry bitLen="1" halPin="in-1" halType="bit"/>
            <complexEntry bitLen="1" halPin="in-2" halType="bit"/>
            <complexEntry bitLen="1" halPin="in-3" halType="bit"/>
and so on
  • emresensoy
  • emresensoy
13 Aug 2025 08:19

New EtherCAT Slave Devices REAL data to HAL

Category: EtherCAT

Hi there,
I made a new ethercat slave device, that you can connect any incremental encoder to ethercat network,
you can watch its video;


Everything is ok with Twincat, I can read A B Z pin situations, encoder puls register (s32), encoder rpm value (real)
But in HAL, I cant get ENC2RPM value correctly, it shows irrelevant numbers,
in xml file there is;
<pdoEntry idx="0006" subIdx="01" bitLen="32" halPin="ENC2RPM" halType="float" />

Main question;
what should be the halType for a variable that can read successfully in Twincat (REAL)


Slave devices ethercat xml command output is here;
<!-- Slave 3 -->
    <Vendor>
      <Id>1640067</Id>
    </Vendor>
    <Descriptions>
      <Devices>
        <Device>
          <Type ProductCode="#x00000001" RevisionNo="#x00000002">ENCODER INTERFACE</Type>
          <Name><![CDATA[ENCODER INTERFACE]]></Name>
          <Sm Enable="1" StartAddress="#x1000" ControlByte="#x64" DefaultSize="0" />
          <Sm Enable="1" StartAddress="#x1200" ControlByte="#x20" DefaultSize="0" />
          <RxPdo Sm="0" Fixed="1" Mandatory="1">
            <Index>#x1600</Index>
            <Name>Outputs</Name>
            <Entry>
              <Index>#x0005</Index>
              <SubIndex>1</SubIndex>
              <BitLen>32</BitLen>
              <Name>ENC1_PULS_PER_REV</Name>
              <DataType>UINT32</DataType>
            </Entry>
            <Entry>
              <Index>#x0005</Index>
              <SubIndex>2</SubIndex>
              <BitLen>32</BitLen>
              <Name>ENC2_PULS_PER_REV</Name>
              <DataType>UINT32</DataType>
            </Entry>
          </RxPdo>
          <TxPdo Sm="1" Fixed="1" Mandatory="1">
            <Index>#x1a00</Index>
            <Name>Inputs</Name>
            <Entry>
              <Index>#x0006</Index>
              <SubIndex>1</SubIndex>
              <BitLen>32</BitLen>
              <Name>ENC1RPM</Name>
              <DataType>UINT32</DataType>
            </Entry>
            <Entry>
              <Index>#x0006</Index>
              <SubIndex>2</SubIndex>
              <BitLen>32</BitLen>
              <Name>REAL_ENC1_PULSE_PER_REV</Name>
              <DataType>UINT32</DataType>
            </Entry>
            <Entry>
              <Index>#x0006</Index>
              <SubIndex>3</SubIndex>
              <BitLen>32</BitLen>
              <Name>ENC2RPM</Name>
              <DataType>UINT32</DataType>
            </Entry>
            <Entry>
              <Index>#x0006</Index>
              <SubIndex>4</SubIndex>
              <BitLen>32</BitLen>
              <Name>REAL_ENC2_PULSE_PER_REV</Name>
              <DataType>UINT32</DataType>
            </Entry>
            <Entry>
              <Index>#x0006</Index>
              <SubIndex>5</SubIndex>
              <BitLen>16</BitLen>
              <Name>ENC2POSITION</Name>
              <DataType>UINT16</DataType>
            </Entry>
            <Entry>
              <Index>#x0006</Index>
              <SubIndex>6</SubIndex>
              <BitLen>16</BitLen>
              <Name>ENC1POSITION</Name>
              <DataType>UINT16</DataType>
            </Entry>
            <Entry>
              <Index>#x0006</Index>
              <SubIndex>7</SubIndex>
              <BitLen>8</BitLen>
              <Name>ENC2A</Name>
              <DataType>UINT8</DataType>
            </Entry>
            <Entry>
              <Index>#x0006</Index>
              <SubIndex>8</SubIndex>
              <BitLen>8</BitLen>
              <Name>ENC2B</Name>
              <DataType>UINT8</DataType>
            </Entry>
            <Entry>
              <Index>#x0006</Index>
              <SubIndex>9</SubIndex>
              <BitLen>8</BitLen>
              <Name>ENC2Z</Name>
              <DataType>UINT8</DataType>
            </Entry>
            <Entry>
              <Index>#x0006</Index>
              <SubIndex>10</SubIndex>
              <BitLen>8</BitLen>
              <Name>ENC1A</Name>
              <DataType>UINT8</DataType>
            </Entry>
            <Entry>
              <Index>#x0006</Index>
              <SubIndex>11</SubIndex>
              <BitLen>8</BitLen>
              <Name>ENC1Z</Name>
              <DataType>UINT8</DataType>
            </Entry>
            <Entry>
              <Index>#x0006</Index>
              <SubIndex>12</SubIndex>
              <BitLen>8</BitLen>
              <Name>ENC1B</Name>
              <DataType>UINT8</DataType>
            </Entry>
          </TxPdo>
        </Device>
      </Devices>

           
  • Hakan
  • Hakan
09 Aug 2025 08:13
Replied by Hakan on topic Amplifier Fault ECT60 Closed Loop

Amplifier Fault ECT60 Closed Loop

Category: EtherCAT

I have three ECT60 and never had a problem. That's not any help of course, but I can offer my config.
<masters>
  <master idx="0" appTimePeriod="1000000" refClockSyncCycles="5">
    <slave idx="0" name="X" type="generic" vid="00000a88" pid="0a880002" configPdos="true">
      <dcConf assignActivate="300" sync0Cycle="*1" sync0Shift="0"/>
      <sdoConfig idx="2000" subIdx="0"><sdoDataRaw data ="a0 0f"/></sdoConfig>  <!-- Max motor current (3.0A=b80b 4.0=a00f 5.0=8813) Rated=4.0A -->
      <sdoConfig idx="2003" subIdx="0"><sdoDataRaw data ="64 00"/></sdoConfig>  <!-- Standby current percentage (100%) -->
      <sdoConfig idx="2011" subIdx="0"><sdoDataRaw data ="01 00"/></sdoConfig>  <!-- Closed loop -->
      <sdoConfig idx="2023" subIdx="1"><sdoDataRaw data ="a0 0f"/></sdoConfig>  <!-- Kp=4000 (def=2000) -->
      <syncManager idx="2" dir="out">
        <pdo idx="1600">
          <pdoEntry idx="6040" subIdx="00" bitLen="16" halPin="cia-controlword" halType="u32"/>
          <pdoEntry idx="6060" subIdx="00" bitLen="8" halPin="opmode" halType="s32"/>
          <pdoEntry idx="607A" subIdx="00" bitLen="32" halPin="target-position" halType="s32"/>
          #<pdoEntry idx="60FF" subIdx="00" bitLen="32" halPin="target-velocity" halType="s32"/>
        </pdo>
      </syncManager>
      <syncManager idx="3" dir="in">
        <pdo idx="1a00">
          <pdoEntry idx="6041" subIdx="00" bitLen="16" halPin="cia-statusword" halType="u32"/>
          <pdoEntry idx="6061" subIdx="00" bitLen="8" halPin="opmode-display" halType="s32"/>
          <pdoEntry idx="6064" subIdx="00" bitLen="32" halPin="actual-position" halType="s32"/>
          #<pdoEntry idx="606C" subIdx="00" bitLen="32" halPin="actual-velocity" halType="s32"/>
          #<pdoEntry idx="6077" subIdx="00" bitLen="32" halPin="actual-torque" halType="s32"/>
        </pdo>
      </syncManager>
    </slave>

You don't need to go the detour with sdoconfig to reset to factory default. You can set the SDO directly with
ethercat download 0x1011 1 1
and there is an "ethercat upload" that works in a similar way if you want to check individual SDOs.
If you haven't done so, power cycle the drive afterwards reset to factory default.
  • Aleske
  • Aleske
03 Aug 2025 18:04 - 03 Aug 2025 18:15
Replied by Aleske on topic Problems with Lichuan Ethercat servo drive

Problems with Lichuan Ethercat servo drive

Category: EtherCAT

Hello,I am in the process of getting 4x Lichuan LC10E drives running in CSP mode. I have also observed the behavior of a large following error in CSP mode, as user Sandro mentioned in his post on 14 Sep 2024. After many hours of trying to run CSP mode without encountering a large following error, I suspect that parameter 6068 "Position window time" is to blame. The default setting is 16 ms, which I interpret as the drive having 16 ms to reach the required position. Together with parameter 6067 "Position window", this allows for a large following error while the drive still believes it is operating correctly.

Unfortunately, I am unable to change these values. Initially, I tried reading them with:"<pdoEntry idx="6068" subIdx="00" bitLen="16" halPin="position-window-time" halType="u32"/>"

But this gives me a changing value in HAL show with strange behavior as I would expect a steady value of 16When I try to write to 6068, I get the following error:
LCEC: Slave 0.3: Failed to execute SDO Download (0x6068:0x00, size 2, byte0=1, error -5, abort_code 0000000=)
 Maybe this helps someone with more knowledge of EtherCAT achieve accurate positioning in CSP mode.Best regards,
Alex 
  • esmurf
  • esmurf
22 Jul 2025 11:46
Replied by esmurf on topic Trying to get my OMC A6 Servos homing

Trying to get my OMC A6 Servos homing

Category: EtherCAT

Try the following:
in hal connect your input pin to PDO 2004 Index 02 or 06 or 0A (pos limit, neg limit, home)
like
net y-limit-ext lcec.0.something.din-2 => lcec.0.X.pos-limit

in ethercat-conf.xml
<pdoEntry idx="2004" subIdx="02" bitLen="16" halPin="pos-limit" halType="u32" />

do not connect anything physically to the servo drives DI inputs.
  • esmurf
  • esmurf
22 Jul 2025 09:28 - 22 Jul 2025 09:59
Replied by esmurf on topic Trying to get my OMC A6 Servos homing

Trying to get my OMC A6 Servos homing

Category: EtherCAT

How did you wire your home and limit switches?
If you push the siwtches by hand, do you see the "pins" change in halshow?

I would recommend to wire the limit and home switches to the servo drives DI inputs.
Then you can see the signals in PDO 60FD.

e.g. add this to your ethercat-conf.xml for each A6 servo:

<pdoEntry idx="60FD" subIdx="00" bitLen="32" halType="complex">
<complexEntry bitLen="1" halPin="limit-neg" halType="bit"/>
<complexEntry bitLen="1" halPin="limit-pos" halType="bit"/>
<complexEntry bitLen="1" halPin="home-switch" halType="bit"/>
<complexEntry bitLen="13" />
<complexEntry bitLen="1" halPin="din1" halType="bit"/>
<complexEntry bitLen="1" halPin="din2" halType="bit"/>
<complexEntry bitLen="1" halPin="din3" halType="bit"/>
<complexEntry bitLen="1" halPin="din4" halType="bit"/>
<complexEntry bitLen="1" halPin="din5" halType="bit"/>
<complexEntry bitLen="1" halPin="din6" halType="bit"/>
<complexEntry bitLen="1" halPin="din7" halType="bit"/>
<complexEntry bitLen="1" halPin="din8" halType="bit"/>
<complexEntry bitLen="1" halPin="din9" halType="bit"/>
<complexEntry bitLen="7" />
</pdoEntry>


I use negative logic. You have to configure this on your drive to match the limit/home switches. This is permanently saved in the drive.
e.g.
# set operating mode
ethercat upload -p 2 --type int8 0x6060 0x00
ethercat download -p 2 --type int8 0x6060 0x00 8

# set "active low" DI input logic
ethercat upload -p 2 --type uint16 0x2004 0x02
ethercat download -p 2 --type uint16 0x2004 0x02 1

ethercat upload -p 2 --type uint16 0x2004 0x06
ethercat download -p 2 --type uint16 0x2004 0x06 1

ethercat upload -p 2 --type uint16 0x2004 0x0A
ethercat download -p 2 --type uint16 0x2004 0x0A 1

You also have to set homing mode  (PDO 0x6098) - see manual 
  • Tntmold
  • Tntmold
01 Jul 2025 13:40 - 01 Jul 2025 13:42
Replied by Tntmold on topic General Questions about using ethercat

General Questions about using ethercat

Category: EtherCAT

halshow value for cia402.0.csp-mode is true, but the drive parameters (value of modes-of-operation/cia402.0.opmode/lcec.0.x.opmode) is 0.

in the XML file there is
<pdoEntry idx="6060" subIdx="00" bitLen="8" halPin="opmode" halType="S32"/>

in the HAL file there is:

setp cia402.0.csp-mode 1
...
net x-modes-of-operation cia402.0.opmode => lcec.0.X.opmode
...

The drive wants parameter 6060 to be 8 for CSP mode. How do I correct that?
  • PedPEx
  • PedPEx
29 Jun 2025 22:21 - 30 Jun 2025 09:32

Problems switching PDO assignments (EP5101-0011)

Category: EtherCAT

Hello endian

I'm sorry for answering a little bit late, i was busy studying for my upcoming exams. I hope you are doing well and everything is good after the storm you mentioned?

I tried the config from the 23rd and had syntax issues with the InitCMD section. As far as i can tell, you removed it in the version you updated on the 25th. Without the InitCMDs, the encoder inputs indeed change over to their 32bit counter PDO, unfortunately they get stuck in a PREOP error state.
While starting the machine, it also threw error about the "<pdoEntry idx="0" bitLen="4" halPin="Control--194" halType="s32">" part, i just removed that part, because it's not used (gap), according to Beckhoffs docs. 

Do you know a solution to the "Slave does not support changing the PDO mapping!" problem, when the slave supports it for sure?
And thank you for your help so far :) 


dmesg output (grep EtherCAT) before starting the machine config
[code][    4.847665] EtherCAT: Master driver 1.6.0 1.6.0.gcafd367-1+1.1
[    4.848045] EtherCAT: 1 master waiting for devices.
[    4.865248] ec_generic: EtherCAT master generic Ethernet device module 1.6.0 1.6.0.gcafd367-1+1.1
[    4.865257] EtherCAT: Accepting B4:96:91:95:02:70 as main device for master 0.
[    4.896651] EtherCAT 0: Starting EtherCAT-IDLE thread.
[    7.436557] EtherCAT 0: Link state of ecm0 changed to UP.
[    7.445248] EtherCAT 0: 3 slave(s) responding on main device.
[    7.445250] EtherCAT 0: Slave states on main device: PREOP.
[    7.445535] EtherCAT 0: Scanning bus.
[    8.826355] EtherCAT 0: Bus scanning completed in 1380 ms.
[    8.826357] EtherCAT 0: Using slave 0 as DC reference clock.
[   11.980063] EtherCAT WARNING 0-0: SDO information error response while fetching SDO entry 0x1802:07!
[   11.980066] EtherCAT ERROR 0-0: SDO abort message 0x06090011: "Subindex does not exist".
[   11.983003] EtherCAT WARNING 0-0: SDO information error response while fetching SDO entry 0x1802:09!
[   11.983004] EtherCAT ERROR 0-0: SDO abort message 0x06090011: "Subindex does not exist".
[   11.997457] EtherCAT WARNING 0-0: SDO information error response while fetching SDO entry 0x1803:07!
[   11.997458] EtherCAT ERROR 0-0: SDO abort message 0x06090011: "Subindex does not exist".
[   12.000886] EtherCAT WARNING 0-0: SDO information error response while fetching SDO entry 0x1803:09!
[   12.000887] EtherCAT ERROR 0-0: SDO abort message 0x06090011: "Subindex does not exist".
[   12.015341] EtherCAT WARNING 0-0: SDO information error response while fetching SDO entry 0x1804:07!
[   12.015342] EtherCAT ERROR 0-0: SDO abort message 0x06090011: "Subindex does not exist".
[   12.018526] EtherCAT WARNING 0-0: SDO information error response while fetching SDO entry 0x1804:09!
[   12.018527] EtherCAT ERROR 0-0: SDO abort message 0x06090011: "Subindex does not exist".
[   12.033225] EtherCAT WARNING 0-0: SDO information error response while fetching SDO entry 0x1805:07!
[   12.033226] EtherCAT ERROR 0-0: SDO abort message 0x06090011: "Subindex does not exist".
[   12.036410] EtherCAT WARNING 0-0: SDO information error response while fetching SDO entry 0x1805:09!
[   12.036411] EtherCAT ERROR 0-0: SDO abort message 0x06090011: "Subindex does not exist".
[   12.599207] EtherCAT WARNING 0-1: SDO information error response while fetching SDO entry 0x1802:07!
[   12.599209] EtherCAT ERROR 0-1: SDO abort message 0x06090011: "Subindex does not exist".
[   12.602392] EtherCAT WARNING 0-1: SDO information error response while fetching SDO entry 0x1802:09!
[   12.602393] EtherCAT ERROR 0-1: SDO abort message 0x06090011: "Subindex does not exist".
[   12.617336] EtherCAT WARNING 0-1: SDO information error response while fetching SDO entry 0x1803:07!
[   12.617338] EtherCAT ERROR 0-1: SDO abort message 0x06090011: "Subindex does not exist".
[   12.620521] EtherCAT WARNING 0-1: SDO information error response while fetching SDO entry 0x1803:09!
[   12.620523] EtherCAT ERROR 0-1: SDO abort message 0x06090011: "Subindex does not exist".
[   12.634488] EtherCAT WARNING 0-1: SDO information error response while fetching SDO entry 0x1804:07!
[   12.634489] EtherCAT ERROR 0-1: SDO abort message 0x06090011: "Subindex does not exist".
[   12.637701] EtherCAT WARNING 0-1: SDO information error response while fetching SDO entry 0x1804:09!
[   12.637702] EtherCAT ERROR 0-1: SDO abort message 0x06090011: "Subindex does not exist".
[   12.652639] EtherCAT WARNING 0-1: SDO information error response while fetching SDO entry 0x1805:07!
[   12.652640] EtherCAT ERROR 0-1: SDO abort message 0x06090011: "Subindex does not exist".
[   12.655578] EtherCAT WARNING 0-1: SDO information error response while fetching SDO entry 0x1805:09!
[   12.655579] EtherCAT ERROR 0-1: SDO abort message 0x06090011: "Subindex does not exist".
[   13.214605] EtherCAT WARNING 0-2: SDO information error response while fetching SDO entry 0x1802:07!
[   13.214608] EtherCAT ERROR 0-2: SDO abort message 0x06090011: "Subindex does not exist".
[   13.217545] EtherCAT WARNING 0-2: SDO information error response while fetching SDO entry 0x1802:09!
[   13.217546] EtherCAT ERROR 0-2: SDO abort message 0x06090011: "Subindex does not exist".
[   13.231999] EtherCAT WARNING 0-2: SDO information error response while fetching SDO entry 0x1803:07!
[   13.232000] EtherCAT ERROR 0-2: SDO abort message 0x06090011: "Subindex does not exist".
[   13.235428] EtherCAT WARNING 0-2: SDO information error response while fetching SDO entry 0x1803:09!
[   13.235429] EtherCAT ERROR 0-2: SDO abort message 0x06090011: "Subindex does not exist".
[   13.249395] EtherCAT WARNING 0-2: SDO information error response while fetching SDO entry 0x1804:07!
[   13.249396] EtherCAT ERROR 0-2: SDO abort message 0x06090011: "Subindex does not exist".
[   13.252582] EtherCAT WARNING 0-2: SDO information error response while fetching SDO entry 0x1804:09!
[   13.252583] EtherCAT ERROR 0-2: SDO abort message 0x06090011: "Subindex does not exist".
[   13.267522] EtherCAT WARNING 0-2: SDO information error response while fetching SDO entry 0x1805:07!
[   13.267523] EtherCAT ERROR 0-2: SDO abort message 0x06090011: "Subindex does not exist".
[   13.270952] EtherCAT WARNING 0-2: SDO information error response while fetching SDO entry 0x1805:09!
[   13.270953] EtherCAT ERROR 0-2: SDO abort message 0x06090011: "Subindex does not exist".
[   22.277621] EtherCAT 0: Link state of ecm0 changed to DOWN.
[   22.285341] EtherCAT ERROR 0-1: Failed to receive AL state datagram: Datagram error.
[   22.293693] EtherCAT 0: 0 slave(s) responding on main device.
[   29.050914] EtherCAT 0: Link state of ecm0 changed to UP.
[   29.058887] EtherCAT 0: 3 slave(s) responding on main device.
[   29.058892] EtherCAT 0: Slave states on main device: INIT.
[   29.059186] EtherCAT 0: Scanning bus.
[   30.450244] EtherCAT 0: Bus scanning completed in 1388 ms.
[   30.450247] EtherCAT 0: Using slave 0 as DC reference clock.
[   30.455189] EtherCAT 0: Slave states on main device: PREOP.
[   33.606315] EtherCAT WARNING 0-0: SDO information error response while fetching SDO entry 0x1802:07!
[   33.606319] EtherCAT ERROR 0-0: SDO abort message 0x06090011: "Subindex does not exist".
[   33.609254] EtherCAT WARNING 0-0: SDO information error response while fetching SDO entry 0x1802:09!
[   33.609256] EtherCAT ERROR 0-0: SDO abort message 0x06090011: "Subindex does not exist".
[   33.623685] EtherCAT WARNING 0-0: SDO information error response while fetching SDO entry 0x1803:07!
[   33.623686] EtherCAT ERROR 0-0: SDO abort message 0x06090011: "Subindex does not exist".
[   33.626894] EtherCAT WARNING 0-0: SDO information error response while fetching SDO entry 0x1803:09!
[   33.626895] EtherCAT ERROR 0-0: SDO abort message 0x06090011: "Subindex does not exist".
[   33.641844] EtherCAT WARNING 0-0: SDO information error response while fetching SDO entry 0x1804:07!
[   33.641845] EtherCAT ERROR 0-0: SDO abort message 0x06090011: "Subindex does not exist".
[   33.645513] EtherCAT WARNING 0-0: SDO information error response while fetching SDO entry 0x1804:09!
[   33.645514] EtherCAT ERROR 0-0: SDO abort message 0x06090011: "Subindex does not exist".
[   33.659944] EtherCAT WARNING 0-0: SDO information error response while fetching SDO entry 0x1805:07!
[   33.659945] EtherCAT ERROR 0-0: SDO abort message 0x06090011: "Subindex does not exist".
[   33.662908] EtherCAT WARNING 0-0: SDO information error response while fetching SDO entry 0x1805:09!
[   33.662909] EtherCAT ERROR 0-0: SDO abort message 0x06090011: "Subindex does not exist".
[   34.220767] EtherCAT WARNING 0-1: SDO information error response while fetching SDO entry 0x1802:07!
[   34.220770] EtherCAT ERROR 0-1: SDO abort message 0x06090011: "Subindex does not exist".
[   34.223707] EtherCAT WARNING 0-1: SDO information error response while fetching SDO entry 0x1802:09!
[   34.223709] EtherCAT ERROR 0-1: SDO abort message 0x06090011: "Subindex does not exist".
[   34.238408] EtherCAT WARNING 0-1: SDO information error response while fetching SDO entry 0x1803:07!
[   34.238410] EtherCAT ERROR 0-1: SDO abort message 0x06090011: "Subindex does not exist".
[   34.241346] EtherCAT WARNING 0-1: SDO information error response while fetching SDO entry 0x1803:09!
[   34.241347] EtherCAT ERROR 0-1: SDO abort message 0x06090011: "Subindex does not exist".
[   34.256045] EtherCAT WARNING 0-1: SDO information error response while fetching SDO entry 0x1804:07!
[   34.256047] EtherCAT ERROR 0-1: SDO abort message 0x06090011: "Subindex does not exist".
[   34.258985] EtherCAT WARNING 0-1: SDO information error response while fetching SDO entry 0x1804:09!
[   34.258986] EtherCAT ERROR 0-1: SDO abort message 0x06090011: "Subindex does not exist".
[   34.273194] EtherCAT WARNING 0-1: SDO information error response while fetching SDO entry 0x1805:07!
[   34.273196] EtherCAT ERROR 0-1: SDO abort message 0x06090011: "Subindex does not exist".
[   34.276135] EtherCAT WARNING 0-1: SDO information error response while fetching SDO entry 0x1805:09!
[   34.276136] EtherCAT ERROR 0-1: SDO abort message 0x06090011: "Subindex does not exist".
[   34.838011] EtherCAT WARNING 0-2: SDO information error response while fetching SDO entry 0x1802:07!
[   34.838014] EtherCAT ERROR 0-2: SDO abort message 0x06090011: "Subindex does not exist".
[   34.841463] EtherCAT WARNING 0-2: SDO information error response while fetching SDO entry 0x1802:09!
[   34.841465] EtherCAT ERROR 0-2: SDO abort message 0x06090011: "Subindex does not exist".
[   34.855647] EtherCAT WARNING 0-2: SDO information error response while fetching SDO entry 0x1803:07!
[   34.855648] EtherCAT ERROR 0-2: SDO abort message 0x06090011: "Subindex does not exist".
[   34.858587] EtherCAT WARNING 0-2: SDO information error response while fetching SDO entry 0x1803:09!
[   34.858588] EtherCAT ERROR 0-2: SDO abort message 0x06090011: "Subindex does not exist".
[   34.873043] EtherCAT WARNING 0-2: SDO information error response while fetching SDO entry 0x1804:07!
[   34.873045] EtherCAT ERROR 0-2: SDO abort message 0x06090011: "Subindex does not exist".
[   34.876006] EtherCAT WARNING 0-2: SDO information error response while fetching SDO entry 0x1804:09!
[   34.876007] EtherCAT ERROR 0-2: SDO abort message 0x06090011: "Subindex does not exist".
[   34.890459] EtherCAT WARNING 0-2: SDO information error response while fetching SDO entry 0x1805:07!
[   34.890461] EtherCAT ERROR 0-2: SDO abort message 0x06090011: "Subindex does not exist".
[   34.893645] EtherCAT WARNING 0-2: SDO information error response while fetching SDO entry 0x1805:09!
[   34.893646] EtherCAT ERROR 0-2: SDO abort message 0x06090011: "Subindex does not exist".
[/code]
[code]dmesg output (grep EtherCAT) that was added after starting the machine config
[code][  190.676872] EtherCAT: Requesting master 0...
[  190.676875] EtherCAT: Successfully requested master 0.
[  190.677525] EtherCAT 0: Domain0: Logical address 0x00000000, 45 byte, expected working counter 9.
[  190.677527] EtherCAT 0:   Datagram domain0-0-main: Logical offset 0x00000000, 45 byte, type LRW.
[  190.677538] EtherCAT 0: Master thread exited.
[  190.677539] EtherCAT 0: Starting EtherCAT-OP thread.
[  190.677584] EtherCAT WARNING 0: 2 datagrams TIMED OUT!
[  190.677586] EtherCAT WARNING 0: 2 datagrams UNMATCHED!
[  190.798114] EtherCAT WARNING 0-0: Slave does not support changing the PDO mapping!
[  190.798116] EtherCAT WARNING 0-0: Currently mapped PDO entries: 0x7000:01/1 0x7000:02/1 0x7000:03/1 0x7000:04/1 0x0000:00/4 0x0000:00/8 0x7000:11/32. Entries to map: 0x7000:01/1 0x7000:02/1 0x7000:03/1 0x7000:04/1 0x7000:11/32
[  190.876116] EtherCAT WARNING 0-0: Slave does not support changing the PDO mapping!
[  190.876119] EtherCAT WARNING 0-0: Currently mapped PDO entries: 0x6000:01/1 0x6000:02/1 0x6000:03/1 0x6000:04/1 0x6000:05/1 0x6000:06/1 0x6000:07/1 0x6000:08/1 0x6000:09/1 0x6000:0A/1 0x6000:0B/1 0x6000:0C/1 0x6000:0D/1 0x1C32:20/1 0x1801:07/1 0x1801:09/1 0x6000:11/32 0x6000:12/32. Entries to map: 0x6000:01/1 0x6000:02/1 0x6000:03/1 0x6000:04/1 0x6000:05/1 0x6000:06/1 0x6000:07/1 0x6000:08/1 0x6000:09/1 0x6000:10/1 0x6000:11/1 0x6000:12/1 0x6000:13/1 0x1C32:32/1 0x1801:07/1 0x1801:09/1 0x6000:17/32 0x6000:18/32
[  195.888053] EtherCAT WARNING 0-0: Slave did not sync after 5000 ms.
[  195.892053] EtherCAT ERROR 0-0: Failed to set SAFEOP state, slave refused state change (PREOP + ERROR).
[  195.893053] EtherCAT ERROR 0-0: AL status message 0x001D: "Invalid output configuration".
[  195.895052] EtherCAT 0-0: Acknowledged state PREOP.
[  195.942054] EtherCAT WARNING 0-1: Slave does not support changing the PDO mapping!
[  195.942057] EtherCAT WARNING 0-1: Currently mapped PDO entries: 0x7000:01/1 0x7000:02/1 0x7000:03/1 0x7000:04/1 0x0000:00/4 0x0000:00/8 0x7000:11/32. Entries to map: 0x7000:01/1 0x7000:02/1 0x7000:03/1 0x7000:04/1 0x7000:11/32
[  196.011052] EtherCAT WARNING 0-1: Slave does not support changing the PDO mapping!
[  196.011054] EtherCAT WARNING 0-1: Currently mapped PDO entries: 0x6000:01/1 0x6000:02/1 0x6000:03/1 0x6000:04/1 0x6000:05/1 0x6000:06/1 0x6000:07/1 0x6000:08/1 0x6000:09/1 0x6000:0A/1 0x6000:0B/1 0x6000:0C/1 0x6000:0D/1 0x1C32:20/1 0x1801:07/1 0x1801:09/1 0x6000:11/32 0x6000:12/32. Entries to map: 0x6000:01/1 0x6000:02/1 0x6000:03/1 0x6000:04/1 0x6000:05/1 0x6000:06/1 0x6000:07/1 0x6000:08/1 0x6000:09/1 0x6000:10/1 0x6000:11/1 0x6000:12/1 0x6000:13/1 0x1C32:32/1 0x1801:07/1 0x1801:09/1 0x6000:17/32 0x6000:18/32
[  196.030052] EtherCAT ERROR 0-1: Failed to set SAFEOP state, slave refused state change (PREOP + ERROR).
[  196.031052] EtherCAT ERROR 0-1: AL status message 0x001D: "Invalid output configuration".
[  196.033050] EtherCAT 0-1: Acknowledged state PREOP.
[  196.080051] EtherCAT WARNING 0-2: Slave does not support changing the PDO mapping!
[  196.080053] EtherCAT WARNING 0-2: Currently mapped PDO entries: 0x7000:01/1 0x7000:02/1 0x7000:03/1 0x7000:04/1 0x0000:00/4 0x0000:00/8 0x7000:11/32. Entries to map: 0x7000:01/1 0x7000:02/1 0x7000:03/1 0x7000:04/1 0x7000:11/32
[  196.148050] EtherCAT WARNING 0-2: Slave does not support changing the PDO mapping!
[  196.148052] EtherCAT WARNING 0-2: Currently mapped PDO entries: 0x6000:01/1 0x6000:02/1 0x6000:03/1 0x6000:04/1 0x6000:05/1 0x6000:06/1 0x6000:07/1 0x6000:08/1 0x6000:09/1 0x6000:0A/1 0x6000:0B/1 0x6000:0C/1 0x6000:0D/1 0x1C32:20/1 0x1801:07/1 0x1801:09/1 0x6000:11/32 0x6000:12/32. Entries to map: 0x6000:01/1 0x6000:02/1 0x6000:03/1 0x6000:04/1 0x6000:05/1 0x6000:06/1 0x6000:07/1 0x6000:08/1 0x6000:09/1 0x6000:10/1 0x6000:11/1 0x6000:12/1 0x6000:13/1 0x1C32:32/1 0x1801:07/1 0x1801:09/1 0x6000:17/32 0x6000:18/32
[  198.251024] EtherCAT ERROR 0-2: Failed to set SAFEOP state, slave refused state change (PREOP + ERROR).
[  198.252024] EtherCAT ERROR 0-2: AL status message 0x001D: "Invalid output configuration".
[  198.254024] EtherCAT 0-2: Acknowledged state PREOP.
[/code]
[/code]
[code][code]ethercat-conf machine config
[code]<masters>
    <master idx="0" appTimePeriod="1000000" refClockSyncCycles="1000" name="m0">
    <!-- EP5101 - Incr. Encoder Input -->
        <slave idx="0" type="generic" vid="0x00000002" pid="0x13ED4052" name="EP5101-0" configPdos="true">
            <!-- IMPORTANT: sometime (sync1Cycle = n * sync0Cycle) sync1Cycle must be appTimePeriod - sync0Cycle) -->
            <!-- Check your DC config...generated is from impoted .xml but assignActivate is hard coded ... it should be different -->
            <dcConf assignActivate="1000" sync0Cycle="1000000" sync0Shift="0" sync1Cycle="0" sync1Shift="0"/>
            <sdoConfig idx="1C12" subIdx="complete">
                <sdoDataRaw data="01000116"/>
            </sdoConfig>
            <sdoConfig idx="1C13" subIdx="complete">
                <sdoDataRaw data="0100011A"/>
            </sdoConfig>
            <syncManager idx="0" dir="out"/>
            <syncManager idx="1" dir="in"/>
            <syncManager idx="2" dir="out">
            <pdo idx="1601">
                    <!-- Enable latch C -->
                    <pdoEntry idx="7000" subIdx="01" bitLen="1" halPin="enable-latch-C" halType="bit"/>
                    <!-- Enable latch extern on positive edge -->
                    <pdoEntry idx="7000" subIdx="02" bitLen="1" halPin="ena-latch-ext-on-pos_edge" halType="bit"/>
                    <!-- Set counter -->
                    <pdoEntry idx="7000" subIdx="03" bitLen="1" halPin="set-counter" halType="bit"/>
                    <!-- Enable latch extern on negative edge -->
                    <pdoEntry idx="7000" subIdx="04" bitLen="1" halPin="ena-latch-ext-on-neg_edge" halType="bit"/>
                    <!-- Set counter value -->
                    <pdoEntry idx="7000" subIdx="11" bitLen="32" halPin="set-counter_value" halType="u32"/>
            </pdo>
            </syncManager>
            <syncManager idx="3" dir="in">
                <pdo idx="1A01">
                <pdoEntry idx="6000" subIdx="01" bitLen="1" halPin="Status-Latch-C-197" halType="bit">
                </pdoEntry>
                <pdoEntry idx="6000" subIdx="02" bitLen="1" halPin="Status-Latch-e-198" halType="bit">
                </pdoEntry>
                <pdoEntry idx="6000" subIdx="03" bitLen="1" halPin="Status-Set-cou-199" halType="bit">
                <!-- ENC STATUS-Status- -Set-cou-199 -->
                </pdoEntry>
                <pdoEntry idx="6000" subIdx="04" bitLen="1" halPin="Status-Counter-200" halType="bit">
                <!-- ENC STATUS-Status- -Counter-200 -->
                </pdoEntry>
                <pdoEntry idx="6000" subIdx="05" bitLen="1" halPin="Status-Counter-201" halType="bit">
                <!-- ENC STATUS-Status- -Counter-201 -->
                </pdoEntry>
                <pdoEntry idx="6000" subIdx="06" bitLen="1" halPin="Status-Status-202" halType="bit">
                <!-- ENC STATUS-Status- -Status- -202 -->
                </pdoEntry>
                <pdoEntry idx="6000" subIdx="07" bitLen="1" halPin="Status-Open-ci-203" halType="bit">
                <!-- ENC STATUS-Status- -Open-ci-203 -->
                </pdoEntry>
                <pdoEntry idx="6000" subIdx="08" bitLen="1" halPin="Status-Extrapo-204" halType="bit">
                <!-- ENC STATUS-Status- -Extrapo-204 -->
                </pdoEntry>
                <pdoEntry idx="6000" subIdx="09" bitLen="1" halPin="Status-Status-205" halType="bit">
                <!-- ENC STATUS-Status- -Status- -205 -->
                </pdoEntry>
                <pdoEntry idx="6000" subIdx="10" bitLen="1" halPin="Status-Status-206" halType="bit">
                <!-- ENC STATUS-Status- -Status- -206 -->
                </pdoEntry>
                <pdoEntry idx="6000" subIdx="11" bitLen="1" halPin="Status-Status-207" halType="bit">
                <!-- ENC STATUS-Status- -Status- -207 -->
                </pdoEntry>
                <pdoEntry idx="6000" subIdx="12" bitLen="1" halPin="Status-Status-208" halType="bit">
                <!-- ENC STATUS-Status- -Status- -208 -->
                </pdoEntry>
                <pdoEntry idx="6000" subIdx="13" bitLen="1" halPin="Status-Status-209" halType="bit">
                <!-- ENC STATUS-Status- -Status- -209 -->
                </pdoEntry>
                <pdoEntry idx="1C32" subIdx="32" bitLen="1" halPin="Status-Sync-er-210" halType="bit">
                <!-- ENC STATUS-Status- -Sync-er-210 -->
                </pdoEntry>
                <pdoEntry idx="1801" subIdx="07" bitLen="1" halPin="Status-TxPDO-S-211" halType="bit">
                <!-- ENC STATUS-Status- -TxPDO-S-211 -->
                </pdoEntry>
                <pdoEntry idx="1801" subIdx="09" bitLen="1" halPin="Status-TxPDO-T-212" halType="bit">
                <!-- ENC STATUS-Status- -TxPDO-T-212 -->
                </pdoEntry>
                <pdoEntry idx="6000" subIdx="17" bitLen="32" halPin="Counter-value-213" halType="s32">
                <!-- ENC STATUS-Counter-value-213 -->
                </pdoEntry>
                <pdoEntry idx="6000" subIdx="18" bitLen="32" halPin="Latch-value-214" halType="s32">
                <!-- ENC STATUS-Latch-value-214 -->
                </pdoEntry>
            </pdo>
            </syncManager>
        </slave>
        <slave idx="1" type="generic" vid="0x00000002" pid="0x13ED4052" name="EP5101-1" configPdos="true">
            <!-- IMPORTANT: sometime (sync1Cycle = n * sync0Cycle) sync1Cycle must be appTimePeriod - sync0Cycle) -->
            <!-- Check your DC config...generated is from impoted .xml but assignActivate is hard coded ... it should be different -->
            <dcConf assignActivate="1000" sync0Cycle="1000000" sync0Shift="0" sync1Cycle="0" sync1Shift="0"/>
            <sdoConfig idx="1C12" subIdx="complete">
                <sdoDataRaw data="01000116"/>
            </sdoConfig>
                <sdoConfig idx="1C13" subIdx="complete">
            <sdoDataRaw data="0100011A"/>
            </sdoConfig>
            <syncManager idx="0" dir="out"/>
            <syncManager idx="1" dir="in"/>
            <syncManager idx="2" dir="out">
            <pdo idx="1601">
                    <!-- Enable latch C -->
                    <pdoEntry idx="7000" subIdx="01" bitLen="1" halPin="enable-latch-C" halType="bit"/>
                    <!-- Enable latch extern on positive edge -->
                    <pdoEntry idx="7000" subIdx="02" bitLen="1" halPin="ena-latch-ext-on-pos_edge" halType="bit"/>
                    <!-- Set counter -->
                    <pdoEntry idx="7000" subIdx="03" bitLen="1" halPin="set-counter" halType="bit"/>
                    <!-- Enable latch extern on negative edge -->
                    <pdoEntry idx="7000" subIdx="04" bitLen="1" halPin="ena-latch-ext-on-neg_edge" halType="bit"/>
                    <!-- Set counter value -->
                    <pdoEntry idx="7000" subIdx="11" bitLen="32" halPin="set-counter_value" halType="u32"/>
            </pdo>
            </syncManager>
            <syncManager idx="3" dir="in">
                <pdo idx="1A01">
                <pdoEntry idx="6000" subIdx="01" bitLen="1" halPin="Status-Latch-C-197" halType="bit">
                </pdoEntry>
                <pdoEntry idx="6000" subIdx="02" bitLen="1" halPin="Status-Latch-e-198" halType="bit">
                </pdoEntry>
                <pdoEntry idx="6000" subIdx="03" bitLen="1" halPin="Status-Set-cou-199" halType="bit">
                <!-- ENC STATUS-Status- -Set-cou-199 -->
                </pdoEntry>
                <pdoEntry idx="6000" subIdx="04" bitLen="1" halPin="Status-Counter-200" halType="bit">
                <!-- ENC STATUS-Status- -Counter-200 -->
                </pdoEntry>
                <pdoEntry idx="6000" subIdx="05" bitLen="1" halPin="Status-Counter-201" halType="bit">
                <!-- ENC STATUS-Status- -Counter-201 -->
                </pdoEntry>
                <pdoEntry idx="6000" subIdx="06" bitLen="1" halPin="Status-Status-202" halType="bit">
                <!-- ENC STATUS-Status- -Status- -202 -->
                </pdoEntry>
                <pdoEntry idx="6000" subIdx="07" bitLen="1" halPin="Status-Open-ci-203" halType="bit">
                <!-- ENC STATUS-Status- -Open-ci-203 -->
                </pdoEntry>
                <pdoEntry idx="6000" subIdx="08" bitLen="1" halPin="Status-Extrapo-204" halType="bit">
                <!-- ENC STATUS-Status- -Extrapo-204 -->
                </pdoEntry>
                <pdoEntry idx="6000" subIdx="09" bitLen="1" halPin="Status-Status-205" halType="bit">
                <!-- ENC STATUS-Status- -Status- -205 -->
                </pdoEntry>
                <pdoEntry idx="6000" subIdx="10" bitLen="1" halPin="Status-Status-206" halType="bit">
                <!-- ENC STATUS-Status- -Status- -206 -->
                </pdoEntry>
                <pdoEntry idx="6000" subIdx="11" bitLen="1" halPin="Status-Status-207" halType="bit">
                <!-- ENC STATUS-Status- -Status- -207 -->
                </pdoEntry>
                <pdoEntry idx="6000" subIdx="12" bitLen="1" halPin="Status-Status-208" halType="bit">
                <!-- ENC STATUS-Status- -Status- -208 -->
                </pdoEntry>
                <pdoEntry idx="6000" subIdx="13" bitLen="1" halPin="Status-Status-209" halType="bit">
                <!-- ENC STATUS-Status- -Status- -209 -->
                </pdoEntry>
                <pdoEntry idx="1C32" subIdx="32" bitLen="1" halPin="Status-Sync-er-210" halType="bit">
                <!-- ENC STATUS-Status- -Sync-er-210 -->
                </pdoEntry>
                <pdoEntry idx="1801" subIdx="07" bitLen="1" halPin="Status-TxPDO-S-211" halType="bit">
                <!-- ENC STATUS-Status- -TxPDO-S-211 -->
                </pdoEntry>
                <pdoEntry idx="1801" subIdx="09" bitLen="1" halPin="Status-TxPDO-T-212" halType="bit">
                <!-- ENC STATUS-Status- -TxPDO-T-212 -->
                </pdoEntry>
                <pdoEntry idx="6000" subIdx="17" bitLen="32" halPin="Counter-value-213" halType="s32">
                <!-- ENC STATUS-Counter-value-213 -->
                </pdoEntry>
                <pdoEntry idx="6000" subIdx="18" bitLen="32" halPin="Latch-value-214" halType="s32">
                <!-- ENC STATUS-Latch-value-214 -->
                </pdoEntry>
            </pdo>
            </syncManager>
        </slave>
        <slave idx="2" type="generic" vid="0x00000002" pid="0x13ED4052" name="EP5101-2" configPdos="true">
            <!-- IMPORTANT: sometime (sync1Cycle = n * sync0Cycle) sync1Cycle must be appTimePeriod - sync0Cycle) -->
            <!-- Check your DC config...generated is from impoted .xml but assignActivate is hard coded ... it should be different -->
            <dcConf assignActivate="1000" sync0Cycle="1000000" sync0Shift="0" sync1Cycle="0" sync1Shift="0"/>
            <sdoConfig idx="1C12" subIdx="complete">
                <sdoDataRaw data="01000116"/>
            </sdoConfig>
                <sdoConfig idx="1C13" subIdx="complete">
            <sdoDataRaw data="0100011A"/>
            </sdoConfig>
            <syncManager idx="0" dir="out"/>
            <syncManager idx="1" dir="in"/>
            <syncManager idx="2" dir="out">
            <pdo idx="1601">
                    <!-- Enable latch C -->
                    <pdoEntry idx="7000" subIdx="01" bitLen="1" halPin="enable-latch-C" halType="bit"/>
                    <!-- Enable latch extern on positive edge -->
                    <pdoEntry idx="7000" subIdx="02" bitLen="1" halPin="ena-latch-ext-on-pos_edge" halType="bit"/>
                    <!-- Set counter -->
                    <pdoEntry idx="7000" subIdx="03" bitLen="1" halPin="set-counter" halType="bit"/>
                    <!-- Enable latch extern on negative edge -->
                    <pdoEntry idx="7000" subIdx="04" bitLen="1" halPin="ena-latch-ext-on-neg_edge" halType="bit"/>
                    <!-- Set counter value -->
                    <pdoEntry idx="7000" subIdx="11" bitLen="32" halPin="set-counter_value" halType="u32"/>
            </pdo>
            </syncManager>
            <syncManager idx="3" dir="in">
                <pdo idx="1A01">
                <pdoEntry idx="6000" subIdx="01" bitLen="1" halPin="Status-Latch-C-197" halType="bit">
                </pdoEntry>
                <pdoEntry idx="6000" subIdx="02" bitLen="1" halPin="Status-Latch-e-198" halType="bit">
                </pdoEntry>
                <pdoEntry idx="6000" subIdx="03" bitLen="1" halPin="Status-Set-cou-199" halType="bit">
                <!-- ENC STATUS-Status- -Set-cou-199 -->
                </pdoEntry>
                <pdoEntry idx="6000" subIdx="04" bitLen="1" halPin="Status-Counter-200" halType="bit">
                <!-- ENC STATUS-Status- -Counter-200 -->
                </pdoEntry>
                <pdoEntry idx="6000" subIdx="05" bitLen="1" halPin="Status-Counter-201" halType="bit">
                <!-- ENC STATUS-Status- -Counter-201 -->
                </pdoEntry>
                <pdoEntry idx="6000" subIdx="06" bitLen="1" halPin="Status-Status-202" halType="bit">
                <!-- ENC STATUS-Status- -Status- -202 -->
                </pdoEntry>
                <pdoEntry idx="6000" subIdx="07" bitLen="1" halPin="Status-Open-ci-203" halType="bit">
                <!-- ENC STATUS-Status- -Open-ci-203 -->
                </pdoEntry>
                <pdoEntry idx="6000" subIdx="08" bitLen="1" halPin="Status-Extrapo-204" halType="bit">
                <!-- ENC STATUS-Status- -Extrapo-204 -->
                </pdoEntry>
                <pdoEntry idx="6000" subIdx="09" bitLen="1" halPin="Status-Status-205" halType="bit">
                <!-- ENC STATUS-Status- -Status- -205 -->
                </pdoEntry>
                <pdoEntry idx="6000" subIdx="10" bitLen="1" halPin="Status-Status-206" halType="bit">
                <!-- ENC STATUS-Status- -Status- -206 -->
                </pdoEntry>
                <pdoEntry idx="6000" subIdx="11" bitLen="1" halPin="Status-Status-207" halType="bit">
                <!-- ENC STATUS-Status- -Status- -207 -->
                </pdoEntry>
                <pdoEntry idx="6000" subIdx="12" bitLen="1" halPin="Status-Status-208" halType="bit">
                <!-- ENC STATUS-Status- -Status- -208 -->
                </pdoEntry>
                <pdoEntry idx="6000" subIdx="13" bitLen="1" halPin="Status-Status-209" halType="bit">
                <!-- ENC STATUS-Status- -Status- -209 -->
                </pdoEntry>
                <pdoEntry idx="1C32" subIdx="32" bitLen="1" halPin="Status-Sync-er-210" halType="bit">
                <!-- ENC STATUS-Status- -Sync-er-210 -->
                </pdoEntry>
                <pdoEntry idx="1801" subIdx="07" bitLen="1" halPin="Status-TxPDO-S-211" halType="bit">
                <!-- ENC STATUS-Status- -TxPDO-S-211 -->
                </pdoEntry>
                <pdoEntry idx="1801" subIdx="09" bitLen="1" halPin="Status-TxPDO-T-212" halType="bit">
                <!-- ENC STATUS-Status- -TxPDO-T-212 -->
                </pdoEntry>
                <pdoEntry idx="6000" subIdx="17" bitLen="32" halPin="Counter-value-213" halType="s32">
                <!-- ENC STATUS-Counter-value-213 -->
                </pdoEntry>
                <pdoEntry idx="6000" subIdx="18" bitLen="32" halPin="Latch-value-214" halType="s32">
                <!-- ENC STATUS-Latch-value-214 -->
                </pdoEntry>
            </pdo>
            </syncManager>
        </slave>
    </master>
</masters>
[/code][/code]
[/code]
[code][code][code]ethercat slaves for now
[code]cnc@CNC-01:~/linuxcnc/configs/Maho400E-LinuxCNC$ ethercat slaves
0  0:0  PREOP  +  EP5101-0011 1K. Inc. Encoder 5V, D-SUB15
1  0:1  PREOP  +  EP5101-0011 1K. Inc. Encoder 5V, D-SUB15
2  0:2  PREOP  +  EP5101-0011 1K. Inc. Encoder 5V, D-SUB15
[/code][/code][/code]
[/code]
  • PedPEx
  • PedPEx
22 Jun 2025 16:09

Problems switching PDO assignments (EP5101-0011)

Category: EtherCAT

Hello all :D

i'm trying to implement a Beckhoff EP5101-0011 incremental encoder input into LinuxCNC with its 32bit counter. I need to read glass scale inputs with around 520 mm in length and a resolution of 1 µm. For that i need atleast 19 bit, and its standard PDO assignment with the "compact" 16bit encoder-value doesn't cut it. 

I can easily change the PDO assignment in the EtherCAT-Configurator application and the EP5101 activates the 32bit counter, after reconnecting the LinuxCNC machine it is also able to use the bigger counter, but after power cycling the device, it defaults back to the 16bit counter. So i tried to set the correct PDO assignments via SDO uploads, but that did also not work, it doesn't want to change in the "big counter mode" via LinuxCNC. 

It also complained about the other SDO uploads (settings), but that's a problem for later.
What exactly do i have to change, to initialize the encoder input to its 32bit PDO setting?

Thank you in advance for your help :)
<!-- EP5101 - Incr. Encoder Input -->
        <slave idx="9" type="generic" vid="0x00000002" pid="0x13ed4052" name="0571_EP5101">
            <!-- configure counter for 32bit -->
                <sdoConfig idx="1C12" subIdx="1"><sdoDataRaw data ="00 16"/></sdoConfig>  <!-- switch to 32bit RxPDO assign-->
                <sdoConfig idx="1C13" subIdx="1"><sdoDataRaw data ="00 1A"/></sdoConfig>  <!-- switch to 32bit TxPDO assign-->
            <!-- overall configuration -->
                <!-- Enable C reset -->
                <sdoConfig idx="8000" subIdx="01"><sdoDataRaw data ="01"/></sdoConfig>
                <!-- Enable extern reset -->
                <sdoConfig idx="8000" subIdx="02"><sdoDataRaw data ="01"/></sdoConfig>
                <!-- Enable up/down counter -->
                <sdoConfig idx="8000" subIdx="03"><sdoDataRaw data ="01"/></sdoConfig>
                <!-- Gate polarity -->
                <sdoConfig idx="8000" subIdx="04"><sdoDataRaw data ="01 00 00 00"/></sdoConfig>
                <!-- Disable filter -->
                <sdoConfig idx="8000" subIdx="08"><sdoDataRaw data ="01"/></sdoConfig>
                <!-- Enable micro increments -->
                <sdoConfig idx="8000" subIdx="0A"><sdoDataRaw data ="00"/></sdoConfig>
                <!-- Open cicruit detection A -->
                <sdoConfig idx="8000" subIdx="0B"><sdoDataRaw data ="01"/></sdoConfig>
                <!-- Open cicruit detection B -->
                <sdoConfig idx="8000" subIdx="0C"><sdoDataRaw data ="01"/></sdoConfig>
                <!-- Open cicruit detection C -->
                <sdoConfig idx="8000" subIdx="0D"><sdoDataRaw data ="00"/></sdoConfig>
                <!-- Reversion of rotation -->
                <sdoConfig idx="8000" subIdx="0E"><sdoDataRaw data ="00"/></sdoConfig>
                <!-- Extern reset polarity -->
                <sdoConfig idx="8000" subIdx="10"><sdoDataRaw data ="01 00 00 00"/></sdoConfig>
                <!-- Frequency window -->
                <sdoConfig idx="8000" subIdx="11"><sdoDataRaw data ="10 27"/></sdoConfig>
                <!-- Frequency scaling -->
                <sdoConfig idx="8000" subIdx="13"><sdoDataRaw data ="64 00 00 00"/></sdoConfig>
                <!-- Period scaling -->
                <sdoConfig idx="8000" subIdx="14"><sdoDataRaw data ="64 00 00 00"/></sdoConfig>
                <!-- Frequency resolution -->
                <sdoConfig idx="8000" subIdx="15"><sdoDataRaw data ="64 00 00 00"/></sdoConfig>
                <!-- Period resolution -->
                <sdoConfig idx="8000" subIdx="16"><sdoDataRaw data ="64 00 00 00"/></sdoConfig>
                <!-- Frequency wait time -->
                <sdoConfig idx="8000" subIdx="17"><sdoDataRaw data ="40 06"/></sdoConfig>
            <!-- configure SyncManagers -->
            <syncManager idx="0" dir="in"/>
            <syncManager idx="1" dir="out"/>
            <syncManager idx="2" dir="out">
                <!-- ENC RxPDO-Map Control -->
                <pdo idx="1601">
                    <!-- Enable latch C -->
                    <pdoEntry idx="7000" subIdx="01" bitLen="1" halPin="enable-latch-C" halType="bit"/>
                    <!-- Enable latch extern on positive edge -->
                    <pdoEntry idx="7000" subIdx="02" bitLen="1" halPin="ena-latch-ext-on-pos_edge" halType="bit"/>
                    <!-- Set counter -->
                    <pdoEntry idx="7000" subIdx="03" bitLen="1" halPin="set-counter" halType="bit"/>
                    <!-- Enable latch extern on negative edge -->
                    <pdoEntry idx="7000" subIdx="04" bitLen="1" halPin="ena-latch-ext-on-neg_edge" halType="bit"/>
                    <!-- Set counter value -->
                    <pdoEntry idx="7000" subIdx="11" bitLen="32" halPin="set-counter_value" halType="u32"/>
                </pdo>
            </syncManager>
            <syncManager idx="3" dir="in">
                <!-- ENC TxPDO-Map Status -->
                <pdo idx="1a01">
                    <!-- Latch C valid -->
                    <pdoEntry idx="6000" subIdx="01" bitLen="1" halPin="latch-c-valid" halType="bit"/>
                    <!-- Latch extern valid -->
                    <pdoEntry idx="6000" subIdx="02" bitLen="1" halPin="latch-extern-valid" halType="bit"/>
                    <!-- Set counter done -->
                    <pdoEntry idx="6000" subIdx="03" bitLen="1" halPin="set-counter-done" halType="bit"/>
                    <!-- Counter underflow -->
                    <pdoEntry idx="6000" subIdx="04" bitLen="1" halPin="counter-underflow" halType="bit"/>
                    <!-- Counter overflow -->
                    <pdoEntry idx="6000" subIdx="05" bitLen="1" halPin="counter-overflow" halType="bit"/>
                    <!-- Status of input status -->
                    <pdoEntry idx="6000" subIdx="06" bitLen="1" halPin="status-of-input-status" halType="bit"/>
                    <!-- Open circuit -->
                    <pdoEntry idx="6000" subIdx="07" bitLen="1" halPin="open-circuit" halType="bit"/>
                    <!-- Extrapolation stall -->
                    <pdoEntry idx="6000" subIdx="08" bitLen="1" halPin="extrapolation-stall" halType="bit"/>
                    <!-- Status of input A -->
                    <pdoEntry idx="6000" subIdx="09" bitLen="1" halPin="status-A" halType="bit"/>
                    <!-- Status of input B -->
                    <pdoEntry idx="6000" subIdx="0a" bitLen="1" halPin="status-B" halType="bit"/>
                    <!-- Status of input C -->
                    <pdoEntry idx="6000" subIdx="0b" bitLen="1" halPin="status-C" halType="bit"/>
                    <!-- Status of input gate -->
                    <pdoEntry idx="6000" subIdx="0c" bitLen="1" halPin="status-gate" halType="bit"/>
                    <!-- Status of extern latch -->
                    <pdoEntry idx="6000" subIdx="0d" bitLen="1" halPin="status-ext_latch" halType="bit"/>
                    <!-- Sync error -->
                    <pdoEntry idx="1c32" subIdx="20" bitLen="1" halPin="sync-error" halType="bit"/>
                    <!-- TxPDO State -->
                    <pdoEntry idx="1800" subIdx="07" bitLen="1" halPin="TxPDO-state" halType="bit"/>
                    <!-- TxPDO Toggle -->
                    <pdoEntry idx="1800" subIdx="09" bitLen="1" halPin="TxPDO-toggle" halType="bit"/>
                    <!-- Counter value -->
                    <pdoEntry idx="6000" subIdx="11" bitLen="32" halPin="counter_value" halType="u32"/>
                    <!-- Latch value -->
                    <pdoEntry idx="6000" subIdx="12" bitLen="32" halPin="latch_value" halType="u32"/>
                </pdo>
            </syncManager>
        </slave>
Displaying 1 - 15 out of 69 results.
Time to create page: 0.473 seconds
Powered by Kunena Forum