Extended Markers: Difference between revisions

From Compost Wiki
Jump to navigation Jump to search
Dannym (talk | contribs)
Dannym (talk | contribs)
 
(4 intermediate revisions by one other user not shown)
Line 48: Line 48:
== Marker Types==
== Marker Types==
Each marker type is implemented in one of two ways. Markers are either supported as new feature types, or as attributes on existing features. The implementation of the markers depends on how the marker is intended to work in the program, and how it affects the features around it. All markers will "split" a feature when they are not placed on a start or end point.
Each marker type is implemented in one of two ways. Markers are either supported as new feature types, or as attributes on existing features. The implementation of the markers depends on how the marker is intended to work in the program, and how it affects the features around it. All markers will "split" a feature when they are not placed on a start or end point.
Tool offset change, CRC change, spindle speed change, and other markers are applied following the marker.


== Feature Based Markers ==
== Feature Based Markers ==
Line 79: Line 81:
The prog stop marker will generate a new feature that will cause the [[ProgStopFeat|ProgStopFeat?]] boolean to return true. This feature should be output on a line by itself by the post processor, and '''the post must not output any additional tool path or clearance moves'''. It is assumed that the customer will place these markers in the appropriate place in the tool path for his needs (e.g. on embedded retracts). The addition of moves by the post processor will prevent the program from being properly simulated.
The prog stop marker will generate a new feature that will cause the [[ProgStopFeat|ProgStopFeat?]] boolean to return true. This feature should be output on a line by itself by the post processor, and '''the post must not output any additional tool path or clearance moves'''. It is assumed that the customer will place these markers in the appropriate place in the tool path for his needs (e.g. on embedded retracts). The addition of moves by the post processor will prevent the program from being properly simulated.


The existing [[OptionalStops%3F|OptionalStops?]] is used to test the type of stop.
The existing [[OptionalStops|OptionalStops?]] is used to test the type of stop.


Example:
Example:
Line 93: Line 95:


===Dwell Marker===
===Dwell Marker===
The dwell marker will generate a new feature that will cause the [[DwellFeat?|DwellFeat?]] boolean to return true. This feature should be output on a line by itself by the post processor. Dwell features have been supported for some time in a number of operation types (mostly turning ops, and expanded drill cycles), and the same commands that were used in the past are used to support the markers, including [[Dwell#]] and [[DwellRevs#]].  
The dwell marker will generate a new feature that will cause the [[DwellFeat|DwellFeat?]] boolean to return true. This feature should be output on a line by itself by the post processor. Dwell features have been supported for some time in a number of operation types (mostly turning ops, and expanded drill cycles), and the same commands that were used in the past are used to support the markers, including [[Dwell#]] and [[DwellRevs#]].  


Example:
Example:
Line 122: Line 124:


=== CRC Markers ===
=== CRC Markers ===
CRC markers are supported using the standard [[CRCOffsetC]] commands as well as the [[CRCC]] command. These commands are simply added in place of the '''chkCRC''' and '''chkCRCNum''' prog subs that are normally called on each feature. Post processors that are unable to call the standard CRC commands can use the booleans [[CRCChange?]], [[CRCLeft?]], [[CRCRight?]], and [[CRCOff?]] to know when to output the required CRC commands. The CRC marker can only change the CRC on/off state and the Left/Right state; it can not change the CRC offset number.
CRC markers are supported using the standard [[CRCOffsetC]] commands as well as the [[CRCC]] command. These commands are simply added in place of the '''chkCRC''' and '''chkCRCNum''' prog subs that are normally called on each feature. Post processors that are unable to call the standard CRC commands can use the booleans [[CRCChange|CRCChange?]], [[CRCLeft]]?, [[CRCRight]]?, and [[CRCOff]]? to know when to output the required CRC commands. The CRC marker can only change the CRC on/off state and the Left/Right state; it can not change the CRC offset number.


Example:
Example:

Latest revision as of 23:01, 1 July 2015

NOTE

Please note that this is preliminary documentation for a feature that is under development. Aspects of this feature or it's posting implementation may change during development and testing.


Overview

Extended markers were added to GibbsCAM for version 9.0. They allow the user a greater level of control over the program by allowing them to optimize not only the feedrates of a tool path but many other aspects, including;

  • Feedrates
  • Spindle Speed
  • Tool Offset
  • Cutter Radius Compensation
  • Dwells
  • Tool Sub-Position
  • Text Comments
  • Prog Stop

This is all in addition to the existing feedrate marker.

Post Support

There are 2 levels of post support for markers: Legacy, and Full support.

Legacy

Legacy post will only support 2 marker types, CRC and Feedrates.

Feedrate support has been included in post processors since the .82 format from the mid 1990's.

The post engine will automatically support feedrate markers by overriding the standard behavior of the CRCOn and CRCOff commands.

This will allow some marker support in the majority of the existing posts. There are posts that will not "pick up" the marker support and that is a known issue. They will have to be upgraded as needed.

Full Marker Support

To fully support markers a post processor must be upgraded. Upgraded posts fully support all marker types that are valid for the machine type for toolpaths that are processed with an EachFeature / NextFeature loop. Toolpaths that do not use the standard compost loops ( such as 4AS and 5AS ) can not support markers.

Upgrade

Upgrading a post to full marker support is a moderately trivial task, and simply requires a few changes to the post.

Compost Flag

In order to have the post engine send all marker types to the post processor, the form must be flagged as supporting the markers. This is an option in Compost3 1.3.3 or later, under the Flags item in the Advanced menu.

When this item is checked, the post engine will send all possible markers to the post processor as part of the toolpath (EachFeat/NextFeat loop ).

Toolpath

The first thing to do when upgrading a post is to ensure that the toolpath loop does not make any assumptions about what type of feature it is on. Some older posts will simply have an "else" case at the end of the feature tests, and assume that the feature is an arc or a point. This will cause problems if the extended marker features are passed to the post and it attempts to treat them as the wrong kind of feature. This can be solved by ensuring that every feature type has it's own corresponding IF test, and that the final ELSE case is left empty. Advanced marker support is best supported by posts that have been upgraded to the current Master Post for the machine type.

Marker Types

Each marker type is implemented in one of two ways. Markers are either supported as new feature types, or as attributes on existing features. The implementation of the markers depends on how the marker is intended to work in the program, and how it affects the features around it. All markers will "split" a feature when they are not placed on a start or end point.

Tool offset change, CRC change, spindle speed change, and other markers are applied following the marker.

Feature Based Markers

Markers that are implemented as new feature types all include a new Feat? boolean. These markers are assumed to be placed on lines by themselves and are assumed to take place instantly, and do not affect the state of any features before or after the marker. If a particular control does not support a specific marker (which is common with markers like tool sub position) then the post can simply skip the feature.

Text Comment Marker

The text comment marker will generate a feature that will cause the CommentFeat? boolean to return true. The text comment may include more than one line, so the post processor must execute an EachCommentFeatLine / NextCommentFeatLine loop. Inside this loop, the command CommentFeatLine$ is called to output the code for each line.

Example:

 IF CommentFeat?
   EachCommentFeatLine
     SeqC '(' CommentFeatLine$ ')' EOL
   NextCommentFeatLine
 END

The post engine will not do any processing or verification of any of the contents of the Comment Marker, it is simply output. No post script, or special command parsing of the text is provided.

Tool Sub Position Marker

The Tool SubPos marker will generate a new feature that will cause the ToolSubPosFeat? boolean to return true. This feature should be output on a line by itself by the post processor, and the post must not output any additional tool path or clearance moves. It is assumed that the customer will place these markers in the appropriate place in the tool path for his needs (e.g. on embedded retracts). The addition of moves by the post processor will prevent the program from being properly simulated.

The sub position command ToolSubPosition# is used to get the new sub position.

Example:

 IF ToolSubPosFeat?
     SeqC 'M19' 'S' ToolSubPosition# EOL
 END

The command TLToolSubPosition# is not used by this feature. The command ToolSubPosChange? has been updated to check the last marker used by the previous operation and will work as expected.

Program Stop Marker

The prog stop marker will generate a new feature that will cause the ProgStopFeat? boolean to return true. This feature should be output on a line by itself by the post processor, and the post must not output any additional tool path or clearance moves. It is assumed that the customer will place these markers in the appropriate place in the tool path for his needs (e.g. on embedded retracts). The addition of moves by the post processor will prevent the program from being properly simulated.

The existing OptionalStops? is used to test the type of stop.

Example:

 IF ProgStopFeat?
     SeqC
     IF OptionalStops?
       'M1'
     ELSE
       'M0'
     END
     EOL
 END

Dwell Marker

The dwell marker will generate a new feature that will cause the DwellFeat? boolean to return true. This feature should be output on a line by itself by the post processor. Dwell features have been supported for some time in a number of operation types (mostly turning ops, and expanded drill cycles), and the same commands that were used in the past are used to support the markers, including Dwell# and DwellRevs#.

Example:

 IF DwellFeat?
     SeqC 'G4 X' Dwell# EOL
 END

Attribute Based Markers

Markers that are implemented as new attributes on existing features each have a new boolean command associated with them, which must be called on every feature if the marker is to be supported. The control of where the marker is to be placed is now up to the user or the toolpath generator, not the post. While Attribute Based Markers will split the feature the marker was added to, the marker itself does not add a feature. These markers simply add a new state to the following split feature. For example, a FeedRate marker that is added to a line feature will split the feature, creating 2 line features: one before the marker, and one after the marker. The line feature after the marker will have the updated FeedRate information as a new state (or attribute) on that feature that the FeedRateC command will pick up and output.

Feedrate Markers

Feedrate makers are supported using the standard FeedRate commands. The conditional FeedRateC is simply called on every feature. This is currently supported in nearly every post. No additional change is needed.

Example:

 SeqC FeedC CRCC MoveXYZABCC FeedrateC SpeedC CRCOffsetC ToolOffsetC EOL

Spindle Speed Markers

Speed markers are supported using the standard Speed commands. The conditional SpeedC is simply called for every feature. This is not supported by most posts and must be added in a similar way to the existing feedrate commands.

Example:

 SeqC FeedC CRCC MoveXYZABCC FeedrateC SpeedC CRCOffsetC ToolOffsetC EOL

Tool Offset Change Markers

Offset change markers are supported using the standard ToolOffset# commands. The conditional ToolOffsetC command is simply called for every feature. This is not supported by most posts and must be added in a similar way to the existing CRC commands. Posts that are unable to use the Fanuc style commands can call the ToolOffsetChange? to be notified when the change happens.

Example:

 SeqC FeedC CRCC MoveXYZABCC FeedrateC SpeedC CRCOffsetC ToolOffsetC EOL

CRC Markers

CRC markers are supported using the standard CRCOffsetC commands as well as the CRCC command. These commands are simply added in place of the chkCRC and chkCRCNum prog subs that are normally called on each feature. Post processors that are unable to call the standard CRC commands can use the booleans CRCChange?, CRCLeft?, CRCRight?, and CRCOff? to know when to output the required CRC commands. The CRC marker can only change the CRC on/off state and the Left/Right state; it can not change the CRC offset number.

Example:

 SeqC FeedC CRCC MoveXYZABCC FeedrateC SpeedC CRCOffsetC ToolOffsetC EOL

Mode Note

By default the command CRCOffsetC will only output the CRC Offset number the first time CRC is turned on during an operation. Subsequent CRC On states will not trigger any output. If the post requires that the CRC offset be restated on each CRC On, it can call ForceCRCOffset to cause the output of the offset each time. The command ForceCRCOffsetF will cancel this mode.

Legacy Note

The existing command CRCOnC will internaly call the CRCC command, and output any needed CRC on or off codes in the toolpath. This is to allow marker support in older posts. Even though the commands will be internally identical, new posts should be writen to call CRCC for readability, as it may seem odd to some post developers that a command named CRCOnC can output a CRC Off code.

Sample Upgrades

Upgrading a post is very easy. Samples are provided in the Post Subversion Repository under the /masters/markers/ folder.

Mill Upgrade

The upgrade of a .19 mill post is as follows.

1) Find the following;

 IF ArcFeat?
   tpArcFeat
 END

and replace it with;

IF ArcFeat?
  tpArcFeat
ELSE
 tpMarkerFeat
END

2) Add the following above the toolpath: sub;

 tpCommentfeat:
   EachCommentFeatLine
     '(' CommentFeatLine$ ')' EOL
   NextCommentFeatLine
 RETURN
 tpDwellFeat:
   SeqC 'G4 X' Dwell# EOL
 RETURN
 tpProgStopFeat:
   SeqC
   IF OptionalStops?
     'M1'
   ELSE
     'M0'
   END
   EOL
 RETURN
 tpMarkerFeat:
   IF CommentFeat?
     tpCommentFeat
   ELSE
     IF DwellFeat?
       tpDwellFeat
     ELSE
       IF ProgStopFeat?
         tpProgStopFeat
       END
     END
   END
 RETURN

3) In the tpArcFeat: sub;

 * Add CRCC after doAbsOrInc
 * Add SpeedC CRCOffsetC ToolOffsetC after ArcFeedC

4) In the tpLineFeat: and tpRapidFeat: subs;

 * ReplaceckCRC withCRCC
 * ReplaceckCRCNum with SpeedC CRCOffsetC ToolOffsetC

5) Remove the subs ckCRC and ckCRCNum;

6) Check the marker support checkbox in compost and compile.

LatheUpgrade

The upgrade of a .18 lathepost is as follows.

1) Add CRCOffC to the subs endOp1, sameToolOp1,newToolOp1 and before the exit moves.

2) Find the following;

 IF ThreadFeat?
   tpThreadFeat
 END

and replace it with;

IF ThreadFeat?
  tpThreadFeat
ELSE
 tpMarkerFeat
END

3) Add the following above the toolpath: sub;

 tpCommentfeat:
   EachCommentFeatLine
     '(' CommentFeatLine$ ')' EOL
   NextCommentFeatLine
 RETURN
 tpDwellFeat:
   SeqC 'G4 X' Dwell# EOL
 RETURN
 tpProgStopFeat:
   SeqC
   IF OptionalStops?
     'M1'
   ELSE
     'M0'
   END
   EOL
 RETURN
 tpSubPosFeat:
   SeqC 'M19' 'S' ToolSubPosition# EOL
 RETURN
 tpMarkerFeat:
   IF CommentFeat?
     tpCommentFeat
   ELSE
     IF DwellFeat?
       tpDwellFeat
     ELSE
       IF ProgStopFeat?
         tpProgStopFeat
       ELSE
         IF ToolSubPosFeat?
           tpSubPosFeat
         END
       END
     END
   END
 RETURN

4) In the tpArcFeat: sub;

 * Add CRCC before the arc direction codes.
 * Add SpeedC ToolOffsetC after FeedRateC

5) In the tpLineFeat: and tpRapidFeat: subs;

 * Replace ckCRC with CRCC
 * Add SpeedC ToolOffsetC to the end of the movement lines.

6) Remove the sub ckCRC;

7) Check the marker support checkbox in compost and compile.