caxis.comp with stepper motor / gear connection to spindle
- scda
-
Topic Author
- Offline
- Junior Member
-
Less
More
- Posts: 32
- Thank you received: 3
16 Mar 2025 15:04 - 16 Mar 2025 15:09 #324057
by scda
caxis.comp with stepper motor / gear connection to spindle was created by scda
Hi all,
I am trying to understand and implement the caxis.comp with my lathe.
My setup is:
VFD with ac motor for "normal" spindle mode (analog signal --> pwmgen)
C-axis is connected via a reducing gear to the spindle, the c-axis motor is a closed loop stepper (step/dir). The c-axis drive is engaged to the spindle with a pneumatic cylinder. Normally it is disengaged
I am trying to better understand the caxis.comp and was wondering if someone can shed some light on this:
pin in float spindle-revs --> connected to spindle.0.revs
pin in float spindle-velocity-in --> connected to encoder velocity signal
pin out float spindle-velocity-out --> ? velocity signal for pwmgen and/or step/gen ?
pin out float position-fb-out --> is this position feedback calculated from encoder velocity signal ? is this connected to joint.xx.pos-fb?
pin in float pid-in; --> connected to PID output of c-axis
pin out signed state; --> what is this for?
Has anyone used this in similar setup (spindle with pwmgen, and c-axis with step/dir). Should the step/dir generator be run in velocity mode?
Would probably help to have some insight.
I have also tried a similiar thing using the mux component and connecteing the encoder signal to the c-axis feedback or not (depending on the mode). But as others have experienced there is an ussed with joint following after switching back to c-axis mode. Even when reseting the encoder position to 0, this will only work if the c-axis is also at 0.
I also could not achieve proper orientation (homing) when switching to c-axis mode.
Will keep trying ----
Regards,
Dave
I am trying to understand and implement the caxis.comp with my lathe.
My setup is:
VFD with ac motor for "normal" spindle mode (analog signal --> pwmgen)
C-axis is connected via a reducing gear to the spindle, the c-axis motor is a closed loop stepper (step/dir). The c-axis drive is engaged to the spindle with a pneumatic cylinder. Normally it is disengaged
I am trying to better understand the caxis.comp and was wondering if someone can shed some light on this:
pin in float spindle-revs --> connected to spindle.0.revs
pin in float spindle-velocity-in --> connected to encoder velocity signal
pin out float spindle-velocity-out --> ? velocity signal for pwmgen and/or step/gen ?
pin out float position-fb-out --> is this position feedback calculated from encoder velocity signal ? is this connected to joint.xx.pos-fb?
pin in float pid-in; --> connected to PID output of c-axis
pin out signed state; --> what is this for?
Has anyone used this in similar setup (spindle with pwmgen, and c-axis with step/dir). Should the step/dir generator be run in velocity mode?
Would probably help to have some insight.
I have also tried a similiar thing using the mux component and connecteing the encoder signal to the c-axis feedback or not (depending on the mode). But as others have experienced there is an ussed with joint following after switching back to c-axis mode. Even when reseting the encoder position to 0, this will only work if the c-axis is also at 0.
I also could not achieve proper orientation (homing) when switching to c-axis mode.
Will keep trying ----
Regards,
Dave
Last edit: 16 Mar 2025 15:09 by scda.
Please Log in or Create an account to join the conversation.
- spumco
- Offline
- Platinum Member
-
Less
More
- Posts: 1908
- Thank you received: 763
16 Mar 2025 18:30 #324066
by spumco
Replied by spumco on topic caxis.comp with stepper motor / gear connection to spindle
Caxis.comp was originally written by Andy Pugh to control a single motor for velocity and positioning mode (spindle & c-axis). I don't think it was intended to control two separate motors.
It's not part of the mainline LCNC components, nor are there many people using it... so I don't think you're going to find a wealth of info on implementation. For your situation, there may be better approaches to managing your dual-motor arrangement.
The main hurdle to overcome for any spindle/axis (dual or single motor) is how to manage the axis encoder. Once you switch from axis to velocity mode the axis will generate a following error when LCNC sees the 'axis' encoder moving away from the commanded position. So we have to 'trick' LCNC and adjust the encoder value somehow.
For the past year I've been fiddling with caxis.comp and have recently come to the conclusion that it isn't going to work for me. There are a couple of annoying things I don't like (can't disconnect the spindle easily to manually rotate the chuck), but the serious problem I found was that spindle synchronized motion wasn't working properly.
Something - and I'm not smart enough to figure out exactly what it was - in the caxis.comp scheme was causing erratic behavior (big motion jumps) during tapping and threading commands. Once I removed caxis.comp and use the spindle as just a spindle the tapping/threading stuff started working as expected. So now I'm re-doing a bunch of stuff in my config and will eventually wind up with something very similar to Aciera's arrangement.
So to sum up, I'd suggest abandoing caxis.comp for your dual-motor lathe and search for Aciera's config. I know he posted his files in the past year or so, although I think he's been working on a glitch with the encoder disconnect function recently.
It's not part of the mainline LCNC components, nor are there many people using it... so I don't think you're going to find a wealth of info on implementation. For your situation, there may be better approaches to managing your dual-motor arrangement.
The main hurdle to overcome for any spindle/axis (dual or single motor) is how to manage the axis encoder. Once you switch from axis to velocity mode the axis will generate a following error when LCNC sees the 'axis' encoder moving away from the commanded position. So we have to 'trick' LCNC and adjust the encoder value somehow.
- caxis.comp does this by intercepting the encoder output, and then subtracting the encoder change from the encoder starting value before sending that to the axis PID feedback input.
- Another method is to disconnect the encoder output from the axis feedback in spindle mode
- Step 0
- LCNC starts up with main spindle motor disabled
- Home C-axis before any spindle moves (at start of LCNC session).
- Step 1
- Command C-axis to C0
- Disconnect spindle encoder
- Enable spindle mode
- in Aciera's case that means switching his drive from position to velocity mode
- for a two-motor arrangement that means retracting the axis motor and enabling the main spindle motor via M-codes & digital inputs/outputs
- Step 2 - Run spindle as a spindle
- Step 3
- Use orient.comp to orient the spindle to 0
- Disable the spindle motor
- Enable the axis motor
- Reconnect the spindle encoder
For the past year I've been fiddling with caxis.comp and have recently come to the conclusion that it isn't going to work for me. There are a couple of annoying things I don't like (can't disconnect the spindle easily to manually rotate the chuck), but the serious problem I found was that spindle synchronized motion wasn't working properly.
Something - and I'm not smart enough to figure out exactly what it was - in the caxis.comp scheme was causing erratic behavior (big motion jumps) during tapping and threading commands. Once I removed caxis.comp and use the spindle as just a spindle the tapping/threading stuff started working as expected. So now I'm re-doing a bunch of stuff in my config and will eventually wind up with something very similar to Aciera's arrangement.
So to sum up, I'd suggest abandoing caxis.comp for your dual-motor lathe and search for Aciera's config. I know he posted his files in the past year or so, although I think he's been working on a glitch with the encoder disconnect function recently.
The following user(s) said Thank You: scda
Please Log in or Create an account to join the conversation.
- scda
-
Topic Author
- Offline
- Junior Member
-
Less
More
- Posts: 32
- Thank you received: 3
16 Mar 2025 21:08 #324070
by scda
Replied by scda on topic caxis.comp with stepper motor / gear connection to spindle
Thanks a lot for the detailed reply. Really appreciated.
I know that this is not an official LCNC function. I was expecting this to be troublesome, but with your feedback, I might consider leaving it be for the moment.
If I find time I will try to understand ACIERA's setup and try this out.
I might just setup spindle orient function for now. This should be fairly straight forward.
Cheers,
Dave
I know that this is not an official LCNC function. I was expecting this to be troublesome, but with your feedback, I might consider leaving it be for the moment.
If I find time I will try to understand ACIERA's setup and try this out.
I might just setup spindle orient function for now. This should be fairly straight forward.
Cheers,
Dave
Please Log in or Create an account to join the conversation.
- spumco
- Offline
- Platinum Member
-
Less
More
- Posts: 1908
- Thank you received: 763
16 Mar 2025 23:54 #324079
by spumco
Replied by spumco on topic caxis.comp with stepper motor / gear connection to spindle
Not a problem, hope it was helpful.
Regarding spindle orient... I'd hoped to use orient for my lathe as a 'poor-man's c-axis' once I realized that caxis.comp wasn't doing what I wanted.
I quickly realized that is orient by itself won't hold a position. You either need a spindle brake, or you need a servo drive that is in position mode (internally). Servo drives in velocity-mode don't necessarily hold a position rigidly, but LCNC is perfectly capable of treating a position-mode servo drive as a spindle.
LCNC can orient a plain old VFD to a pretty exact position, but that does no good if you're trying to use live tools once the spindle is in the appropriate position.
I think you're on the right track for your first steps. Get the spindle working as well as you can, then add the orient function. Orient is simple in concept, but tuning and nailing the position can be tricky and time-consuming. Especially if you have a heavy spindle/chuck.
Something else to consider... your spindle encoder need not be super-high resolution for spindle/orient functions, but for eventual c-axis work the higher the resolution the better. And that can become a rabbit-hole when trying to balance high encoder speeds with high resolution... while remaining budget friendly.
Regarding spindle orient... I'd hoped to use orient for my lathe as a 'poor-man's c-axis' once I realized that caxis.comp wasn't doing what I wanted.
I quickly realized that is orient by itself won't hold a position. You either need a spindle brake, or you need a servo drive that is in position mode (internally). Servo drives in velocity-mode don't necessarily hold a position rigidly, but LCNC is perfectly capable of treating a position-mode servo drive as a spindle.
LCNC can orient a plain old VFD to a pretty exact position, but that does no good if you're trying to use live tools once the spindle is in the appropriate position.
I think you're on the right track for your first steps. Get the spindle working as well as you can, then add the orient function. Orient is simple in concept, but tuning and nailing the position can be tricky and time-consuming. Especially if you have a heavy spindle/chuck.
Something else to consider... your spindle encoder need not be super-high resolution for spindle/orient functions, but for eventual c-axis work the higher the resolution the better. And that can become a rabbit-hole when trying to balance high encoder speeds with high resolution... while remaining budget friendly.
Please Log in or Create an account to join the conversation.
- scda
-
Topic Author
- Offline
- Junior Member
-
Less
More
- Posts: 32
- Thank you received: 3
17 Mar 2025 14:29 #324121
by scda
Replied by scda on topic caxis.comp with stepper motor / gear connection to spindle
Luckly I installed a disk brake on my lathe's spindle during the retrofit (brake is operated with pressurized air). This works pretty well for holding the spindle during cutting in a specific angle.
The following user(s) said Thank You: spumco
Please Log in or Create an account to join the conversation.
Time to create page: 0.058 seconds