Leadshine EL8 Servo Drives - EtherCAT

More
1 year 11 months ago #315586 by DeckelCNC
Hello All,
I am new to linuxcnc and i have been working through installation and getting etherCAT set up.
So far I have / had been sucessful with the basic install and getting Beckhoff units to function. and driving inputs / outputs.I purchased leadshine EL8 servo drives for a 2 axis project i am working on.
Creating my own .xml and .hal i was able to get by beckhoff units into "operational" and the EL8 Drives into "pre-operational," but that was as far as i could get.in the past days i have lost my way (probably with a lack of understanding of fundamentals), and I caved into trying other online .xml examples and got everything in a total mess and couldn't even get back to LinuxCNC to open.I have got my files back to the basic situation of LinuxCNC opening and everything working, but the drives are not going into operational state. i belive its my .hal file. but if i add any cia402 links everything stops working.Is it wrong for me to expect I can make one drive work in LinuxCNC first  ? (say the x axis) then add the y axis later ? i was thinking the homing was stopping the drives from going into operational for a time.this is my situation:~$ ethercat slaves
0  0:0  OP     +  EK1100 EtherCAT-Koppler (2A E-Bus)
1  0:1  OP     +  EL1008 8Ch. Dig. Input 24V, 3ms
2  0:2  OP     +  EL1008 8Ch. Dig. Input 24V, 3ms
3  0:3  OP     +  EL2004 4K. Dig. Ausgang 24V, 0.5A
4  0:4  PREOP  +  L8EC(COE)I have attched 3 files1)axis_mm-try2.ini
 

Attachment not found

2)TRY.hal
 

Attachment not found

3)ethercat-config.xml
 

Attachment not found

Please Log in to join the conversation.

More
1 year 11 months ago #315599 by DeckelCNC
When i try and link a cia402.hal file (below). i am unable to start linuxcnc. (i get lots of errors)
i go through the process of trying to remove the lines that create problems.
but its actually a backwards step from the files i uploaded above. ie everything goes to pre operational (Beckhoff and leadshine drive) by the time i can get linuxcnc to start up.

I have the feeling i am missing a big obvious step, but its not jumping out at me.

Code:
########################################################### # # 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 /home/edmuser/linuxcnc/configs/sim.axis-1/ethercat-conf.xml loadrt lcec loadrt cia402 count=1 loadrt pid names=x-pid #,y-pid,z-pid ########################################################### # 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 x-pid.do-pid-calcs servo-thread #addf y-pid.do-pid-calcs servo-thread #addf z-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 setp cia402.0.csp-mode 1 setp cia402.0.pos-scale 3600 #from servo(ethercat) to cia402 net x-statusword      lcec.0.4.cia-statusword => cia402.0.statusword net x-opmode-display  lcec.0.4.opmode-display => cia402.0.opmode-display net x-drv-act-pos     lcec.0.4.actual-position => cia402.0.drv-actual-position net x-drv-act-velo    lcec.0.4.actual-velocity => cia402.0.drv-actual-velocity #from cia402 to servo(ethercat) net x-controlword         cia402.0.controlword => lcec.0.4.cia-controlword net x-modes-of-operation  cia402.0.opmode => lcec.0.4.opmode net x-drv-target-pos      cia402.0.drv-target-position => lcec.0.4.target-position #net x-drv-target-velo     cia402.0.drv-target-velocity => lcec.0.4.target-velocity #from motion to cia net x-enable    <= joint.0.amp-enable-out => cia402.0.enable net x-amp-fault => joint.0.amp-fault-in   <= cia402.0.drv-fault #net x-pos-cmd   <= joint.0.motor-pos-cmd  => cia402.0.pos-cmd #net x-pos-fb    => joint.0.motor-pos-fb   <= cia402.0.pos-fb #homing net x-home-index <= joint.0.index-enable  => cia402.0.home

Please Log in to join the conversation.

More
1 year 11 months ago #315633 by Aciera
Usually a good idea to share the errors you are getting. Saves people trying to help a lot of time.

Please Log in to join the conversation.

More
1 year 11 months ago #315665 by kworm
Can you also post the output of "ethercat pdos". It is likely the drives may not have all the PDOs you are referencing configured. Did you use the drive manufacturers software to configure them?

Please Log in to join the conversation.

More
1 year 11 months ago #315688 by DeckelCNC
Thank you for the reply's

Kworm : i think i have the pdo's right in the drive Vs the terminal output Vs the .xml ? please let me know if i am not understanding correctly. Thank you for your time. 

Warning: Spoiler!


Aciera (sorry i thought it was better to upload files that made no errors, but not actually working)
i have been reading and come across a post about a Youtuber called Marco Reps ? i thought it would be a idea to apply some of the methods i found in these files. so i have changed things from my first post, and i am now getting errors again / LinuxCNC is not opening.  this looks to be the main issue ?  EL8_machine.hal:41: Pin 'lcec.0.0.cia-statusword' does not exist

i have included the Error report + the .xml + .hal + .ini
Code:
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 LINUXCNC - 2.9.3 Machine configuration directory is '/home/edmuser/linuxcnc/configs/sim.axis-3' Machine configuration file is 'EL8_machine.ini' INIFILE=/home/edmuser/linuxcnc/configs/sim.axis-3/EL8_machine.ini VERSION=1.1 PARAMETER_FILE=linuxcnc.var TPMOD= HOMEMOD= TASK=milltask HALUI=halui DISPLAY=axis COORDINATES=X Y Z KINEMATICS=trivkins coordinates=XYZ Starting LinuxCNC... Starting LinuxCNC server program: linuxcncsvr Loading Real Time OS, RTAPI, and HAL_LIB modules Starting LinuxCNC IO program: io libnml/buffer/shmem.cc 320: Shared memory buffers toolCmd and toolCmd may conflict. (key=1004(0x3EC)) libnml/buffer/shmem.cc 320: Shared memory buffers toolSts and toolSts may conflict. (key=1005(0x3ED)) libnml/buffer/shmem.cc 320: Shared memory buffers emcError and emcError may conflict. (key=1003(0x3EB)) emc/iotask/ioControl.cc 786: can't load tool table. Starting HAL User Interface program: halui linuxcnc TPMOD=tpmod HOMEMOD=homemod EMCMOT=motmod Found file(REL): ./EL8_machine.hal Shutting down and cleaning up LinuxCNC... Removing HAL_LIB, RTAPI, and Real Time OS modules Removing NML shared memory segments Debug file information: Note: Using POSIX realtime ./EL8_machine.hal:41: Pin 'lcec.0.0.cia-statusword' does not exist 55850 Stopping realtime threads Unloading hal components Note: Using POSIX realtime

.XML File

Warning: Spoiler!


.HAL

Warning: Spoiler!


.ini

Warning: Spoiler!

 

Please Log in to join the conversation.

More
1 year 11 months ago #315690 by DeckelCNC
Just fixed an obvious mistake
net x-statusword lcec.0.0.cia-statusword => cia402.0.statusword

all changed to reflect number idx= 4 from .xml
like the below
net x-statusword lcec.0.4.cia-statusword => cia402.0.statusword

LinuxCNC is now opening but the drive is still in Pre-Operational and not moving the motor.

Please Log in to join the conversation.

More
1 year 11 months ago #315692 by kworm
Your mappings look ok. I'm not familiar with Leadshine drives but have you tried the drive software? If you can connect it while LinuxCNC is going you may be able to see what is preventing it from going OP. You could also use the software without LinuxCNC running and make sure you can get motion.

Please Log in to join the conversation.

More
1 year 11 months ago #315695 by DeckelCNC
Hi kworm !
Everything has been good with the drive, tuning and movements through the drive have worked without issue.
i had to config the PDO's also so that all appeared to work...

using the Leadshine motion studio software
I do see the Control Word = 0x0
and the Status Word is 0x410 so it looks like the LinuxCNC EtherCAT Master is not trying to put the drive into operational ?

Please Log in to join the conversation.

More
1 year 10 months ago #315703 by DeckelCNC
you put me on the right track.....
I was provided with the vendor ID (0x4321) and product ID / code (0x10C2) by the manufacturer. 
And these values show in the drive through the software also

using the below terminal input
ethercat slaves -v

the product code was 0x00d0   ???

can anyone provide the reasons for this ? please remember the internal drive value is what the manufacturer stated !

i made this change to the .xml and the drive works.

Please Log in to join the conversation.

More
1 year 10 months ago #315738 by kworm
Glad you got it working. That is strange that the product code would be different than what the drive software shows. To me that definitely seems like a bug in the drive firmware or setup software. Looking at the ESI file from Leadshine they only show 0x10c2 - 0x10c6 as product codes for the EL8.

Please Log in to join the conversation.

Time to create page: 1.999 seconds
Powered by Kunena Forum