Skip to content

Path Python Feature Details

Yorik van Havre edited this page Feb 15, 2015 · 13 revisions

Basic Operations

Common Options

Path Profile

A profile follows the boundaries of solid or a feature on a solid (eg a hole). The cutter moves to depth and then follows the edge at the radius of the cutter.

If the material cannot be cut in a single pass, a 'step-down' value indicates how far down the cutter descends on each pass until the final depth is reached.

A vertical feed rate indicates how fast the cutter plunges into the material

A horizontal feed rate indicates how fast the cutter moves forward.

The speed that the cutter spins at is called 'spindle speed'. The spindle can turn in either a forward or reverse direction. This can be represented as either two properties (speed and direction) or as a single float ranging from -n to +n.

The direction that the cutter travels interacts with the direction it rotates. This is referred to as "climb" vs "conventional/standard" milling. The user should specify which method they prefer and the dirction of travel should be inferred.

Finishing Pass. Often a user will prefer to have numerous step-downs to rough-cut the profile and leave a small amount of material behind. A finishing pass is then done at full depth to remove the remaining material and produce a better surface finish. The user should be able to indicate that a finishing pass is desired and the amount of extra material to leave behind on the non-finishing passes.

Path Pocket

Unlike a profile, a pocket uses the boundaries of a part feature to indicate the area to be cleared.

Just like a profile, the user will expect to set certain option to control details of the operation:

  • The cutter may need to 'step down' a small amount on each pass until reaching the final depth.
  • spindle speed & direction
  • vertical and horizontal feed rates
  • climb/conventional milling mode.

Specific to pocketing: An area can be cleared in many different ways. The specific patterns and required properties is an area where extensive future development can be expected.

Unless the pocket is being cleared in very soft material, the user will not want 100% of the cutter to be clearing material. Like 'step-down' the user will want to specify 'Step-over'. The can be expressed as either an absolute value or as a percentage of the cutter diameter.

Drilling

Drilling is a relatively simple operation but has some options the user will expect to set.

Like other operations, the user will want expect to set:

  • The safe-height for traveling between drilling location.
  • The spindle speed and direction.
  • The vertical feed rate.
  • The tool to use.

Specific to drilling, the user will want to indicate:

  • The start depth of the drilling feed move.
  • The final depth of the drilling operation.
  • The 'peck depth' This is similar to a step-down. It is the distance to feed the drill before retracting to clear chips from the hole.
  • The retract height.
  • The dwell time. This is the time to dwell at the end of each feed cycle before retracting.
  • A boolean value to indicate whether coolant should be turned on.
  • A boolean value to indicate whether to retract at feed speed or rapid speed.

Path representation:

G81 (simple drill):

G81 X2 Y3 Z1 R5

is the same as:

G0 X2 Y2
G0 Z5
G1 Z1
G0 Z5

G83 (chip-breaking)

G83 X2 Y2 Z-1 R10 Q2

is the same as:

G0 X2 Y2
G0 Z10
G1 Z8
G0 Z10
G1 Z6
G0 Z10
G1 Z4
G0 Z10
G1 Z2
G0 Z10
G1 Z0
G0 Z10
G1 Z-1
G0 Z10

Fixture Part Offsets

Fixtures are material holding systems on a machine. The fixture location is highly accurate within the machine's global coordinate system and highly repeatable so it can be removed and replaced accurately.

Fixture Offsets create a local coordinate system related to the fixture. When specified within a CAM program, 0,0,0 for the fixture offset becomes 0,0,0 for the part and all moves are relative to that.

The desire to use offsets like this is universal but not all machine controllers handle offsets natively. A couple machine controller examples:

  • LinuxCNC: preceding a block of commands with a fixture offset command like "G55" will cause all the following commands to be interepreted within the G55 coordinate system.

  • ShopBot: Does not have the idea of fixtures. Instead, a user can write a subroutine program that loads, jogs the machine to a set of predetermined coordinates and then "touches off" to that position, then continues with the main program. This is only possible because the opensbp format allows one program to open another program.

  • GRBL: GRBL receives gcode streamed from another computer via a serial line. Newer versions support fixture offsets like linuxcnc but older versions didn't. Thus the move commands would have to be calculated for each offsets by the CAM application.

Within the FreeCAD path system, the user should be able to select a path or compound and "attach" to it one or more fixture offsets. Each fixture offset should have at least the following properties:

  • Label: The user readable name of the vise or fixture. The can be sent via a commment to the post processor.
  • Name: The command that will be sent to the post processor to activate the fixture offset. "G54", "G55", etc.
  • Offset vector: The coordinates of the fixture offset origin. In cases where Path or the post processor is calculating the offsets, this can be used. (Do we want to support this??). Otherwise, it can be used to visualize the real path in the machine coordinate space.

USE CASE: The user has two vises. In vise A the part is mounted with the part top facing up and operation "1" will be done on it. In vise B, the part is mounted with part top facing down and operation "2" will be done on it. The workflow is to load a part blank in both vises, run the complete job. Switch the parts, run again. Lather, rinse, repeat. The project might look like this:

USE CASE: The user has two vises. He wants to make two copies of the same part and run the machine longer without human intervention. Operation 1 will be done on both vises, the tool will be changed, then operation 2 will be done on both vises. The project might look like this:

#User Preferences Most users will only have access to one or two machines but will be setting up many different projects for them. Getting correct path data for the machine is critical but the proper properties appear in many places of the path module and workflow. Storing and reusing user preferences correctly will reduce work to create a new project and avoid costly errors.

##General preferences These are specific preferences about how FreeCAD behaves regardless of which machine the user is intending a project for.

##Work Centers Here a user would set up the specific machines he will be working with. I used the word 'work center' instead of 'machine' since each entry might represent a semi-permanent configuration of the same machine. For example, a mill with a specific configuration of vises.

QT Mock Dialogs

Future enhancement ideas.

Project properties

If a part has material data associated with it, it should be possible to pre-populate a machining operation with reasonable feed/speed data. No single algorithm will generate correct values in all cases, but reasonable defaults are better than nothing and also better than re-using the last values entered by the user. Issue #8

Array of parts

User describes the geometry and work operations for a single part but wants to cut multiple copies from the same piece of stock. The system can help the user by selecting the number of copies in X and Y direction. Issue #22

Automatic nesting

When cutting multiple parts or multiple copies of the same part, the system should help the user by nesting parts for optimum use of raw material.

Note This is really a hard and complex matter, and I don't think we can solve it without finding a library able to calculate such nesting.

Interface and interaction with machine control software

Actual control of the CNC machine is and always will be out of scope. Some interaction with the control software is, however, possible with existing interfaces if applications are on the same machine or network accessible. A button in the GUI that opens LinuxCNC and passes the generated gcode is one example. Automatic synchronization of tool table data is another.

Note This might be trickier and in any case can probably only be done by someone who has access to such a controller...