584,826 active members*
5,275 visitors online*
Register for free
Login
Page 1 of 2 12
Results 1 to 20 of 27
  1. #1
    Join Date
    May 2008
    Posts
    29

    current axis position

    are there machine variables that have the current axis positions that i can access from gcode? #5061 #5062 ---etc give the probe impact value but i want the value at program start and after a move.
    I have some irregular stock (reclaimed machinable wax) i want to machine it to a standard thickness. so i am trying to write a program that starts with the z axis zeroed to the bottom of the stock and the tool setting at the z-max of the stock. i want to run a surfacing pattern in a loop stepping z until i get to the pre set thickness.
    this is simple to do if i can read the current position in the gcode.
    where in the documentation would i likely find this information?
    If you are not having fun, you are not doing it right.

  2. #2
    Join Date
    Feb 2007
    Posts
    514
    For looping look in the O code section of the manual.

    http://www.linuxcnc.org/docview/deve...ml#cha:O-Codes

    If your stock is different heights can you adjust your number of loops or something like that...

    Are you using 2.3 or 2.2.x?

    John

  3. #3
    Join Date
    May 2008
    Posts
    29
    Thanks John.
    i understand about writing loops and using variables. I can get the job done by measuring the thickness of the wax and entering that in the program, and that works fine. What i want to do is mount the hunk of wax with the z axis zeroed to the bottom of the piece/top of the fixture, and with the z step down set in the program start from where ever the machine is setting and make surfacing passes to my predefined thickness. I am trying to get around editing the program for each hunk of wax, because i am a klutz and i don't trust my typing all that much. so in use i would mount the wax run the tool to the highest point and start the program. taking off the z step thickness or fraction of for the last pass.
    i am not sure which version of emc2 i have. I downloaded the live cd for hardy heron, it came with axis 2.2.7 if that helps.
    If you are not having fun, you are not doing it right.

  4. #4
    Join Date
    Feb 2007
    Posts
    514
    If you don't mind using a beta version you can upgrade to 2.3 beta and use G28.1 or G30.1 to store your current locations then do the math in your loop to figure out how many passes you need.

    http://www.linuxcnc.org/docview/deve...sec:G30,-G30.1

    and to upgrade

    http://wiki.linuxcnc.org/cgi-bin/emc...?UpdatingTo2.3

    John

  5. #5
    Join Date
    May 2008
    Posts
    29
    thanks again BigJohn g30.1 is exactly what i want. I will have to think about upgrading to 2.3beta.
    I am just getting started with cnc milling and i don't know if i want the extra anxiety of unstable software. Ill have to do some reading about 2.3
    If you are not having fun, you are not doing it right.

  6. #6
    Join Date
    Feb 2007
    Posts
    514
    So far 2.3 seems to be bug free... I have it on two computers now and have been using the pre 2.3 on my plasma cutter for quite some time (a year maybe). It doesn't look like much of a pain to revert back to 2.2.x should you want.

    John

  7. #7
    Join Date
    May 2008
    Posts
    29
    the upgrade seems simple enough. i think you talked me into it. i have some things to run this morning, but should enough time to do it this afternoon.
    If you are not having fun, you are not doing it right.

  8. #8
    Join Date
    Feb 2007
    Posts
    514
    When you get your code worked out if you don't mind sharing post it here or send it to me. It sounds like some useful reusable code.

    John

  9. #9
    Join Date
    May 2008
    Posts
    29
    i upgraded. mostly going ok. i had trouble getting the x axis to home. no matter where i set it when i hit home axis it set x to -.5499

    i greped the machine config directory for 5499 and found that in emc.var 5221 was -0.549925. changed the entry to 0.00000 and i can now home x ok

    while i was editing emc.var i noticed that 5223 is set to -0.00000. is that meaningful ?

    now to go see if g30.1 and g28.1 work
    If you are not having fun, you are not doing it right.

  10. #10
    Join Date
    Feb 2007
    Posts
    514
    Not that I know of. There is a menu item under Machine to clear offsets... Don't know what all it will clear off the top of my head. Sounds like your making progress now. IMHO 2.3 is WAY better from every aspect.

    Keep us posted or pop in on the IRC and chat with the rest of the EMC group. Just click on the embedded java client if your not savvy with the IRC on this page.

    http://www.linuxcnc.org/content/view/4/8/lang,en/

    John

  11. #11
    Join Date
    May 2008
    Posts
    29
    i got to work on the program for a while this morning and have a subroutine doing one pass correctly.
    now i have to write write a subroutine to do the inverse pass machining back to the start.
    then add a z step loop and it will be soup.

    there are a few nasty things going on with the conditionals when you put then in a while statement. It took me some time to hack around the problem. it makes the program klunky but i think its a real bug.
    what happens is if you use a GE in a while as in:
    o100 while [ # GE #]
    and then put an 'if' statement inside the 'while' loop emc goes into an infinite loop trying to calculate a tool path. with no conditionals inside the loop GE is fine LE does the same thing.

    i will have to play with it some more to be sure of all the conditions that make it crash.
    If you are not having fun, you are not doing it right.

  12. #12
    Join Date
    Jul 2003
    Posts
    1753
    could you post the program that doesn't work?

    thanks
    sam

  13. #13
    Join Date
    May 2008
    Posts
    29
    sam if i can figure out how to do that i sure will. i just noticed that this forum dosen't like the format if the emc2 gcode variable names
    If you are not having fun, you are not doing it right.

  14. #14
    Join Date
    Feb 2007
    Posts
    514
    you could pastebin it and post the link or hop over to the IRC and post the link...

    John

  15. #15
    Join Date
    May 2008
    Posts
    29
    what is "pastebin" ?
    If you are not having fun, you are not doing it right.

  16. #16
    Join Date
    Jul 2003
    Posts
    1753

  17. #17
    Join Date
    May 2008
    Posts
    29
    i found pastebin now i have to figuer out how to use it
    If you are not having fun, you are not doing it right.

  18. #18
    Join Date
    May 2008
    Posts
    29
    ok its on pastebin with my name cxevalo this is a test to demo the problem.
    If you are not having fun, you are not doing it right.

  19. #19
    Join Date
    Jul 2003
    Posts
    1753
    I am not seeing it. Could you post the link - or give the pastebin that was used (I don't see it on pastebin.ca or pastebin.com)

  20. #20
    Join Date
    Feb 2007
    Posts
    514
    we need the link... AFAIK

    John

Page 1 of 2 12

Similar Threads

  1. What is your current CNC Position?
    By rodneydeeeee in forum Polls
    Replies: 5
    Last Post: 09-15-2015, 01:13 AM
  2. angle position axis
    By bfservice in forum Fanuc
    Replies: 2
    Last Post: 09-29-2008, 03:51 AM
  3. Help needed with z-axis position
    By Spazdemon in forum Centroid CNC Control Products
    Replies: 5
    Last Post: 05-09-2008, 05:24 AM
  4. x-axis losing position...???
    By shnitzel in forum Servo Motors / Drives
    Replies: 11
    Last Post: 09-29-2007, 06:46 PM

Posting Permissions

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