Hello Guest it is April 18, 2024, 09:37:24 PM

Author Topic: G49 and Mach3 Turn ---- how does it work?????  (Read 6825 times)

0 Members and 1 Guest are viewing this topic.

G49 and Mach3 Turn ---- how does it work?????
« on: March 23, 2016, 12:58:09 PM »
Hi,

 so I am newbie with Gcode. Was playing with post processor for Partmaster Lathe V13 and got advise from friend to try to use G49 and G43 to control my tool changer as I want.

So today I went to do some testing how G49 work, before that I surfed on net to see how it is used and what it does, it say:

To use no tool length offset, program: G49 , also found term to cancel tool offset.

So will try to explain what I did, I have tool changer with 8 tools, DIY ATC , it only rotates turret on commands T0x0x (x can be number from 1 to eight), I measured tool offsets according to my master tool and entered them in my Tool table in Mach3 , everything works correct.

Next what I did I choose tool number 1 (my master tool, and set it to show coordinates x=0, Z=0 in DRO), now I wanted to see what will happen when I enter G49 in MDI )manual data input), so I entered G49 and after that T0808, turret rotated to tool number 8 and I expected that when I read data for coordinates on DRO it will say x=0, z=0, but it was for example X=10, Z=20. Tried same experiment with G43 but nothing changed.

In general configuration I checked under Tool Change options, Auto tool changer, I also tried with Ignore tool chane but even with that option I could change tools, I enter T0101 , I get tool number 1 in its coordinate system, enter tool T0808 again I get tool 8 in offset ed coordinate system according to tool 1 (master tool).

So, what I am doing wrong if I am doing wrong and how should look G49 (what I can see on screen so I now it works good) when it is used good. I tried to search  net but I mange to find threads where they use that only for cnc mills so I am not sure why I can not find some example with use for cnc lathe and Mach3 Turn.

Any help will be appreciated,
thx :)

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: G49 and Mach3 Turn ---- how does it work?????
« Reply #1 on: March 23, 2016, 05:55:17 PM »
I have never used G43 and G49 in Turn as you do not really require it and it likely doesnt work anyway. The tool table holds the X and Z offsets for the tools so when you call a tool you will also call an offset.
Normally you would have the same offset number as the tool number but depending on how your M6Start macro is written you may have to use different ones.
For example if you had an 8 position turret and your tools could be removed and replaced easily and repeatable, then you may have several different tools that fit in the same slot so you would call different offsets for the same tool slot depending on which tool was currently in that slot.
 You can also write the M6 macro so that you can call tools greater than the slot number of your turret and still have it go to the correct slot, for example if you had 4 tools set for Slot 1 in an 8 position turret you could call T0101, T0909, T1717, T2525 and they would all seek position 1 on the turret but apply the offsets from the tool table corresponding to the number just called.

This is also handy for using inserts with different nose rads, you can pre-set these in the tool table and depending on the offset you call it will adjust for the nose rad you have in.
 As an example I have a tool in my turret and I have 3 different offsets set up for it, it is Tool 1 with 0.2mm, 0.4mm and 0.8mm nose rads on the Insert, so I can call T0101 for the 0.2 rad, t0909 for the 0.4 rad and t1717 for the 0.8 rad.

 If you  did wish to call a tool and have no X and Z offsets applied, not sure why you would but there may be a reason,  you would simply call T0100 or T0200 ....... T0800 etc. ie the 00 of the tool call will not look in the tool table for the offset, no need for G49 as far as I can see.

Hood
Re: G49 and Mach3 Turn ---- how does it work?????
« Reply #2 on: March 24, 2016, 05:13:19 AM »
I have never used G43 and G49 in Turn as you do not really require it and it likely doesnt work anyway. The tool table holds the X and Z offsets for the tools so when you call a tool you will also call an offset.
Normally you would have the same offset number as the tool number but depending on how your M6Start macro is written you may have to use different ones.
For example if you had an 8 position turret and your tools could be removed and replaced easily and repeatable, then you may have several different tools that fit in the same slot so you would call different offsets for the same tool slot depending on which tool was currently in that slot.
 You can also write the M6 macro so that you can call tools greater than the slot number of your turret and still have it go to the correct slot, for example if you had 4 tools set for Slot 1 in an 8 position turret you could call T0101, T0909, T1717, T2525 and they would all seek position 1 on the turret but apply the offsets from the tool table corresponding to the number just called.

This is also handy for using inserts with different nose rads, you can pre-set these in the tool table and depending on the offset you call it will adjust for the nose rad you have in.
 As an example I have a tool in my turret and I have 3 different offsets set up for it, it is Tool 1 with 0.2mm, 0.4mm and 0.8mm nose rads on the Insert, so I can call T0101 for the 0.2 rad, t0909 for the 0.4 rad and t1717 for the 0.8 rad.

 If you  did wish to call a tool and have no X and Z offsets applied, not sure why you would but there may be a reason,  you would simply call T0100 or T0200 ....... T0800 etc. ie the 00 of the tool call will not look in the tool table for the offset, no need for G49 as far as I can see.

Hood

Hi, thx for replay, will try to explain why I would need G49. So I have tool changer with turret that can accept 8 tools and on given command like T0101 I got rotation of turret and chosen tool in its coordinate system, and I want turret to work like that, I could use G53 inside macro for controlling tool changer to position it self in safe place before rotation but in that way I would need to update that position every time when I make different part in case I do not want tool changer travel back and forth unnecessary.

So my idea was to make adjustments in post processor so that according to data how my longest tool is , how much stick part out of chuck to define safe home tool change point, (this is how it is called in CAM) but in reality it represents point from which tip of every used tool starts before machining process. So if I want that every tool look same as in CAM graphic representation/2D view it means that before rotation to get choosen tool, complete tool changer needs to move right and up for upcoming tool offset. And by analyzing how post processor work I concluded that before rotation is executed (of turret) in current coordinate system is being calculated where tool changer need to be moved, and I used that fact to calculate position where toolchanger needs to move in order that selected tool is active (tool that just need to be active) will have its tool tip very near safe tool change point, next step was to position it exactly in its activate coordinate system ,to its tip is positioned in safe (home ) tool change point (and after that point tool proceeds to machine chosen task that I chose in CAM).

So thing is with that how I made it , it would work perfectly fine (100%) if my machine would have double sized working space  (theoretically unlimited) but as it does not, what happens , if I have for example active drill as tool in tool changer and I want to chose some other drill as both of this tools have offset ed coordinate systems to my master toll (their space is much smaller then space in which can move master tooll, in right side, so if I apply logic for calculating in coordinate system of tool that already have small space compare to master toll (master tool is profiling tool) when I add value (that is offset to according to master tool) to current x  and z value that is active in coordinate system, post processor will calculate point in which is necessary to move tool changer before rotation of turret to have my another drill and when I run my gcode , it will hapen that soft limits will engage (nothing dangerous).

Other situation is that I use machining operations like this , I start with master tool (it have big coordinate space) then I want to use drill, I can make good calculation to back off drill in coordinate system of master tool, then after drill I should chose some tool that sticks out little out of turret like (parting tool or some other turning tool), next I should choose again some tool that sticks out like drill , for example boring bar (this is just example to show in which case it works with no necessary intervention for editing too change coordinates).

Anyway, this is strategy short tool, long tool, short tool.. it works good, but I could make it work 100% good if G49 would work, will try to experiment with T0100 and T0200... stuff

Probably it sounds that I am complicating but it is really simple and should be very easy to use, I do not need to mess with macros in Mach3 , once I made it it stays for ever like it is , and I only define safe tool change (home) position in CAM and post processor takes care about everything from there.

This on video is how I adjusted post processor to work as I described before , version, short tool, long tool, short tool , with fact that I manually edited 3 potions (or 2 not sure any more) where tool changer need to go (until I realized how it actually works, got opportunity only when I mounted in turret long tools like on video).

https://www.youtube.com/watch?v=FhQPxXn28vc

So why I was asking for G49, I wanted to cancel current offset ed coordinate system (which are all rest of 7 tools in turret) and I wanted to make calculations in coordinate system of master tool where to retract tool changer before rotation of turret, in that way I would not get as result coordinates that are out of limit my working area.

Also I saw that post processors as it was made  originally from Dolphin support outputted command G49 after G00 Xx Zx command, and when I asked support why my tool changer works only good for master tool, it happens that all other tools until their tip comes to safe tool change (home) point can pass through part or spindle on their way to that point, so I got answer it is Mach3 issue, and by the time I did not know on what they mean, now I suspect that maybe they meant on G49, it is Mach3 issue, maybe it would work all fine if G49 works, I do not know...
 So it is possible that they had good idea how should tool changer be positioned but it seams that G49 have no effect in Mach3 as it have in other controllers.
« Last Edit: March 24, 2016, 05:28:58 AM by zmajmr »

Offline RICH

*
  • *
  •  7,427 7,427
    • View Profile
Re: G49 and Mach3 Turn ---- how does it work?????
« Reply #3 on: March 24, 2016, 07:01:13 AM »
Seems you are making things complex.

I also never use G49 and G43 for the lathe. My home is also the tool change position ( quick change and not turret) which is set based on max tool offset values for tools to be used. Touch off with longest tool to set Z reference and use G28 for an intermediate move to clear stock before going home or pick move location via CAM. I let Mach do it's job of taking care of tool offsets. There are other variations on the theme depending on how you want to work. Don't do mass parts on the lathe and if in an industrial setting would probably allow for tool offset check and wear, etc.

RICH

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: G49 and Mach3 Turn ---- how does it work?????
« Reply #4 on: March 24, 2016, 07:09:04 AM »
Bit rushed to read all you have written but if I recall Dolphin just lets you set a tool change position for ALL TOOLS rather than one for individual.
You could do a few things if you want to clear the offsets,
1. Is like I mentioned above, call the slot number but with 00 for the offset part of it.
2.You could call T0000 and depending on your Macro it would probably just do the same as above.
3.Use the additional Command option in Dolphin to insert a G53G0X*Z* (ie a machine coords move) so that the machine goes to the desired position depending on the tool you are currently at and the one you want.

For the last one you could probably  even write in the PP to automatically enter a G53 move and have it look at current and next tool and decide the position required, I did something similar when I had both front and rear toolposts and was using Dolphin.

Hood
« Last Edit: March 24, 2016, 07:11:20 AM by Hood »
Re: G49 and Mach3 Turn ---- how does it work?????
« Reply #5 on: March 25, 2016, 07:38:11 AM »
Seems you are making things complex.

I also never use G49 and G43 for the lathe. My home is also the tool change position ( quick change and not turret) which is set based on max tool offset values for tools to be used. Touch off with longest tool to set Z reference and use G28 for an intermediate move to clear stock before going home or pick move location via CAM. I let Mach do it's job of taking care of tool offsets. There are other variations on the theme depending on how you want to work. Don't do mass parts on the lathe and if in an industrial setting would probably allow for tool offset check and wear, etc.

RICH



Hi
Thx for replay, I never tried to use G28, I tried G53 , thing is that with G53 I can not make some relationship that will automatically calculated where to move toolcahnger before rotation of turret (because of part that is variable length in chuck so zero from part can be on diffrent location on Z axis), I know how to adjust post processor that inside of it is calculated for how much tool changer needs to be moved right and up, for every tool it is usually different set of values for (x and Z), maybe it sounds complicated to do that but it is not. So for that what I what to make I need G49 or T0000 as Hood said.

And Mach3 cares about tool offests, I just entere same values in CAM as in Mach3 Tool table and as post processor does not use values for oofest from CAM because how it is written , I use them to calculate moves of tool changer, like I described above.

Re: G49 and Mach3 Turn ---- how does it work?????
« Reply #6 on: March 25, 2016, 07:58:22 AM »
I made wrong quotation  :)
« Last Edit: March 25, 2016, 08:01:44 AM by zmajmr »
Re: G49 and Mach3 Turn ---- how does it work?????
« Reply #7 on: March 25, 2016, 08:00:16 AM »
Bit rushed to read all you have written but if I recall Dolphin just lets you set a tool change position for ALL TOOLS rather than one for individual.
You could do a few things if you want to clear the offsets,
1. Is like I mentioned above, call the slot number but with 00 for the offset part of it.
2.You could call T0000 and depending on your Macro it would probably just do the same as above.
3.Use the additional Command option in Dolphin to insert a G53G0X*Z* (ie a machine coords move) so that the machine goes to the desired position depending on the tool you are currently at and the one you want.

For the last one you could probably  even write in the PP to automatically enter a G53 move and have it look at current and next tool and decide the position required, I did something similar when I had both front and rear toolposts and was using Dolphin.

Hood

Hi and thx for help, that was good idea, I tried that , T0000 and it is same effect as G49 that does not work in Mach3 apperently.

I have Partmaster Lathe V13, and I opend all tabs and I did mange to find only where to define safe tool change (home position) for front and rear turret, I have only rear turret, so maybe it was possible in older version or I just do not know where should I enter those data , even I saw in manual from post processor commands that serves for taking coordiantes of tool change positions, so this is why I am not sure did I can not find where to enter those data (that would be totaly crazy) or that just does not exist for lathe, maybe it is for mill, I do not know.

So have idea what to make with T0000 when G49 does not work and now I came to problem that is connected with how is my tool changer designed, it can only rotate in one direction and then it locks in opposite side, and everything worked perfectly until I stated to experiment with entering T0000, it does not rotates turret but inside of macro are two functions, one gives information about previous tool and other about tool that I want to choose, so according to difference between those 2 information I made checks how to determine for how much I need to actually to rotate turret that will give me in reality tool same as in mach3.

Other thing when I enter in mach3 I need to reference turret first ( I have one optical sensor in turret) and after turret is referenced (rotation of magazine is stopped on place after I press command T0101 I will get in reality tool 1).

So problem is I do not know how to adjust function that it only once rotate turret so I have synchronization between mach3 tool number 1 and really tool 1 in turret, I tried to use ( I had idea to use variable that could be flag, so if I once initialize turret I can remove value of flag from 1 to zero in order not to enter in that part of    if     then  check, so I think that I conclude every time I enter in macro for controlling tool changer flag loses its value, so how to make that variable save/ memorize value.

I will post code of m6start , it works fine until I choose T000 and after that T0101, it should not move turret but it does, because I do not know how to write conditions that if OldTool is =0 and NewTool =1 that that part should only be entered once , I know it is possible how it is written to find combination that I enter multiple time but I really can not think of some solution without variable that can save data (marker, flag, I hope you get idea).

So here is code, if somebody have idea how to make that (will help me a lot), I was trying to think out solution yesterday till 2 in the morning and I thought that I save macro and today when I start all over again , I opened macro and it was empty, I could not believed LOL, luckily I manage to remember logic (If then parts), rest of it I had saved under another name in case that this happens.

  Sub main ()
Dim OldTool, NewTool , a As Integer


CurrentFeedrate = GetOemDRO(818)
Code"G90 G94"

Message "Old tool New Tool      " &GetCurrentTool () &GetSelectedTool ()

OldTool= GetCurrentTool ()
NewTool = GetSelectedTool ()
SetCurrentTool (NewTool)

If NewTool=1  And  OldTool=0 Then
a=1
GoTo label1
End If

If NewTool=0  And  OldTool=0Then
a=0
GoTo label1
End If


If NewTool=0 Then
a=0
End If

If NewTool > 0 And  OldTool>0 Then
a=NewTool - OldTool
End If

If NewTool > 1 And  OldTool=0 Then
a=NewTool-OldTool-1
End If


label1:

If (a = 1) Or (a = -7) Then
Code "G91G01 Y1.251 F200"
While IsMoving()
sleep(50)
Wend
Code "G91G01 Y-0.201 F20"
While IsMoving()
sleep(50)
Wend
End If

If (a = 2)  Or (a = -6) Then
Code "G91G01 Y2.301 F200"
While IsMoving()
sleep(50)
Wend
Code "G91G01 Y -0.201 F20"
While IsMoving()
sleep(50)
Wend
End If

If (a =3)  Or (a = -5) Then
Code "G91G01 Y3.351 F200"
While IsMoving()
sleep(50)
Wend
Code "G91G01 Y -0.201 F20"
While IsMoving()
sleep(50)
Wend
End If

If (a =4) Or (a = -4) Then
Code "G91G01 Y4.401 F200"
While IsMoving()
sleep(50)
Wend
Code "G91G01 Y -0.201 F20"
While IsMoving()
sleep(50)
Wend
End If

If (a =5)  Or (a = -3) Then
Code "G91G01 Y5.451 F200"
While IsMoving()
sleep(50)
Wend
Code "G91G01 Y -0.201 F20"
While IsMoving()
sleep(50)
Wend
End If

If (a =6)   Or (a = -2) Then
Code "G91G01 Y6.501 F200"
While IsMoving()
sleep(50)
Wend
Code "G91G01 Y -0.201 F20"
While IsMoving()
sleep(50)
Wend
End If

If (a =7) Or (a = -1) Then
Code "G91G01 Y7.551 F200"
While IsMoving()
sleep(50)
Wend
Code "G91G01 Y -0.201 F20"
While IsMoving()
sleep(50)
Wend
End If

Code " G90 "
Code "F" & CurrentFeedrate
End Sub
« Last Edit: March 25, 2016, 08:08:46 AM by zmajmr »

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: G49 and Mach3 Turn ---- how does it work?????
« Reply #8 on: March 25, 2016, 08:46:16 AM »
I meant that if I remembered Dolphin only had the possibility of one tool change position and from what you said that was correct, the CAM I use now can have a different change position for each tool.

Anyway did you try the additional command  I mentioned? See attached pic..

It has been a long time since I have looked at Dolphin so I can't recall if you can tell it not to use the tool change position, if that is the case then you could use the command mentioned above instead and enter values to suit each tool.
Hood

Re: G49 and Mach3 Turn ---- how does it work?????
« Reply #9 on: March 25, 2016, 10:08:40 AM »
I meant that if I remembered Dolphin only had the possibility of one tool change position and from what you said that was correct, the CAM I use now can have a different change position for each tool.

Anyway did you try the additional command  I mentioned? See attached pic..

It has been a long time since I have looked at Dolphin so I can't recall if you can tell it not to use the tool change position, if that is the case then you could use the command mentioned above instead and enter values to suit each tool.
Hood



Hi

Yes, I have Goto but it does not work for me or I do not know how to use it, I recorded video about that

https://www.youtube.com/watch?v=K1ttceK0PtM