Hi,

 

I’m not sure how to introduce this, so I’m going to launch right in. 

 

As you know ethercat amplifiers are gaining popularity among LinuxCNC users. If 
the servo’s use absolute encoders than there is no issue since that has already 
been incorporated. However, most servo’s have incremental encoders and require 
homing before being ran in Cyclical Synchronous Position Mode (CSP Mode). I 
have literally been trying to modify homing.c  for a few years and have come up 
with the following solution, it’s not perfect but it works… kind of. Hoping you 
can help. 

 

The homing routine I use is as follows (Cia402 #19 )

*       Move towards negative limit at search vel
*       Home switch goes high
*       Continue in negative direction at latch velocity
*       Home switch goes low
*       Servo resets counter to 0

 

In order to switch modes before homing I created a custom GUI button that calls 
a couple of custom M-codes to switch the servo’s from CSP Mode to Homing Mode 
combined with a timeout/while loop in my custom GUI. The timeout loop is needed 
so that the GUI  greys out during homing and the custom m-codes, this is 
something I would like to eliminate.  Then the button calls the homing routine. 
Within homing.c I’ve made a similar routine to void(do_moving_checks)  that 
loops the servo’s feedback position  to joint_command_position. This is 
critical since if the feedback is not looped and you hit the e-stop or a limit 
during the homing routine the machine will lurch to it’s old position when you 
recover it from e-stop. The issue that I am having is that I get a following 
error when the servo switches from search to latch velocity.  In my mind this 
is unexpected since the feedback is looped to the position command. 

 

That being said, the solution that I am proposing is this (similar to Roschi’s 
orginal shortcut through 2.6 homing.c )

*       Use the homing signal to start the mode switch via ladder logic or 
custom m-code, and use ladder logic to indicate that the homing routine is 
complete by => joint.X.home-sw. Note: Physical home switch connected only to 
amplifier 

*       Create a variable for the .ini file USE_ETHERCAT_HOMING ( I compile 
with no errors but variable is not recognized in homing.c)

*       Modify homing.c so that

*       if USE_ETHERCAT_HOMING =1 the servo’s are in complete control
*       While homing, do nothing but wait and loop the position feedback to the 
commanded position, direction and speed should be irrelevant 
*       Limits and E-stop handled as normal

*       Modify the header file to allow the new states 

 

Unfortunately, I’m not at my Linux computer so I can’t post snippets of the 
modifications I’ve made ☹.  However,  I think that a solution to this is going 
to be required if ethercat servo’s are going to be fully implemented. 

I wish I had the coding savvy to complete this on my own but I am maxed out and 
in need of some guidance/help.

 

Kind regards,

Dan  

 

 

 

  

 


_______________________________________________
Emc-developers mailing list
Emc-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers

Reply via email to