Skip to content

Commit

Permalink
Merge branch 'CustomCoolant'
Browse files Browse the repository at this point in the history
  • Loading branch information
flyfisher604 committed Apr 18, 2021
2 parents bf85ee9 + 1dfb0a3 commit dfcb050
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 10 deletions.
48 changes: 42 additions & 6 deletions MPCNC.cps
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,10 @@ properties = {
cl3_coolantAOff: "M42 P6 S0", // Gcode command to turn off Coolant channel A
cl4_coolantBOn: "M42 P11 S255", // GCode command to turn on Coolant channel B
cl5_coolantBOff: "M42 P11 S0", // Gcode command to turn off Coolant channel B
cl6_cust_coolantAOn: "", // Custom GCode command to turn on Coolant channel A
cl7_cust_coolantAOff: "", // Custom Gcode command to turn off Coolant channel A
cl8_cust_coolantBOn: "", // Custom GCode command to turn on Coolant channel B
cl9_cust_coolantBOff: "", // Custom Gcode command to turn off Coolant channel B
DuetMillingMode: "M453 P2 I0 R30000 F200", // GCode command to setup Duet3d milling mode
DuetLaserMode: "M452 P2 I0 R255 F200", // GCode command to setup Duet3d laser mode
Expand Down Expand Up @@ -383,7 +387,8 @@ propertyDefinitions = {
{ title: "Mrln: M42 P6 S255", id: "M42 P6 S255" },
{ title: "Mrln: M42 P11 S255", id: "M42 P11 S255" },
{ title: "Grbl: M7 (mist)", id: "M7" },
{ title: "Grbl: M8 (flood)", id: "M8" }
{ title: "Grbl: M8 (flood)", id: "M8" },
{ title: "Use custom", id: "Use custom" }
]
},
cl3_coolantAOff: {
Expand All @@ -392,7 +397,8 @@ propertyDefinitions = {
values: [
{ title: "Mrln: M42 P6 S0", id: "M42 P6 S0" },
{ title: "Mrln: M42 P11 S0", id: "M42 P11 S0" },
{ title: "Grbl: M9 (off)", id: "M9" }
{ title: "Grbl: M9 (off)", id: "M9" },
{ title: "Use custom", id: "Use custom" }
]
},
cl4_coolantBOn: {
Expand All @@ -402,7 +408,8 @@ propertyDefinitions = {
{ title: "Mrln: M42 P11 S255", id: "M42 P11 S255" },
{ title: "Mrln: M42 P6 S255", id: "M42 P6 S255" },
{ title: "Grbl: M7 (mist)", id: "M7" },
{ title: "Grbl: M8 (flood)", id: "M8" }
{ title: "Grbl: M8 (flood)", id: "M8" },
{ title: "Use custom", id: "Use custom" }
]
},
cl5_coolantBOff: {
Expand All @@ -411,9 +418,26 @@ propertyDefinitions = {
values: [
{ title: "Mrln: M42 P11 S0", id: "M42 P11 S0" },
{ title: "Mrln: M42 P6 S0", id: "M42 P6 S0" },
{ title: "Grbl: M9 (off)", id: "M9" }
{ title: "Grbl: M9 (off)", id: "M9" },
{ title: "Use custom", id: "Use custom" }
]
},
cl6_cust_coolantAOn: {
title: "Coolant: Custom A Enable", description: "Custom GCode to turn On coolant channel A", group: 8,
type: "string", default_mm: "", default_in: "",
},
cl7_cust_coolantAOff: {
title: "Coolant: Custom A Disable", description: "Custom Gcode to turn Off coolant A", group: 8,
type: "string", default_mm: "", default_in: "",
},
cl8_cust_coolantBOn: {
title: "Coolant: Custom B Enable", description: "Custom GCode to turn On coolant channel B", group: 8,
type: "string", default_mm: "", default_in: "",
},
cl9_cust_coolantBOff: {
title: "Coolant: Custom B Disable", description: "Custom Gcode to turn Off coolant B", group: 8,
type: "string", default_mm: "", default_in: "",
},
DuetMillingMode: {
title: "Duet: Milling mode", description: "GCode command to setup Duet3d milling mode", group: 9,
Expand Down Expand Up @@ -683,11 +707,23 @@ function isSafeToRapid(x, y, z) {
//---------------- Coolant ----------------
function CoolantA(on) {
writeBlock(on ? properties.cl2_coolantAOn : properties.cl3_coolantAOff);
var coolantText = on ? properties.cl2_coolantAOn : properties.cl3_coolantAOff;
if (coolantText == "Use custom") {
coolantText = on ? properties.cl6_cust_coolantAOn : properties.cl7_cust_coolantAOff;
}
writeBlock(coolantText);
}
function CoolantB(on) {
writeBlock(on ? properties.cl4_coolantBOn : properties.cl5_coolantBOff);
var coolantText = on ? properties.cl4_coolantBOn : properties.cl5_coolantBOff;
if (coolantText == "Use custom") {
coolantText = on ? properties.cl8_cust_coolantBOn : properties.cl9_cust_coolantBOff;
}
writeBlock(coolantText);
}
// Manage two channels of coolant by tracking which coolant is being using for
Expand Down
14 changes: 10 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,14 +174,20 @@ If a channel needs to be Disabled because it no longer matchs the coolant reques
For coolant requests, like "Flood and Mist" or "Flood and Through Tool" you may want to enable one or
two channels dependent on if your hardware uses one connections to enable both or a seperate connection for each. Two channels may be enabled by placing the same coolant code in both. For example, setting both channels to "Flood and Mist" will result in enabling both channel A and channel B when the tool requests "Flood and Mist". Correspondingly channels A's enable value will be output (to enable flooding) and channel B's enable value will be output (to enable Mist).

Four custom coolant text strings can be defined for both Channel A and B's on and off values. Use these if the predefine values do not match your hardware. To enable, set the corresponding coolant channel to 'Use custom'.

|Title|Description|Default|Values|
|---|---|---|---|
Coolant: A Mode|Enable channel A when tool is set this coolant|**off**|off, flood, mist, throughTool, air, airThroughTool, suction, floodMist, floodThroughTool|
Coolant: B Mode|Enable channel B when tool is set this coolant|**off**|off, flood, mist, throughTool, air, airThroughTool, suction, floodMist, floodThroughTool|
Coolant: A Enable|GCode to turn On coolant channel A|**Mrln: M42 P6 S255**|"Mrln: M42 P6 S255", , Mrln: M42 P11 S255", "Grbl: M7 (mist)", "Grbl: M8 (flood)"|
Coolant: A Disable Off command|GCode to turn Off coolant channel A|**Mrln: M42 P6 S0**|"Mrln: M42 P6 S0", "Mrln: M42 P11 S0", "Grbl: M9 (off)"|
Coolant: B Enable|GCode to turn On coolant channel B|**Mrln: M42 P11 S255**|"Mrln: M42 P11 S255", "Mrln: M42 P6 S255", "Grbl: M7 (mist)", "Grbl: M8 (flood)"|
Coolant: B Disable Off command|GCode to turn Off coolant channel B|**Mrln: M42 P11 S0**|"Mrln: M42 P11 S0", "Mrln: M42 P6 S0", "Grbl: M9 (off)"|
Coolant: A Enable|GCode to turn On coolant channel A|**Mrln: M42 P6 S255**|"Mrln: M42 P6 S255", , Mrln: M42 P11 S255", "Grbl: M7 (mist)", "Grbl: M8 (flood)", "Use custom"|
Coolant: A Disable|GCode to turn Off coolant channel A|**Mrln: M42 P6 S0**|"Mrln: M42 P6 S0", "Mrln: M42 P11 S0", "Grbl: M9 (off)", "Use custom"|
Coolant: B Enable|GCode to turn On coolant channel B|**Mrln: M42 P11 S255**|"Mrln: M42 P11 S255", "Mrln: M42 P6 S255", "Grbl: M7 (mist)", "Grbl: M8 (flood)", "Use custom"|
Coolant: B Disable|GCode to turn Off coolant channel B|**Mrln: M42 P11 S0**|"Mrln: M42 P11 S0", "Mrln: M42 P6 S0", "Grbl: M9 (off)", "Use custom"|
Coolant: Custom A Enable|Custom GCode to turn On coolant channel A|empty| |
Coolant: Custom A Disable|Custom GCode to turn Off coolant channel A|empty| |
Coolant: Custom B Enable|Custom GCode to turn On coolant channel B|empty| |
Coolant: Custom B Disable|Custom GCode to turn Off coolant channel B|empty| |

## Group 9: Duet Properties

Expand Down

0 comments on commit dfcb050

Please sign in to comment.