Lathe C axis homing

More
25 Mar 2026 12:58 - 25 Mar 2026 13:23 #344719 by jetbadger
Lathe C axis homing was created by jetbadger
First hello everyone, my first post here. :)

I'm currently trying to make a Schaublin 110 retrofit work and using the config from here github.com/LinuxCNC/linuxcnc/issues/3556 as a basis to try and make the C axis functional, however I cannot get it to home. The c-index-enable signal and all corresponding ones are not set to true when homing. I can set it manually in halshow and the axis will reach the index point, but then it resets it before it latches again. I went through everything to the best of my extremely limited ability but can't figure it out. The things I've changed were that C axis is now on Joint2.

 

File Attachment:

File Name: Schaublin1.zip
File Size:14 KB
Attachments:
Last edit: 25 Mar 2026 13:23 by jetbadger.

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

More
25 Mar 2026 16:05 #344724 by spumco
Replied by spumco on topic Lathe C axis homing
I based my C-axis config on Aciera's example as well; he really saved my bacon discovering the index-enable synchronized motion bug.

I don't see anything really obvious in your config at first glance...you've got HOME_USE_INDEX in INI set right...

Index-enable signal appears to be connected to everything:
  • encoder
  • spindle
  • orient
  • joint
  • pid-spindle
  • pid-orient
  • pid-axis
Have you tried orienting the spindle yet?

How are you trying to home joint 2?  Home-all, or just that joint/axis?  halui or something else?

What actually happens when you try to home joint 2?  Keep spinning forever, doesn't move, or something else?

Just for reference, my config starts up in C-axis mode, and there are (software) restrictions so I can't put it in spindle mode until the Caxis is homed.  
# MAIN SPINDLE IS-HOMED SIGNAL - SWITCH FROM CAXIS TO SPINDLE MODE
setp oneshot.s0home.width   1
net SPIN0-CAXIS-IS-HOMED    <=  joint.2.homed           #TO 02IO.HAL, M254/M255, AND PID.C MAXOUTPUT
net SPIN0-CAXIS-IS-HOMED    =>  oneshot.s0home.in
net SPIN0-HOME-MODE-SWITCH  <=  oneshot.s0home.out
net SPIN0-HOME-MODE-SWITCH  =>  halui.mdi-command-02    #CALL M255 TO PUT MAIN SPINDLE BACK TO SPINDLE MODE AFTER INITIAL CAXIS HOMING

I could post my config, but it's really complicated and not in a final-final state just yet.  If you/we cant get yours sorted out quickly I'll post it for you to try to digest.
The following user(s) said Thank You: jetbadger

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

More
25 Mar 2026 16:19 #344725 by jetbadger
Replied by jetbadger on topic Lathe C axis homing
I found the error on my part just minutes ago. I had set HOME_SEARCH_VEL != 0 and that was the issue. Caused half a day of headache for myself, but now the C axis homes and after a few tweaks responds to commands to some extent, yay :)

I was homing it from the gmocappy GUI and now the homing bit works great! Now the other problem is with the mcodes and remaps. Calling m419/420 causes errors with "ngc file ended with no % sign or program end" and unknown m119/120 code. Will try to figure that out next.

I have to thank you and Aciera as your work let me actually attempt this :)

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

More
25 Mar 2026 19:43 #344732 by spumco
Replied by spumco on topic Lathe C axis homing
Good job!

I've renamed my m-codes from the original example, and due to some jitter (servo dithering) when the motor/drive is in position mode I just leave the drive in velocity mode.  LCNC is switched between spindle/orient/positioning. 

My M-codes and main spindle HAL file are attached for your review; maybe they can help.

There is quite a bit commented out, but the gist of it is M254/M255 are used to switch between C-axis and spindle mode, using spindle-orient to realign the spindle before re-connecting the C-axis encoder.

M102 & M103 are 'backstage' M-codes used to adjust stepgen & c-axis PID settings (and disconnect index-enable) in a way you can't (I think) do from inside a normal .ngc g-code file.

Let me know if anything is really unclear.
Attachments:

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

More
25 Mar 2026 20:02 #344733 by spumco
Replied by spumco on topic Lathe C axis homing
I thought I'd added my HAL file, guess not.

The M-code files still have remnants of my first attempt at switching the drive (internally) between velocity and position modes as in @Aciera's example.  That stuff is commented out; just ignore it if you aren't switching your drive.

If you ARE switching your drive internally, you'll probably want stuff like "M66, check for drive mode" in your M-code file.
Attachments:

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

Time to create page: 0.283 seconds
Powered by Kunena Forum