Category: EtherCAT
I am trying to get Leadshine 2CS3E-D507 working to drive two closed-loop steppers to drive the carousel and arm of a toolchanger in simple pp mode.
I think I am very close, but need some help to get over the line.
Scott Laird's driver and the Cia402 component have gotten me to the point where the drive reaches OP state and I can see all the hal pins, but I have not managed to get the steppers to move.
To avoid the complexity of the rest of my machine, I have simply taken one of the sample configs (sim.axis-min), and added two extra joints (joints 3 and 4) for the two closed-loop steppers in the ini file , and added a hal file with what I hope are plausible lcec and cia402 settings. I have then connected the stepper drive to the machine with an Ethernet cable, Linuxcnc starts up OK with no complaints, and ehtercat slaves shows that the 2CS3E-D507 is sitting happily in OP state.
Looking at Machine>Show Hal configuration I can see all the lcec and cia402 pins. Setting setp cia402.0.enable 1 turns on the first joint and the same with cia.1.enable turns on the second one. I can see that this is the case because the LED display shows the corresponding dot. The display shows 88.8. where the dots denote one active axis each.
Reading the position of, say, the first stepper (lcec.0.0.srv-1-actual-position or cia402.0.drv-actual-position ) shows a value of "97", and the other one shows "2". These are arbitrary values corresponding to whatever position the shaft was turned to when powered up.
The corresponding "target position", however, is currently "0", but the drive is not trying to turn from position 97 to 0 at all.
In fact, it seems very determined to hold its current position, so you cannot turn the shaft by hand (which you can easily do when the drive is not enabled). It seems to resist any attempt to move it from its current position of 97
Trying to write a new target position using "setp" fails.
For example, if I try to set it to 700 :
using setp lcec.0.0.srv-1-actual-position 700, it complains that the pin is connected to a signal ( r1-drv-target-pos )
Using setp cia402.0.drv-actual-position 700, it complains " ERROR setting parameter 'cia402.0.drv-actual-position' to '700' pin 'cia402.0.drv-actual-position' is not writable"
The relevant line is the hal file is
net r1-drv-target-pos cia402.0.drv-target-position => lcec.0.0.srv-1-target-position
so I can understand the first complaint (the lcec is taking its input from the signal r1-drv-target-pos, which is getting its value from the cia402.0.drv-target-position pin), but I can't understand the second complaint ( the cia402target position pin not being writable), because one has to be able to tell the drive what the new position target is
Is here a simple fix I am missing, or am I going about this completely the wrong way, and if so, what do I need to change?
Since it's for a tool changer I would like to stick to pp mode rather than csp to simplify things.
I am attaching the .ini and .hal files, which are the only modified ones. All others are as per the normal sim-axis-min sample config in the standard installation.
Many thanks!