-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDrill.cpp
More file actions
30 lines (25 loc) · 766 Bytes
/
Drill.cpp
File metadata and controls
30 lines (25 loc) · 766 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include "Drill.h"
#include "Arduino.h"
material_entry material_db[] = {
// Speed in meters per minute
{ "Toolsteel", 10., },
{ "Stailness", 12., },
{ "Steel", 25., },
{ "Brass", 30., },
{ "Bronze", 30., },
{ "Cast iron", 15., },
{ "Copper", 20., },
{ "Aluminium", 60., },
NULL,
};
#ifndef M_PI
#define M_PI 3.14159265358979323846264338327950288
#endif
// RPM = (1000 * surface speed) / (π * diameter)
// diameter = 1000 * surface speed [mm/min] /rpm [/min] / pi;
double diameter_mm2rpm(material_entry *e, double diam) {
return 1000. * e->recc / M_PI / diam;
};
double rpm2diameter_mm(material_entry *e, double rpm) {
return 1000. * e->recc / rpm / M_PI;
};