- Posts: 34
- Thank you received: 0
Seeking advice on lathe turret set-up
The turret is operated by a stepper motor and locked / unlocked by an air over hydraulic cylinder controlled by a solenoid. The turret tool position is "read" by three opto-switches creating a "truth table":
Tool 1: X, X, X
Tool 2: X, X, -
Tool 3: X, -, X
Tool 4: X, -, -
Tool 5: -, X, X
Tool 6: -, X, -
The turret also has two switches to tell the control if it is clamped or not.
So, I'll need the following inputs:
1. turret clamped switch
2. turret un-clamped switch
3. three opto-switches
And the following outputs:
1. step generator
2. clamp / un-clamp solenoid signal
I've looked at the examples for lathe turrets, but they seem to use a different system of backing-up the turret to a stop. It would also be nice to have the turret turn either CW or CCW to the next tool (shortest path). I would also like to send the turret to position 1 when homing the machine.
Given the above, is classic ladder the best solution? Any pointers?
Please Log in to join the conversation.
All my info on my lathe is here:
gnipsel.com/shop/hardinge/hardinge.xhtml
If your not familiar with ladder logic I have a short tutorial and turret simulator here
gnipsel.com/linuxcnc/index.html
JT
Please Log in to join the conversation.
jj89074 wrote: Tool 1: X, X, X
Tool 2: X, X, -
Tool 3: X, -, X
Tool 4: X, -, -
Tool 5: -, X, X
Tool 6: -, X, -
That's just simple binary (possibly inverted)
The "carousel" component might be helpful.
Please Log in to join the conversation.
I looked at the "carousel" component, but I could use some assistance in figuring out how to use it.
First, I think there is a typo on the manual page for the command line:
loadrt toolchange pockets=N[,N] encoding=ssss[,sss] num_sense=N[,N] bidirectional=N[,N]
pockets The number of pockets in each toolchanger.
Use up to 8 numbers separated by commas to create multiple carousel components.
encoding The position encoding.
gray, binary, index or single. Default = ’gray’
num_sense The number of position sense pins.
Default = 4.
dir set to 1 for unidirectional or 2 for bidirectional operation.
Default = bidirectional
Shouldn't the last parameter in the be dir=N[,N] like:
loadrt toolchange pockets=[N,N] encoding=ssss[,sss] num_sense=N[,N] dir=N[,N]?
I have a 6 position turret with 3 position input pins and it's bidirectional. I'm guessing the command line would be:
loadrt toolchange pockets=6 encoding=binary num_sense=3 dir=bidirectional
How do I use it with a stepper motor driving the tool changer? I've calculated the steps required between tool positions to be 400 full steps.
Also, if I assign each of the 3 position switches to carousel.0.sense, carousel.1.sense, & carousel.2.sense, which is the high bit?
Is there an example configuration in Linuxcnc I could load to see how "carousel" works?
If I could figure out how to "read" the position, I think I could also run the turret with a g-code sub-program.
Sorry if my questions are a bit ignorant...I'm not very familiar with Linux or Linuxcnc.
Please Log in to join the conversation.
jj89074 wrote: Shouldn't the last parameter in the be dir=N[,N] like:
loadrt toolchange pockets=[N,N] encoding=ssss[,sss] num_sense=N[,N] dir=N[,N]?
I have a 6 position turret with 3 position input pins and it's bidirectional. I'm guessing the command line would be:
loadrt toolchange pockets=6 encoding=binary num_sense=3 dir=bidirectional
You are right, there is an error.
Looking at the code the parameter is "dir" and it expects an integer
github.com/LinuxCNC/linuxcnc/blob/master...ts/carousel.comp#L95
So you want
loadrt toolchange pockets=6 encoding=binary num_sense=3 dir=2
How do I use it with a stepper motor driving the tool changer? I've calculated the steps required between tool positions to be 400 full steps.
The simplest way would be a velocity-mode stepgen configured to simply move the motor one way or the other at fixed speed.
Then possibly use a mux4 HAL component to pass 0, +10, -10 or 0 to the stepgen depending on the state of the motor-fwd and motor-rev pins. (if 10 units per sec is the desired stepper speed)
ie
Also, if I assign each of the 3 position switches to carousel.0.sense, carousel.1.sense, & carousel.2.sense, which is the high bit?
The pins will be carousel.0.sense-0, sense-1 etc. sense-0 is the low-order bit.
Please Log in to join the conversation.
Thanks for explaining to me. I'll give it a try this weekend and report back.
Jim
Please Log in to join the conversation.
