caxis.comp - How to freewheel axis/spindle?

More
21 Jan 2025 17:23 #319579 by spumco
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?
Attachments:

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

More
27 Jan 2025 10:14 #319941 by Aciera
Replied by Aciera on topic caxis.comp - How to freewheel axis/spindle?
I guess for free wheel operation you would need to disconnect the encoder signal in hal but the tricky bit is that you will need to reorient the spindle to within ferror range before reconnecting the encoder again.

I'm not familiar with 'caxis.comp' I switched the controller mode using a digital signal:
forum.linuxcnc.org/10-advanced-configura...code?start=30#272218
The following user(s) said Thank You: spumco

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

More
27 Jan 2025 13:27 #319948 by spumco
Replied by spumco on topic caxis.comp - How to freewheel axis/spindle?
@Aciera - 

I had hoped to duplicate your C-axis process back when you were working on it, but my drive doesn't permit on-the-fly mode switching via external input.

Since I don't think I can use orient.comp and caxis.comp on the same joint, I'm thinking about ways to un-home and re-home the joint/axis.  Caxis.comp doesn't re-home or move to C0 whenever the spindle stops - it returns to the same position it was in when the spindle command was issued.

Since I don't need to freewheel in the middle of a program, what do you think about using halui to unhome/rehome the C-axis?
  • Freewheel button ON (M-code)
    • set halui.joint.C.unhome
    • Latch encoder reset pin HIGH (to keep it at 0)
    • Amp enable OFF
  • (manual spindle rotation activity)
  • Freewheel button OFF
    • Amp enable ON
    • Unlatch encoder reset pin
    • set halui.joint.C.home
See any major issues with the above before I try testing it this evening?

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

More
28 Jan 2025 08:34 #319984 by Aciera
Replied by Aciera on topic caxis.comp - How to freewheel axis/spindle?
Sure, give it a try and report back.

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

Time to create page: 0.054 seconds
Powered by Kunena Forum