DeskProto user forum
Forum: communicate with other users
|
|
|
|
page 1 of 3 |
Is there a way that I can modify the post processor that is used to generate the g-code for my projects? I would like to add some m-codes at the beginning and the end to turn the spindle and the vacuum on and off. If I have to hand-modify the NC files each time, that is a great opportunity for error. Modifying it once in the post processor is much preferable. Thanks, Mark |
|
Hi Mark, Indeed this is possible: DeskProto boasts on having a fully configurable postprocessor :-) So indeed any user can add commands like the examples that you mention. You can find this in Options >> Library of Postprocessors >> OK on warning >> select your post and press Edit. You can see which postprocessor is used by viewing your Machine definition in the Library of Machines. Also here: for help on configuring a postprocessor use the Help buttons on each tab page of the postprocessor definition, or use the Reference Manual. The index of the Help file and of the Reference manual is a good entry to find information like this: in this case "postprocessor" is listed in both indexes. The extra commands that you need can best be added as "Start commands" and/or "End commands". Good luck, Lex. |
|
Hi Mark and Lex , I wrote a .ppr for an early serial version FlashCut signal generator. Started with mm. When it worked, made a copy to modify to inch. Later I shortened both as the long version had many comments (FlashCut uses parenthesis for comments not exectued). Also Deskproto uses a linefeed or carriage return ^N mentioned somewhere in the manual. I opened each stock .ppr file to see if any helpful tricks, then proceeded to write and debug my .ppr which works well for me. You can import it to your Deskproto program by saving it as a .ppr file with some name and see how it displays as a guide for your editing purposes. Occasionally, I used notepad to directly edit in the .ppr file after I learned what was going on in the Deskproto post processor editor. Save the listing here as .txt file then rename as a .ppr fileand Save to view in Deskproto. My machine uses XYZ axis and no rotary A-axis or B-axis. [DeskProto PostProcessor] Version = 5.0 [General] Name = Flashcut P mm UseMaximumOutputFilesize = 1 MaximumOutputFilesize = 1400 OutputFileExtension = ~FGC~ DecimalCharacter = . NewLineValues = 13,10,0,0 [General Line Numbering] ToBeUsed = 0 Increment = 2 StartValue = 1000 LineToStartAt = 1 StartCommand = ~~ EndCommand = ~~ [StartEnd] StartCommand0 = ~(DeskProto v5.0 Toolpaths)~ StartCommand1 = ~~ StartCommand2 = ~(filename:)~ StartCommand3 = ~(Date:)~ StartCommand4 = ~(Stock Material:)~ StartCommand5 = ~(Stock Size:)~ StartCommand6 = ~(Stock Position:)~ StartCommand7 = ~(Tool S/F:)~ StartCommand8 = ~(NOTES: Add MACROS with BobCAD v18)~ StartCommand9 = ~( Open NC, and Generate from NC)~ StartCommand10 = ~~ StartCommand11 = ~~ StartCommand12 = ~~ StartCommand13 = ~~ StartCommand14 = ~(G04 X?.? seconds DWELL)~ StartCommand15 = ~(M00 PAUSE)~ StartCommand16 = ~(M03 Spindle ON)~ StartCommand17 = ~(M04 ALL OFF)~ StartCommand18 = ~(M05 Spindle OFF)~ StartCommand19 = ~(M07 Mist Cool ON)~ StartCommand20 = ~(M08 Flood Cool ON)~ StartCommand21 = ~(M09 ALL Cool OFF)~ StartCommand22 = ~(M10 Vacuum ON)~ StartCommand23 = ~(M11 Vacumm OFF}~ StartCommand24 = ~(M12 Tool Lights ON)~ StartCommand25 = ~(M13 Work Lights ON)~ StartCommand26 = ~(M98 CALL Subroutine)~ StartCommand27 = ~(M99 Return from Subroutine)~ StartCommand28 = ~~ StartCommand29 = ~(-------------------------------------)~ StartCommand30 = ~ G17 (XY Plane for Circular motion) ~ StartCommand31 = ~(G02 & G03 not used by DeskProto)~ StartCommand32 = ~ G20 (inch)~ StartCommand33 = ~ G49 (CANCEL Compensation)~ StartCommand34 = ~ G90 (Absolute) ~ StartCommand35 = ~ M04 (ALL OFF)~ StartCommand36 = ~ M13 (Work Lights ON)~ StartCommand37 = ~ G00 Z 0.0 (RETRACT)~ StartCommand38 = ~ G00 X 0.0 Y 0.0 Z 0.0 (PROGRAM ZERO)~ StartCommand39 = ~ F16.0 (Default Feedrate)~ StartCommand40 = ~~ StartCommand41 = ~(-----INITIALIZED------)~ StartCommand42 = ~(--ALL OFF-- Work Lights ON)~ StartCommand43 = ~(RETRACTED Z-axis -ZERO)~ StartCommand44 = ~(-PROGRAM ZERO-)~ StartCommand45 = ~(--READY for TOOL--)~ StartCommand46 = ~~ StartCommand47 = ~~ EndCommand0 = ~~ EndCommand1 = ~~ EndCommand2 = ~(------END & RESET------)~ EndCommand3 = ~~ EndCommand4 = ~ G00 Z 0.0 (RETRACT)~ EndCommand5 = ~ M04 (ALL OFF)~ EndCommand6 = ~ M12 (Tool Lights ON)~ EndCommand7 = ~ M13 (Work Lights ON)~ EndCommand8 = ~ G00 X 0.0 Y 0.0 Z 0.0 (To PROGRAM ZERO)~ EndCommand9 = ~ M30 (END & RESET)~ EndCommand10 = ~(use M02 END if Chaining Files)~ [Movement] StartCommand = ~ G01~ EndCommand = ~~ UseCommandOnlyForFirstMovement = 1 [Movement Coordinates] XValueStartCommand = ~ X~ YValueStartCommand = ~ Y~ ZValueStartCommand = ~ Z ~ AValueStartCommand = ~ (~ XValueEndCommand = ~~ YValueEndCommand = ~~ ZValueEndCommand = ~~ AValueEndCommand = ~) ~ NumberOfXPositions = 1 NumberOfYPositions = 1 NumberOfZPositions = 1 NumberOfAPositions = 0 NumberOfXDecimals = 4 NumberOfYDecimals = 4 NumberOfZDecimals = 4 NumberOfADecimals = 0 XFactor = 1.000000 YFactor = 1.000000 ZFactor = 1.000000 AFactor = 0.000000 WriteOnlyIfChanged = 1 SignAlways = 1 SkipTrailingZeros = 1 Order = 0 Unit = 0 AngleUnit = 0 [Rapid Movement] Method = 0 UseCommandOnlyForFirst = 1 StartCommand = ~ G00~ [Feedrate] ToBeUsed = 1 WriteOnlyIfChanged = 1 StartCommand = ~ F ~ EndCommand = ~~ NumberOfPositions = 1 NumberOfDecimals = 1 Factor = 1.000000 Placement = 2 DistanceUnit = 0 TimeUnit = 1 [Spindlespeed] ToBeUsed = 1 StartCommand = ~(S ~ EndCommand = ~ rpm) M07 (Mist Cool ON)^N^N^N^N(--RAPID MOVE to START POINT--)^N~ NumberOfPositions = 1 NumberOfDecimals = 0 Factor = 1.000000 Placement = 0 [Tool Change] Method = 0 StartCommand = ~^N(Change to Tool #~ UseFirstToolChangeNumber = 1 EndCommand = ~) M4 M12 M13^NG00 X+0. Y+0. Z -3. (Tool Change Position)^N~ UseExtraCommandline = 1 ExtraStartCommand = ~ M06 T~ UseSecondToolChangeNumber = 1 ExtraEndCommand = ~ (FlashCut PAUSES)^N~ UseThirdCommandline = 1 ThirdStartCommand = ~(G43 H~ UseThirdToolChangeNumber = 1 ThirdEndCommand = ~ Use tool # from FlashCut Tools) ^N^N G00 Z 0.0 (RETRACT) M03 (Spindle ON)~ PauseCommand = ~~ This may save you a few days of thinking and trial and error. Pluk |
|
Hi again Mark and Lex, Two corrections for my previous post: When I pasted the post processor file, it became double-spaced; so, edit out all the extra space lines and Save. and StartCommand32 = ~ G20 (inch)~ should be changed to: StartCommand32 = ~ G21 (mm)~ since this is the mm version post processor, You may use G70 (inches) and G71 (mm), page 136 of DeskProto Reference Manual. The string “^N” will start a new line (linefeed), dicussed on page 137 of DeskProto Reference Manual. Also, with an old version of BobCADCAM I have about 20 macros which are blocks of text with (comment lines) and G-code commands and M-code commands. Additionally, macro drill cycles. Makes it easy to generate toolpath from a G-code file to see, insert or delete extra toolpath or macro if needed. Pluk. |
|
Hi Pluk, Thanks for al these tips and ideas on postprocessor editing. Indeed I have sometimes also had those extra empty lines appear all at once: this will I think be caused by different editors having a different use of the ASCII codes <Carriage Return> and <Line Feed>. Anyway these are no problem: DeskProto will also correctly read a PPR file with these empty lines. One more remark: the code to force a new line is in fact "^/N": so a backslash between the circumflex (roof) and the N (it may be that this will disappear on a web page). More information indeed on page 137 of the Reference manual, see the manuals page. About these Macros: do you actually call these macros from the DeskProto NC file ? Lex. |
|
Hi Lex, Have not studied scripting of macros within DeskProto via writing a Wizard. Sometimes I edit the DeskProto G-code after it is generated. I open the G-code file in BobCADCAM's NC editor window, generate and display the toolpath in the toolpath window where I can edit toolpath visually, say add an approach/depart or reposition the entire file and re-generate the G-code with all new X,Y Z values or make multiple copies and nest the copies within the material then generate the G-code for the entire nested work. Other edit features are available to work the toolpath entities, like reverse the direction, offset by distance inward or outward, add a feature suchas a pocket/island or boss or flange or bolt ring to an existing toolpath, freehand line draw, change line colors so roughing is different color than finish toolpath. So many different things are possible on the graphic side of edit. On the G-code side, I wrote macros to Start, End, Dwell time, Tool Change, Turn on or off various devices, all of which can be added to the G-code at appropriate places during edit. You might change FeedRate and Spindle Speed somewhere within the tool path and add or edit those values as well. Therefore, the macro is printed in the G-code file on their own lines, pretty much saves typing or copy paste; so DeskProto is not Calling a Macro from a macro file. BobCADCAM is useful. DeskProto does use macros, which are repetitive routines, tacked into the G-code when it is generated. DeskProto macros may be written in the post processor which is a good place to write although limits where within the G-code the actions will occur: the Program Start or End, FeedRate, Spindle Speed, at tool change. Calling a macro from outside the G-code would be risky as it depends on the computer to find the macro's file, open and read the file and stream the data to the waiting signal generator versus streaming code lines one after another from a single G-code file. FlashCuts signal generator can do subroutine call and return, M98 and M99 within the G-code file. Say you had a toolpath worked out to carve a 3D flower which starts at a point then cuts its way to a finished depth and retracts to the start point. So you have carved the perfume bottle half and now want a strand of flowers. So, you pick start points above the bottle surface where you want the flowers. M98 Pflower is the call to subroutine "flower", G91 (Incremental or Relative mode) to keep the carving relative to the start point, next the G-code to carve the flower until final retract to start point, G90 (Absolute mode), then M99 end of subroutine which sends the program back to execute the next line of G-code following the M98 Pflower call, in this case a move to the next start point and the next M98 Pflower call until each move and each flower is carved. This saves many lines of code. Carving the flowers above the bottle surface first, then machining the bottle surface is also a possibility. You can add many subroutines, suchas a bow, button, and flower. So make a subroutine of 5 flowers, 2 bows, and 2 buttons. A rather complex carving, but easily repeated, thus, fewer codelines, but called and returned over and over. This may be what you asked. I am sure it can be implimented in DeskProto, an already remarkable program. I have not tried subroutines yet, due to summer weather. How would you impliment subroutines? The carvings would be in a catalog, each with an axis which could orient to the surface normal vector at insetion into the main object (perfume bottle's surface). A 5-axis machine required. The carvings could be scaled to size; requires regenerating the G-code at the new scale relative to itself as a finished unit. May need rough and finish toolpath. Lots of small details to resolve makes it complicated, not impossible. Alternatively presently in place of a fully automated process, manually, I would first generate the start points toolpath in DeskProto and generate the G-code, then edit the G-code adding the subroutine call at each point and the subroutine proper of the rotated scaled flower then view the rendered results. Sounds simple enough. I will look into DeskProto's Reference Manual as I vaguely recall either scripting or a process similar to projecting an image or type onto a surface. Cannot promiss anything will come of this however good it seems. Much easier to decorate on a fairly flat surfaced object like the shield. A simple use would be to spot drill through or peck drill into material, a 2D operation. On the Rhino forum the other night, someone was looking for a plug-in to place circles to be drilled to create a picture or likeness from a photo. The drill process is a subroutine at each circle's centerpoint. It is the layout and spacing of holes which is complicated, yet two or three ways were found to fill a surface with spaced circles. The reverse slash does disappears when posted to the website (probably an ascii control character like ESC or Return) and is not the lowercase question mark slash. Users want finished results fast, not a course in how to write software. I would like to see other peoples attempts at post processor goings on. Maybe a contest to reward a good and useful innovation in DeskProto would stimulate interest and participation in developing DeskProto to new levels of creativity. Simply post your solutions in the forum. Pluk |
|
Hi Pluk, This is impressive: very advanced DeskProto use ! Way more advanced then I meant my question about the macros. In fact I had assumed a Macro always to be external code. You are right though: when you paste some lines of code into your NC program as a standard solution for some task, that is of course a macro too. DeskProto will be used without any macros by almost all users (I have to confess that we never use macros): DeskProto will machine even the most complicated geometry using a large number of G1 movements (linear interpolations): not very intelligent, but very effective and easy to use. The process that you describe of editing DeskProto toolpaths in the Bobcad NC-editor is a nice one: we regularly get questions about how to repeat a DeskProto toolpath a number of times: this is a good solution. Does this also work fine for very large NC files (say 50 MB of data or more) ? Lex. |
|
Hi Lex, A 50 MB G-code file is too big for older BobCAD-CAM Version 18 on my Windows 95 computer. Version 23 Mill Pro and Preditor Editor Level 2 will have no issues loading, displaying, and editing a 50MB G-code X,Y,Z file into Version 23 software. (cannot do 5 Axis work). Free video downloads and free trial downloads at bobcad.com Pluk |
|
Hi Lex, A few additions to the postprocessor [StartEnd]: (Flashcut P mm.ppr) (Flashcut P Machine mm.mch) G21 (mm) (G20/G70 inch/min = 0.03937 x mm/min) (G21/G71 mm/min = 25.4 x inch/min) F 406.4 (Default mm/min Feedrate) Tells which postprocessor and which machine were used to generate the G-code file. Conversion factors for Feedrate calculation. The corrected Feedrate. It is also possible to turn on Spindle, Coolant and Light within one M-code which you define in your signal generator's control software; thus, many combinations are available. All useful information, Pluk |
|
Hi Pluk, Useful ideas indeed to fine-tune your own postprocessor, thanks ! One of the idea's on our (very long) list of ideas is to add comments to the postprocessor definition. Then this type of information could be added automatically. A problem still is that not all control software does support comments in the NC file. Still the biggest problem is that there are so many interesting ideas, and there is so little time for development :-( So no promises about when any idea can be added.... Lex. |
|
|
|
page 1 of 3 |
