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:
Code:
//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!