Implementing Spindle Homing for DELTA C2000 Plus (In)correctly?

More
11 Mar 2025 08:37 #323662 by stenly
Sorry for the double post, messed up the formatting of the original one with an edit.

Hello everyone,

I've been trying to set up a DELTA C2000 Plus control drive with LinuxCNC over EtherCAT for a spindle motor and I am having difficulties with the homing (what seems to be the bane of many LinuxCNC users)...

The hal-cia402 driver does not seem to work properly, as the controlword is not being passed correctly and the model does not support CSV mode, which seems to be something the cia402 driver relies on. There is a ready driver for a different, but very similar model, the DELTA MS300. The PDOs are the same, so getting it to run was as easy as changing the pid in the source and recompiling. However, this driver only supports Velocity Mode, even if it works well. Homing Mode is something I am trying to figure out how to implement myself, but sadly I am not well-versed enough to manage on my own.

Would it be a good idea to try to put the following section from the cia402 source into my driver, changing the variable names where appropriate and changing CSV Mode to Velocity Mode:
//home states  
  if (opmode_homing) {
    stat_homed    = ((statusword >> 10) & 1) && ((statusword >> 12) & 1);
    stat_homing   = !stat_homed && !((statusword >> 10) & 1);
  }

..........

// reset home command   
  if (home && (stat_homed && !stat_homed_old) && opmode_homing) {
    home = 0;
  }
  stat_homed_old = stat_homed;  

  // OP Mode
  // set velo mode
  if (stat_voltage_enabled && !pos_mode && !home) {
    opmode = OPMODE_CYCLIC_VELOCITY;
  }
  // mode Home and start homing
  if (home) {
    opmode = OPMODE_HOMING;
    controlword |= (home << 4);  
  }

Do you think this approach is correct? Another thing I've tried is to set it to home over PLC, as the model supports that. But it does not look like it will suit our purposes, as the drive interrupts the EtherCAT connection when switching to PLC mode, which causes unexpected behavior.

I am using the CMC-EC01 extension card for the drive and the homing is intended to be handled by an Origin Switch as the encoder is incremental. I will attach the linuxcnc-ethercat driver for the MS300 for the sake convenience.

Using the EMC-PG01H card for the encoder too, but the encoder is not relevant for the homing. I think. I will tackle that once I get to the spindle orientation...

I appreciate any help and suggestions!
Attachments:

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

More
11 Mar 2025 11:28 #323667 by smc.collins
on the surface this appears like it should be correct , but I am not expert with ethercat, far far from it. it appears your checking for the home comparison and setting 0 or 1 based on that result, then issuing a home command if not homed. The next issue obviously will be having linuxcnc call the homing in the driver. Is this to be used as a C axis, if not just have it call the homing function in your postprocessor iirc

forum.linuxcnc.org/10-advanced-configura...7-homing-the-spindle

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

More
11 Mar 2025 12:00 #323670 by stenly
Thanks for the response, Collins.

That thread is more concerned with the spindle orientation with M19, is it not? Or do you mean to imply I can implement both M6 homing + tool changing and M19 orientation with this? Would this work with an incremental sin/cos encoder with an origin switch instead of an absolute encoder?

One of the responses in that thread was a link to a more recent solution to the spindle homing:
forum.linuxcnc.org/10-advanced-configura...nt-component-revised

I suppose it would be best for me to look into that, as it seems people are pleased with it.

I was under the impression the homing should be handled internally by the drive upon being sent the appropriate command by LinuxCNC over EtherCAT. After all, it does have a "Homing Mode." But it seems that is not necessary and I can handle it all through the orient component (or the more recent solution) which calculates the homing through the encoder feedback? Am I understanding this correctly?

Also, what is the index-enable these components refer to? Is that the origin switch of the motor?

Thanks again for the help.

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

More
11 Mar 2025 12:19 #323672 by smc.collins
index enable usually refers to the Index output of the encoder, basically it's a single pules indicating the encoder has reached the reset point of it's wheel. IE every 2048 pules in a 2048 encoder you get a index pulse. if so equipped, often referred to as the Z pulse in many encoders.

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

More
11 Mar 2025 13:40 #323679 by stenly
Thanks for the overview.

I don't think that will work for me, as my encoder doesn't have a Z pulse. Just an A, B and R one. The motor itself has an origin switch that gives a digital output. The idea is to have that serve as the homing point, probably by using Homing Method 4 for Homing Mode (an operation mode in EtherCAT). I'm going to look into whether or not something like this has been discussed here, but for now it seems I'm the only one with this sort of setup, I think.

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

More
11 Mar 2025 17:45 #323694 by smc.collins
the origin switch is probably what your after, but you might want to make sure it consistently repeats to within a few encoder counts every time or it's useless for things like threading etc.

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

More
12 Mar 2025 06:58 #323729 by stenly
Yes, exactly. But do you know of any example configs or even discussions on how to implement a homing origin switch? I don't think I have found any.

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

More
15 Mar 2025 01:54 #323977 by smc.collins
are you using this for C axis work or just threading ? if just threading, then, it's already handled in spindle mappings in the base config, you just need to make sure to connect it in the HAL file to the Z/index pin. If it's for C axis live tool type work, that's a bit outside of my experience as I haven't had time to finish my own work towards that myself.
The following user(s) said Thank You: stenly

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

Time to create page: 0.089 seconds
Powered by Kunena Forum