V13 Spindle Control: Difference between revisions

From Compost Wiki
Jump to navigation Jump to search
Danm (talk | contribs)
Broaching stuff doesn't belong here.
Danm (talk | contribs)
Updates for v13.0.2
Line 7: Line 7:


==New Compost Options==
==New Compost Options==
===Toolgroups and Part Stations Turning tab===
===Toolgroups and Part Stations Spindle Options tab===
[[Image:Turning_Options_4.4.6.3.png|none]]
[[Image:SpindleOptionsTab.png|none]]
====Turn CSS On with spindle====
====Turn CSS On with spindle====
* When unchecked, the spindle will be turned on with the Fixed RPM command, and then switched to CSS once it goes on part.
* When unchecked, the spindle will be turned on with the Fixed RPM command, and then switched to CSS once the tool goes on part. This will usually occur in Toolpath, before the first move.
* When checked, the spindle will be turned on with the CSS command with an SFPM.
* When checked, the spindle will be turned on with the CSS command with an SFPM.
====CSS Off dropdown====
====CSS Off dropdown====
* Normal (CP3) will switch from CSS to Fixed RPM at CP3 in the retract loop.
* '''Normal (CP3)''' will switch from CSS to Fixed RPM at CP3 in the retract loop.
* Off Part Only will only switch CSS off at CP3 if the retract loop is going off part.
* '''Off Part Only''' will switch CSS off at CP3 if the retract loop is going off part.
* Never will never switch CSS off during retract.
* '''Never''' will never switch CSS off during retract.
====Unconditional Spindle Commands====
====Unconditional Spindle Commands====
* When checked, the spindle commands listed below will always output when called.
* When checked, the spindle commands listed below will always output when called.
* When unchecked, the spindle commands will output conditionality, based on logic used in some .65 posts.
* When unchecked, the spindle commands will output conditionality.
====Part Station/Tool Group Activate Event Conditions====
* '''On state change''' will only output the spindle state in the Approach loop when the current ops' spindle states are different from the previous ops' end state.
* '''State change and off part''' will output the spindle state in the Approach loop when the current ops' spindle state is different from the previous ops' end state, AND when [[PreviousInterOpOffPart]]? would return TRUE.
* '''Every op that uses the spindle''' will output the spindle state in the Approach loop on every op.


==New MDD Options==
==New MDD Options==
[[Image:MDD_SpindleStateOptions_12.8.30.png|none]]
[[Image:SpindleStateOptions.png|none]]
===SpindleStateOptions dialog===
===SpindleStateOptions dialog===
====Tool Group Spindles====
====Tool Group Spindles====
Line 33: Line 37:
* On at Op Start - Turn on the Part Station spindles at the OpStart event.
* On at Op Start - Turn on the Part Station spindles at the OpStart event.
* On at Entry Clearance - Turn on the Part Station spindles at CP1.
* On at Entry Clearance - Turn on the Part Station spindles at CP1.
==Errata==
* [[PartSpindleSpeedType]] is never conditional, regardless of the setting in the Spindle Options dialog.
* For turning canned cycles, the CSS On command can occur during Toolpath, which would result in the G96 being output during the canned path, which is clearly undesirable. Therefore, logic needs to be added to manually output the G96 command before the canned cycle line, and manually turned back off again after the end of the cycle. For example:
<nowiki>
ckCannedCycleCSS:
IF ConstantSurfaceSpeed? AND (NOT PartSpindleCSSActive? OR PartSpindleSFPMChanged?)
SeqLabC 'G96' 'S' Output('S', PartSpindleSFPM#) EOL
SetFlag('ManualCannedCSSOn')
END
RETURN
{ *** Change this sub if you change the Form setting for when CSS is cancelled *** }
ckCancelCannedCycleCSS:
IF Flag?('ManualCannedCSSOn')
SeqLabC 'G97' 'S' Output('S', CalcRPM2#) EOL
SetFlagF('ManualCannedCSSOn')
END
RETURN
latheCannedCycleCore:
ckCannedCycleCSS
IF CannedCycle?
IF Roughing?
turnRoughOp
ELSEIF Threading?
turnThreadOp
ELSEIF Drilling?
turnDrillOp
END
ELSE
IF PeckGrooving? AND PreferCan?
turnPeckGrooveOp
ELSEIF Threading?
turnG33ThreadOp
END
IF Drilling? AND Tap? AND SpindleControl?
SeqLabC PartSpindleOff EOL
SeqLabC PartSpindleSpeed PartSpindleOn EOL
END
END
ckCancelCannedCycleCSS
RETURN
</nowiki>


==Prog Commands==
==Prog Commands==
Line 70: Line 118:
===Sample subroutine to handle Part Spindle output on a lathe===
===Sample subroutine to handle Part Spindle output on a lathe===
  <nowiki>
  <nowiki>
IF ActivatePartSpindle? OR DeactivatePartSpindle?
doPartSpindleTypeC:
  IF PartSpindleDirChanged? OR PartSpindleRPMChanged? OR
IF PartSpeedTypeChange? OR Flag?('PartSpeedTypeInvalidated')
      PartSpindleSFPMChanged? OR PartSpeedTypeChange?
InvalidatePartSpindleSpeed
    IF FirstPartSpindleActivateOfOp?
SetFlagF('PartSpeedTypeInvalidated')
      IF ConstantSurfaceSpeed?
PartSpindleSpeedType
        SeqLabC Preset MaxRPM EOL
END
      END
RETURN
      SeqLabC PartSpindleSpeedType PartSpindleSpeed PartSpindleOn EOL
 
    ELSE
doInvalidatePartSpindleType:
      SeqLabC
SetFlag('PartSpeedTypeInvalidated')
      IF PartSpindleOff? AND PartSpindleDirChanged?
RETURN
        PartSpindleOff
 
      ELSE
handlePartSpindleChange:
        IF PartSpeedTypeChange?
{Need to skip part spindle changes during toolpath for canned cycles.}
          PartSpeedType
IF (ApproachFeat? OR RetractFeat?) OR (NOT thisOpLatheCannedCycle?)
        END
IF (FirstPartSpindleActivateOfOp? OR PartSpeedTypeChange?) AND ApproachFeat?
        PartSpindleSpeed
IF ConstantSurfaceSpeed?
          IF PartSpindleDirChanged?
SeqLabC Preset MaxRPM EOL
            PartSpindleOn
END
          END
doInvalidatePartSpindleType InvalidatePartSpindle InvalidatePartSpindleSpeed
        END
END
      EOL
    END
IF PartSpindleOff?
  END
SeqLabC PartSpindleOff EOL
END
END
 
SeqLabC doPartSpindleTypeC PartSpindleSpeed PartSpindleOn EOL
END
RETURN
</nowiki>
</nowiki>


[[Category:Articles]]
[[Category:Articles]]
[[Category:GibbsCAM v13]]
[[Category:GibbsCAM v13]]

Revision as of 22:22, 8 March 2019

Overview

GibbsCAM v13 12.8.28 and Compost4 4.4.6.3 introduce new features for handling the output of spindle control codes. These features were largely necessitated by the addition of Fully Oriented operation types, such as broaching and Elliptical Turning. This means that, for the first time in GibbsCAM history, a user can program an operation with neither the part spindle nor the tool spindle turning.

The configuration for these spindle changes is split between the MDD, the Form, and the Prog. The MDD controls when the spindles are turned on, and the Form and Prog control when the spindles are stopped, when CSS is activated and deactivated on a lathe, and format the actual G-codes used for these options.

Additionally, there is the potential for future versions of GibbsCAM to support operations with both part and tool spindle spinning, such as for gear hobbing. Master post developers should consider this possibility in order to ensure a flexible post design.

New Compost Options

Toolgroups and Part Stations Spindle Options tab

Turn CSS On with spindle

  • When unchecked, the spindle will be turned on with the Fixed RPM command, and then switched to CSS once the tool goes on part. This will usually occur in Toolpath, before the first move.
  • When checked, the spindle will be turned on with the CSS command with an SFPM.

CSS Off dropdown

  • Normal (CP3) will switch from CSS to Fixed RPM at CP3 in the retract loop.
  • Off Part Only will switch CSS off at CP3 if the retract loop is going off part.
  • Never will never switch CSS off during retract.

Unconditional Spindle Commands

  • When checked, the spindle commands listed below will always output when called.
  • When unchecked, the spindle commands will output conditionality.

Part Station/Tool Group Activate Event Conditions

  • On state change will only output the spindle state in the Approach loop when the current ops' spindle states are different from the previous ops' end state.
  • State change and off part will output the spindle state in the Approach loop when the current ops' spindle state is different from the previous ops' end state, AND when PreviousInterOpOffPart? would return TRUE.
  • Every op that uses the spindle will output the spindle state in the Approach loop on every op.

New MDD Options

SpindleStateOptions dialog

Tool Group Spindles

  • Default - Undefined behavior
  • On at Approach Start - Turn on the Tool Group spindles at the ApproachStart event.
  • On at Op Start - Turn on the Tool Group spindles at the OpStart event.
  • On at Entry Clearance - Turn on the Tool Group spindles at CP1.

Part Station Spindles

  • Default - Undefined behavior
  • On at Approach Start - Turn on the Part Station spindles at the ApproachStart event.
  • On at Op Start - Turn on the Part Station spindles at the OpStart event.
  • On at Entry Clearance - Turn on the Part Station spindles at CP1.

Errata

  • PartSpindleSpeedType is never conditional, regardless of the setting in the Spindle Options dialog.
  • For turning canned cycles, the CSS On command can occur during Toolpath, which would result in the G96 being output during the canned path, which is clearly undesirable. Therefore, logic needs to be added to manually output the G96 command before the canned cycle line, and manually turned back off again after the end of the cycle. For example:
ckCannedCycleCSS:
	IF ConstantSurfaceSpeed? AND (NOT PartSpindleCSSActive? OR PartSpindleSFPMChanged?)
		SeqLabC 'G96' 'S' Output('S', PartSpindleSFPM#) EOL
		SetFlag('ManualCannedCSSOn')
	END
RETURN

{ *** Change this sub if you change the Form setting for when CSS is cancelled *** }
ckCancelCannedCycleCSS:
	IF Flag?('ManualCannedCSSOn')
		SeqLabC 'G97' 'S' Output('S', CalcRPM2#) EOL
		SetFlagF('ManualCannedCSSOn')
	END
RETURN

latheCannedCycleCore:
	ckCannedCycleCSS
	IF CannedCycle?
		IF Roughing?
			turnRoughOp
		ELSEIF Threading?
			turnThreadOp
		ELSEIF Drilling?
			turnDrillOp
		END
	ELSE
		IF PeckGrooving? AND PreferCan?
			turnPeckGrooveOp
		ELSEIF Threading?
			turnG33ThreadOp
		END
		IF Drilling? AND Tap? AND SpindleControl?
			SeqLabC PartSpindleOff EOL
			SeqLabC PartSpindleSpeed PartSpindleOn EOL
		END
	END
	ckCancelCannedCycleCSS
RETURN

Prog Commands

Part Spindle

The part spindle is the spindle which can spin a part. Requires an MDD with one or more part stations set to "Spins Part."

Part Spindle Commands

Part Spindle Booleans

Tool Spindle

The tool spindle is the spindle that can spin a tool. Requires an MDD with one or more tool stations set to "Live Tool."

Tool Spindle Commands

Tool Spindle Booleans

Sample Code

Sample subroutine to handle Part Spindle output on a lathe

doPartSpindleTypeC:
	IF PartSpeedTypeChange? OR Flag?('PartSpeedTypeInvalidated')
		InvalidatePartSpindleSpeed
		SetFlagF('PartSpeedTypeInvalidated')
		PartSpindleSpeedType
	END
RETURN

doInvalidatePartSpindleType:
	SetFlag('PartSpeedTypeInvalidated')
RETURN

handlePartSpindleChange:
	{Need to skip part spindle changes during toolpath for canned cycles.}
	IF (ApproachFeat? OR RetractFeat?) OR (NOT thisOpLatheCannedCycle?)
		IF (FirstPartSpindleActivateOfOp? OR PartSpeedTypeChange?) AND ApproachFeat?
			IF ConstantSurfaceSpeed?
				SeqLabC Preset MaxRPM EOL
			END
			doInvalidatePartSpindleType InvalidatePartSpindle InvalidatePartSpindleSpeed 
		END
		
		IF PartSpindleOff?
			SeqLabC PartSpindleOff EOL
		END

		SeqLabC doPartSpindleTypeC PartSpindleSpeed PartSpindleOn EOL
	END
RETURN