[solved] Rehoming Lathespidle / Rotary-Axis from inside GCode

More
3 years 5 months ago - 3 years 5 months ago #271906 by Aciera
So looking at your summary a possible option would be:

1. we start in axis mode and home the rotary using index

2. to switch to spindle mode we orient the rotary to a known position, disconnect the encoder signals (in hal) and switch the controller to speed mode. Since (in my case at least) it would keep sending signals in speed mode and the stepgen remains at it's last position we would get a joint following error otherwise.

3. to switch back to rotary mode: orient the spindle to the known last (rotary) position (M19 spindle orient seems a likely candidate here, M33 is a bit of a question mark for me), connect the encoder and switch the controller to position mode.

[edit]
As for my homing offset I tried changing the pid values in the ini but it does not affect the offset at all.
Indeed, the pid values in the ini had to be adjusted properly to minimize the following error. Takes a bit more effort to get the values needed. Thanks!


Thanks for all the input.
Last edit: 3 years 5 months ago by Aciera.

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

More
3 years 5 months ago - 3 years 5 months ago #271947 by Aciera
@andy
ok, i think get your point now. G33 lets me reset the encoder count on the index signal without causing a following error.

@chris
Not sure if you already know this:

Looks interesting.
[edit]
Doesn't actually switch between rotary and spindle mode though but still worth a look.
Last edit: 3 years 5 months ago by Aciera.

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

More
3 years 5 months ago #271948 by spumco
@Aciera

I'm starting a C-axis lathe project too... good timing.

I recalled NoJo posting quite a bit about his trials and challenges implementing a spindle/C-axis switching function, as well as polar coordinate switching.  Like him (and you), I plan to use a step-dir controlled servo for my spindle motor.

He hasn't posted in over a year (or reported complete success), but I did find some files that may help you (us) accomplish what you want.  Note that I've just started reading the files and haven't really digested them yet.

caxis.comp appears to manage the c-axis to spindle switching
gn.userkins.comp appears to handle polar interpolation when C-axis is enabled

Hopefully you find these useful.  I also found a zip of NoJo's complete config and remaps, but it appears to be an earlier version than the two attached here.

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

More
3 years 5 months ago #271960 by Aciera
@spumco
Thanks, actually that is probably what made me think that there was a component to switch between rotary and spindle. Seems it's not really as simple as recycling a component though.
I think NoJo ended up doing a fair bit of customizing in the source code that was not shared at the time.
The following user(s) said Thank You: spumco

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

More
3 years 5 months ago #271966 by smc.collins
excellent thread guys, I'll look at caxis.comp and see if i can figure it out

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

More
3 years 5 months ago #271982 by spumco

@spumco
Thanks, actually that is probably what made me think that there was a component to switch between rotary and spindle. Seems it's not really as simple as recycling a component though.
I think NoJo ended up doing a fair bit of customizing in the source code that was not shared at the time.
 

Nothing is ever simple with LCNC, is it?

From what I gathered, I think the backstage fiddling he had to do was because he wanted switchable kinematics (Polarkins) available via m-codes.

Plowing back through some of the comments I made to him when he was starting out I was reminded of something I wrote earlier... I don't think we need polar interpolation.

When I look at the code Fusion 360 outputs for my commercial C-axis live-tool lathe, there's no polar interpolation.  It's all done in the post processor.  My control has polar interpolation internally, but my post processor doesn't use it - it just outputs X/Z/C moves, having done the Y->C  gymnastics inside the post.

I've no intention of hand-coding a radial cam groove on a shaft - the sort of thing you really want polar interp for in a control.  F360 can handle that one as far as I'm concerned.

If NoJo's implementation was that fussy, I don't think it's necessary, at least for my use-case.  What I'm interested in is C-axis indexing (at the moment) as well as a dual-purpose velocity/positioning spindle.  And his caxis.comp plus HAL config appears to accomplish that without anything seiously 'advanced'.

-R

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

Time to create page: 0.085 seconds
Powered by Kunena Forum