- Posts: 165
- Thank you received: 0
Spindle as speed counter clockwise.
I have configured spindle at speed, working great (clockwise rotation)!
The lathe sometimes needs to run counter clockwise. The gui shows for example: -2.500RPM.
The problem is that the gcode doesn't continue and the spindle as speed led stays off.
How to solve this?
Please Log in to join the conversation.
How can I configure it to show a positive value?
This is what I can find in my HAL file about the direction of the motor
net spindle-ccw => hm2_5i25.0.7i76.0.0.spindir
net spindle-cw <= motion.spindle-forward
net spindle-ccw <= motion.spindle-reverse
net spindle-manual-cw halui.spindle.forward
net spindle-manual-ccw halui.spindle.reverse
Please Log in to join the conversation.
- photomankc
- Offline
- Junior Member
-
- Posts: 35
- Thank you received: 0
linuxcnc.org/docs/2.4/html/hal_components.html#r1_2_1
You can feed the RPMs into that and it's output should always be a positive value. I'm not sure exactly where in your HAL that would need to be placed.
linuxcnc.org/docs/html/examples/spindle.html
That link explains how spindle-at-speed can be setup so you can probably look through your HAL to see how it's done and where to insert the ABS component to eliminate the sign.
Please Log in to join the conversation.
timmert wrote: Hi
I have configured spindle at speed, working great (clockwise rotation)!
The lathe sometimes needs to run counter clockwise. The gui shows for example: -2.500RPM.
The problem is that the gcode doesn't continue and the spindle as speed led stays off.
How to solve this?
What drives your spindle-at-speed input?
You probably have motion.spindle-speed-out-abs connected to the hardware with separate fwd.rev logic.
It is likely that a "wcomp" or "near" component is being used to compare the spindle speed feedback from the encoder to the commanded speed, but it is probably looking at the absolute version of the commanded speed.
The simplest answer is probably to connect the "near" to motion.spindle-speed-out-rps instead, which is a positive/negative number matching the encoder velocity output scaling and sign.
Please Log in to join the conversation.
Attachment not found
I do use the near component
Not sure anymore how to edit it
# ---Setup spindle at speed signals---
net spindle-vel-cmd-rps => near.0.in1
net spindle-vel-fb-rps => near.0.in2
net spindle-at-speed motion.spindle-at-speed <= near.0.out
setp near.0.scale 1.10
Please Log in to join the conversation.
Can you monitor near.0.in0 and near.0.in1 with halmeter and tell us the numbers at 500rpm fwd and 500 rpm reverse?
Please Log in to join the conversation.
I can see a near 0.in1 and 0.in2
0.1
CW 500RPM = 8.33333....
CCW 500RPM = - 8.3333...
0.2
CW 500RPM = 8.5
CCW 500RPM = 8.5
Please Log in to join the conversation.
timmert wrote: 0.1
CW 500RPM = 8.33333....
CCW 500RPM = - 8.3333...
0.2
CW 500RPM = 8.5
CCW 500RPM = 8.5
This seems to say that spindle-vel-fb-rps does not go negative when the spindle reverses.
That is directly linked to the encoder, so that seems to indicate that the encoder only shows positive numbers.
And this is why:
Do you only have a single-pulse spindle encoder by any chance? (Do you have index?)
counter-mode can's sense direction. If you do have a proper quadrature encoder then set that to 0.
If you don't have a quadrature encoder then one solution is to use:
A better solution is to fit a proper encoder, so you can do rigid tapping.
Please Log in to join the conversation.
I have an index single and 150ppr encoder
It's a (rotary?) encoder connected to the spindle with a belt.
What do you recommend?
A index and quadrature encoder?
Please Log in to join the conversation.
Please Log in to join the conversation.
