CAM Postprocessor Customization: Difference between revisions

From FreeCAD Documentation
(Second level heading, not third level. Also add {{Path Tools navi}} to categorize the page.)
Line 10: Line 10:
}}
}}


===Introduction===
==Introduction==

FreeCAD uses as internal representation for the generated paths, so called G-codes. They can describe such things as: speed and feed rates, stopping the motor etc... But the most important thing is the movements they describe. These movements are rather simple: They can be straight lines or they can be circular arcs. More sophisticated curves such as B-splines are already approximated by FreeCAD's [[Image:Workbench_Path.svg|24px]] [[Path Workbench]].
FreeCAD uses as internal representation for the generated paths, so called G-codes. They can describe such things as: speed and feed rates, stopping the motor etc... But the most important thing is the movements they describe. These movements are rather simple: They can be straight lines or they can be circular arcs. More sophisticated curves such as B-splines are already approximated by FreeCAD's [[Image:Workbench_Path.svg|24px]] [[Path Workbench]].


===What the post processor can do for you===
==What the post processor can do for you==

Many mills use G-codes as well to control the milling process. They may look almost like the internal codes, but there may be some differences:
Many mills use G-codes as well to control the milling process. They may look almost like the internal codes, but there may be some differences:
* the machine can have a special startup sequence
* the machine can have a special startup sequence
Line 25: Line 27:
* You might wish to include a custom header to identify or document the program for future reference.
* You might wish to include a custom header to identify or document the program for future reference.
* ...
* ...




Furthermore there are other languages to control a mill, such as HPGL, DXF, or others.
Furthermore there are other languages to control a mill, such as HPGL, DXF, or others.
Line 32: Line 32:
The post processor is a program which translates the internal codes into a complete file, that can be uploaded to your machine.
The post processor is a program which translates the internal codes into a complete file, that can be uploaded to your machine.


===Preparation for writing your own post processor===
==Preparation for writing your own post processor==

You may start with a very simple model showing how your machine reads straight lines and arcs. Prepare it with any program suitable for your machine.
You may start with a very simple model showing how your machine reads straight lines and arcs. Prepare it with any program suitable for your machine.


Line 45: Line 46:
You can then have a look at the file and compare it to the output of existing post processors such as {{FileName|linux_cnc_post.py}} or {{FileName|grbl_post.py}} and try yourself to adapt them or you upload your to the path forum https://forum.freecadweb.org/viewforum.php?f=15 to get some help.
You can then have a look at the file and compare it to the output of existing post processors such as {{FileName|linux_cnc_post.py}} or {{FileName|grbl_post.py}} and try yourself to adapt them or you upload your to the path forum https://forum.freecadweb.org/viewforum.php?f=15 to get some help.


===Naming convention===
==Naming convention==

For a file format {{FileName|<filename>}} the post processor should get the name {{FileName|<filename>_post.py}}
For a file format {{FileName|<filename>}} the post processor should get the name {{FileName|<filename>_post.py}}


If you are testing, place it in your macro directory. If it functions well, please consider providing it for others to benefit (post it to the FreeCAD Path forum) so that it can be included in the FreeCAD distribution going forward.
If you are testing, place it in your macro directory. If it functions well, please consider providing it for others to benefit (post it to the FreeCAD Path forum) so that it can be included in the FreeCAD distribution going forward.


===Other existing post processors===
==Other existing post processors==

For comparison you may look at the post processors which come with your FreeCAD installation. They are located under the Mod directory in Path/PathScripts/post.
For comparison you may look at the post processors which come with your FreeCAD installation. They are located under the Mod directory in Path/PathScripts/post.


Line 57: Line 60:
* [[Image:Path_PostProcess.svg|24px]] [[Path_Post|Path PostProcess]]
* [[Image:Path_PostProcess.svg|24px]] [[Path_Post|Path PostProcess]]


{{Path Tools navi}}
[[Category:Path]]

{{Userdocnavi}}
{{Userdocnavi}}

Revision as of 02:41, 15 February 2020

This documentation is not finished. Please help and contribute documentation.

GuiCommand model explains how commands should be documented. Browse Category:UnfinishedDocu to see more incomplete pages like this one. See Category:Command Reference for all commands.

See WikiPages to learn about editing the wiki pages, and go to Help FreeCAD to learn about other ways in which you can contribute.

Tutorial
Topic
Path Workbench
Level
Time to complete
Authors
chrisb
FreeCAD version
Example files
See also
None

Introduction

FreeCAD uses as internal representation for the generated paths, so called G-codes. They can describe such things as: speed and feed rates, stopping the motor etc... But the most important thing is the movements they describe. These movements are rather simple: They can be straight lines or they can be circular arcs. More sophisticated curves such as B-splines are already approximated by FreeCAD's Path Workbench.

What the post processor can do for you

Many mills use G-codes as well to control the milling process. They may look almost like the internal codes, but there may be some differences:

  • the machine can have a special startup sequence
  • it can have a special stop sequence
  • arcs can be defined with a relative or an absolute center
  • it may require line numbers in a certain format
  • it can used so called canned cycles for predefined subprocesses such as drilling
  • You might prefer your g-code output in either metric or imperial units.
  • It might be useful to perform a set of moves prior to calling for a tool change to make the action easier for the operator
  • You might wish to include comments for readability or suppress them to keep the program small
  • You might wish to include a custom header to identify or document the program for future reference.
  • ...

Furthermore there are other languages to control a mill, such as HPGL, DXF, or others.

The post processor is a program which translates the internal codes into a complete file, that can be uploaded to your machine.

Preparation for writing your own post processor

You may start with a very simple model showing how your machine reads straight lines and arcs. Prepare it with any program suitable for your machine.

A file for such paths starting at (0,0,0) and going towards Y would be helpful. Make sure it is the tool itself moving along this path, i.e. no tool radius compensation must be applied.

The path in FreeCAD would look like this. Please note the small blue arrow, it indicates the starting direction. For a very first go you may provide only one level in the XY-plane.

You can then have a look at the file and compare it to the output of existing post processors such as linux_cnc_post.py or grbl_post.py and try yourself to adapt them or you upload your to the path forum https://forum.freecadweb.org/viewforum.php?f=15 to get some help.

Naming convention

For a file format <filename> the post processor should get the name <filename>_post.py

If you are testing, place it in your macro directory. If it functions well, please consider providing it for others to benefit (post it to the FreeCAD Path forum) so that it can be included in the FreeCAD distribution going forward.

Other existing post processors

For comparison you may look at the post processors which come with your FreeCAD installation. They are located under the Mod directory in Path/PathScripts/post.

Related