On machines with limited RPM I'd like the post to automatically adjust the feed rate by the proportionate amount that the spindle speed is limited by. This is adjusted from the current Haas NGC post.
I added this to the properties section at the head of the post so the user can enter the RPM on the post page.
MaxRPM: {
title : "Spindle Speed",
description : "Adjust cutting data based on machine rpm",
group : "Machine Lab",
type : "spatial",
value : 12000.,
scope : "post"
},
function getFeed(f) {
// var MaxRPM = 3000.0; // this line makes the logic work when uncommented
if (spindleSpeed > MaxRPM) {
var adjustmentRatio = MaxRPM / spindleSpeed;
f *= adjustmentRatio; // Adjust feed rate proportionally
}
if (getProperty("useG95")) {
return feedOutput.format(f / spindleSpeed); // use feed value
}
if (typeof activeMovements != "undefined" && activeMovements) {
var feedContext = activeMovements[movement];
if (feedContext != undefined) {
if (!feedFormat.areDifferent(feedContext.feed, f)) {
if (feedContext.id == currentFeedId) {
return ""; // nothing has changed
}
forceFeed();
currentFeedId = feedContext.id;
return settings.parametricFeeds.feedOutputVariable + (settings.parametricFeeds.firstFeedParameter + feedContext.id);
}
}
currentFeedId = undefined; // force parametric feed next time
}
return feedOutput.format(f); // use feed value
}
Solved! Go to Solution.
On machines with limited RPM I'd like the post to automatically adjust the feed rate by the proportionate amount that the spindle speed is limited by. This is adjusted from the current Haas NGC post.
I added this to the properties section at the head of the post so the user can enter the RPM on the post page.
MaxRPM: {
title : "Spindle Speed",
description : "Adjust cutting data based on machine rpm",
group : "Machine Lab",
type : "spatial",
value : 12000.,
scope : "post"
},
function getFeed(f) {
// var MaxRPM = 3000.0; // this line makes the logic work when uncommented
if (spindleSpeed > MaxRPM) {
var adjustmentRatio = MaxRPM / spindleSpeed;
f *= adjustmentRatio; // Adjust feed rate proportionally
}
if (getProperty("useG95")) {
return feedOutput.format(f / spindleSpeed); // use feed value
}
if (typeof activeMovements != "undefined" && activeMovements) {
var feedContext = activeMovements[movement];
if (feedContext != undefined) {
if (!feedFormat.areDifferent(feedContext.feed, f)) {
if (feedContext.id == currentFeedId) {
return ""; // nothing has changed
}
forceFeed();
currentFeedId = feedContext.id;
return settings.parametricFeeds.feedOutputVariable + (settings.parametricFeeds.firstFeedParameter + feedContext.id);
}
}
currentFeedId = undefined; // force parametric feed next time
}
return feedOutput.format(f); // use feed value
}
Solved! Go to Solution.
Solved by aju_augustine. Go to Solution.
Hi @rstpeng ,
To retrieve the values of MaxRPM, which is defined in your post properties, you can modify your post as illustrated below:
function getFeed(f) {
if (spindleSpeed > getProperty("MaxRPM")) {
var adjustmentRatio = getProperty("MaxRPM") / spindleSpeed;
f *= adjustmentRatio; // Adjust feed rate proportionally
}
I hope this solution proves helpful for your needs.
Hi @rstpeng ,
To retrieve the values of MaxRPM, which is defined in your post properties, you can modify your post as illustrated below:
function getFeed(f) {
if (spindleSpeed > getProperty("MaxRPM")) {
var adjustmentRatio = getProperty("MaxRPM") / spindleSpeed;
f *= adjustmentRatio; // Adjust feed rate proportionally
}
I hope this solution proves helpful for your needs.
Can't find what you're looking for? Ask the community or share your knowledge.