Biomimetics and Dextrous Manipulation Lab

GeneratingMicromachiningToolpaths

Categories: AdhesiveManufacturing

On this page... (hide)

  1.   1.  Toolpath Generation Script
    1.   1.1  Format
    2.   1.2  Examples
  2.   2.  Indenting Functions
    1.   2.1  beginprogram
    2.   2.2  cleanblade
    3.   2.3  dwell
    4.   2.4  endprogram
    5.   2.5  indentpattern
    6.   2.6  linearmove
    7.   2.7  move
    8.   2.8  newline
    9.   2.9  optionalstop
    10.   2.10  planesurface
    11.   2.11  rapidmove
    12.   2.12  requiredstop
    13.   2.13  setfeed
  3.   3.  Profile Definitions
    1.   3.1  Format
    2.   3.2  Examples
  4.   4.  Visualization

overview paragraph

folder structure notes

1.  Toolpath Generation Script

1.1  Format

1.2  Examples

SampleIndent Base

directmetal_r2

2.  Indenting Functions

2.1  beginprogram

Description

beginprogram opens a file in text mode for writing, and writes the boilerplate G-code used for initializing the CNC machine. The file is defined as a global variable, so that subsequent calls to functions generating G-code don't need to keep passing the file handle.

Parameters

NameTypeComment
numberintegerHaas program number; should be five digits including leading zeros.
namestringBare filename; extension will be automatically added.
offsetstringWork offset to use, e.g. G154 P57.
descriptionstringProgram comment; will appear at top of file.

Options

None.

2.2  cleanblade

Description

cleanblade generates G-code that will wipe the blade clean using the brush on the block machining pallet. Requries a work coordinate system to be defined for the location of the cleaning brush.

Parameters

NameTypeComment
machiningOffsetstringWork offset to use for machining, e.g. G154 P57.
cleaningOffsetstringWork offset to use for cleaning, e.g. G154 P56.
varargincell arraykey-value pairs for optional parameters.

Options

NameTypeDefaultComment
movefeedfloat50Feedrate in IPM for non-cleaning motions.
cleanfeedfloat25Feedrate in IPM for cleaning motions.
bladelengthfloat3Length of blade in inches.
extrafloat0.8Additional distance in inches to feed when cleaning to clear brushes with back of blade.
xclearfloat-0.25X-coordinate in machining WCS to move to prior to move to Z-clear plane in cleaning WCS.
repeatsint1Number of cleaning passes over blade.

2.3  dwell

Description

dwell Writes the G-code for a dwell; for short dwell times, this is used to force the machine to exactly hit commanded coordinates without smoothing the corner.

Parameters

NameTypeComment
dwelltimefloatTime to dwell, in seconds.

Options

None.

2.4  endprogram

Description

endprogram writes G-code to return the machine to the home position, and then ends the program. This function will print an estimate of the time required for machining, and close the text file.

Parameters

None.

Options

None.

2.5  indentpattern

Description

endprogram writes G-code to return the machine to the home position, and then ends the program. This function will print an estimate of the time required for machining, and close the text file.

Parameters

NameTypeDefaultComment
xlength 0.0024Total length of pattern (inches)
xspace   
zdepth   
indentangle   
indentspeed 2Feed during indenting and retracting (inches/minute)
dwelltime 0.02Time to pause at the bottom and top of each indentation (seconds)
dechiplength   
retractangle   
zdechipheight   
zmoldsurface   
requiredstopboolfalseIf true, places a required stop at the end of the pattern, if false, places optional stop

Options

None.

2.6  linearmove

Description

linearmove generates G-code to linearly move to the specified coordinates in the current work coordinate system. This will use a G01 command at the current programmed feedrate. Internally uses move to calculate which if any of the axes to move.

Parameters

NameTypeComment
xfloatDestination X-coordinate in current coordinate system.
yfloatDestination Y-coordinate in current coordinate system.
zfloatDestination Z-coordinate in current coordinate system.

Options

None.

2.7  move

Description

move is called by linearmove and rapidmove, and computes which if any of the coordinates have changed. The function returns the calculated distance of the move, and a string of coordinates.

Parameters

NameTypeComment
xfloatDestination X-coordinate in current coordinate system.
yfloatDestination Y-coordinate in current coordinate system.
zfloatDestination Z-coordinate in current coordinate system.

Options

None.

2.8  newline

Description

newline is a utility function to generate a newline in the output G-code. This is also used to end G-code blocks.

Parameters

None.

Options

None.

2.9  optionalstop

Description

optionalstop generates G-code for an optional program stop. This will pause execution of the G-code if the optional stop switch is active until CYCLE START is pressed.

Parameters

None.

Options

None.

2.10  planesurface

Description

planesurface generates G-code that performs an orthogonal machining operation to plane an area flat. Unmatched options will be passed through to cleanblade if blade cleaning is enabled.

Parameters

NameTypeComment
varargincell arraykey-value list of options.

Options

NameTypeDefaultComment
xlengthfloat1.0Total length in inches to plane.
zdepthfloat0.00Depth in inches below mold surface to perform the planing operation at.
indentanglefloat48Angle of indent trajectory measured counterclockwise from the +x direction.
speedfloat2.0Feed in IPM for planing operations.
dechiplengthfloat0.0400Distance to move in the x direction for dechipping trajectory.
retractanglefloat60Angle of retract trajectory measured counterclockwise from the +x direction.
zdechipheightfloat0.0008Height above the mold surface for dechipping.
zmoldsurfacefloat0.00Z location in inches of the mold surface in the machining work coordinate system.
requiredstopbooleanfalseIf true, changes optional stops after operation to required stops.
cleanbladebooleanfalseIf true, adds a blade cleaning cycle after the planing operation.
machiningOffsetstringemptyMust be specified if cleanblade is true. Work offset to use for machining, e.g. G154 P57.
cleaningOffsetstringemptyMust be specified if cleanblade is true. Work offset to use for cleaning, e.g. G154 P56.

2.11  rapidmove

Description

rapidmove generates G-code to linearly move to the specified coordinates in the current work coordinate system. This will use a G00 command at the current rapid feedrate. This is not guaranteed to move in a straight line to the target position. Internally uses move to calculate which if any of the axes to move.

Parameters

NameTypeComment
xfloatDestination X-coordinate in current coordinate system.
yfloatDestination Y-coordinate in current coordinate system.
zfloatDestination Z-coordinate in current coordinate system.

Options

None.

2.12  requiredstop

Description

requiredstop generates G-code for a required program stop. This will pause execution of the G-code until CYCLE START is pressed.

Parameters

None.

Options

None.

2.13  setfeed

Description

setfeed generates G-code to set the active feedrate for all G01 commands.

Parameters

None.

Options

None.

3.  Profile Definitions

note: "unique" folder contains features that are not intended to be patterned, but machined once each.

3.1  Format

3.2  Examples

BaseProfile

Options

backwardsPRofilewrapper

Options

4.  Visualization

plottrajectory, both for .nc files and for toolpaths

Page last modified on April 18, 2024, at 11:14 AM