522,050 active members*
2,367 visitors online*
Register for free
Login
Results 1 to 5 of 5
  1. #1

    Join Date
    Mar 2020
    Posts
    17

    Set parameters at runtime?

    I have a couple of parts that I'm working on that are essentially plates with a bunch of threaded and counterbored holes. Depending on which one I need, the thread is different as is the depth of the counterbore. I could certainly, and very easily create two programs for the two versions but I'm curious if there is anyway in pathpilot to prompt the operator at the start of the program for which variant is desired, set parameters accordingly, then run the same program using those set parameters for the counterbore depth and tapping speed/feed. I've seen this sort of behavior on some very old fadal machines where I work. The operator goes through a series of prompts to configure the part that is being made and the machine jumps through a bunch of if/then statements based on the inputs. The result is a single program capable of making multiple variants of what is otherwise the same part. Is this an option with pathpilot?

  2. #2
    Registered
    Join Date
    Nov 2012
    Posts
    460

    Re: Set parameters at runtime?

    The PathPilot G-code interpreter has a good feature set, where you can do math, define variables, and do conditionals and loops.
    I have some utility programs where I for example set up stock width/thickness and it machines off the rough edges out of the saw.
    That "setup" has to be done by editing the text file to set the parameters, though, there's no built-in "pop up a dialog" feature that I know of.
    All the "conversational" dialog wizards in the controller are built-into the PathPilot software.

    If you need a dialog, then I can think of two options.
    One is to install some LinuxCNC GUI add-on (there's something called QTvcp for example)
    You would then re-configure the HAL files to read the virtual "pins" that those widgets would control.

    The other is to develop an M-code macro program in Python, and install it as part of PathPilot.

    Both of these require Linux programming experience, and the first one additionally requires wanting to deal with HAL files.
    Both of them would have to be re-applied each time you update the version of PathPilot, too, although the custom M-code one might be easier to do that with.

  3. #3

    Join Date
    Mar 2020
    Posts
    17

    Re: Set parameters at runtime?

    Your post saw programs intrigue me. Is that something you'd be willing to share?

    Regarding the original question, both options seem like more work than I'm interested in dealing with for the relatively minor benefit of not having multiple program files. Thank you for the input though.

  4. #4
    Registered
    Join Date
    Nov 2012
    Posts
    460

    Re: Set parameters at runtime?

    Here's my "clean up the stock on the left" program:

    I probe the left yon bottom corner of the stock as 0x0x0 and set the "width" to the Y dimension of stock, "height" to the Z dimension, and this program cleans up the left side at X=0.2 (assuming tool 4 is 1/4" end mill.)

    Beware: metric units!

    %
    (side clearing N layers of M mm)
    (00 left yon bottom)

    (Parameters to change: size of stock)
    #<width>=38
    #<height>=6.5
    #<DOC>=4

    (how deep to cut to the right and below)
    #<cut>=0.2
    #<bottom>=-1

    (T4 D=6.35 end mill)
    G90 G54 G64 G50 G17 G40 G80 G94 G91.1 G49
    G21 (Metric)
    G30
    G54

    (T4 1/4 inch end mill)
    T4 G43 H4 M6
    S4500 M3 M8

    #<xleft>=5
    #<ymargin>=4

    #<xcut>=[-3.175+#<cut>]
    #<ycut>=[-#<width>-#<ymargin>]
    #<zcut>=[#<height>]
    G0Z[#<height>+10]
    G0X[-#<xleft>]
    G0Y[#<ycut>]

    o100 do
    #<zcut>=[#<zcut>-#<DOC>]
    o110 if [#<zcut> LT #<bottom>]
    #<zcut>=[#<bottom>]
    o110 endif
    G1Z[#<zcut>]F300
    G1X[#<xcut>]F300
    G1Y[#<ymargin>]F600
    G0X[-#<xleft>]
    G0Y[#<ycut>]
    o100 while [#<zcut> GT #<bottom>]

    (whisper pass)
    G0X[-#<xleft>]
    G0Y[#<ycut>]
    G1Z[#<bottom>]F300
    G1X[#<xcut>]F300
    G1Y[#<ymargin>]F400
    G0Z[#<height>+10]

    M9
    G30
    G0X-10Y10
    F1000
    M5
    H99 T99 G43 M06

    M30
    %

  5. #5
    Registered
    Join Date
    Apr 2017
    Posts
    123

    Re: Set parameters at runtime?

    I've been doing something similar to what @jwatte has been doing. Most of my work consists of a big Windows program that generates gCode. The gCode generated, though, consists essentially entirely of calls to subroutines, so the calling code can be edited to make the sort of changes that you seem to be interested in.

    The attached zip file includes an example. Through a series of interactions, I told the Windows program that I wanted to round two of the corners of a 2" x 2" x 1" slab of 6061, and that then I wanted to shave 0.2" from the left 1" of its top surface. I had to tell the Windows program what tool I wanted to use, I had to choose feeds & speeds, and so on. The code it generated (round NE & SE. . .ncc) captures all of those choices, but the subroutines do all the work. Looked at from the other direction, the subroutines don't start off knowing how big the slab is, what sort of DOC I want to use, the OD of the tool, and so on, so most of their code is spent in figuring out how to do their jobs.

    The resulting good news is that all of the job specifications are in the (relatively) reader-friendly calling program. If I wanted to do the same job on a 2" x 3" x 1" slab, and at the same time improve the finish by reducing the stepover to 0.35, all I'd need to do to the calling program is to change the lines
    Code:
    #<_XRight>          = 2
    . . .
     #<_StepOverFraction> = 0.4
    to
    Code:
    #<_XRight>          = 3            
    . . .
     #<_StepOverFraction> = 0.35
    (of course, the timing estimates that the Windows program generates as comments would no longer be correct).

    My Windows program depends on a database infrastructure (Sybase's Advantage) that is free, but something of a fiddly PITA to install. With that warning I'm happy to share all of this stuff with anyone who wants it.

    You might also have some use for the gCode.exe program that I've thrown into the zip file. It is a gCode grammar-checker, more helpful than PathPilot's ill-localized diagnostics.

Similar Threads

  1. Partner 1F Runtime Error 216
    By bluekat in forum Milltronics
    Replies: 3
    Last Post: 12-24-2014, 02:16 PM
  2. Runtime error
    By mstreur in forum Deckel, Maho, Aciera, Abene Mills
    Replies: 0
    Last Post: 07-09-2014, 07:26 PM
  3. v-25 demo runtime error
    By 1234567 in forum BobCad-Cam
    Replies: 1
    Last Post: 05-29-2012, 11:39 PM
  4. Runtime error
    By ARHEA in forum EnRoute
    Replies: 0
    Last Post: 05-17-2012, 06:43 PM
  5. Runtime error
    By msme-lc in forum General CNC (Mill / Lathe) Control Software (NC)
    Replies: 1
    Last Post: 09-30-2008, 10:14 PM

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
  •