From 874d3d3fc53b0c9b505ffbf7b98d89a33707bf24 Mon Sep 17 00:00:00 2001 From: C-o-r-E Date: Mon, 2 Mar 2015 20:07:12 -0500 Subject: [PATCH] Add support for solenoid articulated extruders --- Marlin/Marlin_main.cpp | 67 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 66 insertions(+), 1 deletion(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 8390a5f84..47619c947 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -154,6 +154,8 @@ // M302 - Allow cold extrudes, or set the minimum extrude S. // M303 - PID relay autotune S sets the target temperature. (default target temperature = 150C) // M304 - Set bed PID parameters P I and D +// M380 - Activate solenoid on active extruder +// M381 - Disable all solenoids // M400 - Finish all moves // M401 - Lower z-probe if present // M402 - Raise z-probe if present @@ -3497,6 +3499,17 @@ Sigma_Exit: } break; #endif + +#ifdef EXT_SOLENOID + case 380: + enable_solenoid_on_active_extruder(); + break; + + case 381: + disable_all_solenoids(); + break; +#endif //EXT_SOLENOID + case 400: // M400 finish all moves { st_synchronize(); @@ -4000,6 +4013,13 @@ case 404: //M404 Enter the nominal filament width (3mm, 1.75mm ) N<3.0> or disp prepare_move(); } } + +#ifdef EXT_SOLENOID + st_synchronize(); + disable_all_solenoids(); + enable_solenoid_on_active_extruder(); +#endif //EXT_SOLENOID + #endif SERIAL_ECHO_START; SERIAL_ECHO(MSG_ACTIVE_EXTRUDER); @@ -4707,7 +4727,6 @@ bool setTargetedHotend(int code){ return false; } - float calculate_volumetric_multiplier(float diameter) { if (!volumetric_enabled || diameter == 0) return 1.0; float d2 = diameter * 0.5; @@ -4718,3 +4737,49 @@ void calculate_volumetric_multipliers() { for (int i=0; i