Seeking advice on lathe turret set-up

More
15 Apr 2016 21:33 #73368 by jj89074
I'm looking for advice on what is the best way control the 6-position turret on my lathe.

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 or Create an account to join the conversation.

More
15 Apr 2016 23:37 #73380 by BigJohnT
I use Classicladder for my Hardinge CHNC turret.

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 or Create an account to join the conversation.

More
17 Apr 2016 14:30 #73479 by andypugh

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 or Create an account to join the conversation.

More
19 Apr 2016 16:11 #73603 by jj89074
Andy,

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 or Create an account to join the conversation.

More
19 Apr 2016 17:30 - 19 Apr 2016 19:10 #73606 by andypugh

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
loadrt carousel ......
loadrt mux4 
loadrt steppgen mode=v

addf ....

net fwd  carousel.0.motor-fwd mux4.0.sel0
net rev  carousel.0.motor-rev mux4.0.sel1 
net vel-out mux4.0.out stepgen.0.velocity-cmd
setp mux4.0.in0 0
setp mux4.0.in1 10
setp mux4.0.in2 -10
setp mux4.0.in3 0

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.
Last edit: 19 Apr 2016 19:10 by andypugh.

Please Log in or Create an account to join the conversation.

More
19 Apr 2016 19:01 #73611 by jj89074
Andy,

Thanks for explaining to me. I'll give it a try this weekend and report back.

Jim

Please Log in or Create an account to join the conversation.

Time to create page: 0.128 seconds
Powered by Kunena Forum