Leadshine EL7-EC homing functions

More
16 Dec 2023 16:58 #288347 by jamwaffles
I'm trying to use the builtin homing routines on a Leadshine EL7-EC. I'm certain I'm setting the right config values in the SDOs as per the manual and other threads on this forum, and Leadshine's Motion Studio software confirms the same, however when I click "home joint" in the Axis GUI, it either moves to the motor encoder 0 position, or doesn't move at all. I've been hacking on this a lot so I don't recall what changes I made to get different behaviour but I feel like it was related to CSP/CSV? In at least one occasion I've seen the EtherCAT control word change from 08 (CSP) to 06 (HOME) however the axis did not move at all in this state.

I have the drives set up in CSP mode, and ordinary motion works absolutely fine - it's just the homing that's an issue. I do also have the home switch set up on the inputs correctly as far as I can tell - I can even see it changing in the Axis GUI when I manually trigger it on/off.

So, my question is: has anyone got LinuxCNC working with the EL7's builtin homing routines? If so, could you share you config? I'm starting to wonder if it's bad drive firmware but that feels like blaming the compiler when my code doesn't work...

Failing that I'd take a setup that homes via LinuxCNC instead but it'd be nice to be able to use the index pulse of the encoder.

I've attached my basic 3 axis config. I'm working only on the Y axis at the moment so ignore X and Z as I haven't got home switches set up yet.
Attachments:
The following user(s) said Thank You: eduard

Please Log in or Create an account to join the conversation.

More
23 Dec 2023 09:58 #288875 by andypugh
I am not sure how one would make this work. It might even require an external homing routine.

It might be possible to persuade LinuxCNC that it has absolute encoders, and trigger the internal drive homing separately.

But a neater way might be a custom .comp that senda a homing command to the drives, and then just waits,

You set up a custom homng routine uisng the [EMCMOT]HOMEMOD INI file setting. I haven't found any documentation of how to write the component, but there is an example file here: github.com/LinuxCNC/linuxcnc/blob/master...onents/homecomp.comp

Please Log in or Create an account to join the conversation.

More
23 Dec 2023 10:25 - 23 Dec 2023 10:26 #288883 by rodw
Things change and move on. the CIA402 component you use worked well for the author that had absolute encoders but it does not work where there are home and limit switches attached to the drive (the usual case).

The correct way to do this is to write a custom homing component using homecomp.comp
linuxcnc.org/docs/stable/html/man/man9/homecomp.9.html
If you look at the standard homing.c source, there is a state machine ( C switch statement) that covers many steps for homing. With CIA402 drives, you tell  it to home, then wait until its done so few of these steps apply so we can skip them in a custom homing component.

I've had a bit of enforced downtime in hospital and have been looking at it again. I did have a go once before but the methodology was changed to simplify it and it obsoleted my attempt. I think a modified cia402.comp will still be required so that the ethercat stuff is done inside the lcec/cia402 loops. Last time I tried to do it all in the homecomp.
While the loop exists in the homecomp, I think it  is outside of the ethercat loops (set in the addf statements) so might be a servo thread behind.
Last edit: 23 Dec 2023 10:26 by rodw.

Please Log in or Create an account to join the conversation.

More
23 Dec 2023 10:33 #288885 by rodw

But a neater way might be a custom .comp that senda a homing command to the drives, and then just waits,

You set up a custom homng routine uisng the [EMCMOT]HOMEMOD INI file setting. I haven't found any documentation of how to write the component, but there is an example file here: github.com/LinuxCNC/linuxcnc/blob/master...onents/homecomp.comp

Andy, With some knowledge of  homing.c The combination of man homecomp and the source actually does give quite reasonable documentation in Dewey Garrett's precise and succint style :)

For Ethercat, you also need to study Dominic Brauns cia402.comp github.com/dbraun1981/hal-cia402. This is designed for CIA402 compatible Ethercat drives. This defines standard registers so it should not be necessary to write homecomps for every drive out there.
The following user(s) said Thank You: eduard

Please Log in or Create an account to join the conversation.

More
23 Dec 2023 11:46 #288897 by jamwaffles
Thanks for the feedback everyone. I did come to the same conclusion and ended up using LinuxCNC's homing routines and just passing the limit switch input through `lcec`, so my setup is quite "normal" at the moment. I really wanted to use the Z index (also passed through to LCNC) but I decided just limit switches are good enough for repeatability for now.

If I make my own homing component, I'll try to remember to update this thread. Be warned however: it'll be in Rust :D

Please Log in or Create an account to join the conversation.

More
23 Dec 2023 12:16 #288900 by rodw
I did the same too and just home the normal linuxcnc way.
The area  that really interests me is that some drives (like mine) can home by stalling. This should be very repeatable and really simplify homing by eliminating the wiring. Combine it with 220v AC servos and it would result in a really quick build.

Please Log in or Create an account to join the conversation.

More
23 Dec 2023 12:17 #288901 by jamwaffles
Yeah the EL7 can home by stalling (uh "torque detection" lol) but a) I've already wired the limit switches in and b) it just sounds like a crash but in slow motion which gives me the jeebies.

Please Log in or Create an account to join the conversation.

More
23 Dec 2023 12:55 #288905 by rodw

Yeah the EL7 can home by stalling (uh "torque detection" lol) but a) I've already wired the limit switches in and b) it just sounds like a crash but in slow motion which gives me the jeebies.

Yeh, why I stopped too. Following errors seemed to stop things before the damage as it clearly wasn't homing.
Noticed tonight there is a register that displays motor torque. i might put into halscope and watch it

Please Log in or Create an account to join the conversation.

Time to create page: 0.132 seconds
Powered by Kunena Forum