Lathe C axis homing

More
7 months 6 days ago #344797 by spumco
Replied by spumco on topic Lathe C axis homing
No, the machine starts up in C-axis mode.  Actually, it may be more useful to think of it as the C-axis is always 'on', but paused when the spindle or orient is engaged.
  • Start LCNC
    • C-axis is not paused, encoder disconnect not active
  • Home all axes
    • axes-are-homed triggers C-axis homing
  • C-axis is-homed signal triggers M255 via one-shot and halui.mdi
  • M255
    • Checks if C-axis is homed, abort if not homed
    • G0 C0
    • Disconnect encoder from c-axis joint/axis and PID
    • Disable C-axis PID
    • Change stepgen settings to spindle values
  • Now in spindle mode, all automatically.
To get back in C-axis mode:
  • M254
    • Checks if C-axis is homed, abort if not homed
    • M19 orient spindle to 0 position
    • change stepgen to C-axis values
    • reconnect encoder
    • enable PID
  • C-axis is on, and positioned at C0

Minor tip: one thing that frequently trips me up when copying/using other people's files is forgetting to change the M-code (and other) path(s) in the INI file.
The following user(s) said Thank You: jetbadger

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

More
7 months 6 days ago #344798 by Aciera
Replied by Aciera on topic Lathe C axis homing

Calling m419/420 causes errors with "ngc file ended with no % sign or program end" and unknown m119/120 code.

Note that mcode files containing executable code (eg m119, m120) need to marked as executable (right click on the file -> properties -> permissions).
The following user(s) said Thank You: spumco, jetbadger

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

More
7 months 6 days ago #344799 by spumco
Replied by spumco on topic Lathe C axis homing
Forgot some important safety stuff...

M254 also sets an M5, as well as turns on spindle.N.inhibit.

M255 also sets an M5, and turns off spindle.N.inhibit.

I got caught out by this during testing when I left an M3 command active and switched to C-axis.  When I switched back to spindle mode and gave it an Sxxxx RPM value it immediately started rotating.  That was a pants-fudge event...

As you go through my HAL file, you may notice some partly-related but (perhaps) unclear functions/logic.  One of these is a spindle disable/freewheel feature which I use when indicating a part or toolholder.

My particular spindle motor (SZGH) does not permit freewheeling the motor in velocity mode if it's enabled.  Simply disconnecting the drive enable whenever you want isn't good enough, because the C-axis freaks out with a following error once you start rotating the chuck by hand.  So the disable function has a bunch of checks to make sure C-axis is paused, and there are no other backstage things trying to force the motor to spin the moment you turn the freewheel function off.
The following user(s) said Thank You: besriworld, jetbadger

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

More
6 months 3 weeks ago #345226 by jetbadger
Replied by jetbadger on topic Lathe C axis homing
I was not able afterall to get the C axis to behave with the previous setup. It would home and reach setpoints very well, but after going into spindle mode and back into Caxis mode it hunts for home position in almost a comical way no matter how much I played around with the PID values for the orient thingy and I couldn't wrap my head around the multiple gains for it.

I will try your config, @spumco. Ended up pretty much copy/pasting your's and atleast on the bench it starts up so I'll see if I can figure it out on the actual machine. 

From what I gather, logic.s0free should be an AND device, so with personality=0x105? Maybe there are other essential things there? I assume SPIN0-xx  signals are distributed in another file?
 

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

More
6 months 3 weeks ago #345232 by spumco
Replied by spumco on topic Lathe C axis homing


From what I gather, logic.s0free should be an AND device, so with personality=0x105? Maybe there are other essential things there? I assume SPIN0-xx  signals are distributed in another file?

 

Yes, logic.s0free is 0x105

There are probably other essential ingredients missing from that hal file.  Best bet is for me to post my whole config...  You've got two options:
  • I can give you a slightly out-of-date version right this second.  It has all the spindle/c-axis stuff in it, OR
  • Wait until tonight and I'll give you the latest version
    • Includes a switchkins component for my separate parting slide, plus some changes that don't affect C-axis stuff
Keep in mind that either config is quite complicated, and there are still a number of functions/features I haven't finished:
- Collet closer position sensor logic/interlocks for both main and sub-spindles
- GUI view rotation for sub/main spindle work
- Other stuff yet to be discovered

Your pick.

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

More
6 months 3 weeks ago #345243 by jetbadger
Replied by jetbadger on topic Lathe C axis homing
Oh whichever is easiest for you, I don't have a parting slide and C axis at this moment is all I'm trying to do. I'm immensely grateful anyway :)

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

Time to create page: 0.104 seconds
Powered by Kunena Forum