[edit]
See this post further down on how to reproduce this issue in a sim config:
#3556 (comment)
[/edit]
Background:
Some users want to setup a joint as a spindle/rotary-axis (eg using a lathe spindle as a Caxis). The usual approach is to configure a rotary axis with homing to index and then use hal logic to disconnect the encoder signal before switching to spindle mode to avoid triggering a joint following error. The spindle has to be rehomed (using the encoder index) before the encoder can be reconnected in hal.
Issue:
While the above method works reliably, it has been reported that synchronized motion (eg G33, G33.1) shows erratic behavior while in spindle mode:
https://forum.linuxcnc.org/38-general-linuxcnc-questions/55116-g33-1-synchronized-tapping-problem?start=20#324268
As described in the forum thread above, I have done testing which reproduced the issue. Further testing showed that the erratic behavior seems to only appear if 'joint.n.index-enable' (where n is the joint for the caxis) is connected to the encoder index-enable and subsequently also to spindle.n.index-enable. This is used to home the caxis to index on startup.
Testing a configuration where joint 4 is setup as rotary/spindle:
- start config and home all (joint 4 is set to home to index)
- testing g33 shows broken behavior (does a rapid move to target coordinate)
- open 'hal configuration' tool and issue HAL command: 'unlinkp joint.4.index-enable'
- testing g33 shows expected behavior
- issue HAL command: 'net c-index-enable joint.4.index-enable'
- testing g33 shows broken behavior (does a rapid move to target coordinate)
So a workaround seems to be to disconnect 'joint.n.index-enable' (where n is the joint for the caxis) when switching to spindle mode.
I attach my test configuration including the components used for future reference.
Drehachse.tar.gz
Some notes about the test config:
- Rotary (Caxis) is on Joint 4, uses a stepgen with settings from ini [JOINT_4] section
- Spindle also uses stepgen but with setting from ini [SPINDLE_0]
- Startup mode is rotary with joint.4 homing to index (ie joint.4.index-enable is connected in HAL)
- 'M419' moves rotary to 0 position, sets hal pin to freeze joint.4.pos-fb and calls M119 to set stepgen values as set in ini [SPINDLE_0] and disconnect 'joint.4.index-enable' to avoid breaking sinchronized motion as outlined in my last post
- 'M420' orients the spindle to 0° (using index to rehome first) sets hal pin to reconnect the encder to joint.4.pos-fb and calls M120 to set stepgen values as set in ini [JOINT_4] and reconnect the 'joint.4.index-enable' pin
Conclusion:
The underlying issue seems to be that the 'joint.n.index-enable' pin is not 'released' after the homing procedure.
[edit]
See this post further down on how to reproduce this issue in a sim config:
#3556 (comment)
[/edit]
Background:
Some users want to setup a joint as a spindle/rotary-axis (eg using a lathe spindle as a Caxis). The usual approach is to configure a rotary axis with homing to index and then use hal logic to disconnect the encoder signal before switching to spindle mode to avoid triggering a joint following error. The spindle has to be rehomed (using the encoder index) before the encoder can be reconnected in hal.
Issue:
While the above method works reliably, it has been reported that synchronized motion (eg G33, G33.1) shows erratic behavior while in spindle mode:
https://forum.linuxcnc.org/38-general-linuxcnc-questions/55116-g33-1-synchronized-tapping-problem?start=20#324268
As described in the forum thread above, I have done testing which reproduced the issue. Further testing showed that the erratic behavior seems to only appear if 'joint.n.index-enable' (where n is the joint for the caxis) is connected to the encoder index-enable and subsequently also to spindle.n.index-enable. This is used to home the caxis to index on startup.
Testing a configuration where joint 4 is setup as rotary/spindle:
So a workaround seems to be to disconnect 'joint.n.index-enable' (where n is the joint for the caxis) when switching to spindle mode.
I attach my test configuration including the components used for future reference.
Drehachse.tar.gz
Some notes about the test config:
Conclusion:
The underlying issue seems to be that the 'joint.n.index-enable' pin is not 'released' after the homing procedure.