Category: HAL
I'm using a component authored by Andy Pugh to control my lathe's main spindle as both a C-axis and spindle. Comp attached, and I believe this was the last version Andy and NoJo worked out via the forum a few years ago.
NOTE - this component treats the spindle as an axis until a spindle command is issued. This means absent a spindle command, the C-axis is active and trying to maintain a position. Once the spindle command is done, C-axis re-engages and will return to the last position (within one turn) prior to the spindle command.
I want the ability to disconnect the spindle/axis so I can manually turn it (indicating part/chuck). Because the spindle motor is a servo, if the drive is enabled and machine is on, the spindle is locked in position when the machine is at rest.
Right now I have a simple enable toggle in HAL that disables the drive directly. This allows me to turn the spindle by hand for indicating or tightening the chuck. I can jog the C-axis, but I find being able to manually move the spindle more convenient.
Unfortunately, because I haven't disconnected anything else in HAL, if I rotate the spindle more than about a turn I get a following error and LCNC turns the machine off. I've had to set the ferror higher than I'd like just to be able to turn it a bit, and I'd really like to tighten it up.
I could use some help figuring out how to disable the motor in such a way that:
- No following error while disabled, regardless of turns
- No caxis.comp errors or accumulation of following error upon re-enable (which would result in a potentially violent attempt by the C-axis PID to eliminate the following error)
Is this something I could accomplish in HAL, or does caxis.comp need to be modified/edited in some way?