Hello Guest it is May 14, 2021, 10:36:41 PM

Author Topic: Changing G54 inside script  (Read 990 times)

0 Members and 1 Guest are viewing this topic.

Re: Changing G54 inside script
« Reply #10 on: June 19, 2019, 04:51:28 PM »
Thanks for the help. I think that is indeed the case. The gcode firsts sends the head down after which it tells the machine to use the tool#2 offsets. I think that when I switch those lines that the machine will work correctly. I will try it as soon as possible. Thanks again, will keep you updated.
Re: Changing G54 inside script
« Reply #11 on: June 19, 2019, 06:17:53 PM »
hi jelle ,i did it with G52
ach time i need drill i have the G52 in the script ,but you must not forget reset it when finish the script
good luck

Offline Graham Waterworth

*
  • *
  •  2,322 2,322
  • Yorkshire Dales, England
    • View Profile
Re: Changing G54 inside script
« Reply #12 on: June 19, 2019, 06:21:08 PM »
If I am understanding your problem right you need to offset the x axis depending on which tool you use.

why not set up a sub routines for each tool with a G52 x-50 or what ever you need the offset to be and another sub with G52 x0 in it to call to cancel that offset. You can also set the Y and Z for each tool this way.

All the subs could be coded into your cad system or stored in Machs subs folder.

So your code would look along these lines
%
M98 P251(CALL TOOL 1)
G00 X150 Y20.
G01 ETC.
M98 P250 (CANCEL OFFSET)

M98 P252 (CALL TOOL 2)
ETC.
M98 P250 (CANCEL TOOLS)
ETC.
M30

Subs would be
O250
T0 M6
G52 X0
M99

O251
T1 M6
G52 X-50.
M99

O252
T2 M6
G52 X-100.
M99
%

Without engineers the world stops
Re: Changing G54 inside script
« Reply #13 on: June 20, 2019, 04:39:40 PM »
Hello, I tested the program when I changed the order of the mill going to the pocket location and the tool g43 offest to use. Indeed the machine works great with the x and y offset in the tool table. Like Chaoticone suggested

I tried it with different tools and added the x an y offsets in the tool table. It works great with all the tools. The only problem I have now is that fusion 360 always puts the location of the milling feature before the g43 offset.
I am not very experienced in gcode writing and reading. So does anyone know how to change the order fusion 360 puts out the code? If possible at all?

Otherwise I need to change the order of the code manually for every gcode I make.

Thanks in advance
Re: Changing G54 inside script
« Reply #14 on: June 20, 2019, 07:42:35 PM »
jelle i think you waste time with try use with tool table
dont forget you have many other cycle to run ,not only move axis
run the motor,drill head down,bit drill down(in many case need more then 1 )
if horizontal need also add more
so i think you batter think about M function with G52 inside
similier as Garham suggest
yaakov
Re: Changing G54 inside script
« Reply #15 on: June 20, 2019, 07:43:53 PM »
i forget also you need look for sensors like horizontal driil up,or drill head up

Offline Chaoticone

*
  • *
  •  5,626 5,626
  • Precision Chaos
    • View Profile
Re: Changing G54 inside script
« Reply #16 on: June 20, 2019, 10:40:15 PM »
Hello, I tested the program when I changed the order of the mill going to the pocket location and the tool g43 offest to use. Indeed the machine works great with the x and y offset in the tool table. Like Chaoticone suggested

I tried it with different tools and added the x an y offsets in the tool table. It works great with all the tools. The only problem I have now is that fusion 360 always puts the location of the milling feature before the g43 offset.
I am not very experienced in gcode writing and reading. So does anyone know how to change the order fusion 360 puts out the code? If possible at all?

Otherwise I need to change the order of the code manually for every gcode I make.

Thanks in advance

Sounds like you could tweak your Post processor and get the Gcode output as you want it. Maybe there is a different post processor already that will do what you want? Have you asked Autocad? Fusion support? I would think they have a forum too but I could be wrong. Most post processors are editable but I have never messed with fusion or any CAM used with it much at all.

Code: [Select]
I am not very experienced in gcode writing and reading.
No, I'm not great myself. CAM makes it easy to skip that step but if you are going to run the machine much, do yourself a favor and learn some of it. The best way I can put it is folks using CAM software with no knowledge of Gcode would be the same as someone using a calculator with no knowledge of math. So, learn the basics at least. If you need the equivalent of a scientific calculator in Gcode, you can do that too. Gcode is pretty powerful and the only language your machine understands. If you can't speak some Gcode it would be like going to a foreign land and hiring folks to build you a house that you can't talk to. The machine (if built right) is a very reliable helper that will do exactly what you tell it to every time. Take advantage of that. I keep Peter Smids CNC Programming Handbook at arms reach for reference. I don't try to remember it all. If I can just remember where I put that book I impress myself  :D and in pretty good shape. You might like this link.

http://eng-serve.com/cnc/gcode_comment.html
« Last Edit: June 20, 2019, 10:52:02 PM by Chaoticone »
;D If you could see the things I have in my head, you would be laughing too. ;D

My guard dog is not what you need to worry about!
Re: Changing G54 inside script
« Reply #17 on: June 21, 2019, 03:33:30 AM »
chaoticone
jelle machine is not typical cnc to engraving
its cal PTP and its use in furniture industry
and gcode much more complicate ,also have many I/O need control while run
program mostly come as close file that we have label on part .scan the barcode and run
and second option its by parametric programs that just change parts size and all machining change according
there also issiue there about right side and left side(mirror) so i think your
suggest its just in time
and its will be very hard to write gcode by hand
must have some cad cam
Re: Changing G54 inside script
« Reply #18 on: June 22, 2019, 04:33:14 AM »
Your tool change script could change the trailing number in G54.1 Pxx to match the new tool number and select a different fixture offset for each tool.
Re: Changing G54 inside script
« Reply #19 on: June 23, 2019, 01:32:21 PM »
Hayley664
its not good solution for his specific machine
because he must have at least 2 "homes" right and left(most have 4 ,but 2 its must)
so he cant block his homes acording tool number
i think only solution for him its G52
and create m function ,and inside make the table with offset per drill bit