Skip to content

Commit

Permalink
Added Max Spindle Speed
Browse files Browse the repository at this point in the history
  • Loading branch information
will1742 committed Oct 14, 2021
1 parent a286fa1 commit 8eea4e1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
11 changes: 5 additions & 6 deletions Haas_Lathes_BIDC/Bechtel ST-20.cps
Original file line number Diff line number Diff line change
Expand Up @@ -131,14 +131,13 @@ properties = {/*
type: "boolean",
value: false,
scope: "post"
},
},*/
maximumSpindleSpeed: {
title: "Max spindle speed",
description: "Defines the maximum spindle speed allowed on the main spindle.",
group: 4,
type: "integer",
range: [0, 999999999]
},
},/*
subMaximumSpindleSpeed: {
title: "Max spindle speed for subspindle",
description: "Defines the maximum spindle speed allowed on the subspindle.",
Expand Down Expand Up @@ -860,7 +859,7 @@ function startSpindle(forceRPMMode, initialPosition, rpm) {
}

var useConstantSurfaceSpeed = currentSection.getTool().getSpindleMode() == SPINDLE_CONSTANT_SURFACE_SPEED;
var maxSpeed = (currentSection.spindle == SPINDLE_SECONDARY) ? staticProperties.subMaximumSpindleSpeed : staticProperties.maximumSpindleSpeed;
var maxSpeed = (currentSection.spindle == SPINDLE_SECONDARY) ? staticProperties.subMaximumSpindleSpeed : getProperty("maximumSpindleSpeed");
var maximumSpindleSpeed = (tool.maximumSpindleSpeed > 0) ? Math.min(tool.maximumSpindleSpeed, maxSpeed) : maxSpeed;
if (useConstantSurfaceSpeed && !forceRPMMode) {
skipBlock = _skipBlock;
Expand Down Expand Up @@ -1574,7 +1573,7 @@ function onOpen() {
}
}

writeBlock(gFormat.format(50), sOutput.format(getSection(0).spindle == SPINDLE_PRIMARY ? staticProperties.maximumSpindleSpeed : staticProperties.subMaximumSpindleSpeed));
writeBlock(gFormat.format(50), sOutput.format(getSection(0).spindle == SPINDLE_PRIMARY ? getProperty("maximumSpindleSpeed") : staticProperties.subMaximumSpindleSpeed));
sOutput.reset();

if (staticProperties.gotChipConveyor) {
Expand Down Expand Up @@ -4613,5 +4612,5 @@ function setProperty(property, value) {
}
// <<<<< INCLUDED FROM ../common/haas lathe.cps

// properties.maximumSpindleSpeed.value = 4000;
properties.maximumSpindleSpeed.value = 4000;
// properties.subMaximumSpindleSpeed.value = 4000;
11 changes: 5 additions & 6 deletions Haas_Lathes_BIDC/Bechtel ST-20Y.cps
Original file line number Diff line number Diff line change
Expand Up @@ -131,14 +131,13 @@ properties = {/*
type: "boolean",
value: false,
scope: "post"
},
},*/
maximumSpindleSpeed: {
title: "Max spindle speed",
description: "Defines the maximum spindle speed allowed on the main spindle.",
group: 4,
type: "integer",
range: [0, 999999999]
},
},/*
subMaximumSpindleSpeed: {
title: "Max spindle speed for subspindle",
description: "Defines the maximum spindle speed allowed on the subspindle.",
Expand Down Expand Up @@ -928,7 +927,7 @@ function startSpindle(forceRPMMode, initialPosition, rpm) {
}

var useConstantSurfaceSpeed = currentSection.getTool().getSpindleMode() == SPINDLE_CONSTANT_SURFACE_SPEED;
var maxSpeed = (currentSection.spindle == SPINDLE_SECONDARY) ? staticProperties.subMaximumSpindleSpeed : staticProperties.maximumSpindleSpeed;
var maxSpeed = (currentSection.spindle == SPINDLE_SECONDARY) ? staticProperties.subMaximumSpindleSpeed : getProperty("maximumSpindleSpeed");
var maximumSpindleSpeed = (tool.maximumSpindleSpeed > 0) ? Math.min(tool.maximumSpindleSpeed, maxSpeed) : maxSpeed;
if (useConstantSurfaceSpeed && !forceRPMMode) {
skipBlock = _skipBlock;
Expand Down Expand Up @@ -1658,7 +1657,7 @@ function onOpen() {
}
}

writeBlock(gFormat.format(50), sOutput.format(getSection(0).spindle == SPINDLE_PRIMARY ? staticProperties.maximumSpindleSpeed : staticProperties.subMaximumSpindleSpeed));
writeBlock(gFormat.format(50), sOutput.format(getSection(0).spindle == SPINDLE_PRIMARY ? getProperty("maximumSpindleSpeed") : staticProperties.subMaximumSpindleSpeed));
sOutput.reset();

if (staticProperties.gotChipConveyor) {
Expand Down Expand Up @@ -4696,5 +4695,5 @@ function setProperty(property, value) {
}
// <<<<< INCLUDED FROM ../common/haas lathe.cps

// properties.maximumSpindleSpeed.value = 4000;
properties.maximumSpindleSpeed.value = 4000;
// properties.subMaximumSpindleSpeed.value = 4000;

0 comments on commit 8eea4e1

Please sign in to comment.