/*
* Frank herrmann (xpix)
*
* Script to calculate simple the cuttingspeed
* for specific materials
*
*/
// Values from http://www.cenon.de/toolKnowHow/index.html
// First param cut speed -> meter/second and
// teethfeed for tool diamter (<=4mm, <=8mm, > 8.01mm)
var Steel = new Material(50, [0.02, 0.03, 0.04]);
var Aluminium = new Material(150, [0.04, 0.05, 0.06]);
var Delrin = new Material(750, [0.05, 0.06, 0.07]);
var example = Aluminium;
// variable data
var vc = example.cutspeed; // meters/minute i.e. Aluminium = 200m/min
var dm = 3; // Diameter in mm
var teeth = 2; // count Teeth from tool
var deep = cut_depth(dm, example); // cutting depth in mm
var maxrs = 12000; // Maximum revolutions from machine
// PI factor
var pi = 3.14; // Pi
var n = number_revolutions(vc);
var f = feed(n, deep, teeth);
alert('Max RPM: ' + n + ' r/min\n' + 'Max Feed: ' + (n * deep * teeth) + ' r/min\n' + '----------- for your machine ---------------\n' + 'Use RPM: ' + (n > maxrs ? maxrs : n) + ' r/min\n' + 'Use Feed: ' + f + ' mm/min\n' + 'Cut depth: ' + deep + ' mm');
// --------------- subs ---------------
function Material(cutspeed, teethfeed) {
this.cutspeed = cutspeed;
this.teethfeed = teethfeed;
}
function cut_depth(dm, material) {
if (dm <= 4) {
return material.teethfeed[0];
}
if (dm <= 8) {
return material.teethfeed[1];
}
return material.teethfeed[2];
}
function number_revolutions(vc) {
// max. Drehzahl n:
return Math.round((vc * 1000) / (pi * 3));
}
function feed(n, deep, teeth) {
// calculate feed=f
var f = Math.round(n * deep * teeth);
// Maximum rev/min of machine less the calculated rpm
// calculate in percent
// i.e. max possible: 20000 rpm at (max)feed 100mm/min
// max spindle: 10000 rpm result feed 50mm/min
if (n > maxrs) {
return Math.round((f / n) * maxrs);
}
return f;
}
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Fiddle Pages
Your fiddles accessible under a custom domain and a vanity path - the simplest hosting for your personal project.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Get Fiddle Pages with PRO
Your fiddles accessible under a custom domain and a vanity path - the simplest hosting for your personal project.