- Configuring LinuxCNC
- Advanced Configuration
- EtherCAT
- Technical questions about CIA402 and homecomp.comp on A6
Technical questions about CIA402 and homecomp.comp on A6
- Hakan
- Offline
- Platinum Member
-
Less
More
- Posts: 1280
- Thank you received: 444
12 Feb 2026 08:14 #342840
by Hakan
Replied by Hakan on topic Technical questions about CIA402 and homecomp.comp on A6
The mindset should be that the drive decides.
The component can only ask the drive to do things like switch op-mode, start homing, etc
for the rest the drive must react to every status condition that comes from the drive.
There are other circumstances when the position feedback can be out of sync with linuxcnc joint commanded position.
A spindle running in PV mode as a spindle motor, switching to csp mode as an axle comes to mind.
The component handles and offset in such a case.
The component can only ask the drive to do things like switch op-mode, start homing, etc
for the rest the drive must react to every status condition that comes from the drive.
There are other circumstances when the position feedback can be out of sync with linuxcnc joint commanded position.
A spindle running in PV mode as a spindle motor, switching to csp mode as an axle comes to mind.
The component handles and offset in such a case.
Please Log in or Create an account to join the conversation.
- rodw
-
- Offline
- Platinum Member
-
Less
More
- Posts: 11791
- Thank you received: 3992
12 Feb 2026 09:46 #342842
by rodw
Replied by rodw on topic Technical questions about CIA402 and homecomp.comp on A6
Ihave a new component in progress that is designed to address many if the things you raise home jump, pv mode etc. be patient as i had to put it aside for a while
The following user(s) said Thank You: andrax, NWE
Please Log in or Create an account to join the conversation.
- andrax
-
Topic Author
- Away
- Elite Member
-
Less
More
- Posts: 234
- Thank you received: 55
12 Feb 2026 13:38 #342844
by andrax
Replied by andrax on topic Technical questions about CIA402 and homecomp.comp on A6
Ethercat components are now very inexpensive to purchase. The servo kits at Stepperonline cost less than €200, including customs duties and taxes. Fieldbus modules are available at low prices on eBay.
Why Ethercat?
Step/dir: has limited frequency/encoder resolution and is only suitable for small tools. High demands on the PC.
Analog: I tried this, but unfortunately it was very disappointing.
Ethercat: Real-time capable, motion control, position feedback, extremely high speeds possible.
Why Ethercat?
Step/dir: has limited frequency/encoder resolution and is only suitable for small tools. High demands on the PC.
Analog: I tried this, but unfortunately it was very disappointing.
Ethercat: Real-time capable, motion control, position feedback, extremely high speeds possible.
Please Log in or Create an account to join the conversation.
- Marcos DC
-
- Offline
- Senior Member
-
Less
More
- Posts: 68
- Thank you received: 41
12 Feb 2026 23:51 #342871
by Marcos DC
Replied by Marcos DC on topic Technical questions about CIA402 and homecomp.comp on A6
Thanks for the explanation, that makes sense for your setup.
When I mentioned cost, I wasn’t really thinking only about the price of the drives themselves. The hardware can indeed be quite cheap nowadays, especially the Chinese EtherCAT kits. What I had more in mind was the total cost: time spent integrating, debugging, dealing with CiA402 states, homing behavior, synchronization issues, and so on. In LinuxCNC, that complexity is very real, as I’m sure you know.
For my own projects, I’m not looking at EtherCAT as something that would “upgrade” my machine in a practical sense. If I end up buying an EtherCAT drive, it would be purely to learn and experiment with the technology, not because it necessarily adds value compared to a Mesa + step/dir or ±10V setup, which are already very robust and proven.
Also, just to be clear, at this point in my life (I’m 50), I’m not chasing résumé points or planning to change jobs — this is purely technical curiosity and personal interest in understanding the trade-offs better.
Out of curiosity: when you compared step/dir, were you thinking about software step generation / parallel port, or FPGA-based solutions like Mesa? In my experience, that distinction makes a huge difference in terms of performance and PC load.
When I mentioned cost, I wasn’t really thinking only about the price of the drives themselves. The hardware can indeed be quite cheap nowadays, especially the Chinese EtherCAT kits. What I had more in mind was the total cost: time spent integrating, debugging, dealing with CiA402 states, homing behavior, synchronization issues, and so on. In LinuxCNC, that complexity is very real, as I’m sure you know.
For my own projects, I’m not looking at EtherCAT as something that would “upgrade” my machine in a practical sense. If I end up buying an EtherCAT drive, it would be purely to learn and experiment with the technology, not because it necessarily adds value compared to a Mesa + step/dir or ±10V setup, which are already very robust and proven.
Also, just to be clear, at this point in my life (I’m 50), I’m not chasing résumé points or planning to change jobs — this is purely technical curiosity and personal interest in understanding the trade-offs better.
Out of curiosity: when you compared step/dir, were you thinking about software step generation / parallel port, or FPGA-based solutions like Mesa? In my experience, that distinction makes a huge difference in terms of performance and PC load.
The following user(s) said Thank You: andrax
Please Log in or Create an account to join the conversation.
- NWE
-
- Offline
- Elite Member
-
Less
More
- Posts: 181
- Thank you received: 46
13 Feb 2026 01:38 #342874
by NWE
Might make a difference what kind of hardware you're dealing with. On nearly all my analog servo configs, I was connecting a new computer + Mesa board to old servo drives, the old servo drives usually had limited documentation to where it took some experimenting to figure out for example whether the enable is active high or active low. First power-up is usually a wanabe runaway.
Odd hardware like this old electric forklift I'm retrofitting with LinuxCNC. The motor controller expects 4V to 0V for the speed control. 0V is max speed we found out really quick.. We have it blocked up with the wheels off the floor so it doesn't run away on me. The program to monitor its motive stability will be interesting. It will have to be reliable and fail-safe before we take it off the blocks. This is a huge 72V forklift, I'm not sure on its lift capacity or mast height, but it is huge. The delivery truck brought it in two pc. because it was too tall to take down the road.
Replied by NWE on topic Technical questions about CIA402 and homecomp.comp on A6
My experience has been analog +/-10V servo control configs were a lot more labor intensive to get right compared to step/direction via parallel port or mesa boards driving open loop steppers (easy) or ethercat (a bit of network configuration plus some xml file programming). My analog servo configs have all been... quite a journey.Thanks for the explanation, that makes sense for your setup.
When I mentioned cost, I wasn’t really thinking only about the price of the drives themselves. The hardware can indeed be quite cheap nowadays, especially the Chinese EtherCAT kits. What I had more in mind was the total cost: time spent integrating, debugging, dealing with CiA402 states, homing behavior, synchronization issues, and so on. In LinuxCNC, that complexity is very real, as I’m sure you know.
For my own projects, I’m not looking at EtherCAT as something that would “upgrade” my machine in a practical sense. If I end up buying an EtherCAT drive, it would be purely to learn and experiment with the technology, not because it necessarily adds value compared to a Mesa + step/dir or ±10V setup, which are already very robust and proven.
Might make a difference what kind of hardware you're dealing with. On nearly all my analog servo configs, I was connecting a new computer + Mesa board to old servo drives, the old servo drives usually had limited documentation to where it took some experimenting to figure out for example whether the enable is active high or active low. First power-up is usually a wanabe runaway.
Odd hardware like this old electric forklift I'm retrofitting with LinuxCNC. The motor controller expects 4V to 0V for the speed control. 0V is max speed we found out really quick.. We have it blocked up with the wheels off the floor so it doesn't run away on me. The program to monitor its motive stability will be interesting. It will have to be reliable and fail-safe before we take it off the blocks. This is a huge 72V forklift, I'm not sure on its lift capacity or mast height, but it is huge. The delivery truck brought it in two pc. because it was too tall to take down the road.
Please Log in or Create an account to join the conversation.
- rodw
-
- Offline
- Platinum Member
-
Less
More
- Posts: 11791
- Thank you received: 3992
13 Feb 2026 11:16 #342884
by rodw
Maybe thats an oversight. the homing process is managed by the cia402 state machine. Homing completed is returned in Bit 12 (from memory) and if it errors, that is returned in bit 13). The function of these bits are often not well documented but its really standard cia402 behaviour.
Replied by rodw on topic Technical questions about CIA402 and homecomp.comp on A6
Back after my IP being banned for a week! (Thanks for letting me out of Jail Andy!)From what it looks like, the only way out from homing is that is finishes.
This could probably be expanded to include error states and whatever can occur.
Maybe thats an oversight. the homing process is managed by the cia402 state machine. Homing completed is returned in Bit 12 (from memory) and if it errors, that is returned in bit 13). The function of these bits are often not well documented but its really standard cia402 behaviour.
The following user(s) said Thank You: NWE
Please Log in or Create an account to join the conversation.
- andrax
-
Topic Author
- Away
- Elite Member
-
Less
More
- Posts: 234
- Thank you received: 55
13 Feb 2026 13:30 #342887
by andrax
Replied by andrax on topic Technical questions about CIA402 and homecomp.comp on A6
How did you design the process?
You write the values for homing in 0x6041 and
then set a bit for start homing, right?
The servo should then respond with a status bit that can be monitored.
Or I have three other suggestions that could be considered
1.
After writing 0x6041, read the register again and check the consistency. Then start homing and monitor a status bit
2.
Monitor the axis movement.
The axis must start moving after start homing.
A minimum distance could be specified here, otherwise an error will occur.
3.
Gantry version
The axis positions could be compared with each other.
If the difference is too great, then there is a malfunction.
PS: There was once a project called “Ethercat auto configurator.”
Is this still being pursued?
You write the values for homing in 0x6041 and
then set a bit for start homing, right?
The servo should then respond with a status bit that can be monitored.
Or I have three other suggestions that could be considered
1.
After writing 0x6041, read the register again and check the consistency. Then start homing and monitor a status bit
2.
Monitor the axis movement.
The axis must start moving after start homing.
A minimum distance could be specified here, otherwise an error will occur.
3.
Gantry version
The axis positions could be compared with each other.
If the difference is too great, then there is a malfunction.
PS: There was once a project called “Ethercat auto configurator.”
Is this still being pursued?
Please Log in or Create an account to join the conversation.
- rodw
-
- Offline
- Platinum Member
-
Less
More
- Posts: 11791
- Thank you received: 3992
14 Feb 2026 03:16 #342923
by rodw
Replied by rodw on topic Technical questions about CIA402 and homecomp.comp on A6
the cis402 state machine looks something like this:
state is the status register. d->control.raw is the control register. This is in a separate procedure that eventually returns true (1) if the machine is turned on.
Then you can proceed to homing etc if you are using internal homing.. Something like this
this attempts to limit the torque when homing, you can see we receive a homing signal and we wait until we can read it back to confirm it stuck, then wait until homing completes or errors.
The status word looks something like this (homing bits are also used by manufacturers when not homing
// STATE TRANSITIONS
switch (state) {
case 0x0000:
case 0x0040: // Switch On Disabled
d->control.raw = 0x0006; // CMD: Shutdown
break;
case 0x0021: // Ready to Switch On
d->control.raw = 0x0007; // CMD: Switch Onif (homed && !data.prev_homed) {
break;
case 0x0023: // Switched On
d->control.raw = 0x000F; // CMD: Enable Operation
break;
case 0x0007: // Quick Stop Active
d->control.raw = 0x0000; // CMD: Disable Voltage (Reset the stop)
break;
case 0x0027: // OPERATION ENABLED
d->control.raw = 0x000F; // Maintain Enable
return 1; // Signal: "Drive Ready for Motion"
default:
d->control.raw = 0x0000; // Safety Fallback
break;
}
return 0; // Still transitioning to on statestate is the status register. d->control.raw is the control register. This is in a separate procedure that eventually returns true (1) if the machine is turned on.
Then you can proceed to homing etc if you are using internal homing.. Something like this
// 4. Drive Logic: Only command motion/homing if Operational AND Mode is correct
if (drive_ready) {
if (homing) {
opmode_out = 6;
// --- DYNAMIC TORQUE LIMIT ---
// Use the HAL pin 'torque_limit', but maybe you want to
// force it lower specifically for homing?
// Usually, we just use the pin value set by the user.
drive_torque_limit_out = (int32_t)(homing_torque_limit * torque_scale);
if (opmode_display_in == 6) {
if (!data.status.bits.op_error)
data.control.bits.op_specific1 = 1;
}
} else {
opmode_out = default_opmode;
data.control.bits.op_specific1 = 0;
// Set normal torque limit (100% or as defined by HAL)
drive_torque_limit_out = (int32_t)(torque_limit * torque_scale);
if (mode_verified) {
drive_target_position = (int32_t)(target_position * data.s_pos_scale);
drive_target_velocity = (int32_t)(target_velocity * data.s_vel_scale);
}
}
}
else {
// Drive not ready (Faulted, Timeout, or Powering up)
opmode_out = default_opmode;
data.control.bits.op_specific1 = 0;
drive_torque_limit_out = 0; // Safety clamp
}this attempts to limit the torque when homing, you can see we receive a homing signal and we wait until we can read it back to confirm it stuck, then wait until homing completes or errors.
The status word looks something like this (homing bits are also used by manufacturers when not homing
typedef struct {
union {
unsigned short raw;
struct {
unsigned short ready_to_switch_on :1; // Bit 0
unsigned short switched_on :1; // Bit 1
unsigned short op_enabled :1; // Bit 2
unsigned short fault :1; // Bit 3
unsigned short voltage_enabled :1; // Bit 4
unsigned short quick_stop :1; // Bit 5
unsigned short sw_on_disabled :1; // Bit 6
unsigned short warning :1; // Bit 7
unsigned short manufacturer :1; // Bit 8
unsigned short remote :1; // Bit 9
unsigned short target_reached :1; // Bit 10
unsigned short internal_limit :1; // Bit 11
unsigned short op_specific :1; // Bit 12 (Homing Attained)
unsigned short op_error :1; // Bit 13 (Homing Error)
unsigned short manufacturer_1 :1; // Bit 14
unsigned short manufacturer_2 :1; // Bit 15
} bits;
} status;
The following user(s) said Thank You: Marcos DC, andrax, NWE
Please Log in or Create an account to join the conversation.
- Marcos DC
-
- Offline
- Senior Member
-
Less
More
- Posts: 68
- Thank you received: 41
14 Feb 2026 07:54 - 14 Feb 2026 08:00 #342925
by Marcos DC
Replied by Marcos DC on topic Technical questions about CIA402 and homecomp.comp on A6
Sorry if this is drifting a bit from Andrax’s original question.
@NWE
I’m not really talking about old analog hardware or tricky retrofits. My reference is mainly the integration effort in LinuxCNC itself, comparing FPGA-based step/dir (Mesa) or ±10 V with well-documented drives versus EtherCAT + CiA402. In that context, step/dir on Mesa is a very different beast from software stepgen, and is usually much more KISS and predictable to integrate.
And by the way, thanks to rodw for the work he’s been doing—not only on this, but for his contributions to the LinuxCNC community as a whole.
@NWE
I’m not really talking about old analog hardware or tricky retrofits. My reference is mainly the integration effort in LinuxCNC itself, comparing FPGA-based step/dir (Mesa) or ±10 V with well-documented drives versus EtherCAT + CiA402. In that context, step/dir on Mesa is a very different beast from software stepgen, and is usually much more KISS and predictable to integrate.
And by the way, thanks to rodw for the work he’s been doing—not only on this, but for his contributions to the LinuxCNC community as a whole.
Last edit: 14 Feb 2026 08:00 by Marcos DC.
The following user(s) said Thank You: rodw, andrax
Please Log in or Create an account to join the conversation.
- Hakan
- Offline
- Platinum Member
-
Less
More
- Posts: 1280
- Thank you received: 444
14 Feb 2026 08:04 #342926
by Hakan
Replied by Hakan on topic Technical questions about CIA402 and homecomp.comp on A6
rodw, I kind of think of a structure like thisKeep track of what op-mode we were in last time so we recognize a transition
between op-modes. To deal with offsets and such things.
if drive ready
if csp
else if csv
else if pv
...
else if probing
else if homing
if homing_method == 1
else if homing_method == 2
else if homing_method == 37
Do the torque homing. Although it doesn't seem to be standard
between op-modes. To deal with offsets and such things.
The following user(s) said Thank You: andrax
Please Log in or Create an account to join the conversation.
- Configuring LinuxCNC
- Advanced Configuration
- EtherCAT
- Technical questions about CIA402 and homecomp.comp on A6
Time to create page: 0.157 seconds