Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: truckwiz on January 20, 2009, 04:10:23 PM

Title: Mach turn & tool change
Post by: truckwiz on January 20, 2009, 04:10:23 PM
Hi,
 I think I started on this before but can not find my old post . I have a lathe running Mach turn with a turret tool changer ,I know that I have to write a macro to get the turret to work. I'll list some specs and see if anyone can help me get this to work right.

Here are the turret specs.

*It is driven by a gecko powered stepper, its has to turn the same way all the time to make the tool change.
* the turret has 6 positions and has 3 encoders that can be wired to into 3 inputs for mach3 to read. mach3 has to drive the stepper one direction untill it see's the right encoder code for the tool it's calling for and then stop and back up a "hair" to lock the tool.

 The biggest proplem I'm having with this is how to make mach3  turn a axis that it has no DRO for.Any help would be greatly appreciated.

Thanks' Brian



  
Title: Re: Mach turn & tool change
Post by: Hood on January 20, 2009, 04:24:15 PM
You would probably be best to set the turret up as an axis then do a home move. From that home move you would then be able to call a set distance for each tool in your macro.
Hood
Title: Re: Mach turn & tool change
Post by: truckwiz on January 20, 2009, 04:44:09 PM
hood,
 I had it hooked up to the "A" axis and had it moving , the problem is that it will only turn one way free and locks if it turns the other way. I have played around with using a micro controller to turn it ,but have had a hard time getting mach3 to tell the micro what tool to go tool and confirming the tool change without burning up a bunch of input and output pins.


Brian
Title: Re: Mach turn & tool change
Post by: Hood on January 20, 2009, 05:07:39 PM
I think the A axis should do what you want if you enable the rotational rollover. Then what you would need  to do is write into your macro that if new tool  was less than current tool   it would do a G0A360 move first. That should then rezero the A Axis and you can then tell it to move to the tool you want.
Hood
Title: Re: Mach turn & tool change
Post by: truckwiz on January 20, 2009, 06:57:15 PM
Ok,
 Let me make sure I have this right.

1. hook up a plc to the 3 encoders , when the plc see's all 3 encoders at 111 (tool 1 and home) it will send a "1" to mach3 to say it's home.
2.If mach3 calls for tool number "3" , it will go home first and then advance  90 degrees and back 1 degree to lock tool number "3" in.

 I can call out a G0A90 and a G0a-01 in the macro ,right ?

Brian
 
Title: Re: Mach turn & tool change
Post by: Hood on January 20, 2009, 07:26:10 PM
What are you meaning by encoders?
If you have a PLC is it ModBUS capable?
Hood
Title: Re: Mach turn & tool change
Post by: truckwiz on January 20, 2009, 08:05:31 PM
Hood,
 Let me rephrase that ,on my tool changer there are 3 optical  switches. When the 3 slots line up you are at tool "1". I will be using a idec micro smart for the PLC ( should be modBus capable,but I  was not thinking that way). I thought I would take the the optical switches and turn them into just one output and use as a input on the parallel port.

Brian
Title: Re: Mach turn & tool change
Post by: Hood on January 20, 2009, 08:30:37 PM
OK for setting as an axis you would just do a RefAll like normal when you start Mach and all your axis would be homed (turret included)
 So say you have the home as tool 1 position then  if you call tool 3 you know you have to rotate the axis  by so many steps to get there, if its set in degrees then its really easy. You would just command a move in your macro similar to
If GetSelectedTool=3 Then
Code(" G0A120")
While Ismoving
Sleep(10)
Wend
Code ("G0A119)
End If


You would also need code to make sure it only rotates one way for positioning, something like
 If GetSelectedTool<GetCurrentTool Then
Code("G0A360")........... etc


Hood

Edit
Just tested it here and seems rotational axis is only moving one direction, will have to look further to see if there is a setting for that but its nearly 2am now so I need sleep.
Edit again  ;)
If your want to move back one degree from for example A220 you would do a G0A-119 :)
Hood
Title: Re: Mach turn & tool change
Post by: Hood on January 20, 2009, 08:38:21 PM
And another Edit, that seems to make life really simple, means it will always rotate one way if your degrees are positive and the other if its negative so no need for the G0A360 move if  the tool number is less than the one set :) now i need sleep :)
Hood
Title: Re: Mach turn & tool change
Post by: truckwiz on January 20, 2009, 10:00:25 PM
Cool,
 It will take me a little time to wire this up and code it. I'm sure I'll have more questions before I'm done , but Thank You for the help so far!


Brian
Title: Re: Mach turn & tool change
Post by: jimpinder on January 21, 2009, 04:20:07 AM
I am getting into this a bit late on - but there are a few things I am puzzling about.

The first was the comment in the first post - "How to make Mach 3 turn an axis for which there is no DRO"
I cannot see why you do not just put a DRO on the screen for the turret - marked turret. It only needs to be one or at the most two digits long.

As far as turning the toolholder on a stepper, then if you set the steps per unit at the number of steps it needs to turn to from one tool to the next, then the commands are simple G0 A1.*********  -  G0 A1  where ********* in the fraction you need to overun, and A1 is the locked position of Tool1. The machine would then overrun the position and back up to lock the tool.  The DRO would then show the number of the tool in the holder.

I would make the home position the position of locked tool 0, but I cannot see why you need three indicators - one would do if you have the contrallability of steppers.The logic of choosing the tool numbers is fairly straight-forward, if the axis is continuous.

I know Hood has already done a lot on this - but am I anywhere near the right lines on this, I might start on a turret myself, soon.

Jim.


Title: Re: Mach turn & tool change
Post by: Hood on January 21, 2009, 04:48:26 AM
Jim yes thats more or less, as you say only one pulse is needed but seems that three are on this turret so never confused the issue :)
Probably best to set up the steps per unit to match your tools so if you had six tools work it out so T1 is 0, T2 IS 2 etc etc.

Not sure how the rotational axis works , ie whether 1 revolution is 1 unit or more likely 1 degree is 1 unit, so if you had a stepper that was 10 micro stepping that would be 2000 steps to do 360 units so 2000/360=5.5555  would be steps per degree so for 6 tools you need to move 60 degrees each tool  so set it to 5.555 x 60 =333.333steps per unit.

Hood
Title: Re: Mach turn & tool change
Post by: jimpinder on January 22, 2009, 04:49:02 AM
You can make one unit be what you want. I dont know the gearing on this particulary turret, but I would make the steps per unit sufficiently high to move my turret round to the next tool (as you say 60 degrees). Lets call each unit a "toolturn" instead of an inch, or a foot, or a millimeter.

This, I thought, would make the logic side of the job a lot easier. You can still do fractions of a toolturn, in either direction to lock it in place. If you limited the DRO to a single digit readout it would show the tool number only as it passed the mark, and then got locked back into place.
Title: Re: Mach turn & tool change
Post by: truckwiz on January 23, 2009, 12:13:18 AM
Hi,
 I'm just wrapping up the wiring to this mess, as soon as I get to a point where I can start testing I will let everyone know.

 FYI, The 3 optical switches is the way this turret was built .I could tear it apart and make a new encoder wheel that just uses one to show home,but I have enough stuff around to make the 3 work.

 I am a machinist by trade and hoped that by getting this machine up to par that it will help me be more competitive with the bigger shops in my area. I threw in the PLC to help with adding a bar feeder as soon as the turret is working right.

Brian
Title: Re: Mach turn & tool change
Post by: truckwiz on February 01, 2009, 08:38:27 PM
OK,
 Here is what I have going on. I set up the turret for rotational and it re-zero's after 360. I'm having problems controlling the direction of rotation, for instance I can make a G0A+25 and it will go to 25 degree's then if I give it a G0A+360 it wants to take the shortest way to 360 instead of going the right way all the way around

Brian
Title: Re: Mach turn & tool change
Post by: Hood on February 02, 2009, 02:59:00 AM
Config menu the General Config, change the "Angle Short Rot on G0" to unchecked.
Hood
Title: Re: Mach turn & tool change
Post by: truckwiz on February 03, 2009, 08:52:02 AM
Cool,
 Works good now,Thanks'

 The next problem I'm having is in the macro. I would like the turret to do a ref home before it moves to the tool. I've used the G28.1 A0 with mixed results. The turret will turn and then set and error when it see's the home switch (something like home switch is triggered, reset and try again).

Brian


Title: Re: Mach turn & tool change
Post by: Hood on February 03, 2009, 09:07:41 AM
Sounds like your switches are a bit sensitive, you could do a few things,
You could  try increasing the debounce a bit so your switches are not quite so sensitive (probably not the best idea)
You could set a G28 position on Homing and limits page and when you call G28 from the macro it will go there, setting your G28 as just off your limits should avoid this problem.
You could do the move in absolute moves, you would need to probably call a G0 before you did the G53. Doing the G53 just short of machine zero should avoid hitting the limits.
Hood
Title: Re: Mach turn & tool change
Post by: truckwiz on December 18, 2011, 01:32:03 PM
Hi All,
 I'm working on this tool changer again (after 2 1/2 years). I was having lot of trouble with the stepper losing counts after a couple of tool changes ,so I installed a 100w ac servo on the tool changer and that fixed some of the mess.
 I'm now trying to get the micro smart plc to talk with mach3 , I've read allot of the mod bus threads but still really can't tell what the code should be in the plc to allow it to "talk" to mach. any help would be more than appreciated.

Thanks' Brian  
Title: Re: Mach turn & tool change
Post by: Hood on December 20, 2011, 07:29:11 AM
Any links for that PLC?
Hood
Title: Re: Mach turn & tool change
Post by: truckwiz on December 20, 2011, 10:03:41 AM
 I found this info ,but like always it needs more hardware than I have. My mcro smart does not have the port 2 on it & I know port 1 works with modbus because I have had HMI's hooked to them before.

Brian

www.idec.com/language/english/AppNotes/Modbus%20Training.pdf
Title: Re: Mach turn & tool change
Post by: truckwiz on March 15, 2017, 08:34:07 PM
Hi all,
 I'm pulling this back up because I'm still trying to get this turret working.

My turret has 3 opto sensors to tell what position it is in. I've wired the sensors to ACTIVE 1,2 and 3 and was doing some testing reading all 3 inputs when I had a massive computer lockup .This little test code worked before the lockup but now it doesn't ( this code is just looking at one opto).

While   GetOEMLED(821) = 1
       JogOn(3,1)
Wend

      JogOff(3)

 The led lights up in Diagnostics ,but it won't stop the jog. I end up hitting the e-stop and then mach3 starts locking up.

Thanks'
    Brian