586,060 active members*
4,242 visitors online*
Register for free
Login
Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2005
    Posts
    1430

    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
    Join Date
    Jun 2005
    Posts
    1430
    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-07-2010, 03:47 AM
  2. 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, 05:27 PM
  3. Setting up loops
    By Zmachine in forum Haas Lathes
    Replies: 6
    Last Post: 03-20-2009, 04:15 PM
  4. M-codes and G-codes 4 Matsuura ES-1000V
    By maximusek in forum G-Code Programing
    Replies: 2
    Last Post: 11-27-2007, 01:41 PM
  5. loops and subs
    By d.dixson in forum Mach Mill
    Replies: 5
    Last Post: 04-07-2007, 11:25 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
  •