Results 1 to 2 of 2

Thread: O codes and WHILE/ENDWHILE loops

  1. #1
    Registered greybeard's Avatar
    Join Date
    Jun 2005
    Location
    UK
    Posts
    1386
    Downloads
    0
    Uploads
    0

    O codes and WHILE/ENDWHILE loops

    I have been using WHILE/ENDWHILE loops to plot parabolic curves, with slow but sure success.
    New problem with the use of this approach - is it possible to include in the loop a parameter that is a function of the number of times that the loop has run ?

    It sounds a bit like the traditional "picking yourself up by your own bootstraps, but I thought I'd ask

    Typical line of code is .....

    #11=83.5
    O103 WHILE [#11 GE 79.970]
    g01 x[[#11*#1] y[[-9.6*[[83.5-#11]**0.5]+23.5]*#1] z[-1*[85.175-#11]*#1] F#3
    #11=[#11-0.03525]
    O103 ENDWHILE

    (This will make the v-tool follow a parabolic path, but with one edge circular and the other one straight as it decends into the work piece through 100 steps.)

    .......but I want to add in to the x value an additional component that is increasing linearly with each step of the loop, which has the effect of sloping the line, like going from upright to italic lettering.
    For example, if I change x[#11*#1] to x[[#11+N/100]*#1] , the change is fixed, and I want the value of N to increase from 0 to 100 during the 100 steps of the loop.

    Can anyone help ?
    Thanks,
    John
    It's like doing jigsaw puzzles in the dark.
    Enjoy today's problems, for tomorrow's may be worse.


  2. #2
    Registered greybeard's Avatar
    Join Date
    Jun 2005
    Location
    UK
    Posts
    1386
    Downloads
    0
    Uploads
    0
    Well, as is often the case, 7 hours sleep produced the answer
    While making the morning tea, the following seems to have solved it...
    x[[#11-[[83.5-#11]*1.83688]]*#1]
    .... slews the parabola round just nicely.
    OK, so the inner circular edge is now eliptical, but who's counting.
    It's like doing jigsaw puzzles in the dark.
    Enjoy today's problems, for tomorrow's may be worse.


Similar Threads

  1. Using loops in gcode?
    By forhire in forum DynaTorch
    Replies: 4
    Last Post: 04-06-2010, 10:47 PM
  2. Need Help!- Need full list of G CODES AND M CODES FOR FANUC 21I
    By SonnyTees.com in forum G-Code Programing
    Replies: 3
    Last Post: 02-23-2010, 11:27 AM
  3. Setting up loops
    By Zmachine in forum Haas Lathes
    Replies: 6
    Last Post: 03-20-2009, 11:15 AM
  4. M-codes and G-codes 4 Matsuura ES-1000V
    By maximusek in forum G-Code Programing
    Replies: 2
    Last Post: 11-27-2007, 07:41 AM
  5. loops and subs
    By d.dixson in forum Mach Mill
    Replies: 5
    Last Post: 04-07-2007, 06:25 PM

Posting Permissions



About CNCzone.com

    We are the largest and most active discussion forum from DIY CNC Machines to the Cad/Cam software to run them. The site is 100% free to join and use, so join today!

Follow us on

Facebook Dribbble RSS Feed


Search Engine Friendly URLs by vBSEO ©2011, Crawlability, Inc.