Can I change X,Y,Z zero mid program?


Page 1 of 2 12 LastLast
Results 1 to 12 of 20

Thread: Can I change X,Y,Z zero mid program?

  1. #1
    Member luremaker's Avatar
    Join Date
    Dec 2018
    Location
    UK
    Posts
    8
    Downloads
    0
    Uploads
    0

    Default Can I change X,Y,Z zero mid program?

    Hi,
    I often machine identical parts and would like to machine several of them at the same time. I could secure them to the table then probe the datums and copt/translate my toolpaths in the CAM package, post process and run but this is rather time consuming (500K lines of code). What I would like to do is probe the datums of each work piece and enter them into a script that will change the X,Y,X zero values after cutting the first part then run the program again etc. Even adding gcode at the end of the program then pasting a copy of the program below would do.

    Any ideas anyone?

    Thanks

    Similar Threads:


  2. #2
    Community Moderator ger21's Avatar
    Join Date
    Mar 2003
    Location
    Shelby Township
    Posts
    34526
    Downloads
    0
    Uploads
    0

    Default Re: Can I change X,Y,Z zero mid program?

    G54, G55, G56, ...

    Gerry

    UCCNC 2017 Screenset
    http://www.thecncwoodworker.com/2017.html

    Mach3 2010 Screenset
    http://www.thecncwoodworker.com/2010.html

    JointCAM - CNC Dovetails & Box Joints
    http://www.g-forcecnc.com/jointcam.html

    (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)


  3. #3
    Member luremaker's Avatar
    Join Date
    Dec 2018
    Location
    UK
    Posts
    8
    Downloads
    0
    Uploads
    0

    Default Re: Can I change X,Y,Z zero mid program?

    Quote Originally Posted by ger21 View Post
    G54, G55, G56, ...
    Thanks, obviously I am quite new to this but did manage to find the G54,G55 etc

    So if I set XYZ to zero at fixture datum #1
    G54 0 0 0
    G55 at distance from datum #1 to datum #2

    will this code work?
    G21
    G90
    G91 G28 X0 Y0 Z0 M05
    (T1 End Mill D8 )
    G90 M6 T0101
    (----------------------------------------------------------------- )
    M03 S2400
    G00 X-4.1200 Y89.0000 F1000
    G00 Z1.0000 F400
    G01 Z-1.5000
    G01 Y0.0000
    G01 X-4.0000
    etc
    G01 Y0.0000
    G01 X-4.0000
    G01 Y89.0000
    G00 Z-5.2500
    G00 X-4.1200
    G01 Z10.0000 F1000


    G55

    repeat G code


    G91 G28 X0 Y0 Z0 M05
    G90
    M30



  4. #4
    Member
    Join Date
    Jun 2010
    Location
    Australia
    Posts
    3879
    Downloads
    4
    Uploads
    0

    Default Re: Can I change X,Y,Z zero mid program?

    You do not mention what size CNC you have, nor what controller you have (eg Mach3). This info is usually needed.

    I have machined up to 20 units at a time, in a 3x6 or 2x10 grid, using the G54/etc codes.
    Can I change X,Y,Z zero mid program?-5406-jpg

    Or you can simply do the maths yourself in your code. Um - if you are using a dum CAM package, that might be more difficult. I write my own programs by hand.

    Cheers
    Roger



  5. #5
    Member luremaker's Avatar
    Join Date
    Dec 2018
    Location
    UK
    Posts
    8
    Downloads
    0
    Uploads
    0

    Default Re: Can I change X,Y,Z zero mid program?

    Quote Originally Posted by RCaffin View Post
    You do not mention what size CNC you have, nor what controller you have (eg Mach3). This info is usually needed.

    I have machined up to 20 units at a time, in a 3x6 or 2x10 grid, using the G54/etc codes.
    Can I change X,Y,Z zero mid program?-5406-jpg

    Or you can simply do the maths yourself in your code. Um - if you are using a dum CAM package, that might be more difficult. I write my own programs by hand.

    Cheers
    Roger
    Sorry. I am using Mach 3. The machine is an old Denford which has been modified by a previous owner.



  6. #6
    Member
    Join Date
    Jan 2005
    Location
    USA
    Posts
    10291
    Downloads
    0
    Uploads
    0

    Default Re: Can I change X,Y,Z zero mid program?

    Quote Originally Posted by luremaker View Post
    Thanks, obviously I am quite new to this but did manage to find the G54,G55 etc

    So if I set XYZ to zero at fixture datum #1
    G54 0 0 0
    G55 at distance from datum #1 to datum #2

    will this code work?
    G21
    G90
    G91 G28 X0 Y0 Z0 M05
    (T1 End Mill D8 )
    G90 M6 T0101
    (----------------------------------------------------------------- )
    M03 S2400
    G00 X-4.1200 Y89.0000 F1000
    G00 Z1.0000 F400
    G01 Z-1.5000
    G01 Y0.0000
    G01 X-4.0000
    etc
    G01 Y0.0000
    G01 X-4.0000
    G01 Y89.0000
    G00 Z-5.2500
    G00 X-4.1200
    G01 Z10.0000 F1000


    G55

    repeat G code


    G91 G28 X0 Y0 Z0 M05
    G90
    M30
    Yes that can work but a simple X---- Y------ move to the next position is all that is needed will work also

    Mactec54


  7. #7
    Member luremaker's Avatar
    Join Date
    Dec 2018
    Location
    UK
    Posts
    8
    Downloads
    0
    Uploads
    0

    Default Re: Can I change X,Y,Z zero mid program?

    Quote Originally Posted by mactec54 View Post
    Yes that can work but a simple X---- Y------ move to the next position is all that is needed will work also
    So I could just replace the G55 with a G00 x,y,z?

    I am assuming that Mach 3 uses the G55 XYZ set in Mach3 when add a line ust saying M55?

    Either way I think I would prefer too use the G55 as that makes it easier to write a basic program for multiple part machining.



  8. #8
    Member
    Join Date
    Jan 2005
    Location
    USA
    Posts
    10291
    Downloads
    0
    Uploads
    0

    Default Re: Can I change X,Y,Z zero mid program?

    Quote Originally Posted by luremaker View Post
    So I could just replace the G55 with a G00 x,y,z?

    I am assuming that Mach 3 uses the G55 XYZ set in Mach3 when add a line ust saying M55?

    Either way I think I would prefer too use the G55 as that makes it easier to write a basic program for multiple part machining.
    Yes correct except you never use a Z axes move when Doing a X Y move, a Z move should always be on a line before a X Y Axes move for obvious reasons

    No it can't be a M55 the control would not know what to do with that

    Mactec54


  9. #9
    Member luremaker's Avatar
    Join Date
    Dec 2018
    Location
    UK
    Posts
    8
    Downloads
    0
    Uploads
    0

    Default Re: Can I change X,Y,Z zero mid program?

    Whoops - I did mean G55 not M55.

    I will have a play tomorrow with G55 as if I get it eorking it will be a great help as I will be able to machine 4 parts overnight.

    Last edited by luremaker; 08-19-2019 at 06:28 PM.


  10. #10
    Member
    Join Date
    Jun 2010
    Location
    Australia
    Posts
    3879
    Downloads
    4
    Uploads
    0

    Default Re: Can I change X,Y,Z zero mid program?

    Be warned: there is a slight problem in Mach3 with G54.
    When you load a program which is written using several instances of G54, the on-screen display of the cutter path at Load Time is correct, but the Run-Time display is not. The run-time display SW forgets all about the offsets. This is clearly a display bug in Mach3 as a) the load-time display is correct and b) the actual path machined is correct. One gets used to this ... (I think it was an error by the original author: Art Fenerty.)

    So why didn't Artsoft fix this? Two reasons: not enough loud complaints about it, and then they decided to go for Mach4 instead. One day, someone is going to get hold of the source code for Mach3, strip the LPT driver stuff right out (ie rely on the ESS), and fix the bugs. That may take some doing ...

    Cheers
    Roger



  11. #11
    Member luremaker's Avatar
    Join Date
    Dec 2018
    Location
    UK
    Posts
    8
    Downloads
    0
    Uploads
    0

    Default Re: Can I change X,Y,Z zero mid program?

    Well had a go today with a small program.

    Set G54 to datum of first part and G55 to datum of the second and it ran OK.

    BUT I then set G54 and G55 to 0,0,0 loaded a workpiece and set the datum and ran my program and at about line 19,000 the machine decides to go to machine 0,0,0 then back to the workpiece and carried on cutting. There were no lines in the gcode calling for this move so it beats me.



  12. #12
    Community Moderator ger21's Avatar
    Join Date
    Mar 2003
    Location
    Shelby Township
    Posts
    34526
    Downloads
    0
    Uploads
    0

    Default Re: Can I change X,Y,Z zero mid program?

    Mach3 has lots of little bugs that only show up on occasion. And different versions may have different bugs.

    Gerry

    UCCNC 2017 Screenset
    http://www.thecncwoodworker.com/2017.html

    Mach3 2010 Screenset
    http://www.thecncwoodworker.com/2010.html

    JointCAM - CNC Dovetails & Box Joints
    http://www.g-forcecnc.com/jointcam.html

    (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)


Page 1 of 2 12 LastLast

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


About CNCzone.com

    We are the largest and most active discussion forum for manufacturing industry. The site is 100% free to join and use, so join today!

Follow us on


Our Brands

Can I change X,Y,Z zero mid program?

Can I change X,Y,Z zero mid program?

Can I change X,Y,Z zero mid program?