- Notifications
You must be signed in to change notification settings - Fork1
An Autodesk Fusion post-processor for the CNC-Step HIGH-Z 720T milling machine running the KINETIC-NC software
License
chiefenne/Fusion_360_KINETIC-NC_Post-Processor
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
A modifiedAutodesk Fusion post-processor for theHIGH-Z S-720/T milling machine running theKINETIC-NC software, which both are from CNC-Step (https://www.cnc-step.de).
Autodesk Fusion post-processors are written in JavaScript and the documentation of the existing classes, functions, etc., is described in theAutodesk CAM Post Processor Documentation.
I made some modifications to the post-processor provided by CNC-Step, in order to make it more convenient for my typical operations. Be aware, that the modifications are tested only the KINETIC-NC software and on my personal machine. KINETIC-NC supports an additional set of specific commands which are not part of the RS-274D standard. KINETIC-NC supports also a macro language, which can be used to automate recurring tasks.
Adding/modifying the functionality of the post-processor is convenient when using theVisual Studio Code editor and theAutodesk Fusion Post Processor Utility extension.
Mainly two functions from the post API are employed. The main function needed iswriteln() which comes with the Fusion JavaScript API. The second one iswriteComment() which is a wrapper aroundwriteln() that just adds brackets before and after the text (this is also the comment format understood by KINETIC-NC).
A third function written by myself issafeStartPositionChiefenne(). This is used to go to a "safe" start position. In my setups I have most of the time a situation where my workpiece coordinate system is G54. Further I clamp the stock so that I can safely approach the G54 origin. First I traverse at y=0 along the x-axis (G54 X0), then I move along the y-axis (G54 Y0). The spindel is left at z=0.
- General
- Use the G54 workpiece origin to automate a safe path to the stock (instead of going straight from the machine origin).
- Prompt the user to confirm, while displaying the current G54 offsets in the KINETIC-NC info window.
- How it is done (and when)
- Implemented via subroutine callsafeStartPositionChiefenne()
- Before and after tool change (functiononSection() when tool change is requiredinsertToolCall)
- At program end (functiononClose())
- Jump labels between sections (e.g., 2D adaptive clearing, pockets, etc.)
- Allows to execute individual sections separately
- Repeat / Next within each section
- Allows easily to redo sections multiple times
- Remove entries not understood by KINETIC-NC (works meanwhile, but still is removed to run on older versions)
- Remove% from last line
Adding a section toFUSION_360_KINETIC-NC_HIGH-Z_720T.cps which will always be written to the*.nc file when using this post-processor:
writeln("");writeComment("Safe path to workpiece origin - derived automatically from G54 x-coordinate");writeComment("So we need to switch to G54 before running the program");writeBlock("G54");writeln('PRINT "x-offset = ";#900;" mm"');writeln('PRINT "y-offset = ";#901;" mm"');writeln('PRINT "z-offset = ";#903;" mm"');writeln('ASKBOOL "Continue with offsets?" I=2');writeln("");
writeln("");
Adds an empty line because the string"" is empty.
writeBlock("G54");
In the *.nc file this renders to:.
N10G54
The line numbers (Nxx) are automatically generated when using writeBlock().
writeComment("This is a comment");
Write a comment line into the *.nc file. The result in the file will look like this (the round brackets are added be the functionwriteComment to the text) and KINETIC-NC interprets this as a comment:
(Thisisacomment)
functionsafeHomePositionChiefenne(){// Run tool to safe position (see chiefenne mods function writeProgramHeader)//// machine x,y extent// -----------------------------// | |// | |// | ---------- |// | | stock | |// | | | |// | o--------- |// | |// | |// 0 -------xy------------------//// 0 ... machine zero (G53)// o ... stock zero (G54)// xy ... safe position to move to stock origin (G54)////writeln("");writeComment("Go safe to home position: G28 would go shortest path");writeBlock(gAbsIncModal.format(53),"(machine coordinates)");writeBlock("G0 Z0 (lift spindle)");writeBlock("G0 Y0 (move to Y0 before going to home position)");writeBlock("G0 X0 (move to machine home position)");}
When calling the functionsafeStartPositionChiefenne() in the post processor it renders to the following G-code:
(Movingtoworkpieceorigin)N30G53(machinecoordinates)N35G0Z0(liftspindle)N40G54(workpiececoordinates)N45G1X0F1000(goslowtoworkpieceoriginX)N50G1Y0F1000(goslowtoworkpieceoriginY)
The line numbers (Nxx) are automatically generated when usingwriteBlock().
In the past I added those lines always manually at sevaral positions in the *.nc file in order to move safely to the workpiece without crashing into any clamps. For my typical setups I then just needed to adapt the initial x-coordinate in the initial section.
In order to overcome the manual editing, it is nowautomated based on the settings of G54. This is the workpiece (stock) offset in most of my setups. KINETIC-NC stores the coordinates of the offsets in non-volatile variables (they are saved across sessions even when the machine is off). The offsets for x, y, and z are stored in the variables #900, #901, #902 respectively. These are now used only for printing them to the information window.
I added the funtionsafeStartPositionChiefenne() which moves the spindle automatically according to the G54 offests. This is done before and after each tool change and at program end.
Note
A tool change requires the tool to be measured again. For this I added the G79 command to theM66 macro.So in order for this version of the post-processor to work smoothly you need to update your M66.txt accordingly.
The M66 macro is stored in the following folder on the PC:
C:\ProgramData\KinetiC-NC\macros
Note
"C:\ProgramData" normally is not visible in the Windows explorer (unless otherwise set by the user). So just enter the path as schon in the figure below in Windows explorer.
KINETIC-NC allows skipping portions of the code by using theSKIP command. This comes in handy when in a longer NC program a certain section should be done later again, but some other operations not. In order to support this upfront, the respective code is added by the post-processor as comments, so that it just has to be uncommented when being used.
Note
A label cannot exist on its own unless it has been defined in by the SKIP command before.
Note
Labels need to use other characters than those used in G-code
Following lines show an example of how this is prepared in the G-code by the post-processor:
(Modify SKIP label to jump to the respective section)(To activate, remove the brackets around SKIP and JUMP labels)(Skip label is without : and JUMP label is with :)(SKIP Q0002)(Q0001:)
If needed the code can be activated by editing the code like:
SKIPQ0003...... many code lines....Q0003:
The code between the SKIP command and the label is not executed. The SKIP command is typically used withIF..THEN constructs.
Note
The colon is needed only at the label itself. In the line where the SKIP command is, it is not allowed.
KINETIC-NC allows loops over portions of the G-code. In order to facilitate this feature, theREPEAT andNEXT keywords are automatically inserted close to the top and at the end of each section.
The following code snippet from the thread example file shows this:
(Edit repeat count according to needs)REPEAT=1N1625M9N1635G0X27.95Y12.5N1640G0G43 Z15H13N1645G0 Z5N1650G1 Z-2.5F333.3N1655G1X28.75F1000N1660G3X21.25I-3.75J0N1665G3X28.75I3.75J0N1670G3X27.6126Y15.1901I-3.75J0N1675G1X27.0553Y14.6162N1680G0 Z5N1685G0X40.6Y12.5N1690G1 Z-2.5F333.3N1695G1X41.4F1000N1700G3X38.6I-1.4J0N1705G3X41.4I1.4J0N1710G3X39.2421Y13.6771I-1.4J0N1715G1X39.6752Y13.0045N1720G0 Z15NEXT
Just change the number after theREPEAT keyword from1 to a bigger number and the section should be executed the respective number of times.
To further streamline the FUSION-to-KINETIC-NC workflow, a tool library converter has been developed as well.SeeFUSION to KINETIC-NC tool library converter.
About
An Autodesk Fusion post-processor for the CNC-Step HIGH-Z 720T milling machine running the KINETIC-NC software
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.