586,117 active members*
3,357 visitors online*
Register for free
Login
Page 1 of 2 12
Results 1 to 20 of 23
  1. #1
    Join Date
    Jul 2005
    Posts
    969

    little gcode problem i guess

    ok i recently acquired a syil x4+ and am getting back in the whole programming thing, for the last few year i have been operating but not programming and fortunately for us as operator the programmer is really good so we dont have to fiddle much with the code in the machine so now that i have my own cnc i have to figure out a bunch off thing that i forgot how to take care of.

    so here is my problem i am currently trying to do a test part to see if the machine does what its suppose to do and if the tolerance are respected now here is the problem.

    the first operation seem to go fine machine starts from its home position goes to its g54 to do the contour of the part then it does the central pocket all with the same tool ounce this is done it goes back to it home position to call a tool change to do the to little pocket in the central pocket and this is where it bugs

    N5200 G1 Z.1 F6.33
    N5210 G0 Z2.
    N5220 M5
    N5230 G91 G28 Z0. M9
    N5240 G28 X0. Y0. A0.
    N5250 M01
    ( 15/64 LEFT SIDE CENTER POCKET TOOL - 3 DIA. OFF. - 3 LEN. - 3 DIA. - .234375 )
    N5260 T3 M6
    N5270 G0 G90 G54 X1.3271 Y1.3464 A0. S3000 M3
    N5280 G43 H3 Z2. M8
    N5290 Z.1
    N5300 G1 Z-.38 F6.
    N5310 X1.3264 F10.
    N5320 X1.3242 Y1.3522


    now normally what its should do is ask for tool change, which it does, then i press cycle start and it should go to its g54 which should be its work zero but instead it seem to be trying to go to X1.3271 Y1.3464 from its home position and then from there well to machine goes over travel does anybody have an idea as to why it does that...???
    The opinions expressed in this post are my own. -Les opinions exprimé dans ce messages sont les mienne

  2. #2
    Join Date
    Jun 2008
    Posts
    1511
    It wants to go there because you have it programmed to go there.
    N5270 G0 G90 G54 X1.3271 Y1.3464 A0. S3000 M3

    If G54 is the center of the pocket then the code above is telling it from G54 go X1.3271 Y1.3464. What you want to do is G0G90G54X0Y0A0S3000M3 This will take you to G54 position.

    Stevo

  3. #3
    Join Date
    Jul 2005
    Posts
    969
    i am not sure i get what you are saying in this case
    if i am reading it right it should be
    from the g54 ,position your self at X1.3271 Y1.3464... no!
    so g54 x0 y0 would just put it in the corner of the block
    but my problem is that instead of going to the block it try to make its move from the home position and not from the work offset position so i guess then my code is right its mach3 that does not make the good move
    The opinions expressed in this post are my own. -Les opinions exprimé dans ce messages sont les mienne

  4. #4
    Join Date
    Feb 2008
    Posts
    586
    This is a Mach3 controller?

    Never had the pleasure of running one.

    Try putting your G54 G90 on line N5265. Somehow its not reading the G54 on the line its programmed.

  5. #5
    Join Date
    Jun 2008
    Posts
    1511
    Hmm. Ok so your G54 X0Y0 is the corner of the block and your center of the pocket is X1.3271 Y1.3464 from G54. Is your G54 set up properly? When you found the corner of the part you put the "machine" position in the G54 offsets. If so then yes your code should be correct.

    As like Beege I do not have any experience on a Mach3 control if thats what it is. Try doing what Beege said. In a seperate line before your X and Y movement put the G54. It might be that it is not instating the G54 until the next line of code. I have seen that before. I have had to set parameters in the Fanucs that are for instating an offset in the same line or the next exacuted line. Worth a shot.

    N5260 T3 M6
    N5265G0G90G54
    N5270X1.3271 Y1.3464 A0. S3000 M3
    N5280 G43 H3 Z2. M8

    Stevo

  6. #6
    Join Date
    Jul 2005
    Posts
    969
    yep ill try this out, for now family mater call, got to take care of the kid and do my father duty will post back later.
    The opinions expressed in this post are my own. -Les opinions exprimé dans ce messages sont les mienne

  7. #7
    Join Date
    Mar 2003
    Posts
    35538
    G54 is Mach3's default coordinate system, so calling G54 probably doesn't actually do anything, because you're probably already in G54.
    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)

  8. #8
    Join Date
    Jul 2005
    Posts
    969
    Quote Originally Posted by ger21 View Post
    G54 is Mach3's default coordinate system, so calling G54 probably doesn't actually do anything, because you're probably already in G54.
    i dont get it then since it did the two first operation wich was the contour and the big pocket how did it knew where the part was, unless i dont get what you are saying? cuz from what i get from your post g54 would be equivalent to its home position?? or am i wrong... anyway another thing is i took a look at a post for mach3 from nova... something website that was made for mach9 and with that post it does not do any g28 or infact as you point do any g54 for that mater it does it like this

    N5310 G03 X3.6442 Y2.7049 I-.0625 J0.
    N5320 G01 Z.1 F6.33
    N5330 G00 Z2. M09
    N5340 M05
    N5350 T3 M06 (15/64 LEFT SIDE CENTER POCKET)
    N5360 (MAX - Z2.)
    N5370 (MIN - Z-.62)
    N5380 G00 Z2. M08
    N5390 G00 X1.3271 Y1.3464 S2000 M03
    N5400 Z.1
    N5410 G01 Z-.38 F6

    but then i dont get it from what i get you only have 2 inches in between your part and the quill to do your tool change??... oh no now i get it what i have to do is set my clearance to something like 8" but then again i dont get it how does it figure were the part is if it does not take note of the g54...
    The opinions expressed in this post are my own. -Les opinions exprimé dans ce messages sont les mienne

  9. #9
    Join Date
    Apr 2005
    Posts
    1778
    Executing a G54 doesn't cause any movement. It sets the machine offsets to the G54 coordinate system.

    Looking at this line of code:
    G0 G90 G54 X1.3271 Y1.3464 A0. S3000 M3

    It is basically saying:
    G0 (Set modal rapid motion)
    G90 (Use absolute coordinates)
    G54 (Use the G54 coordinate settings)
    X1.3271 Y1.3464 A0. (Move to these coordinates)
    S3000 M3 (Turn the spindle on and set the speed to 3000rpm)

    You have to decide where you want the origin for the part, set the G54, G55 or which ever coordinate system you want to run in and then program the cuts relative to that origin.

    I set my G54 origin with this line of code:
    G10 L2 P1 X0.0 Y0.0 Z0.0 (set to home P1==G54, P2==G55, etc)
    Then you could set your G55 origin with something like this:
    G10 L2 P2 X1.3271 Y1.3464 Z0.0 A0 (but where ever you want it to be)
    Then you could invoke:
    G55
    G0 X0 Y0 A0
    (do some operations)
    G54 (restore home coordinates)

    I am running EMC2 but since Mach originated in EMC also, I would expect that the code for this would be similar.

    Alan

  10. #10
    Join Date
    May 2008
    Posts
    18
    Have you checked the values in the G54 parameters?????

    Dave

  11. #11
    Join Date
    Jul 2005
    Posts
    969
    I understand the g54 is not a movement code but were the zero or origin of my part is but you have to call it if i am not mistaking or else the machine is just going to start its move from were its is... no? from what i got from the post of ger21 i do not need to call a g54 in mach as mach will automatically consider a move with no work offset as a move using g54... no? to be honest with you G10 L2 P2 its the first time i see this code and i never got to use this so you sort of lost me there, but ill have a look at how to use it and if mach3 use it.
    Didnt know about mach3 originating from emc!

    As for this:
    G0 (Set modal rapid motion)
    G90 (Use absolute coordinates)
    G54 (Use the G54 coordinate settings)
    X1.3271 Y1.3464 A0. (Move to these coordinates)
    S3000 M3 (Turn the spindle on and set the speed to 3000rpm)
    I totally agree its just that in the case of my current problem seem to be like beege is saying so instead of go to its g54 and positioning its self X x.xxx and Y y.yyy from the work offset (g54) it try to do it from home position (g28) effectively going over travel also as i said my g54 is good as the two first operation it does with tool 2 are good its just that ounce its done and the tool change as been done it, it seems to be trying to go to the X and Y before it takes into consideration the g54.
    The opinions expressed in this post are my own. -Les opinions exprimé dans ce messages sont les mienne

  12. #12
    Join Date
    Mar 2003
    Posts
    4826
    I'd be surprised if G54 is Mach's default coordinate system, it might be the default workshift, but the real coordinate system that belongs to the machine (and where G28 references) is G53.

    That call for G28 X0 Y0 A0 at the tool change bothers me a bit. That is a command to move to machine zero through points X0 and Y0. Since G91 was not commanded on that line, it may have attempted to move through the current workshift's X0Y0. Without being there and experimenting with the machine, its tough to guess what the control would try to do.

    So perhaps try
    G00 G91 G28 X0 Y0
    as the 'fully written out' command.

    Also as a safety, after a tool change it is a good habit to insert a safety line like this:
    /G0 G54 X0 Y0

    This sends the tool to the workshift X0Y0 where you can do a visual check that indeed the tool is at the datum. Once you get into running the program repeatedly, you can then skip this move with the block delete switch.
    First you get good, then you get fast. Then grouchiness sets in.

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

  13. #13
    Join Date
    Mar 2003
    Posts
    35538
    G53 is machine coordinates in Mach. If you don't call G53, it'll start in G54. Ataxy, check the status bar when you load your code. It should have a G54 in there, indicating you are already in G54.
    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)

  14. #14
    Join Date
    Jul 2005
    Posts
    969
    N5200 G1 Z.1 F6.33
    N5210 G0 Z2.
    N5220 M5
    N5230 G91 G28 Z0. M9
    N5240 G28 X0. Y0. A0.
    N5250 M01
    ( 15/64 LEFT SIDE CENTER POCKET TOOL - 3 DIA. OFF. - 3 LEN. - 3 DIA. - .234375 )
    N5260 T3 M6
    N5270 G0 G90 G54 X1.3271 Y1.3464 A0. S3000 M3
    N5280 G43 H3 Z2. M8
    N5290 Z.1
    N5300 G1 Z-.38 F6.
    N5310 X1.3264 F10.
    N5320 X1.3242 Y1.3522

    this code works good up to the tool change it simply finish its operation goes up Z0 to home position then X0 and Y0 then i get the M01 since its a test part i do most of it in single block and from time to time i hold the alt-r to override it i also, sorry just noticed it, i get at the M01 a abnormal condition "status g90/g91" if again i press cycle start i get to the Txx Mxx line it calls me to do my tool change and then ounce i press cycle start to indicate that the tool change is made this is where the machine seem to go

    N5270 G0 X1.3271 Y1.3464 A0. S3000 M3
    N5275 G90 G54

    instead of
    N5270 G0 G90 G54 X1.3271 Y1.3464 A0. S3000 M3

    so basicly it does its X and Y move in home instead of work, but what ill do is try what the user have recommended by starting with putting the g90 and g54 in a line previous to the g0 move to see if this help i will also try the code i get by using the _MACH3B.pst from novalab.com
    The opinions expressed in this post are my own. -Les opinions exprimé dans ce messages sont les mienne

  15. #15
    Join Date
    Mar 2003
    Posts
    4826
    Ataxy,
    Can you tell us what values you have for X and Y in your G54 workshift registers?

    If you have zeros in there, then that means that the datum is exactly the same as machine zero, G53 X0 Y0.

    A call such as G28 X0 Y0 in this case will move the machine directly to machine zero, since the intermediate point is one and the same location as machine zero.

    However, as soon as you enter some real values in the G54 workshift, then the command
    G28 X0Y0 creates a two part move, firstly to workshift zero (I think) and then to machine zero.

    However, G0 G28 G91 X0Y0 will move directly to machine zero because the intermediate point is incrementally zero distance from the current position.

    Now when the machine moves back, it should move back correctly to the coordinate commanded in your program.

    I would take a rational approach to diagnosing the problem and record exactly how far the machine is moving when I think it is moving incorrectly. This difference between the expected and the real position should correspond with some value that is pretty easy to find, either in a workshift amount, or an incremental movement because the control was inadvertantly left in G91 mode at some point. Although some controls may read a G91 and apply it only to the line it is on, others may change mode to incremental until such time as the next G90 is encountered. So if in doubt, spell out (in gcode) exactly what you want to happen, even if it seems redundant codewise. You can then condense the code later on, once you understand what is happening.
    First you get good, then you get fast. Then grouchiness sets in.

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

  16. #16
    Join Date
    Jul 2005
    Posts
    969
    Quote Originally Posted by HuFlungDung View Post
    Ataxy,
    Can you tell us what values you have for X and Y in your G54 workshift registers?

    If you have zeros in there, then that means that the datum is exactly the same as machine zero, G53 X0 Y0.

    A call such as G28 X0 Y0 in this case will move the machine directly to machine zero, since the intermediate point is one and the same location as machine zero.
    the Y and X value for the work offset are -4.7785 and -5.6238 in the same order

    Quote Originally Posted by HuFlungDung View Post
    However, as soon as you enter some real values in the G54 workshift, then the command
    G28 X0Y0 creates a two part move, firstly to workshift zero (I think) and then to machine zero.

    However, G0 G28 G91 X0Y0 will move directly to machine zero because the intermediate point is incrementally zero distance from the current position.

    Now when the machine moves back, it should move back correctly to the coordinate commanded in your program.

    I would take a rational approach to diagnosing the problem and record exactly how far the machine is moving when I think it is moving incorrectly. This difference between the expected and the real position should correspond with some value that is pretty easy to find, either in a workshift amount, or an incremental movement because the control was inadvertantly left in G91 mode at some point. Although some controls may read a G91 and apply it only to the line it is on, others may change mode to incremental until such time as the next G90 is encountered. So if in doubt, spell out (in gcode) exactly what you want to happen, even if it seems redundant codewise. You can then condense the code later on, once you understand what is happening.
    cant really say what is the distance to do as i as not finish its move before going over limit

    P.S.:i did try the g90 g54 on a line before the g0 x ..... y ..... and i still get the same result but i was able to make it do the part with the post from novalab but it does not do any g28 or zero home in between its operation so ill have to put my retract to the max for my tool change to work
    The opinions expressed in this post are my own. -Les opinions exprimé dans ce messages sont les mienne

  17. #17
    Join Date
    Mar 2003
    Posts
    4826
    Does the A value have to be in there? Does the control not care if there is no A axis hooked up, or do you have one hooked up?
    First you get good, then you get fast. Then grouchiness sets in.

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

  18. #18
    Join Date
    Jul 2005
    Posts
    969
    Quote Originally Posted by HuFlungDung View Post
    Does the A value have to be in there? Does the control not care if there is no A axis hooked up, or do you have one hooked up?
    yep i got one hook up
    The opinions expressed in this post are my own. -Les opinions exprimé dans ce messages sont les mienne

  19. #19
    Join Date
    Jul 2005
    Posts
    969
    ok i tryed the the post for the tormach that is on the yahoo group and so far so good it does not give any problem
    The opinions expressed in this post are my own. -Les opinions exprimé dans ce messages sont les mienne

  20. #20
    Join Date
    Jun 2008
    Posts
    1511
    I think Huflungdung is pretty much on the right path with your problem. It does not matter what your default coordinate is on your machine it should be common practice to call the coordinate no matter what.

    Huflungs post reminded me of an issue that I had. When sending the machine home with a G28, my next movement line was instating the G54 with an X,Y movement. But with my control when a G28 is commanded it cancels all tool offsets and basically instates G53. Now with my first move and G54 in the same line it was not picking up the G54 and it was working from G53. Which sounds like your problem.

    As Beege, Huflung, and I pointed out in post 4,5,12. Try instating your G54 on a seperate line before doing your X,Y move. Try doing it with no movement.
    G90G54
    G0X0Y0A0S3000M3
    X1.3271 Y1.3464

    If that works then try moving the G0X0Y0A0S3000M3 into the G90G54 line. If you are not going to the same position then you will know that the G90G54 must be instated on seperate lines before your movement.

    Stevo

Page 1 of 2 12

Similar Threads

  1. KMB1 gcode problem
    By mmachining in forum HURCO
    Replies: 2
    Last Post: 10-07-2008, 04:58 AM
  2. GUESS: Home Limit or Both
    By Mr.Chips in forum CNC Machine Related Electronics
    Replies: 8
    Last Post: 03-20-2008, 05:03 PM
  3. Cam to gcode problem
    By Sonicmook56 in forum CNC (Mill / Lathe) Control Software (NC)
    Replies: 3
    Last Post: 12-24-2007, 02:01 PM
  4. Replies: 0
    Last Post: 03-10-2005, 07:46 PM
  5. dxf to gcode problem...
    By freezer in forum Uncategorised CAM Discussion
    Replies: 9
    Last Post: 02-19-2004, 07:02 AM

Posting Permissions

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