Spindle (stepper motor) stopping too fast.
14 Nov 2023 17:03 - 14 Nov 2023 17:08 #285393
by timo
Spindle (stepper motor) stopping too fast. was created by timo
Hello,
I am playing around with some motors and a lathe configuration. (no physical load on the motor shafts)
I used Pncconf to set up a lathe example with x-z axis and a step dir pulse spindle.
I put values in for RAMP_RATE, MAX_ACCELERATION and STEPGEN_MAXACCEL
Greetings
I am playing around with some motors and a lathe configuration. (no physical load on the motor shafts)
I used Pncconf to set up a lathe example with x-z axis and a step dir pulse spindle.
I put values in for RAMP_RATE, MAX_ACCELERATION and STEPGEN_MAXACCEL
- M3 S3000 speeds the motor slowly up
- Then M4 S3000 slows it down and speeds slowly up in reverse direction
- M3 S3000 and then M3 S0 stops the (stepper motor) immediately, without slowing down
- M3 S3000 and then M3 S1 slows it down
- M5 also stops immediately without slowing down first
Is that normal? Why is M3 S0 behaving totally different from M3 S1?
Usually the spindle is ramping down over a certain time when M5 is in the program. But the machine is either "freewheeling" or a VFD does its "slowing down procedure" without the Linux computer.
Greetings
Last edit: 14 Nov 2023 17:08 by timo.
Please Log in or Create an account to join the conversation.
14 Nov 2023 17:46 #285398
by blazini36
Replied by blazini36 on topic Spindle (stepper motor) stopping too fast.
Should probably post your hal file.
M3 S0 may be treated the same as M5. It may be setting a motion hal pin like spindle.M.on = false. Maybe that's connected to the stepgen enable signal or something. hard to guess without seeing it.
M3 S0 may be treated the same as M5. It may be setting a motion hal pin like spindle.M.on = false. Maybe that's connected to the stepgen enable signal or something. hard to guess without seeing it.
Please Log in or Create an account to join the conversation.
14 Nov 2023 23:33 #285441
by spumco
Replied by spumco on topic Spindle (stepper motor) stopping too fast.
This seems to be an issue that's cropped up over the years for stepgen-based spindle control. I think it's because the stepgen simply turns off at an M5, and if the motor drive is in position mode (typical stepper, and sometimes servo) the drive sees that as a command to stop instantly. If the drive is in velocity mode, then stopping the stepgen will (likely) result in the drive's internal decel settings taking over.
I've been doing some reasearch on this, and I noticed that both PnCconf and Mesact both create configs where the spindle stepgen control is treated like an axis stepgen. I brought this up a few months ago, but didn't receive a response.
forum.linuxcnc.org/39-pncconf/49366-pncc...ep-dir-spindle-issue
JT responded to me on github, but I've not checked to see if mesact has been changed.
I've come across two solutions... one mentioned in the post above, and the other was a HAL time-off relay combined with a limit.comp that hijacked the M5 command and ramped down the spindle.
I have a stepgen spindle about a day away from commisioning and I'll have to sort this out as well. I'll probably go with the method worked out in the link above.
I've been doing some reasearch on this, and I noticed that both PnCconf and Mesact both create configs where the spindle stepgen control is treated like an axis stepgen. I brought this up a few months ago, but didn't receive a response.
forum.linuxcnc.org/39-pncconf/49366-pncc...ep-dir-spindle-issue
JT responded to me on github, but I've not checked to see if mesact has been changed.
I've come across two solutions... one mentioned in the post above, and the other was a HAL time-off relay combined with a limit.comp that hijacked the M5 command and ramped down the spindle.
I have a stepgen spindle about a day away from commisioning and I'll have to sort this out as well. I'll probably go with the method worked out in the link above.
The following user(s) said Thank You: timo
Please Log in or Create an account to join the conversation.
15 Nov 2023 00:51 #285445
by blazini36
Replied by blazini36 on topic Spindle (stepper motor) stopping too fast.
This is something I never actually noticed. I've been using a 5krpm servo with S/D on my spindle for years. It probably does this but I never actually noticed because it's such a low inertia spindle, even with the tool. I'm sure this would be a much bigger problem on a lathe swinging a part.
Please Log in or Create an account to join the conversation.
15 Nov 2023 03:47 #285450
by spumco
Is your servo drive in position or velocity (or torque) mode internally? I suspect this makes a big difference... but I also don't know of any servo drives that accept S&D command in velocity or torque/current control.
Replied by spumco on topic Spindle (stepper motor) stopping too fast.
This is something I never actually noticed. I've been using a 5krpm servo with S/D on my spindle for years. It probably does this but I never actually noticed because it's such a low inertia spindle, even with the tool. I'm sure this would be a much bigger problem on a lathe swinging a part.
Is your servo drive in position or velocity (or torque) mode internally? I suspect this makes a big difference... but I also don't know of any servo drives that accept S&D command in velocity or torque/current control.
Please Log in or Create an account to join the conversation.
15 Nov 2023 04:03 #285454
by PCW
Replied by PCW on topic Spindle (stepper motor) stopping too fast.
A simple fix would be to simply tie the spindle stepgen enable true.
Then the stepgen accel settings can be used to limit the
ramp-up/ramp-down rates.
Then the stepgen accel settings can be used to limit the
ramp-up/ramp-down rates.
Please Log in or Create an account to join the conversation.
15 Nov 2023 04:12 #285456
by spumco
But the issue going to keep cropping up as long as PnCconf outputs configs for newcomers with the 'gotcha' built-in.
Replied by spumco on topic Spindle (stepper motor) stopping too fast.
I think that's what Andy and NoJo essentially came up with in the thread I linked for NoJo's C-axis lathe. Basically tied the stepgen enable to motion.machine-on.A simple fix would be to simply tie the spindle stepgen enable true.
Then the stepgen accel settings can be used to limit the
ramp-up/ramp-down rates.
But the issue going to keep cropping up as long as PnCconf outputs configs for newcomers with the 'gotcha' built-in.
Please Log in or Create an account to join the conversation.
15 Nov 2023 04:19 - 15 Nov 2023 04:21 #285457
by blazini36
Replied by blazini36 on topic Spindle (stepper motor) stopping too fast.
Pretty much what you said, it runs S/D in position mode. When I set it up I didn't use any sort of PID on the linuxCNCs ide, for milling it works perfectly fine. Rigid tapping works pretty well too except it switches directions very rapidly which sometimes gets me in trouble with smaller taps. Been planning on tuning it up one day but since I don't have any real issues it'll probably be later than sooner.Is your servo drive in position or velocity (or torque) mode internally? I suspect this makes a big difference... but I also don't know of any servo drives that accept S&D command in velocity or torque/current control.
Last edit: 15 Nov 2023 04:21 by blazini36.
Please Log in or Create an account to join the conversation.
15 Nov 2023 11:16 - 15 Nov 2023 13:09 #285484
by timo
Replied by timo on topic Spindle (stepper motor) stopping too fast.
Thank everyone for the given responses. I tried to find a hint, but was not able to find the mentioned threds, I will read and try to make some sense out of it.
I dId not have the hal file at hand, But it is the one that Pncconf generated after clicking through the basic menues quickly. Hal file I need to copy from the machine to the Internet, when I am in "the cave".
p.s. solved see next posts
I dId not have the hal file at hand, But it is the one that Pncconf generated after clicking through the basic menues quickly. Hal file I need to copy from the machine to the Internet, when I am in "the cave".
p.s. solved see next posts
Last edit: 15 Nov 2023 13:09 by timo.
Please Log in or Create an account to join the conversation.
15 Nov 2023 12:42 #285497
by spumco
Replied by spumco on topic Spindle (stepper motor) stopping too fast.
If you're really new to LCNC, quite a lot of the thread I linked won't make much sense without some context. If you find you're still confused post back and we'll try to help translate advanced LCNC jargon
The HAL file will be in your configuration folder under linuxcnc/configs/. It's a text file, but the forum software won't let you attach it as-is. Copy the file and rename it to main_hal.txt and you should be good.
The HAL file will be in your configuration folder under linuxcnc/configs/. It's a text file, but the forum software won't let you attach it as-is. Copy the file and rename it to main_hal.txt and you should be good.
The following user(s) said Thank You: timo
Please Log in or Create an account to join the conversation.
Time to create page: 0.190 seconds