Commit 6d57efa8 authored by MagoKimbra's avatar MagoKimbra

Add Managment Dual Extruder Dondolo

Dondolo By Gianni Franci
http://www.thingiverse.com/thing:673816
parent 027452d7
### Version 4.2.0
* Add Dual Extruder DONDOLO
* Add PID Extrusion Rate Kc in percent.
* New configuration systems (Now you can create a separate file with all configuration and use it in you FW update)
* New namings for file
......
......@@ -407,14 +407,15 @@
*********************************** Hotend offset ***************************************
*****************************************************************************************
* *
* Offset of the extruders (uncomment if using more than one and relying on firmware *
* Offset of the hotends (uncomment if using more than one and relying on firmware *
* to position when changing). *
* The offset has to be X=0, Y=0 for the hotend 0 (default hotend). *
* The offset has to be X=0, Y=0, Z=0 for the hotend 0 (default hotend). *
* For the other hotends it is their distance from the hotend 0. *
* *
*****************************************************************************************/
//#define HOTEND_OFFSET_X {0.0, 5.00, 0.0, 0.0} // (in mm) for each hotend, offset of the hotend on the X axis
//#define HOTEND_OFFSET_Y {0.0, 5.00, 0.0, 0.0} // (in mm) for each hotend, offset of the hotend on the Y axis
//#define HOTEND_OFFSET_X {0.0, 5.0, 0.0, 0.0} // (in mm) for each hotend, offset of the hotend on the X axis
//#define HOTEND_OFFSET_Y {0.0, 5.0, 0.0, 0.0} // (in mm) for each hotend, offset of the hotend on the Y axis
//#define HOTEND_OFFSET_Z {0.0, 0.0, 0.0, 0.0} // (in mm) for each hotend, offset of the hotend on the Z axis
/*****************************************************************************************/
#endif
\ No newline at end of file
......@@ -429,14 +429,15 @@
*********************************** Hotend offset ***************************************
*****************************************************************************************
* *
* Offset of the extruders (uncomment if using more than one and relying on firmware *
* Offset of the hotends (uncomment if using more than one and relying on firmware *
* to position when changing). *
* The offset has to be X=0, Y=0 for the hotend 0 (default hotend). *
* The offset has to be X=0, Y=0, Z=0 for the hotend 0 (default hotend). *
* For the other hotends it is their distance from the hotend 0. *
* *
*****************************************************************************************/
//#define HOTEND_OFFSET_X {0.0, 5.00, 0.0, 0.0} // (in mm) for each hotend, offset of the hotend on the X axis
//#define HOTEND_OFFSET_Y {0.0, 5.00, 0.0, 0.0} // (in mm) for each hotend, offset of the hotend on the Y axis
//#define HOTEND_OFFSET_X {0.0, 5.0, 0.0, 0.0} // (in mm) for each hotend, offset of the hotend on the X axis
//#define HOTEND_OFFSET_Y {0.0, 5.0, 0.0, 0.0} // (in mm) for each hotend, offset of the hotend on the Y axis
//#define HOTEND_OFFSET_Z {0.0, 0.0, 0.0, 0.0} // (in mm) for each hotend, offset of the hotend on the Z axis
/*****************************************************************************************/
#endif
\ No newline at end of file
......@@ -375,14 +375,15 @@
*********************************** Hotend offset ***************************************
*****************************************************************************************
* *
* Offset of the extruders (uncomment if using more than one and relying on firmware *
* Offset of the hotends (uncomment if using more than one and relying on firmware *
* to position when changing). *
* The offset has to be X=0, Y=0 for the hotend 0 (default hotend). *
* The offset has to be X=0, Y=0, Z=0 for the hotend 0 (default hotend). *
* For the other hotends it is their distance from the hotend 0. *
* *
*****************************************************************************************/
//#define HOTEND_OFFSET_X {0.0, 5.00, 0.0, 0.0} // (in mm) for each hotend, offset of the hotend on the X axis
//#define HOTEND_OFFSET_Y {0.0, 5.00, 0.0, 0.0} // (in mm) for each hotend, offset of the hotend on the Y axis
//#define HOTEND_OFFSET_X {0.0, 5.0, 0.0, 0.0} // (in mm) for each hotend, offset of the hotend on the X axis
//#define HOTEND_OFFSET_Y {0.0, 5.0, 0.0, 0.0} // (in mm) for each hotend, offset of the hotend on the Y axis
//#define HOTEND_OFFSET_Z {0.0, 0.0, 0.0, 0.0} // (in mm) for each hotend, offset of the hotend on the Z axis
/*****************************************************************************************/
#endif
\ No newline at end of file
......@@ -21,6 +21,7 @@
* - BariCUDA paste extruder
* - Multiextruder MKR4
* - Multiextruder NPr2
* - Multiextruder DONDOLO
* - Extruder idle oozing prevention
* - Extruder run-out prevention
* - Bowden Filament management
......@@ -398,7 +399,7 @@
*********************** Multiextruder NPr2 ****************************
***********************************************************************
* *
* Setting fot color meccanism NPr2 by NicolaP (www.3dmakerlab.it) *
* Setting for color meccanism NPr2 by NicolaP (www.3dmakerlab.it) *
* Find angle setting by g-Code "M997 Cxxx" *
* *
* Uncomment NPR2 to enable this feature *
......@@ -415,6 +416,26 @@
/***********************************************************************/
/***********************************************************************
********************* Dual Extruder DONDOLO ***************************
***********************************************************************
* *
* Setting for multiextruder DONDOLO 1.0b by Gianni Franci *
* http://www.thingiverse.com/thing:673816 *
* For function set NUM_SERVOS +1 if you use for endstop or probe *
* Set DONDOLO SERVO INDEX for servo you use for DONDOLO *
* Set DONDOLO SERVOPOS E0 angle for E0 extruder *
* Set DONDOLO SERVOPOS E1 angle for E1 extruder *
* Remember set HOTEND OFFSET X Y Z *
***********************************************************************/
//#define DONDOLO
#define DONDOLO_SERVO_INDEX 0
#define DONDOLO_SERVOPOS_E0 120
#define DONDOLO_SERVOPOS_E1 10
#define DONDOLO_SERVO_DELAY 1000
/***********************************************************************/
/***********************************************************************
**************** Extruder idle oozing prevention **********************
***********************************************************************
......
......@@ -320,12 +320,7 @@ unsigned long printer_usage_seconds;
// Hotend offset
#if HOTENDS > 1
#if DISABLED(DUAL_X_CARRIAGE)
#define NUM_HOTEND_OFFSETS 2 // only in XY plane
#else
#define NUM_HOTEND_OFFSETS 3 // supports offsets in XYZ plane
#endif
float hotend_offset[NUM_HOTEND_OFFSETS][HOTENDS];
float hotend_offset[3][HOTENDS];
#endif
#if ENABLED(NPR2)
......@@ -723,13 +718,25 @@ bool enqueuecommand(const char *cmd) {
servo[3].detach();
#endif
#if ENABLED(DONDOLO)
servo[DONDOLO_SERVO_INDEX].write(DONDOLO_SERVOPOS_E0);
delay(DONDOLO_SERVO_DELAY);
#endif
// Set position of Servo Endstops that are defined
#if HAS(SERVO_ENDSTOPS)
for (int i = 0; i < 3; i++)
if (servo_endstop_id[i] >= 0)
servo[servo_endstop_id[i]].move(servo_endstop_angle[i][1]);
#if ENABLED(DONDOLO)
for (int i = 0; i < 3; i++) {
if (servo_endstops[i] >= 0 && servo_endstops[i] != DONDOLO_SERVO_INDEX)
servo[servo_endstops[i]].write(servo_endstop_angles[i * 2 + 1]);
}
#else
for (int i = 0; i < 3; i++) {
if (servo_endstops[i] >= 0)
servo[servo_endstops[i]].write(servo_endstop_angles[i * 2 + 1]);
}
#endif
#endif
}
#endif
/**
......@@ -5731,18 +5738,13 @@ inline void gcode_M206() {
if (code_seen('X')) hotend_offset[X_AXIS][target_extruder] = code_value();
if (code_seen('Y')) hotend_offset[Y_AXIS][target_extruder] = code_value();
#if ENABLED(DUAL_X_CARRIAGE)
if (code_seen('Z')) hotend_offset[Z_AXIS][target_extruder] = code_value();
#endif
if (code_seen('Z')) hotend_offset[Z_AXIS][target_extruder] = code_value();
ECHO_SM(DB, MSG_HOTEND_OFFSET);
for (int e = 0; e < HOTENDS; e++) {
ECHO_MV(" ", hotend_offset[X_AXIS][e]);
ECHO_MV(",", hotend_offset[Y_AXIS][e]);
#if ENABLED(DUAL_X_CARRIAGE)
ECHO_MV(",", hotend_offset[Z_AXIS][e]);
#endif
ECHO_MV(",", hotend_offset[Z_AXIS][e]);
}
ECHO_E;
}
......@@ -5864,28 +5866,54 @@ inline void gcode_M226() {
inline void gcode_M280() {
int servo_index = code_seen('P') ? code_value_short() : -1;
int servo_position = 0;
if (code_seen('S')) {
servo_position = code_value_short();
if (servo_index >= 0 && servo_index < NUM_SERVOS) {
Servo *srv = &servo[servo_index];
#if SERVO_LEVELING
srv->attach(0);
#endif
srv->write(servo_position);
#if SERVO_LEVELING
delay(SERVO_DEACTIVATION_DELAY);
srv->detach();
#endif
#if ENABLED(DONDOLO)
if (code_seen('S')) {
servo_position = code_value_short();
if (servo_index >= 0 && servo_index < NUM_SERVOS && servo_index != DONDOLO_SERVO_INDEX) {
Servo *srv = &servo[servo_index];
#if SERVO_LEVELING
srv->attach(0);
#endif
srv->write(servo_position);
#if SERVO_LEVELING
delay(PROBE_SERVO_DEACTIVATION_DELAY);
srv->detach();
#endif
}
else if(servo_index == DONDOLO_SERVO_INDEX) {
Servo *srv = &servo[servo_index];
srv->write(servo_position);
delay (DONDOLO_SERVO_DELAY);
}
else {
ECHO_SM(ER, "Servo ");
ECHO_EVM(servo_index, " out of range");
}
}
else {
ECHO_SM(ER, "Servo ");
ECHO_EVM(servo_index, " out of range");
#else
if (code_seen('S')) {
servo_position = code_value_short();
if (servo_index >= 0 && servo_index < NUM_SERVOS) {
Servo *srv = &servo[servo_index];
#if SERVO_LEVELING
srv->attach(0);
#endif
srv->write(servo_position);
#if SERVO_LEVELING
delay(SERVO_DEACTIVATION_DELAY);
srv->detach();
#endif
}
else {
ECHO_SM(ER, "Servo ");
ECHO_EVM(servo_index, " out of range");
}
}
}
else if (servo_index >= 0) {
ECHO_SMV(OK, " Servo ", servo_index);
ECHO_EMV(": ", servo[servo_index].read());
}
else if (servo_index >= 0) {
ECHO_SMV(OK, " Servo ", servo_index);
ECHO_EMV(": ", servo[servo_index].read());
}
#endif
}
#endif // NUM_SERVOS > 0
......@@ -6706,13 +6734,17 @@ inline void gcode_T(uint8_t tmp_extruder) {
else {
target_extruder = tmp_extruder;
#if EXTRUDERS > 1
bool make_move = false;
#if HOTENDS > 1
#if ENABLED(DONDOLO)
bool make_move = true;
#else
bool make_move = false;
#endif
#endif
if (code_seen('F')) {
#if EXTRUDERS > 1
#if HOTENDS > 1
make_move = true;
#endif
......@@ -6775,13 +6807,13 @@ inline void gcode_T(uint8_t tmp_extruder) {
delayed_move_time = 0;
}
#else // !DUAL_X_CARRIAGE
// Offset hotend (only by XY)
// Offset hotend (XYZ)
#if HOTENDS > 1
for (int i = X_AXIS; i <= Y_AXIS; i++)
for (int i = X_AXIS; i <= Z_AXIS; i++)
current_position[i] += hotend_offset[i][target_extruder] - hotend_offset[i][active_extruder];
#endif // HOTENDS > 1
#if ENABLED(MKR4) && (EXTRUDERS > 1)
#if ENABLED(MKR4)
#if (EXTRUDERS == 4) && HAS(E0E2) && HAS(E1E3) && (DRIVER_EXTRUDERS == 2)
st_synchronize(); // Finish all movement
disable_e();
......@@ -6942,11 +6974,25 @@ inline void gcode_T(uint8_t tmp_extruder) {
old_color = active_extruder = target_extruder;
active_driver = 0;
ECHO_LMV(DB, MSG_ACTIVE_COLOR, (int)active_extruder);
#elif ENABLED(DONDOLO)
active_extruder = target_extruder;
active_driver = 0;
if (active_extruder == 0) {
st_synchronize();
servo[DONDOLO_SERVO_INDEX].write(DONDOLO_SERVOPOS_E0);
delay (DONDOLO_SERVO_DELAY);
}
else if (active_extruder == 1) {
st_synchronize();
servo[DONDOLO_SERVO_INDEX].write(DONDOLO_SERVOPOS_E1);
delay(DONDOLO_SERVO_DELAY);
}
ECHO_LMV(DB, MSG_ACTIVE_DRIVER, active_driver);
ECHO_LMV(DB, MSG_ACTIVE_EXTRUDER, active_extruder);
#else
active_driver = active_extruder = target_extruder;
ECHO_LMV(DB, MSG_ACTIVE_EXTRUDER, (int)active_extruder);
#endif // end MKR4 || NPR2
ECHO_LMV(DB, MSG_ACTIVE_EXTRUDER, active_extruder);
#endif // end MKR4 || NPR2 || DONDOLO
#endif // end no DUAL_X_CARRIAGE
#if MECH(DELTA) || MECH(SCARA)
......
......@@ -98,7 +98,7 @@ extern float home_offset[3];
// Hotend offset
#if HOTENDS > 1
extern float hotend_offset[NUM_HOTEND_OFFSETS][HOTENDS];
extern float hotend_offset[3][HOTENDS];
#endif // HOTENDS > 1
#if ENABLED(NPR2)
......
......@@ -217,6 +217,14 @@
#include "pins.h"
#include "Configuration_Overall.h"
/**
* DONDOLO
*/
#if ENABLED(DONDOLO)
#undef SINGLENOZZLE
#define DRIVER_EXTRUDERS 0
#endif
/**
* SINGLENOZZLE
*/
......@@ -700,13 +708,4 @@
*/
#define NUM_AXIS 4
// Hotend offset
#if HOTENDS > 1
#if DISABLED(DUAL_X_CARRIAGE)
#define NUM_HOTEND_OFFSETS 2 // only in XY plane
#else
#define NUM_HOTEND_OFFSETS 3 // supports offsets in XYZ plane
#endif
#endif // HOTENDS > 1
#endif //CONDITIONALS_H
......@@ -436,12 +436,14 @@ void Config_ResetDefault() {
float tmp9[] = DEFAULT_Kc;
#endif // PIDTEMP
#if ENABLED(HOTEND_OFFSET_X) && ENABLED(HOTEND_OFFSET_Y)
#if ENABLED(HOTEND_OFFSET_X) && ENABLED(HOTEND_OFFSET_Y) && ENABLED(HOTEND_OFFSET_Z)
float tmp10[] = HOTEND_OFFSET_X;
float tmp11[] = HOTEND_OFFSET_Y;
float tmp12[] = HOTEND_OFFSET_Z;
#else
float tmp10[] = {0};
float tmp11[] = {0};
float tmp12[] = {0};
#endif
for (int8_t i = 0; i < 3 + EXTRUDERS; i++) {
......@@ -483,6 +485,11 @@ void Config_ResetDefault() {
hotend_offset[Y_AXIS][i] = tmp11[i];
else
hotend_offset[Y_AXIS][i] = 0;
max_i = sizeof(tmp12) / sizeof(*tmp12);
if(i < max_i)
hotend_offset[Z_AXIS][i] = tmp12[i];
else
hotend_offset[Z_AXIS][i] = 0;
#endif // HOTENDS > 1
}
}
......@@ -697,10 +704,11 @@ void Config_ResetDefault() {
if (!forReplay) {
ECHO_LM(DB, "Hotend offset (mm):");
}
for (int e = 0; e < HOTENDS; e++) {
ECHO_SMV(DB, " M218 T", e);
ECHO_MV(" X", hotend_offset[X_AXIS][e]);
ECHO_EMV(" Y" ,hotend_offset[Y_AXIS][e]);
for (int h = 0; h < HOTENDS; h++) {
ECHO_SMV(DB, " M218 T", h);
ECHO_MV(" X", hotend_offset[X_AXIS][h]);
ECHO_MV(" Y", hotend_offset[Y_AXIS][h]);
ECHO_EMV(" Z", hotend_offset[Z_AXIS][h]);
}
#endif //HOTENDS > 1
......
......@@ -1682,6 +1682,10 @@
#error DEPENDENCY ERROR: You have to set E_MIN_PIN to a valid pin if you enable NPR2
#endif
#if ENABLED(DONDOLO) && NUM_SERVOS < 1
#error DEPENDENCY ERROR: You must set NUM_SERVOS > 0 for DONDOLO
#endif
#if ENABLED(LASERBEAM) && (!PIN_EXISTS(LASER_PWR) || !PIN_EXISTS(LASER_TTL))
#error DEPENDENCY ERROR: You have to set LASER_PWR_PIN and LASER_TTL_PIN to a valid pin if you enable LASERBEAM
#endif
......
......@@ -568,7 +568,21 @@ void set_stepper_direction() {
count_direction[Z_AXIS] = 1;
}
#if DISABLED(ADVANCE)
#if DISABLED(ADVANCE) && ENABLED(DONDOLO)
if (TEST(out_bits, E_AXIS)) {
if (active_extruder == 0)
REV_E_DIR();
else
NORM_E_DIR();
count_direction[E_AXIS] = -1;
else {
if (active_extruder == 0)
NORM_E_DIR();
else
REV_E_DIR();
count_direction[E_AXIS] = 1;
}
#elif DISABLED(ADVANCE)
if (TEST(out_bits, E_AXIS)) {
REV_E_DIR();
count_direction[E_AXIS] = -1;
......@@ -790,12 +804,26 @@ ISR(TIMER1_COMPA_vect) {
if (e_steps[0] != 0) {
E0_STEP_WRITE(INVERT_E_STEP_PIN);
if (e_steps[0] < 0) {
E0_DIR_WRITE(INVERT_E0_DIR);
#if ENABLED(DONDOLO)
if (active_extruder == 0)
E0_DIR_WRITE(INVERT_E0_DIR);
else
E0_DIR_WRITE(!INVERT_E0_DIR);
#else
E0_DIR_WRITE(INVERT_E0_DIR);
#endif
e_steps[0]++;
E0_STEP_WRITE(!INVERT_E_STEP_PIN);
}
else if (e_steps[0] > 0) {
E0_DIR_WRITE(!INVERT_E0_DIR);
#if ENABLED(DONDOLO)
if (active_extruder == 0)
E0_DIR_WRITE(!INVERT_E0_DIR);
else
E0_DIR_WRITE(INVERT_E0_DIR);
#else
E0_DIR_WRITE(!INVERT_E0_DIR);
#endif
e_steps[0]--;
E0_STEP_WRITE(!INVERT_E_STEP_PIN);
}
......
......@@ -33,8 +33,9 @@ The new features are:
A single Firmware for all types of printers; Cartesian, Delta, SCARA, CoreXY & CoreXZ.
The possibility of having only one hotend independently from the extruders that you have.
The addition of the 4th extruder.
System Management MKr4 for 4 extruders with just two drivers or two extruders with a driver only.
System Management MKr4 for 4 extruders with just two drivers or only driver.
Management Multyextruder NPr2, 4/6 extruders with only two engines.
Management Dual Extruder DONDOLO.
Adding commands to facilitate purging of hotend.
Step per unit varied for each extruder as well as the feedrate.
The addition of a different feedrate for retraction.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment