Threading Index Varies With Speed
- cmorley
- Offline
- Moderator
-
Less
More
- Posts: 7863
- Thank you received: 2121
27 Dec 2024 21:20 #317510
by cmorley
Replied by cmorley on topic Threading Index Varies With Speed
Well I now see there is pos_desired and pos_error but it looks like maybe a relative position.
relative to synced position?
relative to synced position?
Please Log in or Create an account to join the conversation.
- 10K
-
Topic Author
- Offline
- Premium Member
-
Less
More
- Posts: 142
- Thank you received: 32
30 Dec 2024 15:58 #317678
by 10K
Replied by 10K on topic Threading Index Varies With Speed
This problem, and this forum thread, all started when I was getting gouging when making a 1"-8 thread. After analysis, I believe that the lathe was bogging down slightly when making later passes in the increasingly deep thread. I've confirmed that the position of the thread changes with speed. The slight decrease in speed made the cutter take a larger bite, which caused further bogging down and then an even larger bite. Eventually, the lathe reached stability and was able to speed up and quit gouging.
Today, I tried making the thread again. I kept thinking that the Monarch lathe motor is large (7HP), and should be able to power through the threading cuts. My lathe has a back gear (speed reduced, torque increased), which I have never used. I put the lathe in the back gear and tried the thread cut. The gouging stopped completely. So that problem is solved to my satisfaction.
The contributing problem, thread position varies with spindle speed, seems to be built in to the LinuxCNC code. Spindle speed should not be changed during the threading operation. I'm not convinced that replacing the Z stepper with a more powerful motor, which would allow me more acceleration, would change this behavior very much. I'm also not convinced that having more pulses per spindle revolution, either through making a new gear with more teeth or using software to synthesize more pulses, would make much difference.
Please let me know if my logic is flawed.
Today, I tried making the thread again. I kept thinking that the Monarch lathe motor is large (7HP), and should be able to power through the threading cuts. My lathe has a back gear (speed reduced, torque increased), which I have never used. I put the lathe in the back gear and tried the thread cut. The gouging stopped completely. So that problem is solved to my satisfaction.
The contributing problem, thread position varies with spindle speed, seems to be built in to the LinuxCNC code. Spindle speed should not be changed during the threading operation. I'm not convinced that replacing the Z stepper with a more powerful motor, which would allow me more acceleration, would change this behavior very much. I'm also not convinced that having more pulses per spindle revolution, either through making a new gear with more teeth or using software to synthesize more pulses, would make much difference.
Please let me know if my logic is flawed.
Please Log in or Create an account to join the conversation.
- PCW
-
- Away
- Moderator
-
Less
More
- Posts: 18374
- Thank you received: 5016
30 Dec 2024 17:05 - 30 Dec 2024 17:09 #317679
by PCW
Replied by PCW on topic Threading Index Varies With Speed
Can you post a plot that contains the encoder velocity to determine
if LinuxCNC or the hardware is to blame?
The odd thing is that the 100 RPM plot looks to be as expected
but the 200 RPM plot is obviously broken. (the Z velocity never
reaches a steady state even though it's obviously possible with
the acceleration constraints)
Also please use the interpolated position, the non-interpolated
position combined with the low resolution encoder makes
everything worse with it's large position steps. This is the intended
use case for interpolated position.
if LinuxCNC or the hardware is to blame?
The odd thing is that the 100 RPM plot looks to be as expected
but the 200 RPM plot is obviously broken. (the Z velocity never
reaches a steady state even though it's obviously possible with
the acceleration constraints)
Also please use the interpolated position, the non-interpolated
position combined with the low resolution encoder makes
everything worse with it's large position steps. This is the intended
use case for interpolated position.
Last edit: 30 Dec 2024 17:09 by PCW.
Please Log in or Create an account to join the conversation.
- 10K
-
Topic Author
- Offline
- Premium Member
-
Less
More
- Posts: 142
- Thank you received: 32
30 Dec 2024 20:19 - 30 Dec 2024 20:24 #317685
by 10K
Replied by 10K on topic Threading Index Varies With Speed
First, I looked at the interpolated and raw signals in HalScope. As expected, one had jaggies and one didn't. In my INI file, I changed:
net spindle-position encoder.0.position => spindle.0.revs
To:
net spindle-position encoder.0.position-interpolated => spindle.0.revs
I ran the threading program at 200 RPM:
Jaggies gone, plus initial slope change before threading now a straight line. However, there's a break in the velocity midway on the line that was not there before. Still have the odd saw-tooth velocity while threading. (Note: I was running the program without a tool, so no actual threading took place)
I thought this might have fixed the problem. So I made another 8TPI thread at 100 and 200 RPM. Alas, they did not overlay. Same problem. In case you're wondering, I could not find another piece of 1" stock, so I used a 1/2" rod.
PS. Looks like I need to resharpen the cutter! Easy to see in the closeup.
net spindle-position encoder.0.position => spindle.0.revs
To:
net spindle-position encoder.0.position-interpolated => spindle.0.revs
I ran the threading program at 200 RPM:
Jaggies gone, plus initial slope change before threading now a straight line. However, there's a break in the velocity midway on the line that was not there before. Still have the odd saw-tooth velocity while threading. (Note: I was running the program without a tool, so no actual threading took place)
I thought this might have fixed the problem. So I made another 8TPI thread at 100 and 200 RPM. Alas, they did not overlay. Same problem. In case you're wondering, I could not find another piece of 1" stock, so I used a 1/2" rod.
PS. Looks like I need to resharpen the cutter! Easy to see in the closeup.
Attachments:
Last edit: 30 Dec 2024 20:24 by 10K. Reason: Added PS
Please Log in or Create an account to join the conversation.
- PCW
-
- Away
- Moderator
-
Less
More
- Posts: 18374
- Thank you received: 5016
30 Dec 2024 23:25 #317693
by PCW
Replied by PCW on topic Threading Index Varies With Speed
Could you plot the encoder position and velocity to see if the error is from the encoder side or LinuxCNC?
The jagginess may be from encoder wheel inaccuracies and inherent velocity quantization
errors from the 1 ms time stamp of the software encoder (this would be improved by using the hardware encoder)
The jagginess may be from encoder wheel inaccuracies and inherent velocity quantization
errors from the 1 ms time stamp of the software encoder (this would be improved by using the hardware encoder)
Please Log in or Create an account to join the conversation.
- cmorley
- Offline
- Moderator
-
Less
More
- Posts: 7863
- Thank you received: 2121
31 Dec 2024 06:48 #317703
by cmorley
Replied by cmorley on topic Threading Index Varies With Speed
I would think (in general) encoder resolution, axis acceleration and trajectory servo update rate all have potential to improve the tracking.
but changing the speed significantly is not going to track in the same place with the current code. I wouldn't think it would be hard to code absolute position tracking, but I bet it has some corner cases.
but changing the speed significantly is not going to track in the same place with the current code. I wouldn't think it would be hard to code absolute position tracking, but I bet it has some corner cases.
Please Log in or Create an account to join the conversation.
- PCW
-
- Away
- Moderator
-
Less
More
- Posts: 18374
- Thank you received: 5016
31 Dec 2024 15:39 #317720
by PCW
The time to get into sync with spindle rotation can of course vary, but the target Z position must be
synchronized to the spindle angle for the actual cutting path (or it's not spindle synchronized motion at all)
Replied by PCW on topic Threading Index Varies With Speed
If that's the case, it's crazy and broken as any speed variation would cause threading inaccuracies.I would think (in general) encoder resolution, axis acceleration and trajectory servo update rate all have potential to improve the tracking.
but changing the speed significantly is not going to track in the same place with the current code. I wouldn't think it would be hard to code absolute position tracking, but I bet it has some corner cases.
The time to get into sync with spindle rotation can of course vary, but the target Z position must be
synchronized to the spindle angle for the actual cutting path (or it's not spindle synchronized motion at all)
Please Log in or Create an account to join the conversation.
- PCW
-
- Away
- Moderator
-
Less
More
- Posts: 18374
- Thank you received: 5016
31 Dec 2024 15:49 - 31 Dec 2024 15:53 #317721
by PCW
Replied by PCW on topic Threading Index Varies With Speed
Take a look at this plot:
There is something pathological here as the Z velocity is never constant,
having a slow exponential rise, so the thread does not have a constant pitch.
This is not due to the acceleration constraints but either a hardware/encoder
bug or bug in the threading code.
This is why I asked for a plot of the encoder position/velocity, to determine if this
is a LinuxCNC threading bug or hal/encoder bug.
There is something pathological here as the Z velocity is never constant,
having a slow exponential rise, so the thread does not have a constant pitch.
This is not due to the acceleration constraints but either a hardware/encoder
bug or bug in the threading code.
This is why I asked for a plot of the encoder position/velocity, to determine if this
is a LinuxCNC threading bug or hal/encoder bug.
Attachments:
Last edit: 31 Dec 2024 15:53 by PCW.
Please Log in or Create an account to join the conversation.
- 10K
-
Topic Author
- Offline
- Premium Member
-
Less
More
- Posts: 142
- Thank you received: 32
31 Dec 2024 17:43 - 31 Dec 2024 17:45 #317724
by 10K
Replied by 10K on topic Threading Index Varies With Speed
Here's the plot you requested:
This cut is slightly different from the previous ones, as it has a tapered exit for the thread.
The comment about the non-constant exponential threading velocity got me thinking about the threads I cut. I made six. On about half of them, I had to rerun the program because there were tight spots in the threads and I could not easily get the nut on. Running the program a second time, at the same speed, still resulted in some cutting near the bottom of the threads.
I laid the treads up against a 8TPI tap. About half of them look OK, and the tap will sit in the threads without wobbling. The other half, the tap wobbles, or see-saws. Here's a photo of one of those. You can see that the tap is touching on the left side of the thread on one end, and the right side on the other. The reason some of them are OK might be because they were run twice. I don't recall which are which.
This cut is slightly different from the previous ones, as it has a tapered exit for the thread.
The comment about the non-constant exponential threading velocity got me thinking about the threads I cut. I made six. On about half of them, I had to rerun the program because there were tight spots in the threads and I could not easily get the nut on. Running the program a second time, at the same speed, still resulted in some cutting near the bottom of the threads.
I laid the treads up against a 8TPI tap. About half of them look OK, and the tap will sit in the threads without wobbling. The other half, the tap wobbles, or see-saws. Here's a photo of one of those. You can see that the tap is touching on the left side of the thread on one end, and the right side on the other. The reason some of them are OK might be because they were run twice. I don't recall which are which.
Attachments:
Last edit: 31 Dec 2024 17:45 by 10K.
Please Log in or Create an account to join the conversation.
- PCW
-
- Away
- Moderator
-
Less
More
- Posts: 18374
- Thank you received: 5016
31 Dec 2024 18:46 #317730
by PCW
Replied by PCW on topic Threading Index Varies With Speed
Well, naturally, that looks normal (no exponential/varying thread pitch)
Was that at 200 RPM?
Was that at 200 RPM?
Please Log in or Create an account to join the conversation.
Time to create page: 0.139 seconds