V13 Spindle Control

From Compost Wiki
Revision as of 02:18, 9 March 2019 by Danm (talk | contribs)
Jump to navigation Jump to search

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

Spindle On Events

Tool Group Spindles
  • On at Approach Start (Default) - 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
  • On at Approach Start (Default) - 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.

Spindle Off Events

Tool Group Spindles
  • Off at Exit Clearance (Default) - Turn off the Tool spindle at CP3.
  • Off at Retract End - Turn off the Tool spindle at the end of the Retract.
  • Off at Op End - Turn off the Tool spindle at the Op End.

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