Merge pull request #3808 from thinkyhead/rc_singlenozzle

SINGLENOZZLE
This commit is contained in:
Scott Lahteine 2016-05-23 15:52:19 -07:00
commit 89e630b2fb
22 changed files with 86 additions and 7 deletions

View file

@ -539,6 +539,16 @@
#define ARRAY_BY_EXTRUDERS1(v1) ARRAY_BY_EXTRUDERS(v1, v1, v1, v1) #define ARRAY_BY_EXTRUDERS1(v1) ARRAY_BY_EXTRUDERS(v1, v1, v1, v1)
/**
* With SINGLENOZZLE all "extruders" are in the same place
*/
#if ENABLED(SINGLENOZZLE)
#undef EXTRUDER_OFFSET_X
#undef EXTRUDER_OFFSET_Y
#define EXTRUDER_OFFSET_X { 0 }
#define EXTRUDER_OFFSET_Y { 0 }
#endif
/** /**
* Z_DUAL_ENDSTOPS endstop reassignment * Z_DUAL_ENDSTOPS endstop reassignment
*/ */

View file

@ -120,6 +120,9 @@
// :[1,2,3,4] // :[1,2,3,4]
#define EXTRUDERS 1 #define EXTRUDERS 1
// For Cyclops or any "multi-extruder" that shares a single nozzle.
//#define SINGLENOZZLE
// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). // Offset of the extruders (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 extruder 0 hotend (default extruder). // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
// For the other hotends it is their distance from the extruder 0 hotend. // For the other hotends it is their distance from the extruder 0 hotend.

View file

@ -149,7 +149,9 @@
#error "EXTRUDERS must be 1 with Z_DUAL_STEPPER_DRIVERS." #error "EXTRUDERS must be 1 with Z_DUAL_STEPPER_DRIVERS."
#endif #endif
#endif // EXTRUDERS > 1 #elif ENABLED(SINGLENOZZLE)
#error "SINGLENOZZLE requires 2 or more EXTRUDERS."
#endif
/** /**
* Limited number of servos * Limited number of servos

View file

@ -120,6 +120,9 @@
// :[1,2,3,4] // :[1,2,3,4]
#define EXTRUDERS 1 #define EXTRUDERS 1
// For Cyclops or any "multi-extruder" that shares a single nozzle.
//#define SINGLENOZZLE
// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). // Offset of the extruders (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 extruder 0 hotend (default extruder). // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
// For the other hotends it is their distance from the extruder 0 hotend. // For the other hotends it is their distance from the extruder 0 hotend.

View file

@ -120,6 +120,9 @@
// :[1,2,3,4] // :[1,2,3,4]
#define EXTRUDERS 2 #define EXTRUDERS 2
// For Cyclops or any "multi-extruder" that shares a single nozzle.
//#define SINGLENOZZLE
// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). // Offset of the extruders (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 extruder 0 hotend (default extruder). // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
// For the other hotends it is their distance from the extruder 0 hotend. // For the other hotends it is their distance from the extruder 0 hotend.

View file

@ -123,6 +123,9 @@
// :[1,2,3,4] // :[1,2,3,4]
#define EXTRUDERS 1 #define EXTRUDERS 1
// For Cyclops or any "multi-extruder" that shares a single nozzle.
//#define SINGLENOZZLE
// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). // Offset of the extruders (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 extruder 0 hotend (default extruder). // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
// For the other hotends it is their distance from the extruder 0 hotend. // For the other hotends it is their distance from the extruder 0 hotend.

View file

@ -120,6 +120,9 @@
// :[1,2,3,4] // :[1,2,3,4]
#define EXTRUDERS 1 #define EXTRUDERS 1
// For Cyclops or any "multi-extruder" that shares a single nozzle.
//#define SINGLENOZZLE
// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). // Offset of the extruders (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 extruder 0 hotend (default extruder). // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
// For the other hotends it is their distance from the extruder 0 hotend. // For the other hotends it is their distance from the extruder 0 hotend.

View file

@ -127,6 +127,9 @@
// :[1,2,3,4] // :[1,2,3,4]
#define EXTRUDERS 1 #define EXTRUDERS 1
// For Cyclops or any "multi-extruder" that shares a single nozzle.
//#define SINGLENOZZLE
// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). // Offset of the extruders (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 extruder 0 hotend (default extruder). // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
// For the other hotends it is their distance from the extruder 0 hotend. // For the other hotends it is their distance from the extruder 0 hotend.

View file

@ -120,6 +120,9 @@
// :[1,2,3,4] // :[1,2,3,4]
#define EXTRUDERS 1 #define EXTRUDERS 1
// For Cyclops or any "multi-extruder" that shares a single nozzle.
//#define SINGLENOZZLE
// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). // Offset of the extruders (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 extruder 0 hotend (default extruder). // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
// For the other hotends it is their distance from the extruder 0 hotend. // For the other hotends it is their distance from the extruder 0 hotend.

View file

@ -120,6 +120,9 @@
// :[1,2,3,4] // :[1,2,3,4]
#define EXTRUDERS 1 // Single extruder. Set to 2 for dual extruders #define EXTRUDERS 1 // Single extruder. Set to 2 for dual extruders
// For Cyclops or any "multi-extruder" that shares a single nozzle.
//#define SINGLENOZZLE
// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). // Offset of the extruders (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 extruder 0 hotend (default extruder). // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
// For the other hotends it is their distance from the extruder 0 hotend. // For the other hotends it is their distance from the extruder 0 hotend.

View file

@ -145,6 +145,9 @@
// :[1,2,3,4] // :[1,2,3,4]
#define EXTRUDERS 1 #define EXTRUDERS 1
// For Cyclops or any "multi-extruder" that shares a single nozzle.
//#define SINGLENOZZLE
// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). // Offset of the extruders (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 extruder 0 hotend (default extruder). // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
// For the other hotends it is their distance from the extruder 0 hotend. // For the other hotends it is their distance from the extruder 0 hotend.

View file

@ -120,6 +120,9 @@
// :[1,2,3,4] // :[1,2,3,4]
#define EXTRUDERS 1 #define EXTRUDERS 1
// For Cyclops or any "multi-extruder" that shares a single nozzle.
//#define SINGLENOZZLE
// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). // Offset of the extruders (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 extruder 0 hotend (default extruder). // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
// For the other hotends it is their distance from the extruder 0 hotend. // For the other hotends it is their distance from the extruder 0 hotend.

View file

@ -123,6 +123,9 @@
// :[1,2,3,4] // :[1,2,3,4]
#define EXTRUDERS 1 #define EXTRUDERS 1
// For Cyclops or any "multi-extruder" that shares a single nozzle.
//#define SINGLENOZZLE
// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). // Offset of the extruders (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 extruder 0 hotend (default extruder). // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
// For the other hotends it is their distance from the extruder 0 hotend. // For the other hotends it is their distance from the extruder 0 hotend.

View file

@ -120,6 +120,9 @@
// :[1,2,3,4] // :[1,2,3,4]
#define EXTRUDERS 1 #define EXTRUDERS 1
// For Cyclops or any "multi-extruder" that shares a single nozzle.
//#define SINGLENOZZLE
// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). // Offset of the extruders (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 extruder 0 hotend (default extruder). // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
// For the other hotends it is their distance from the extruder 0 hotend. // For the other hotends it is their distance from the extruder 0 hotend.

View file

@ -120,6 +120,9 @@
// :[1,2,3,4] // :[1,2,3,4]
#define EXTRUDERS 2 #define EXTRUDERS 2
// For Cyclops or any "multi-extruder" that shares a single nozzle.
//#define SINGLENOZZLE
// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). // Offset of the extruders (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 extruder 0 hotend (default extruder). // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
// For the other hotends it is their distance from the extruder 0 hotend. // For the other hotends it is their distance from the extruder 0 hotend.

View file

@ -120,6 +120,9 @@
// :[1,2,3,4] // :[1,2,3,4]
#define EXTRUDERS 1 #define EXTRUDERS 1
// For Cyclops or any "multi-extruder" that shares a single nozzle.
//#define SINGLENOZZLE
// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). // Offset of the extruders (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 extruder 0 hotend (default extruder). // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
// For the other hotends it is their distance from the extruder 0 hotend. // For the other hotends it is their distance from the extruder 0 hotend.

View file

@ -120,6 +120,9 @@
// :[1,2,3,4] // :[1,2,3,4]
#define EXTRUDERS 1 #define EXTRUDERS 1
// For Cyclops or any "multi-extruder" that shares a single nozzle.
//#define SINGLENOZZLE
// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). // Offset of the extruders (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 extruder 0 hotend (default extruder). // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
// For the other hotends it is their distance from the extruder 0 hotend. // For the other hotends it is their distance from the extruder 0 hotend.

View file

@ -126,6 +126,9 @@
// :[1,2,3,4] // :[1,2,3,4]
#define EXTRUDERS 1 #define EXTRUDERS 1
// For Cyclops or any "multi-extruder" that shares a single nozzle.
//#define SINGLENOZZLE
// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). // Offset of the extruders (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 extruder 0 hotend (default extruder). // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
// For the other hotends it is their distance from the extruder 0 hotend. // For the other hotends it is their distance from the extruder 0 hotend.

View file

@ -113,6 +113,9 @@
// :[1,2,3,4] // :[1,2,3,4]
#define EXTRUDERS 1 #define EXTRUDERS 1
// For Cyclops or any "multi-extruder" that shares a single nozzle.
//#define SINGLENOZZLE
// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). // Offset of the extruders (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 extruder 0 hotend (default extruder). // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
// For the other hotends it is their distance from the extruder 0 hotend. // For the other hotends it is their distance from the extruder 0 hotend.

View file

@ -120,6 +120,9 @@
// :[1,2,3,4] // :[1,2,3,4]
#define EXTRUDERS 1 #define EXTRUDERS 1
// For Cyclops or any "multi-extruder" that shares a single nozzle.
//#define SINGLENOZZLE
// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). // Offset of the extruders (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 extruder 0 hotend (default extruder). // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
// For the other hotends it is their distance from the extruder 0 hotend. // For the other hotends it is their distance from the extruder 0 hotend.

View file

@ -120,6 +120,9 @@
// :[1,2,3,4] // :[1,2,3,4]
#define EXTRUDERS 1 #define EXTRUDERS 1
// For Cyclops or any "multi-extruder" that shares a single nozzle.
//#define SINGLENOZZLE
// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). // Offset of the extruders (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 extruder 0 hotend (default extruder). // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
// For the other hotends it is their distance from the extruder 0 hotend. // For the other hotends it is their distance from the extruder 0 hotend.

View file

@ -417,19 +417,29 @@ float Temperature::get_pid_output(int e) {
pid_output = pTerm[e] + iTerm[e] - dTerm[e]; pid_output = pTerm[e] + iTerm[e] - dTerm[e];
#if ENABLED(SINGLENOZZLE)
#define _NOZZLE_TEST true
#define _NOZZLE_EXTRUDER active_extruder
#define _CTERM_INDEX 0
#else
#define _NOZZLE_TEST e == active_extruder
#define _NOZZLE_EXTRUDER e
#define _CTERM_INDEX e
#endif
#if ENABLED(PID_ADD_EXTRUSION_RATE) #if ENABLED(PID_ADD_EXTRUSION_RATE)
cTerm[e] = 0; cTerm[_CTERM_INDEX] = 0;
if (e == active_extruder) { if (_NOZZLE_TEST) {
long e_position = stepper.position(E_AXIS); long e_position = stepper.position(E_AXIS);
if (e_position > last_position[e]) { if (e_position > last_position[_NOZZLE_EXTRUDER]) {
lpq[lpq_ptr++] = e_position - last_position[e]; lpq[lpq_ptr++] = e_position - last_position[_NOZZLE_EXTRUDER];
last_position[e] = e_position; last_position[_NOZZLE_EXTRUDER] = e_position;
} }
else { else {
lpq[lpq_ptr++] = 0; lpq[lpq_ptr++] = 0;
} }
if (lpq_ptr >= lpq_len) lpq_ptr = 0; if (lpq_ptr >= lpq_len) lpq_ptr = 0;
cTerm[e] = (lpq[lpq_ptr] / planner.axis_steps_per_unit[E_AXIS]) * PID_PARAM(Kc, e); cTerm[_CTERM_INDEX] = (lpq[lpq_ptr] / planner.axis_steps_per_unit[E_AXIS]) * PID_PARAM(Kc, e);
pid_output += cTerm[e]; pid_output += cTerm[e];
} }
#endif //PID_ADD_EXTRUSION_RATE #endif //PID_ADD_EXTRUSION_RATE