Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: alainc on October 31, 2012, 01:41:59 PM

Title: gcode changing tools lathe
Post by: alainc on October 31, 2012, 01:41:59 PM
Hi
I'm new in cnc.
I made ​​a drawing with Bobcad I converted to gcode. i put code on Mach3 for lathe.
My problem is when I call t0101 in my code the  tools go to 0 and after my code executes , the tools hit my live center !
do you have idee what i'm doing wrong.
thank you
Alain
Title: Re: gcode changing tools lathe
Post by: Hood on October 31, 2012, 02:32:57 PM
What do you mean by "the tools go to zero"? Are you meaning the axis moves or something else?
Hood
Title: Re: gcode changing tools lathe
Post by: alainc on October 31, 2012, 02:39:42 PM
yes the axis move.
when i insert t0101 the axis move to 0 on DRO and hit live center.
thank you
Title: Re: gcode changing tools lathe
Post by: Hood on October 31, 2012, 02:46:04 PM
The axis should not move unless you have something in your M6Start.m1s macro to make it do so or your code is telling it to move..
When you call a tool all that should happen is the DROs change to reflect any offsets for that tool that you have set up in the tool table.
If you call a tool from MDI line does the axis move?
Hood
Title: Re: gcode changing tools lathe
Post by: alainc on October 31, 2012, 02:54:08 PM
i restart pc and i put t0101 in mdi and click cycle start and axis move
sorry for my englsh
alain
Title: Re: gcode changing tools lathe
Post by: Hood on October 31, 2012, 02:59:36 PM
Ok if you are meaning the axis physically moves then your m6start macro must have something in it to tell it to do so. Go to the Operator menu then Edit VB Script. A window will pop up and if you choose open you can browse to your lathes macro folder and you will see m6start.m1s, open it and see whats in there and copy and paste it here.
Hood
Title: Re: gcode changing tools lathe
Post by: alainc on October 31, 2012, 03:13:24 PM

script
tool = GetSelectedTool()
  SetCurrentTool( tool )



alain
Title: Re: gcode changing tools lathe
Post by: Hood on October 31, 2012, 03:17:38 PM
Ok thats fine, is there anything ing the m6end.m1s?
Hood
Title: Re: gcode changing tools lathe
Post by: alainc on October 31, 2012, 03:20:10 PM
scripts
m6end.m1s
rem nothing here in lathe
Title: Re: gcode changing tools lathe
Post by: Hood on October 31, 2012, 03:21:48 PM
Ok something strange is going on, can you attach your xml and I will have a look.
Hood
Title: Re: gcode changing tools lathe
Post by: alainc on October 31, 2012, 03:27:10 PM
Et voila
thank you
alain
Title: Re: gcode changing tools lathe
Post by: alainc on October 31, 2012, 03:54:59 PM
hi
i have a question what is the step to start ? (lathe)
ref z
ref x
and after
thanks
alain
Title: Re: gcode changing tools lathe
Post by: Hood on October 31, 2012, 03:57:43 PM
Cant see anything that would cause the axis to physically move in your xml.
When I MDI a tool change the DROs change to reflect the tool table I have loaded but the axis do not physically move.
I did notice you had the A channel of the MPG set up to the same pin as you have for X Home switch, that doesnt seem right but would not cause the problem you are seeing.
If you change the tool change option on General Config to Auto then MDI a tool change does it still move the axis?
Hood
Title: Re: gcode changing tools lathe
Post by: Hood on October 31, 2012, 03:58:35 PM
That is basically it, I prefer to reference the X first as it will be less likely to collide with the tailstock or anything else.
Hood
Title: Re: gcode changing tools lathe
Post by: alainc on October 31, 2012, 04:05:52 PM
your the best men.
it's ok now
after ref what is next step
thank you very much
alain
Title: Re: gcode changing tools lathe
Post by: Hood on October 31, 2012, 05:03:30 PM
Usally you set up your tools in the tool table with respect to your X reference switch so that when you call a tool it will go to the correct diameter.
So when first starting Mach you would reference then call a tool then move the tool to the end of the stock in the chuck and set the Z to zero and thats you ready.
Hood
Title: Re: gcode changing tools lathe
Post by: alainc on October 31, 2012, 05:05:34 PM
thank you ,
for your time very apreciate,
alain
Title: Re: gcode changing tools lathe
Post by: Hood on October 31, 2012, 05:10:46 PM
No problem :)
Hood