584,837 active members*
5,674 visitors online*
Register for free
Login
IndustryArena Forum > Machine Controllers Software and Solutions > G-Code Programing > incrementing the z axis and repeating the pattern?
Results 1 to 4 of 4
  1. #1
    Join Date
    May 2008
    Posts
    5

    incrementing the z axis and repeating the pattern?

    Good evening. I am building a CNC milling machine out of a cheaply acquired Sieg x1 which needed a new motor controller. This wasn't the Clarke board but an E bay purchase which is nearly identical but costs £18 and wires straight in once it has been removed from its box. I have stuck neoprene foam on the inside of the upper box which has quietened it a good bit and I replaced the lower spindle bearing. Total cost for the machine was £127 and a couple of evenings meddling so I am a happpy man.
    I have three Nema 23 motors and have fitted the first one to the z axis.

    I'm using an Arduino Uno running GRBL1.1 and I'm using the Universal G-code sender to drive it.
    After a couple of days of frustration and engineering language, I got the programs talking to each other and yesterday, I connected it all up and calibrated the screw.
    Blow me down, it works!
    Now I'm much less good at Cad programs than I am at rocket science but I have done a lot of laborious assembly language over the years so G-code isn't too intimidating. I found an online g code simulator program that allows me to edit the code and see the toolpath (I am making simple one piece objects with little embellishment.) so I could make the part in wax or plastic for test purposes.
    Here is the problem. Once I start to make this in metal, I shall need to make a series of repeated shallow cuts, won't I?
    The machine and cutter won't have the grunt to work deeply so I was wondering whether there was a method of executing a block of code, for example,
    mill an outline,
    step the z axis,
    repeat until done.
    Move on to the next process,
    mill a shape,
    step the z axis.
    Repeat until done.
    sort of like a subroutine in a conventional program.
    Is this how it is done?
    If it is, would somebody please explain to me how to do it as I can't see any way of doing it without cutting and pasting a huge amount of code with z statements between them which looks pretty clunky to me.

    Sorry, it is an elementary question but I'm a beginner and this would be a very great help
    Thank you for reading this far!

  2. #2
    Join Date
    Jun 2015
    Posts
    4131

    Re: incrementing the z axis and repeating the pattern?

    hi tom is me, jerry ! welcome to pattern codes

    some cnc controllers can patternize, while others can not; in your case you don't need a complex patterning code, but to change the "Z origin " after each cut ( or keep the " z origin " as it is, and use a temporary " z shift " )

    most cnc controllers have the possibility to change both " z origin " & " z shift "; i don't know if your rocket does it

    sometimes i also need to repeat a cut; even if i may edit " z origin " & " z shift ", in time, i have developed a soubroutine for the Okuma cnc :
    ... it can take whatever XY code
    ... repeats the code among Z axis ( for example equal steps for roughing + one last step for finishing : 0 1 2 3 4 + 4.3 )
    ... handles also circular rotation ( comes in handy when cutting wheels with teeth )
    ... handles tool entrance and tool exit : rapid, feed, increased feed, etc
    ... uses 2 clearance planes : the plane where feed begins, and the plane above the fixtures
    ... handles radius compensation, without auxiliary movements
    ... some positioning optimizations, etc
    * now i simply need to input the toolpath inside this soubroutine, edit some parameters, and i am done i like it because it requires less edit time, making it possible to edit the code fast, near the machine, without going back to the pc, etc

    hmm, for your rocket, i would recomend a simple approach : if possible, put the cutting toolpath inside a soubroutine, and call it repeteadly :
    ... Z-1
    ... cut ( call soubroutine )
    ... Z-2
    ... cut ( call soubroutine )
    ... Z-2.25
    ... cut ( call soubroutine )
    * soubroutine content should be only the toolpath

    depending on your rocket capabilities, such codes can be improved kindly


    ps : https://www.youtube.com/watch?v=QpjwNa5izzM
    Ladyhawke - My Delirium, https://www.youtube.com/watch?v=X_bFO1SNRZg

  3. #3
    Join Date
    May 2008
    Posts
    5

    Re: incrementing the z axis and repeating the pattern?

    Thanks Jerry. Seems my Arduino based GRBL has some limitations! It will not run subroutines and takes no account of tool size. This means a lot of hand coding. I'm simulating the toolpath and this seems to work albeit slowly. Then again, I'm planning to work in stainless and taking a .004" cut with a 65mm cutter.This may be conservative and I shall have to see if it works well enough to increase this to .010", feeding at 7 IPM.
    Nothing wrong with starting out gently, I suppose. just as long as it doesn't harden.

  4. #4
    Join Date
    Jun 2015
    Posts
    4131

    Re: incrementing the z axis and repeating the pattern?

    hi tom, i have seen an arduino at work only once : it was a guy that was creating some code, and after that he was loading that code inside the arduino; it was like, once the program begins, you can not stop&restart it, or adjust it on the run

    i don't know, it may be ok for some applications, maybe there is more to Arduino ... etc

    about cnc machines, there are many programmers that create codes from CAM, so, for example, even a simple line that goes incremental on Z axis, will have a long code, that requires time to be edited

    i try to shorten the edit time as much as possible, because a lot of auxilary time is lost with program adjustments and restart sequences

    so, same thing can be done in different ways, depending on the available functions; i don't know, try to see what functions can be added to an Arduino ? kindly
    Ladyhawke - My Delirium, https://www.youtube.com/watch?v=X_bFO1SNRZg

Similar Threads

  1. C- axis position not repeating
    By wmpy in forum CNC Swiss Screw Machines
    Replies: 0
    Last Post: 04-24-2017, 07:12 PM
  2. AXIS not moving and DRO is incrementing.
    By Capteod in forum Mach Mill
    Replies: 0
    Last Post: 04-16-2013, 12:42 AM
  3. non repeating x axis
    By johnreeddesign in forum Milltronics
    Replies: 7
    Last Post: 10-07-2011, 12:13 AM
  4. Axis not repeating
    By Aircraftman in forum Mazak, Mitsubishi, Mazatrol
    Replies: 6
    Last Post: 07-31-2009, 08:16 AM

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
  •