Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
MarlinKimbra
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
machinery
MarlinKimbra
Commits
5f774564
Commit
5f774564
authored
Apr 03, 2016
by
MagoKimbra
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Hotend offset & add variant Core
parent
1d25bf4b
Changes
16
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
297 additions
and
254 deletions
+297
-254
Configuration_Basic.h
MK/Configuration_Basic.h
+12
-0
Configuration_Cartesian.h
MK/Configuration_Cartesian.h
+21
-11
Configuration_Core.h
MK/Configuration_Core.h
+23
-12
Configuration_Delta.h
MK/Configuration_Delta.h
+18
-5
Configuration_Feature.h
MK/Configuration_Feature.h
+3
-3
Configuration_Store.cpp
MK/Configuration_Store.cpp
+47
-61
base.h
MK/base.h
+4
-0
MK_Main.cpp
MK/module/MK_Main.cpp
+96
-104
MK_Main.h
MK/module/MK_Main.h
+6
-13
502.h
MK/module/boards/502.h
+3
-3
language.h
MK/module/language/language.h
+7
-2
mechanics.h
MK/module/mechanics.h
+3
-1
planner.cpp
MK/module/motion/planner.cpp
+25
-20
stepper.cpp
MK/module/motion/stepper.cpp
+13
-13
stepper.h
MK/module/motion/stepper.h
+3
-2
sanitycheck.h
MK/module/sanitycheck.h
+13
-4
No files found.
MK/Configuration_Basic.h
View file @
5f774564
...
@@ -72,10 +72,22 @@
...
@@ -72,10 +72,22 @@
/***********************************************************************
/***********************************************************************
*************************** Mechanism type ****************************
*************************** Mechanism type ****************************
***********************************************************************
* *
* CARTESIAN - Prusa, Mendel, etc *
* COREXY - H-Bot/Core XY (x_motor = x+y, y_motor = x-y) *
* COREYX - H-Bot/Core XY (x_motor = y+x, y_motor = y-x) *
* COREXZ - H-Bot/Core XZ (x_motor = x+z, z_motor = x-z) *
* COREZX - H-Bot/Core XZ (x_motor = z+x, z_motor = z-x) *
* DELTA - Rostock, Kossel, RostockMax, Cerberus, etc *
* SCARA - SCARA *
* *
***********************************************************************/
***********************************************************************/
#define MECHANISM MECH_CARTESIAN
#define MECHANISM MECH_CARTESIAN
//#define MECHANISM MECH_COREXY
//#define MECHANISM MECH_COREXY
//#define MECHANISM MECH_COREYX
//#define MECHANISM MECH_COREXZ
//#define MECHANISM MECH_COREXZ
//#define MECHANISM MECH_COREZX
//#define MECHANISM MECH_DELTA
//#define MECHANISM MECH_DELTA
//#define MECHANISM MECH_SCARA
//#define MECHANISM MECH_SCARA
/***********************************************************************/
/***********************************************************************/
...
...
MK/Configuration_Cartesian.h
View file @
5f774564
...
@@ -278,9 +278,19 @@
...
@@ -278,9 +278,19 @@
// Offsets to the probe relative to the extruder tip (Hotend - Probe)
// Offsets to the probe relative to the extruder tip (Hotend - Probe)
// X and Y offsets MUST be INTEGERS
// X and Y offsets MUST be INTEGERS
#define X_PROBE_OFFSET_FROM_EXTRUDER 0 // Probe on: -left +right
//
#define Y_PROBE_OFFSET_FROM_EXTRUDER 0 // Probe on: -front +behind
// +-- BACK ---+
#define Z_PROBE_OFFSET_FROM_EXTRUDER -1 // -below (always!)
// | |
// L | (+) P | R <-- probe (10,10)
// E | | I
// F | (-) N (+) | G <-- nozzle (0,0)
// T | | H
// | P (-) | T <-- probe (-10,-10)
// | |
// O-- FRONT --+
#define X_PROBE_OFFSET_FROM_EXTRUDER 0 // X offset: -left [of the nozzle] +right
#define Y_PROBE_OFFSET_FROM_EXTRUDER 0 // Y offset: -front [of the nozzle] +behind
#define Z_PROBE_OFFSET_FROM_EXTRUDER -1 // Z offset: -below [of the nozzle] (always negative!)
#define Z_RAISE_BEFORE_HOMING 10 // (in mm) Raise Z before homing (G28) for Probe Clearance.
#define Z_RAISE_BEFORE_HOMING 10 // (in mm) Raise Z before homing (G28) for Probe Clearance.
// Be sure you have this distance over your Z_MAX_POS in case
// Be sure you have this distance over your Z_MAX_POS in case
...
@@ -419,9 +429,9 @@
...
@@ -419,9 +429,9 @@
* For the other hotends it is their distance from the hotend 0. *
* For the other hotends it is their distance from the hotend 0. *
* *
* *
*****************************************************************************************/
*****************************************************************************************/
//#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_X {0.0, 0
.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_Y {0.0, 0
.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
#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
/*****************************************************************************************/
/*****************************************************************************************/
...
...
MK/Configuration_Core.h
View file @
5f774564
...
@@ -46,7 +46,8 @@
...
@@ -46,7 +46,8 @@
/*****************************************************************************************
/*****************************************************************************************
************************************* Core settings *************************************
************************************* Core settings *************************************
*****************************************************************************************
*****************************************************************************************
* This define the moltiplicator axis from X to Y or Z in COREXY or COREXZ. *
* This define the moltiplicator axis from X to Y or Z in *
* COREXY - COREYX or COREXZ - COREZX *
* Example: *
* Example: *
* COREXY set COREX_YZ_FACTOR 1 *
* COREXY set COREX_YZ_FACTOR 1 *
* The result is: *
* The result is: *
...
@@ -299,9 +300,19 @@
...
@@ -299,9 +300,19 @@
// Offsets to the probe relative to the extruder tip (Hotend - Probe)
// Offsets to the probe relative to the extruder tip (Hotend - Probe)
// X and Y offsets MUST be INTEGERS
// X and Y offsets MUST be INTEGERS
#define X_PROBE_OFFSET_FROM_EXTRUDER 0 // Probe on: -left +right
//
#define Y_PROBE_OFFSET_FROM_EXTRUDER 0 // Probe on: -front +behind
// +-- BACK ---+
#define Z_PROBE_OFFSET_FROM_EXTRUDER -1 // -below (always!)
// | |
// L | (+) P | R <-- probe (10,10)
// E | | I
// F | (-) N (+) | G <-- nozzle (0,0)
// T | | H
// | P (-) | T <-- probe (-10,-10)
// | |
// O-- FRONT --+
#define X_PROBE_OFFSET_FROM_EXTRUDER 0 // X offset: -left [of the nozzle] +right
#define Y_PROBE_OFFSET_FROM_EXTRUDER 0 // Y offset: -front [of the nozzle] +behind
#define Z_PROBE_OFFSET_FROM_EXTRUDER -1 // Z offset: -below [of the nozzle] (always negative!)
#define Z_RAISE_BEFORE_HOMING 10 // (in mm) Raise Z before homing (G28) for Probe Clearance.
#define Z_RAISE_BEFORE_HOMING 10 // (in mm) Raise Z before homing (G28) for Probe Clearance.
// Be sure you have this distance over your Z_MAX_POS in case
// Be sure you have this distance over your Z_MAX_POS in case
...
@@ -440,9 +451,9 @@
...
@@ -440,9 +451,9 @@
* For the other hotends it is their distance from the hotend 0. *
* For the other hotends it is their distance from the hotend 0. *
* *
* *
*****************************************************************************************/
*****************************************************************************************/
//#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_X {0.0, 0
.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_Y {0.0, 0
.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
#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
#endif
\ No newline at end of file
MK/Configuration_Delta.h
View file @
5f774564
...
@@ -118,8 +118,21 @@
...
@@ -118,8 +118,21 @@
#define PROBE_COUNT 3
#define PROBE_COUNT 3
// Z-Probe variables
// Z-Probe variables
// X, Y, Z, E distance between hotend nozzle and deployed bed leveling probe.
// Offsets to the probe relative to the extruder tip (Hotend - Probe)
#define Z_PROBE_OFFSET {0, 0, -1}
// X and Y offsets MUST be INTEGERS
//
// +-- BACK ---+
// | |
// L | (+) P | R <-- probe (10,10)
// E | | I
// F | (-) N (+) | G <-- nozzle (0,0)
// T | | H
// | P (-) | T <-- probe (-10,-10)
// | |
// O-- FRONT --+
#define X_PROBE_OFFSET_FROM_EXTRUDER 0 // X offset: -left [of the nozzle] +right
#define Y_PROBE_OFFSET_FROM_EXTRUDER 0 // Y offset: -front [of the nozzle] +behind
#define Z_PROBE_OFFSET_FROM_EXTRUDER -1 // Z offset: -below [of the nozzle] (always negative!)
// Start and end location values are used to deploy/retract the probe (will move from start to end and back again)
// Start and end location values are used to deploy/retract the probe (will move from start to end and back again)
#define Z_PROBE_DEPLOY_START_LOCATION {0, 0, 20} // X, Y, Z, E start location for z-probe deployment sequence
#define Z_PROBE_DEPLOY_START_LOCATION {0, 0, 20} // X, Y, Z, E start location for z-probe deployment sequence
...
@@ -377,9 +390,9 @@
...
@@ -377,9 +390,9 @@
* For the other hotends it is their distance from the hotend 0. *
* For the other hotends it is their distance from the hotend 0. *
* *
* *
*****************************************************************************************/
*****************************************************************************************/
//#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_X {0.0, 0
.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_Y {0.0, 0
.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
#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
#endif
\ No newline at end of file
MK/Configuration_Feature.h
View file @
5f774564
...
@@ -182,9 +182,9 @@
...
@@ -182,9 +182,9 @@
#define LPQ_MAX_LEN 50
#define LPQ_MAX_LEN 50
// HotEnd{HE0,HE1,HE2,HE3}
// HotEnd{HE0,HE1,HE2,HE3}
#define DEFAULT_Kp {40, 40, 40, 40} // Kp for
E0, E1, E2, E
3
#define DEFAULT_Kp {40, 40, 40, 40} // Kp for
H0, H1, H2, H
3
#define DEFAULT_Ki {07, 07, 07, 07} // Ki for
E0, E1, E2, E
3
#define DEFAULT_Ki {07, 07, 07, 07} // Ki for
H0, H1, H2, H
3
#define DEFAULT_Kd {60, 60, 60, 60} // Kd for
E0, E1, E2, E
3
#define DEFAULT_Kd {60, 60, 60, 60} // Kd for
H0, H1, H2, H
3
#define DEFAULT_Kc {100, 100, 100, 100} // heating power = Kc * (e_speed)
#define DEFAULT_Kc {100, 100, 100, 100} // heating power = Kc * (e_speed)
/***********************************************************************/
/***********************************************************************/
...
...
MK/Configuration_Store.cpp
View file @
5f774564
...
@@ -16,10 +16,10 @@
...
@@ -16,10 +16,10 @@
*
*
*/
*/
#define EEPROM_VERSION "
V25
"
#define EEPROM_VERSION "
MKV428
"
/**
/**
*
V25
EEPROM Layout:
*
MKV428
EEPROM Layout:
*
*
* ver
* ver
* M92 XYZ E0 ... axis_steps_per_unit X,Y,Z,E0 ... (per extruder)
* M92 XYZ E0 ... axis_steps_per_unit X,Y,Z,E0 ... (per extruder)
...
@@ -35,13 +35,11 @@
...
@@ -35,13 +35,11 @@
* M205 Z max_z_jerk
* M205 Z max_z_jerk
* M205 E E0 ... max_e_jerk (per extruder)
* M205 E E0 ... max_e_jerk (per extruder)
* M206 XYZ home_offset (x3)
* M206 XYZ home_offset (x3)
* M666 P zprobe_zoffset
*
* HOTENDS OFFSET:
* M218 T XY hotend_offset (x4) (T0..3)
* M218 T XY hotend_offset (x4) (T0..3)
* M666 P zprobe_zoffset
*
*
* HOTENDS AD595:
* HOTENDS AD595:
* M595
T O G
Hotend AD595 Offset & Gain
* M595
H OS
Hotend AD595 Offset & Gain
*
*
* DELTA:
* DELTA:
* M666 XYZ endstop_adj (x3)
* M666 XYZ endstop_adj (x3)
...
@@ -137,7 +135,7 @@ void _EEPROM_readData(int& pos, uint8_t* value, uint8_t size) {
...
@@ -137,7 +135,7 @@ void _EEPROM_readData(int& pos, uint8_t* value, uint8_t size) {
void
Config_StoreSettings
()
{
void
Config_StoreSettings
()
{
float
dummy
=
0.0
f
;
float
dummy
=
0.0
f
;
char
ver
[
4
]
=
"
000"
;
char
ver
[
7
]
=
"000
000"
;
int
i
=
EEPROM_OFFSET
;
int
i
=
EEPROM_OFFSET
;
EEPROM_WRITE_VAR
(
i
,
ver
);
// invalidate data first
EEPROM_WRITE_VAR
(
i
,
ver
);
// invalidate data first
EEPROM_WRITE_VAR
(
i
,
axis_steps_per_unit
);
EEPROM_WRITE_VAR
(
i
,
axis_steps_per_unit
);
...
@@ -153,15 +151,12 @@ void Config_StoreSettings() {
...
@@ -153,15 +151,12 @@ void Config_StoreSettings() {
EEPROM_WRITE_VAR
(
i
,
max_z_jerk
);
EEPROM_WRITE_VAR
(
i
,
max_z_jerk
);
EEPROM_WRITE_VAR
(
i
,
max_e_jerk
);
EEPROM_WRITE_VAR
(
i
,
max_e_jerk
);
EEPROM_WRITE_VAR
(
i
,
home_offset
);
EEPROM_WRITE_VAR
(
i
,
home_offset
);
EEPROM_WRITE_VAR
(
i
,
hotend_offset
);
#if !MECH(DELTA)
#if !MECH(DELTA)
EEPROM_WRITE_VAR
(
i
,
zprobe_zoffset
);
EEPROM_WRITE_VAR
(
i
,
zprobe_zoffset
);
#endif
#endif
#if HOTENDS > 1
EEPROM_WRITE_VAR
(
i
,
hotend_offset
);
#endif
#if HEATER_USES_AD595
#if HEATER_USES_AD595
EEPROM_WRITE_VAR
(
i
,
ad595_offset
);
EEPROM_WRITE_VAR
(
i
,
ad595_offset
);
EEPROM_WRITE_VAR
(
i
,
ad595_gain
);
EEPROM_WRITE_VAR
(
i
,
ad595_gain
);
...
@@ -248,10 +243,8 @@ void Config_StoreSettings() {
...
@@ -248,10 +243,8 @@ void Config_StoreSettings() {
EEPROM_WRITE_VAR
(
i
,
volumetric_enabled
);
EEPROM_WRITE_VAR
(
i
,
volumetric_enabled
);
// Save filament sizes
// Save filament sizes
for
(
int
q
=
0
;
q
<
4
;
q
++
)
{
for
(
int
e
=
0
;
e
<
EXTRUDERS
;
e
++
)
if
(
q
<
EXTRUDERS
)
dummy
=
filament_size
[
q
];
EEPROM_WRITE_VAR
(
i
,
filament_size
[
e
]);
EEPROM_WRITE_VAR
(
i
,
dummy
);
}
#if ENABLED(IDLE_OOZING_PREVENT)
#if ENABLED(IDLE_OOZING_PREVENT)
EEPROM_WRITE_VAR
(
i
,
IDLE_OOZING_enabled
);
EEPROM_WRITE_VAR
(
i
,
IDLE_OOZING_enabled
);
...
@@ -261,7 +254,7 @@ void Config_StoreSettings() {
...
@@ -261,7 +254,7 @@ void Config_StoreSettings() {
EEPROM_WRITE_VAR
(
i
,
motor_current
);
EEPROM_WRITE_VAR
(
i
,
motor_current
);
#endif
#endif
char
ver2
[
4
]
=
EEPROM_VERSION
;
char
ver2
[
7
]
=
EEPROM_VERSION
;
int
j
=
EEPROM_OFFSET
;
int
j
=
EEPROM_OFFSET
;
EEPROM_WRITE_VAR
(
j
,
ver2
);
// validate data
EEPROM_WRITE_VAR
(
j
,
ver2
);
// validate data
...
@@ -276,12 +269,12 @@ void Config_StoreSettings() {
...
@@ -276,12 +269,12 @@ void Config_StoreSettings() {
void
Config_RetrieveSettings
()
{
void
Config_RetrieveSettings
()
{
int
i
=
EEPROM_OFFSET
;
int
i
=
EEPROM_OFFSET
;
char
stored_ver
[
4
];
char
stored_ver
[
7
];
char
ver
[
4
]
=
EEPROM_VERSION
;
char
ver
[
7
]
=
EEPROM_VERSION
;
EEPROM_READ_VAR
(
i
,
stored_ver
);
//read stored version
EEPROM_READ_VAR
(
i
,
stored_ver
);
//
read stored version
//
ECHO_EM("Version: [" << ver << "] Stored version: [" << stored_ver << "]");
//ECHO_EM("Version: [" << ver << "] Stored version: [" << stored_ver << "]");
if
(
strncmp
(
ver
,
stored_ver
,
3
)
!=
0
)
{
if
(
strncmp
(
ver
,
stored_ver
,
6
)
!=
0
)
{
Config_ResetDefault
();
Config_ResetDefault
();
}
}
else
{
else
{
...
@@ -305,15 +298,12 @@ void Config_RetrieveSettings() {
...
@@ -305,15 +298,12 @@ void Config_RetrieveSettings() {
EEPROM_READ_VAR
(
i
,
max_z_jerk
);
EEPROM_READ_VAR
(
i
,
max_z_jerk
);
EEPROM_READ_VAR
(
i
,
max_e_jerk
);
EEPROM_READ_VAR
(
i
,
max_e_jerk
);
EEPROM_READ_VAR
(
i
,
home_offset
);
EEPROM_READ_VAR
(
i
,
home_offset
);
EEPROM_READ_VAR
(
i
,
hotend_offset
);
#if !MECH(DELTA)
#if !MECH(DELTA)
EEPROM_READ_VAR
(
i
,
zprobe_zoffset
);
EEPROM_READ_VAR
(
i
,
zprobe_zoffset
);
#endif
#endif
#if HOTENDS > 1
EEPROM_READ_VAR
(
i
,
hotend_offset
);
#endif
#if HEATER_USES_AD595
#if HEATER_USES_AD595
EEPROM_READ_VAR
(
i
,
ad595_offset
);
EEPROM_READ_VAR
(
i
,
ad595_offset
);
EEPROM_READ_VAR
(
i
,
ad595_gain
);
EEPROM_READ_VAR
(
i
,
ad595_gain
);
...
@@ -400,10 +390,8 @@ void Config_RetrieveSettings() {
...
@@ -400,10 +390,8 @@ void Config_RetrieveSettings() {
EEPROM_READ_VAR
(
i
,
volumetric_enabled
);
EEPROM_READ_VAR
(
i
,
volumetric_enabled
);
for
(
int8_t
q
=
0
;
q
<
4
;
q
++
)
{
for
(
int8_t
e
=
0
;
e
<
EXTRUDERS
;
e
++
)
EEPROM_READ_VAR
(
i
,
dummy
);
EEPROM_READ_VAR
(
i
,
filament_size
[
e
]);
if
(
q
<
EXTRUDERS
)
filament_size
[
q
]
=
dummy
;
}
calculate_volumetric_multipliers
();
calculate_volumetric_multipliers
();
...
@@ -489,7 +477,6 @@ void Config_ResetDefault() {
...
@@ -489,7 +477,6 @@ void Config_ResetDefault() {
max_e_jerk
[
i
]
=
tmp5
[
i
];
max_e_jerk
[
i
]
=
tmp5
[
i
];
else
else
max_e_jerk
[
i
]
=
tmp5
[
max_i
-
1
];
max_e_jerk
[
i
]
=
tmp5
[
max_i
-
1
];
#if HOTENDS > 1
max_i
=
sizeof
(
tmp10
)
/
sizeof
(
*
tmp10
);
max_i
=
sizeof
(
tmp10
)
/
sizeof
(
*
tmp10
);
if
(
i
<
max_i
)
if
(
i
<
max_i
)
hotend_offset
[
X_AXIS
][
i
]
=
tmp10
[
i
];
hotend_offset
[
X_AXIS
][
i
]
=
tmp10
[
i
];
...
@@ -505,7 +492,6 @@ void Config_ResetDefault() {
...
@@ -505,7 +492,6 @@ void Config_ResetDefault() {
hotend_offset
[
Z_AXIS
][
i
]
=
tmp12
[
i
];
hotend_offset
[
Z_AXIS
][
i
]
=
tmp12
[
i
];
else
else
hotend_offset
[
Z_AXIS
][
i
]
=
0
;
hotend_offset
[
Z_AXIS
][
i
]
=
0
;
#endif // HOTENDS > 1
}
}
#if MB(ALLIGATOR)
#if MB(ALLIGATOR)
max_i
=
sizeof
(
tmp13
)
/
sizeof
(
*
tmp13
);
max_i
=
sizeof
(
tmp13
)
/
sizeof
(
*
tmp13
);
...
@@ -557,7 +543,9 @@ void Config_ResetDefault() {
...
@@ -557,7 +543,9 @@ void Config_ResetDefault() {
diagrod_adj
[
1
]
=
TOWER_B_DIAGROD_ADJ
;
diagrod_adj
[
1
]
=
TOWER_B_DIAGROD_ADJ
;
diagrod_adj
[
2
]
=
TOWER_C_DIAGROD_ADJ
;
diagrod_adj
[
2
]
=
TOWER_C_DIAGROD_ADJ
;
max_pos
[
2
]
=
MANUAL_Z_HOME_POS
;
max_pos
[
2
]
=
MANUAL_Z_HOME_POS
;
set_default_z_probe_offset
();
z_probe_offset
[
0
]
=
X_PROBE_OFFSET_FROM_EXTRUDER
;
z_probe_offset
[
1
]
=
Y_PROBE_OFFSET_FROM_EXTRUDER
;
z_probe_offset
[
2
]
=
Z_PROBE_OFFSET_FROM_EXTRUDER
;
set_delta_constants
();
set_delta_constants
();
#endif
#endif
...
@@ -717,7 +705,6 @@ void Config_ResetDefault() {
...
@@ -717,7 +705,6 @@ void Config_ResetDefault() {
ECHO_MV
(
" Y"
,
home_offset
[
Y_AXIS
]
);
ECHO_MV
(
" Y"
,
home_offset
[
Y_AXIS
]
);
ECHO_EMV
(
" Z"
,
home_offset
[
Z_AXIS
]
);
ECHO_EMV
(
" Z"
,
home_offset
[
Z_AXIS
]
);
#if HOTENDS > 1
if
(
!
forReplay
)
{
if
(
!
forReplay
)
{
ECHO_LM
(
CFG
,
"Hotend offset (mm):"
);
ECHO_LM
(
CFG
,
"Hotend offset (mm):"
);
}
}
...
@@ -727,7 +714,6 @@ void Config_ResetDefault() {
...
@@ -727,7 +714,6 @@ void Config_ResetDefault() {
ECHO_MV
(
" Y"
,
hotend_offset
[
Y_AXIS
][
h
]);
ECHO_MV
(
" Y"
,
hotend_offset
[
Y_AXIS
][
h
]);
ECHO_EMV
(
" Z"
,
hotend_offset
[
Z_AXIS
][
h
]);
ECHO_EMV
(
" Z"
,
hotend_offset
[
Z_AXIS
][
h
]);
}
}
#endif // HOTENDS > 1
#if HEATER_USES_AD595
#if HEATER_USES_AD595
if
(
!
forReplay
)
{
if
(
!
forReplay
)
{
...
@@ -736,7 +722,7 @@ void Config_ResetDefault() {
...
@@ -736,7 +722,7 @@ void Config_ResetDefault() {
for
(
int8_t
h
=
0
;
h
<
HOTENDS
;
h
++
)
{
for
(
int8_t
h
=
0
;
h
<
HOTENDS
;
h
++
)
{
ECHO_SMV
(
CFG
,
" M595 T"
,
h
);
ECHO_SMV
(
CFG
,
" M595 T"
,
h
);
ECHO_MV
(
" O"
,
ad595_offset
[
h
]);
ECHO_MV
(
" O"
,
ad595_offset
[
h
]);
ECHO_EMV
(
",
G
"
,
ad595_gain
[
h
]);
ECHO_EMV
(
",
S
"
,
ad595_gain
[
h
]);
}
}
#endif // HEATER_USES_AD595
#endif // HEATER_USES_AD595
...
...
MK/base.h
View file @
5f774564
...
@@ -23,8 +23,12 @@
...
@@ -23,8 +23,12 @@
#include "Configuration_Cartesian.h"
#include "Configuration_Cartesian.h"
#elif MECH(COREXY)
#elif MECH(COREXY)
#include "Configuration_Core.h"
#include "Configuration_Core.h"
#elif MECH(COREYX)
#include "Configuration_Core.h"
#elif MECH(COREXZ)
#elif MECH(COREXZ)
#include "Configuration_Core.h"
#include "Configuration_Core.h"
#elif MECH(COREZX)
#include "Configuration_Core.h"
#elif MECH(DELTA)
#elif MECH(DELTA)
#include "Configuration_Delta.h"
#include "Configuration_Delta.h"
#elif MECH(SCARA)
#elif MECH(SCARA)
...
...
MK/module/MK_Main.cpp
View file @
5f774564
...
@@ -74,6 +74,7 @@ bool volumetric_enabled = false;
...
@@ -74,6 +74,7 @@ bool volumetric_enabled = false;
float
filament_size
[
EXTRUDERS
]
=
ARRAY_BY_EXTRUDERS
(
DEFAULT_NOMINAL_FILAMENT_DIA
);
float
filament_size
[
EXTRUDERS
]
=
ARRAY_BY_EXTRUDERS
(
DEFAULT_NOMINAL_FILAMENT_DIA
);
float
volumetric_multiplier
[
EXTRUDERS
]
=
ARRAY_BY_EXTRUDERS
(
1.0
);
float
volumetric_multiplier
[
EXTRUDERS
]
=
ARRAY_BY_EXTRUDERS
(
1.0
);
float
home_offset
[
3
]
=
{
0
};
float
home_offset
[
3
]
=
{
0
};
float
hotend_offset
[
3
][
HOTENDS
];
float
min_pos
[
3
]
=
{
X_MIN_POS
,
Y_MIN_POS
,
Z_MIN_POS
};
float
min_pos
[
3
]
=
{
X_MIN_POS
,
Y_MIN_POS
,
Z_MIN_POS
};
float
max_pos
[
3
]
=
{
X_MAX_POS
,
Y_MAX_POS
,
Z_MAX_POS
};
float
max_pos
[
3
]
=
{
X_MAX_POS
,
Y_MAX_POS
,
Z_MAX_POS
};
...
@@ -115,11 +116,6 @@ double printer_usage_filament;
...
@@ -115,11 +116,6 @@ double printer_usage_filament;
float
z_endstop_adj
=
0
;
float
z_endstop_adj
=
0
;
#endif
#endif
// Hotend offset
#if HOTENDS > 1
float
hotend_offset
[
3
][
HOTENDS
];
#endif
#if HEATER_USES_AD595
#if HEATER_USES_AD595
float
ad595_offset
[
HOTENDS
]
=
ARRAY_BY_HOTENDS1
(
TEMP_SENSOR_AD595_OFFSET
);
float
ad595_offset
[
HOTENDS
]
=
ARRAY_BY_HOTENDS1
(
TEMP_SENSOR_AD595_OFFSET
);
float
ad595_gain
[
HOTENDS
]
=
ARRAY_BY_HOTENDS1
(
TEMP_SENSOR_AD595_GAIN
);
float
ad595_gain
[
HOTENDS
]
=
ARRAY_BY_HOTENDS1
(
TEMP_SENSOR_AD595_GAIN
);
...
@@ -136,6 +132,10 @@ double printer_usage_filament;
...
@@ -136,6 +132,10 @@ double printer_usage_filament;
bool
Spool_must_write
[
EXTRUDERS
]
=
ARRAY_BY_EXTRUDERS
(
false
);
bool
Spool_must_write
[
EXTRUDERS
]
=
ARRAY_BY_EXTRUDERS
(
false
);
#endif
#endif
#if HAS(SERVOS)
Servo
servo
[
NUM_SERVOS
];
#endif
#if HAS(SERVO_ENDSTOPS)
#if HAS(SERVO_ENDSTOPS)
const
int
servo_endstop_id
[]
=
SERVO_ENDSTOP_IDS
;
const
int
servo_endstop_id
[]
=
SERVO_ENDSTOP_IDS
;
const
int
servo_endstop_angle
[][
2
]
=
{
X_ENDSTOP_SERVO_ANGLES
,
Y_ENDSTOP_SERVO_ANGLES
,
Z_ENDSTOP_SERVO_ANGLES
};
const
int
servo_endstop_angle
[][
2
]
=
{
X_ENDSTOP_SERVO_ANGLES
,
Y_ENDSTOP_SERVO_ANGLES
,
Z_ENDSTOP_SERVO_ANGLES
};
...
@@ -173,6 +173,11 @@ double printer_usage_filament;
...
@@ -173,6 +173,11 @@ double printer_usage_filament;
#endif
#endif
#if MECH(DELTA)
#if MECH(DELTA)
#define TOWER_1 X_AXIS
#define TOWER_2 Y_AXIS
#define TOWER_3 Z_AXIS
float
delta
[
3
]
=
{
0.0
};
float
delta
[
3
]
=
{
0.0
};
float
delta_tmp
[
3
]
=
{
0.0
};
float
delta_tmp
[
3
]
=
{
0.0
};
float
endstop_adj
[
3
]
=
{
0
};
float
endstop_adj
[
3
]
=
{
0
};
...
@@ -191,7 +196,7 @@ double printer_usage_filament;
...
@@ -191,7 +196,7 @@ double printer_usage_filament;
float
base_max_pos
[
3
]
=
{
X_MAX_POS
,
Y_MAX_POS
,
Z_MAX_POS
};
float
base_max_pos
[
3
]
=
{
X_MAX_POS
,
Y_MAX_POS
,
Z_MAX_POS
};
float
base_home_pos
[
3
]
=
{
X_HOME_POS
,
Y_HOME_POS
,
Z_HOME_POS
};
float
base_home_pos
[
3
]
=
{
X_HOME_POS
,
Y_HOME_POS
,
Z_HOME_POS
};
float
max_length
[
3
]
=
{
X_MAX_LENGTH
,
Y_MAX_LENGTH
,
Z_MAX_LENGTH
};
float
max_length
[
3
]
=
{
X_MAX_LENGTH
,
Y_MAX_LENGTH
,
Z_MAX_LENGTH
};
float
z_probe_offset
[
3
]
=
Z_PROBE_OFFSET
;
float
z_probe_offset
[
3
];
float
bed_level
[
AUTO_BED_LEVELING_GRID_POINTS
][
AUTO_BED_LEVELING_GRID_POINTS
];
float
bed_level
[
AUTO_BED_LEVELING_GRID_POINTS
][
AUTO_BED_LEVELING_GRID_POINTS
];
int
delta_grid_spacing
[
2
]
=
{
0
,
0
};
int
delta_grid_spacing
[
2
]
=
{
0
,
0
};
const
float
bed_radius
=
DELTA_PROBABLE_RADIUS
;
const
float
bed_radius
=
DELTA_PROBABLE_RADIUS
;
...
@@ -293,10 +298,6 @@ double printer_usage_filament;
...
@@ -293,10 +298,6 @@ double printer_usage_filament;
bool
allow_lengthy_extrude_once
;
// for load/unload
bool
allow_lengthy_extrude_once
;
// for load/unload
#endif
#endif
#if HAS(SERVOS)
Servo
servo
[
NUM_SERVOS
];
#endif
#if HAS(CHDK)
#if HAS(CHDK)
unsigned
long
chdkHigh
=
0
;
unsigned
long
chdkHigh
=
0
;
boolean
chdkActive
=
false
;
boolean
chdkActive
=
false
;
...
@@ -320,8 +321,6 @@ void process_next_command();
...
@@ -320,8 +321,6 @@ void process_next_command();
void
plan_arc
(
float
target
[
NUM_AXIS
],
float
*
offset
,
uint8_t
clockwise
);
void
plan_arc
(
float
target
[
NUM_AXIS
],
float
*
offset
,
uint8_t
clockwise
);
bool
setTargetedExtruder
(
int
code
);
#if ENABLED(PREVENT_DANGEROUS_EXTRUDE)
#if ENABLED(PREVENT_DANGEROUS_EXTRUDE)
float
extrude_min_temp
=
EXTRUDE_MINTEMP
;
float
extrude_min_temp
=
EXTRUDE_MINTEMP
;
#endif
#endif
...
@@ -973,7 +972,7 @@ DEFINE_PGM_READ_ANY(signed char, byte);
...
@@ -973,7 +972,7 @@ DEFINE_PGM_READ_ANY(signed char, byte);
static inline type array(int axis) \
static inline type array(int axis) \
{ return pgm_read_any(&array##_P[axis]); }
{ return pgm_read_any(&array##_P[axis]); }
#if MECH(CARTESIAN) || MECH(COREXY) || MECH(CORE
XZ
) || MECH(SCARA)
#if MECH(CARTESIAN) || MECH(COREXY) || MECH(CORE
YX) || MECH(COREXZ) || MECH(COREZX
) || MECH(SCARA)
XYZ_CONSTS_FROM_CONFIG
(
float
,
base_max_pos
,
MAX_POS
);
XYZ_CONSTS_FROM_CONFIG
(
float
,
base_max_pos
,
MAX_POS
);
XYZ_CONSTS_FROM_CONFIG
(
float
,
base_home_pos
,
HOME_POS
);
XYZ_CONSTS_FROM_CONFIG
(
float
,
base_home_pos
,
HOME_POS
);
XYZ_CONSTS_FROM_CONFIG
(
float
,
max_length
,
MAX_LENGTH
);
XYZ_CONSTS_FROM_CONFIG
(
float
,
max_length
,
MAX_LENGTH
);
...
@@ -1126,7 +1125,7 @@ inline void sync_plan_position() {
...
@@ -1126,7 +1125,7 @@ inline void sync_plan_position() {
#if MECH(DELTA) || MECH(SCARA)
#if MECH(DELTA) || MECH(SCARA)
inline
void
sync_plan_position_delta
()
{
inline
void
sync_plan_position_delta
()
{
calculate_delta
(
current_position
);
calculate_delta
(
current_position
);
plan_set_position
(
delta
[
X_AXIS
],
delta
[
Y_AXIS
],
delta
[
Z_AXIS
],
current_position
[
E_AXIS
]);
plan_set_position
(
delta
[
TOWER_1
],
delta
[
TOWER_2
],
delta
[
TOWER_3
],
current_position
[
E_AXIS
]);
}
}
#endif
#endif
inline
void
set_current_to_destination
()
{
memcpy
(
current_position
,
destination
,
sizeof
(
current_position
));
}
inline
void
set_current_to_destination
()
{
memcpy
(
current_position
,
destination
,
sizeof
(
current_position
));
}
...
@@ -1150,7 +1149,7 @@ static void clean_up_after_endstop_move() {
...
@@ -1150,7 +1149,7 @@ static void clean_up_after_endstop_move() {
endstops_hit_on_purpose
();
// clear endstop hit flags
endstops_hit_on_purpose
();
// clear endstop hit flags
}
}
#if MECH(CARTESIAN) || MECH(COREXY) || MECH(CORE
XZ
) || MECH(SCARA)
#if MECH(CARTESIAN) || MECH(COREXY) || MECH(CORE
YX) || MECH(COREXZ) || MECH(COREZX
) || MECH(SCARA)
/**
/**
* Plan a move to (X, Y, Z) and set the current_position
* Plan a move to (X, Y, Z) and set the current_position
...
@@ -1534,7 +1533,7 @@ static void clean_up_after_endstop_move() {
...
@@ -1534,7 +1533,7 @@ static void clean_up_after_endstop_move() {
}
}
}
}
#define HOMEAXIS(LETTER) homeaxis(LETTER##_AXIS)
#define HOMEAXIS(LETTER) homeaxis(LETTER##_AXIS)
#endif // CARTESIAN || COREXY || CORE
XZ
|| SCARA
#endif // CARTESIAN || COREXY || CORE
YX || COREXZ || COREZX
|| SCARA
#if MECH(DELTA)
#if MECH(DELTA)
static
void
homeaxis
(
AxisEnum
axis
)
{
static
void
homeaxis
(
AxisEnum
axis
)
{
...
@@ -1611,11 +1610,6 @@ static void clean_up_after_endstop_move() {
...
@@ -1611,11 +1610,6 @@ static void clean_up_after_endstop_move() {
}
}
#define HOMEAXIS(LETTER) homeaxis(LETTER##_AXIS)
#define HOMEAXIS(LETTER) homeaxis(LETTER##_AXIS)
void
set_default_z_probe_offset
()
{
float
default_z_probe_offset
[]
=
Z_PROBE_OFFSET
;
memcpy
(
z_probe_offset
,
default_z_probe_offset
,
sizeof
(
z_probe_offset
));
}
void
set_delta_constants
()
{
void
set_delta_constants
()
{
max_length
[
Z_AXIS
]
=
max_pos
[
Z_AXIS
]
-
Z_MIN_POS
;
max_length
[
Z_AXIS
]
=
max_pos
[
Z_AXIS
]
-
Z_MIN_POS
;
base_max_pos
[
Z_AXIS
]
=
max_pos
[
Z_AXIS
];
base_max_pos
[
Z_AXIS
]
=
max_pos
[
Z_AXIS
];
...
@@ -1758,7 +1752,7 @@ static void clean_up_after_endstop_move() {
...
@@ -1758,7 +1752,7 @@ static void clean_up_after_endstop_move() {
endstop_adj
[
Z_AXIS
]
+=
z_endstop
;
endstop_adj
[
Z_AXIS
]
+=
z_endstop
;
calculate_delta
(
current_position
);
calculate_delta
(
current_position
);
plan_set_position
(
delta
[
X_AXIS
]
-
(
endstop_adj
[
X_AXIS
]
-
saved_endstop_adj
[
X_AXIS
])
,
delta
[
Y_AXIS
]
-
(
endstop_adj
[
Y_AXIS
]
-
saved_endstop_adj
[
Y_AXIS
]),
delta
[
Z_AXIS
]
-
(
endstop_adj
[
Z_AXIS
]
-
saved_endstop_adj
[
Z_AXIS
]),
current_position
[
E_AXIS
]);
plan_set_position
(
delta
[
TOWER_1
]
-
(
endstop_adj
[
X_AXIS
]
-
saved_endstop_adj
[
X_AXIS
])
,
delta
[
TOWER_2
]
-
(
endstop_adj
[
Y_AXIS
]
-
saved_endstop_adj
[
Y_AXIS
]),
delta
[
TOWER_3
]
-
(
endstop_adj
[
Z_AXIS
]
-
saved_endstop_adj
[
Z_AXIS
]),
current_position
[
E_AXIS
]);
st_synchronize
();
st_synchronize
();
}
}
...
@@ -2477,20 +2471,20 @@ static void clean_up_after_endstop_move() {
...
@@ -2477,20 +2471,20 @@ static void clean_up_after_endstop_move() {
}
}
refresh_cmd_timeout
();
refresh_cmd_timeout
();
calculate_delta
(
destination
);
calculate_delta
(
destination
);
plan_buffer_line
(
delta
[
X_AXIS
],
delta
[
Y_AXIS
],
delta
[
Z_AXIS
],
destination
[
E_AXIS
],
feedrate
*
feedrate_multiplier
/
60
/
100.0
,
active_extruder
,
active_driver
);
plan_buffer_line
(
delta
[
TOWER_1
],
delta
[
TOWER_2
],
delta
[
TOWER_3
],
destination
[
E_AXIS
],
feedrate
*
feedrate_multiplier
/
60
/
100.0
,
active_extruder
,
active_driver
);
set_current_to_destination
();
set_current_to_destination
();
}
}
void
calculate_delta
(
float
cartesian
[
3
])
{
void
calculate_delta
(
float
cartesian
[
3
])
{
delta
[
X_AXIS
]
=
sqrt
(
delta_diagonal_rod_1
delta
[
TOWER_1
]
=
sqrt
(
delta_diagonal_rod_1
-
sq
(
delta_tower1_x
-
cartesian
[
X_AXIS
])
-
sq
(
delta_tower1_x
-
cartesian
[
X_AXIS
])
-
sq
(
delta_tower1_y
-
cartesian
[
Y_AXIS
])
-
sq
(
delta_tower1_y
-
cartesian
[
Y_AXIS
])
)
+
cartesian
[
Z_AXIS
];
)
+
cartesian
[
Z_AXIS
];
delta
[
Y_AXIS
]
=
sqrt
(
delta_diagonal_rod_2
delta
[
TOWER_2
]
=
sqrt
(
delta_diagonal_rod_2
-
sq
(
delta_tower2_x
-
cartesian
[
X_AXIS
])
-
sq
(
delta_tower2_x
-
cartesian
[
X_AXIS
])
-
sq
(
delta_tower2_y
-
cartesian
[
Y_AXIS
])
-
sq
(
delta_tower2_y
-
cartesian
[
Y_AXIS
])
)
+
cartesian
[
Z_AXIS
];
)
+
cartesian
[
Z_AXIS
];
delta
[
Z_AXIS
]
=
sqrt
(
delta_diagonal_rod_3
delta
[
TOWER_3
]
=
sqrt
(
delta_diagonal_rod_3
-
sq
(
delta_tower3_x
-
cartesian
[
X_AXIS
])
-
sq
(
delta_tower3_x
-
cartesian
[
X_AXIS
])
-
sq
(
delta_tower3_y
-
cartesian
[
Y_AXIS
])
-
sq
(
delta_tower3_y
-
cartesian
[
Y_AXIS
])
)
+
cartesian
[
Z_AXIS
];
)
+
cartesian
[
Z_AXIS
];
...
@@ -2514,9 +2508,9 @@ static void clean_up_after_endstop_move() {
...
@@ -2514,9 +2508,9 @@ static void clean_up_after_endstop_move() {
right
=
(
1
-
ratio_y
)
*
z3
+
ratio_y
*
z4
,
right
=
(
1
-
ratio_y
)
*
z3
+
ratio_y
*
z4
,
offset
=
(
1
-
ratio_x
)
*
left
+
ratio_x
*
right
;
offset
=
(
1
-
ratio_x
)
*
left
+
ratio_x
*
right
;
delta
[
X_AXIS
]
+=
offset
;
delta
[
TOWER_1
]
+=
offset
;
delta
[
Y_AXIS
]
+=
offset
;
delta
[
TOWER_2
]
+=
offset
;
delta
[
Z_AXIS
]
+=
offset
;
delta
[
TOWER_3
]
+=
offset
;
if
(
debugLevel
&
DEBUG_DEBUG
)
{
if
(
debugLevel
&
DEBUG_DEBUG
)
{
ECHO_SMV
(
DEB
,
"grid_x="
,
grid_x
);
ECHO_SMV
(
DEB
,
"grid_x="
,
grid_x
);
...
@@ -2730,10 +2724,10 @@ static void clean_up_after_endstop_move() {
...
@@ -2730,10 +2724,10 @@ static void clean_up_after_endstop_move() {
ECHO_MV
(
" ADC B:"
,
degBed
(),
1
);
ECHO_MV
(
" ADC B:"
,
degBed
(),
1
);
ECHO_MV
(
"C->"
,
rawBedTemp
()
/
OVERSAMPLENR
,
0
);
ECHO_MV
(
"C->"
,
rawBedTemp
()
/
OVERSAMPLENR
,
0
);
#endif
#endif
for
(
uint8_t
cur_hotend
=
0
;
cur_hotend
<
HOTENDS
;
++
cur_hotend
)
{
for
(
uint8_t
h
=
0
;
h
<
HOTENDS
;
++
h
)
{
ECHO_MV
(
" T"
,
cur_hotend
);
ECHO_MV
(
" T"
,
h
);
ECHO_MV
(
":"
,
degHotend
(
cur_hotend
),
1
);
ECHO_MV
(
":"
,
degHotend
(
h
),
1
);
ECHO_MV
(
"C->"
,
rawHotendTemp
(
cur_hotend
)
/
OVERSAMPLENR
,
0
);
ECHO_MV
(
"C->"
,
rawHotendTemp
(
h
)
/
OVERSAMPLENR
,
0
);
}
}
#endif
#endif
}
}
...
@@ -2827,7 +2821,7 @@ void gcode_get_destination() {
...
@@ -2827,7 +2821,7 @@ void gcode_get_destination() {
for
(
int
i
=
0
;
i
<
NUM_AXIS
;
i
++
)
{
for
(
int
i
=
0
;
i
<
NUM_AXIS
;
i
++
)
{
if
(
code_seen
(
axis_codes
[
i
]))
{
if
(
code_seen
(
axis_codes
[
i
]))
{
destination
[
i
]
=
code_value
()
+
(
axis_relative_modes
[
i
]
||
relative_mode
?
current_position
[
i
]
:
0
);
destination
[
i
]
=
code_value
()
+
(
axis_relative_modes
[
i
]
||
relative_mode
?
current_position
[
i
]
:
-
hotend_offset
[
i
][
active_extruder
]
);
}
}
else
{
else
{
destination
[
i
]
=
current_position
[
i
];
destination
[
i
]
=
current_position
[
i
];
...
@@ -5167,7 +5161,7 @@ inline void gcode_M114() {
...
@@ -5167,7 +5161,7 @@ inline void gcode_M114() {
zpos
=
count_position
[
Z_AXIS
];
zpos
=
count_position
[
Z_AXIS
];
CRITICAL_SECTION_END
;
CRITICAL_SECTION_END
;
#if MECH(COREXY) || MECH(CORE
XZ
)
#if MECH(COREXY) || MECH(CORE
YX) || MECH(COREXZ) || MECH(COREZX
)
ECHO_M
(
MSG_COUNT_A
);
ECHO_M
(
MSG_COUNT_A
);
#elif MECH(DELTA)
#elif MECH(DELTA)
ECHO_M
(
MSG_COUNT_ALPHA
);
ECHO_M
(
MSG_COUNT_ALPHA
);
...
@@ -5176,7 +5170,7 @@ inline void gcode_M114() {
...
@@ -5176,7 +5170,7 @@ inline void gcode_M114() {
#endif
#endif
ECHO_V
(
xpos
);
ECHO_V
(
xpos
);
#if
ENABLED(COREXY
)
#if
MECH(COREXY) || MECH(COREYX
)
ECHO_M
(
" B:"
);
ECHO_M
(
" B:"
);
#elif MECH(DELTA)
#elif MECH(DELTA)
ECHO_M
(
" Beta:"
);
ECHO_M
(
" Beta:"
);
...
@@ -5185,7 +5179,7 @@ inline void gcode_M114() {
...
@@ -5185,7 +5179,7 @@ inline void gcode_M114() {
#endif
#endif
ECHO_V
(
ypos
);
ECHO_V
(
ypos
);
#if
ENABLED(COREXZ
)
#if
MECH(COREXZ) || MECH(COREZX
)
ECHO_M
(
" C:"
);
ECHO_M
(
" C:"
);
#elif MECH(DELTA)
#elif MECH(DELTA)
ECHO_M
(
" Teta:"
);
ECHO_M
(
" Teta:"
);
...
@@ -5685,27 +5679,24 @@ inline void gcode_M206() {
...
@@ -5685,27 +5679,24 @@ inline void gcode_M206() {
}
}
#endif // FWRETRACT
#endif // FWRETRACT
#if HOTENDS > 1
/**
* M218 - set hotend offset (in mm), H<hotend_number> X<offset_on_X> Y<offset_on_Y> Z<offset_on_Z>
/**
* M218 - set hotend offset (in mm), T<extruder_number> X<offset_on_X> Y<offset_on_Y>
*/
*/
inline
void
gcode_M218
()
{
inline
void
gcode_M218
()
{
if
(
setTargetedExtruder
(
218
))
return
;
if
(
setTargetedHotend
(
218
))
return
;
if
(
code_seen
(
'X'
))
hotend_offset
[
X_AXIS
][
target_extruder
]
=
code_value
();
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
(
code_seen
(
'Y'
))
hotend_offset
[
Y_AXIS
][
target_extruder
]
=
code_value
();
if
(
code_seen
(
'Z'
))
hotend_offset
[
Z_AXIS
][
target_extruder
]
=
code_value
();
if
(
code_seen
(
'Z'
))
hotend_offset
[
Z_AXIS
][
target_extruder
]
=
code_value
();
ECHO_SM
(
DB
,
SERIAL_HOTEND_OFFSET
);
ECHO_SM
(
DB
,
SERIAL_HOTEND_OFFSET
);
for
(
int
e
=
0
;
e
<
HOTENDS
;
e
++
)
{
for
(
uint8_t
h
=
0
;
h
<
HOTENDS
;
h
++
)
{
ECHO_MV
(
" "
,
hotend_offset
[
X_AXIS
][
e
]);
ECHO_MV
(
" "
,
hotend_offset
[
X_AXIS
][
h
]);
ECHO_MV
(
","
,
hotend_offset
[
Y_AXIS
][
e
]);
ECHO_MV
(
","
,
hotend_offset
[
Y_AXIS
][
h
]);
ECHO_MV
(
","
,
hotend_offset
[
Z_AXIS
][
e
]);
ECHO_MV
(
","
,
hotend_offset
[
Z_AXIS
][
h
]);
}
}
ECHO_E
;
ECHO_E
;
}
}
#endif // HOTENDS > 1
/**
/**
* M220: Set speed percentage factor, aka "Feed Rate" (M220 S95)
* M220: Set speed percentage factor, aka "Feed Rate" (M220 S95)
...
@@ -5898,25 +5889,25 @@ inline void gcode_M226() {
...
@@ -5898,25 +5889,25 @@ inline void gcode_M226() {
// multi-hotend PID patch: M301 updates or prints a single hotend's PID values
// multi-hotend PID patch: M301 updates or prints a single hotend's PID values
// default behaviour (omitting E parameter) is to update for hotend 0 only
// default behaviour (omitting E parameter) is to update for hotend 0 only
int
e
=
code_seen
(
'H'
)
?
code_value
()
:
0
;
// hotend being updated
int
h
=
code_seen
(
'H'
)
?
code_value
()
:
0
;
// hotend being updated
if
(
e
<
HOTENDS
)
{
// catch bad input value
if
(
h
<
HOTENDS
)
{
// catch bad input value
if
(
code_seen
(
'P'
))
PID_PARAM
(
Kp
,
e
)
=
code_value
();
if
(
code_seen
(
'P'
))
PID_PARAM
(
Kp
,
h
)
=
code_value
();
if
(
code_seen
(
'I'
))
PID_PARAM
(
Ki
,
e
)
=
scalePID_i
(
code_value
());
if
(
code_seen
(
'I'
))
PID_PARAM
(
Ki
,
h
)
=
scalePID_i
(
code_value
());
if
(
code_seen
(
'D'
))
PID_PARAM
(
Kd
,
e
)
=
scalePID_d
(
code_value
());
if
(
code_seen
(
'D'
))
PID_PARAM
(
Kd
,
h
)
=
scalePID_d
(
code_value
());
#if ENABLED(PID_ADD_EXTRUSION_RATE)
#if ENABLED(PID_ADD_EXTRUSION_RATE)
if
(
code_seen
(
'C'
))
PID_PARAM
(
Kc
,
e
)
=
code_value
();
if
(
code_seen
(
'C'
))
PID_PARAM
(
Kc
,
h
)
=
code_value
();
if
(
code_seen
(
'L'
))
lpq_len
=
code_value
();
if
(
code_seen
(
'L'
))
lpq_len
=
code_value
();
NOMORE
(
lpq_len
,
LPQ_MAX_LEN
);
NOMORE
(
lpq_len
,
LPQ_MAX_LEN
);
#endif
#endif
updatePID
();
updatePID
();
ECHO_SMV
(
OK
,
"
e:"
,
e
);
ECHO_SMV
(
OK
,
"
H:"
,
h
);
ECHO_MV
(
" p:"
,
PID_PARAM
(
Kp
,
e
));
ECHO_MV
(
" p:"
,
PID_PARAM
(
Kp
,
h
));
ECHO_MV
(
" i:"
,
unscalePID_i
(
PID_PARAM
(
Ki
,
e
)));
ECHO_MV
(
" i:"
,
unscalePID_i
(
PID_PARAM
(
Ki
,
h
)));
ECHO_MV
(
" d:"
,
unscalePID_d
(
PID_PARAM
(
Kd
,
e
)));
ECHO_MV
(
" d:"
,
unscalePID_d
(
PID_PARAM
(
Kd
,
h
)));
#if ENABLED(PID_ADD_EXTRUSION_RATE)
#if ENABLED(PID_ADD_EXTRUSION_RATE)
ECHO_MV
(
" c:"
,
PID_PARAM
(
Kc
,
e
));
ECHO_MV
(
" c:"
,
PID_PARAM
(
Kc
,
h
));
#endif
#endif
ECHO_E
;
ECHO_E
;
}
}
...
@@ -6295,9 +6286,13 @@ inline void gcode_M400() { st_synchronize(); }
...
@@ -6295,9 +6286,13 @@ inline void gcode_M400() { st_synchronize(); }
#if MECH(CARTESIAN)
#if MECH(CARTESIAN)
ECHO_M
(
"cartesian"
);
ECHO_M
(
"cartesian"
);
#elif MECH(COREXY)
#elif MECH(COREXY)
ECHO_M
(
"coreXY"
);
ECHO_M
(
"corexy"
);
#elif MECH(COREYX)
ECHO_M
(
"coreyx"
);
#elif MECH(COREXZ)
#elif MECH(COREXZ)
ECHO_M
(
"coreXZ"
);
ECHO_M
(
"corexz"
);
#elif MECH(COREZX)
ECHO_M
(
"corezx"
);
#elif MECH(DELTA)
#elif MECH(DELTA)
ECHO_M
(
"delta"
);
ECHO_M
(
"delta"
);
#endif
#endif
...
@@ -6574,21 +6569,21 @@ inline void gcode_M503() {
...
@@ -6574,21 +6569,21 @@ inline void gcode_M503() {
#if HEATER_USES_AD595
#if HEATER_USES_AD595
/**
/**
* M595 - set Hotend AD595 offset & Gain
T
<hotend_number> O<offset> S<gain>
* M595 - set Hotend AD595 offset & Gain
H
<hotend_number> O<offset> S<gain>
*/
*/
inline
void
gcode_M595
()
{
inline
void
gcode_M595
()
{
if
(
setTargeted
Extruder
(
595
))
return
;
if
(
setTargeted
Hotend
(
595
))
return
;
if
(
code_seen
(
'O'
))
ad595_offset
[
target_extruder
]
=
code_value
();
if
(
code_seen
(
'O'
))
ad595_offset
[
target_extruder
]
=
code_value
();
if
(
code_seen
(
'S'
))
ad595_gain
[
target_extruder
]
=
code_value
();
if
(
code_seen
(
'S'
))
ad595_gain
[
target_extruder
]
=
code_value
();
for
(
in
t
h
=
0
;
h
<
HOTENDS
;
h
++
)
{
for
(
uint8_
t
h
=
0
;
h
<
HOTENDS
;
h
++
)
{
// if gain == 0 you get MINTEMP!
// if gain == 0 you get MINTEMP!
if
(
ad595_gain
[
h
]
==
0
)
ad595_gain
[
h
]
=
1
;
if
(
ad595_gain
[
h
]
==
0
)
ad595_gain
[
h
]
=
1
;
}
}
ECHO_LM
(
DB
,
MSG_AD595
);
ECHO_LM
(
DB
,
MSG_AD595
);
for
(
in
t
h
=
0
;
h
<
HOTENDS
;
h
++
)
{
for
(
uint8_
t
h
=
0
;
h
<
HOTENDS
;
h
++
)
{
ECHO_SMV
(
DB
,
"T"
,
h
);
ECHO_SMV
(
DB
,
"T"
,
h
);
ECHO_MV
(
" Offset: "
,
ad595_offset
[
h
]);
ECHO_MV
(
" Offset: "
,
ad595_offset
[
h
]);
ECHO_EMV
(
", Gain: "
,
ad595_gain
[
h
]);
ECHO_EMV
(
", Gain: "
,
ad595_gain
[
h
]);
...
@@ -6625,7 +6620,7 @@ inline void gcode_M503() {
...
@@ -6625,7 +6620,7 @@ inline void gcode_M503() {
#if MECH(DELTA)
#if MECH(DELTA)
float
fr60
=
feedrate
/
60
;
float
fr60
=
feedrate
/
60
;
#define RUNPLAN calculate_delta(destination); \
#define RUNPLAN calculate_delta(destination); \
plan_buffer_line(delta[
X_AXIS], delta[Y_AXIS], delta[Z_AXIS
], destination[E_AXIS], fr60, active_extruder, active_driver);
plan_buffer_line(delta[
TOWER_1], delta[TOWER_2], delta[TOWER_3
], destination[E_AXIS], fr60, active_extruder, active_driver);
#else
#else
#define RUNPLAN line_to_destination();
#define RUNPLAN line_to_destination();
#endif
#endif
...
@@ -6739,8 +6734,8 @@ inline void gcode_M503() {
...
@@ -6739,8 +6734,8 @@ inline void gcode_M503() {
#if MECH(DELTA)
#if MECH(DELTA)
// Move XYZ to starting position, then E
// Move XYZ to starting position, then E
calculate_delta
(
lastpos
);
calculate_delta
(
lastpos
);
plan_buffer_line
(
delta
[
X_AXIS
],
delta
[
Y_AXIS
],
delta
[
Z_AXIS
],
destination
[
E_AXIS
],
fr60
,
active_extruder
,
active_driver
);
plan_buffer_line
(
delta
[
TOWER_1
],
delta
[
TOWER_2
],
delta
[
TOWER_3
],
destination
[
E_AXIS
],
fr60
,
active_extruder
,
active_driver
);
plan_buffer_line
(
delta
[
X_AXIS
],
delta
[
Y_AXIS
],
delta
[
Z_AXIS
],
lastpos
[
E_AXIS
],
fr60
,
active_extruder
,
active_driver
);
plan_buffer_line
(
delta
[
TOWER_1
],
delta
[
TOWER_2
],
delta
[
TOWER_3
],
lastpos
[
E_AXIS
],
fr60
,
active_extruder
,
active_driver
);
#else
#else
// Move XY to starting position, then Z, then E
// Move XY to starting position, then Z, then E
destination
[
X_AXIS
]
=
lastpos
[
X_AXIS
];
destination
[
X_AXIS
]
=
lastpos
[
X_AXIS
];
...
@@ -7046,14 +7041,6 @@ inline void gcode_T(uint8_t tmp_extruder) {
...
@@ -7046,14 +7041,6 @@ inline void gcode_T(uint8_t tmp_extruder) {
st_synchronize
();
st_synchronize
();
}
}
// apply Y & Z extruder offset (x offset is already used in determining home pos)
current_position
[
Y_AXIS
]
=
current_position
[
Y_AXIS
]
-
hotend_offset
[
Y_AXIS
][
active_extruder
]
+
hotend_offset
[
Y_AXIS
][
target_extruder
];
current_position
[
Z_AXIS
]
=
current_position
[
Z_AXIS
]
-
hotend_offset
[
Z_AXIS
][
active_extruder
]
+
hotend_offset
[
Z_AXIS
][
target_extruder
];
active_extruder
=
target_extruder
;
active_extruder
=
target_extruder
;
// This function resets the max/min values - the current position may be overwritten below.
// This function resets the max/min values - the current position may be overwritten below.
...
@@ -7080,11 +7067,6 @@ inline void gcode_T(uint8_t tmp_extruder) {
...
@@ -7080,11 +7067,6 @@ inline void gcode_T(uint8_t tmp_extruder) {
delayed_move_time
=
0
;
delayed_move_time
=
0
;
}
}
#else // !DUAL_X_CARRIAGE
#else // !DUAL_X_CARRIAGE
// Offset hotend (XYZ)
#if HOTENDS > 1
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)
#if ENABLED(MKR4)
#if (EXTRUDERS == 4) && HAS(E0E2) && HAS(E1E3) && (DRIVER_EXTRUDERS == 2)
#if (EXTRUDERS == 4) && HAS(E0E2) && HAS(E1E3) && (DRIVER_EXTRUDERS == 2)
...
@@ -7613,11 +7595,8 @@ void process_next_command() {
...
@@ -7613,11 +7595,8 @@ void process_next_command() {
gcode_M209
();
break
;
gcode_M209
();
break
;
#endif // FWRETRACT
#endif // FWRETRACT
#if HOTENDS > 1
case
218
:
// M218 - set hotend offset (in mm), T<extruder_number> X<offset_on_X> Y<offset_on_Y>
case
218
:
// M218 - set hotend offset (in mm), T<extruder_number> X<offset_on_X> Y<offset_on_Y>
gcode_M218
();
break
;
gcode_M218
();
break
;
#endif
case
220
:
// M220 S<factor in percent> - set speed factor override percentage
case
220
:
// M220 S<factor in percent> - set speed factor override percentage
gcode_M220
();
break
;
gcode_M220
();
break
;
case
221
:
// M221 T<extruder> S<factor in percent> - set extrude factor override percentage
case
221
:
// M221 T<extruder> S<factor in percent> - set extrude factor override percentage
...
@@ -7922,12 +7901,12 @@ void clamp_to_software_endstops(float target[3]) {
...
@@ -7922,12 +7901,12 @@ void clamp_to_software_endstops(float target[3]) {
ECHO_LMV
(
DEB
,
"target[X_AXIS]="
,
target
[
X_AXIS
]);
ECHO_LMV
(
DEB
,
"target[X_AXIS]="
,
target
[
X_AXIS
]);
ECHO_LMV
(
DEB
,
"target[Y_AXIS]="
,
target
[
Y_AXIS
]);
ECHO_LMV
(
DEB
,
"target[Y_AXIS]="
,
target
[
Y_AXIS
]);
ECHO_LMV
(
DEB
,
"target[Z_AXIS]="
,
target
[
Z_AXIS
]);
ECHO_LMV
(
DEB
,
"target[Z_AXIS]="
,
target
[
Z_AXIS
]);
ECHO_LMV
(
DEB
,
"delta[
X_AXIS]="
,
delta
[
X_AXIS
]);
ECHO_LMV
(
DEB
,
"delta[
TOWER_1]="
,
delta
[
TOWER_1
]);
ECHO_LMV
(
DEB
,
"delta[
Y_AXIS]="
,
delta
[
Y_AXIS
]);
ECHO_LMV
(
DEB
,
"delta[
TOWER_2]="
,
delta
[
TOWER_2
]);
ECHO_LMV
(
DEB
,
"delta[
Z_AXIS]="
,
delta
[
Z_AXIS
]);
ECHO_LMV
(
DEB
,
"delta[
TOWER_3]="
,
delta
[
TOWER_3
]);
}
}
plan_buffer_line
(
delta
[
X_AXIS
],
delta
[
Y_AXIS
],
delta
[
Z_AXIS
],
target
[
E_AXIS
],
frfm
,
active_extruder
,
active_driver
);
plan_buffer_line
(
delta
[
TOWER_1
],
delta
[
TOWER_2
],
delta
[
TOWER_3
],
target
[
E_AXIS
],
frfm
,
active_extruder
,
active_driver
);
}
}
return
true
;
return
true
;
}
}
...
@@ -7976,7 +7955,7 @@ void clamp_to_software_endstops(float target[3]) {
...
@@ -7976,7 +7955,7 @@ void clamp_to_software_endstops(float target[3]) {
#endif // DUAL_X_CARRIAGE
#endif // DUAL_X_CARRIAGE
#if MECH(CARTESIAN) || MECH(COREXY) || MECH(CORE
XZ
)
#if MECH(CARTESIAN) || MECH(COREXY) || MECH(CORE
YX) || MECH(COREXZ) || MECH(COREZX
)
inline
bool
prepare_move_cartesian
()
{
inline
bool
prepare_move_cartesian
()
{
// Do not use feedrate_multiplier for E or Z only moves
// Do not use feedrate_multiplier for E or Z only moves
...
@@ -7989,7 +7968,7 @@ void clamp_to_software_endstops(float target[3]) {
...
@@ -7989,7 +7968,7 @@ void clamp_to_software_endstops(float target[3]) {
return
true
;
return
true
;
}
}
#endif // CARTESIAN || COREXY || CORE
XZ
#endif // CARTESIAN || COREXY || CORE
YX || COREXZ || COREZX
/**
/**
* Prepare a single move and get ready for the next one
* Prepare a single move and get ready for the next one
...
@@ -8015,7 +7994,7 @@ void prepare_move() {
...
@@ -8015,7 +7994,7 @@ void prepare_move() {
if
(
!
prepare_move_dual_x_carriage
())
return
;
if
(
!
prepare_move_dual_x_carriage
())
return
;
#endif
#endif
#if MECH(CARTESIAN) || MECH(COREXY) || MECH(CORE
XZ
)
#if MECH(CARTESIAN) || MECH(COREXY) || MECH(CORE
YX) || MECH(COREXZ) || MECH(COREZX
)
if
(
!
prepare_move_cartesian
())
return
;
if
(
!
prepare_move_cartesian
())
return
;
#endif
#endif
...
@@ -8138,7 +8117,7 @@ void plan_arc(
...
@@ -8138,7 +8117,7 @@ void plan_arc(
#if MECH(DELTA) || MECH(SCARA)
#if MECH(DELTA) || MECH(SCARA)
calculate_delta
(
arc_target
);
calculate_delta
(
arc_target
);
adjust_delta
(
arc_target
);
adjust_delta
(
arc_target
);
plan_buffer_line
(
delta
[
X_AXIS
],
delta
[
Y_AXIS
],
delta
[
Z_AXIS
],
arc_target
[
E_AXIS
],
feed_rate
,
active_extruder
,
active_driver
);
plan_buffer_line
(
delta
[
TOWER_1
],
delta
[
TOWER_2
],
delta
[
TOWER_3
],
arc_target
[
E_AXIS
],
feed_rate
,
active_extruder
,
active_driver
);
#else
#else
plan_buffer_line
(
arc_target
[
X_AXIS
],
arc_target
[
Y_AXIS
],
arc_target
[
Z_AXIS
],
arc_target
[
E_AXIS
],
feed_rate
,
active_extruder
,
active_driver
);
plan_buffer_line
(
arc_target
[
X_AXIS
],
arc_target
[
Y_AXIS
],
arc_target
[
Z_AXIS
],
arc_target
[
E_AXIS
],
feed_rate
,
active_extruder
,
active_driver
);
#endif
#endif
...
@@ -8148,7 +8127,7 @@ void plan_arc(
...
@@ -8148,7 +8127,7 @@ void plan_arc(
#if MECH(DELTA) || MECH(SCARA)
#if MECH(DELTA) || MECH(SCARA)
calculate_delta
(
target
);
calculate_delta
(
target
);
adjust_delta
(
target
);
adjust_delta
(
target
);
plan_buffer_line
(
delta
[
X_AXIS
],
delta
[
Y_AXIS
],
delta
[
Z_AXIS
],
target
[
E_AXIS
],
feed_rate
,
active_extruder
,
active_driver
);
plan_buffer_line
(
delta
[
TOWER_1
],
delta
[
TOWER_2
],
delta
[
TOWER_3
],
target
[
E_AXIS
],
feed_rate
,
active_extruder
,
active_driver
);
#else
#else
plan_buffer_line
(
target
[
X_AXIS
],
target
[
Y_AXIS
],
target
[
Z_AXIS
],
target
[
E_AXIS
],
feed_rate
,
active_extruder
,
active_driver
);
plan_buffer_line
(
target
[
X_AXIS
],
target
[
Y_AXIS
],
target
[
Z_AXIS
],
target
[
E_AXIS
],
feed_rate
,
active_extruder
,
active_driver
);
#endif
#endif
...
@@ -8290,8 +8269,8 @@ void plan_arc(
...
@@ -8290,8 +8269,8 @@ void plan_arc(
float
max_temp
=
0.0
;
float
max_temp
=
0.0
;
if
(
millis
()
>
next_status_led_update_ms
)
{
if
(
millis
()
>
next_status_led_update_ms
)
{
next_status_led_update_ms
+=
500
;
// Update every 0.5s
next_status_led_update_ms
+=
500
;
// Update every 0.5s
for
(
uint8_t
cur_hotend
=
0
;
cur_hotend
<
HOTENDS
;
++
cur_hotend
)
for
(
uint8_t
h
=
0
;
h
<
HOTENDS
;
++
h
)
max_temp
=
max
(
max
(
max_temp
,
degHotend
(
cur_hotend
)),
degTargetHotend
(
cur_hotend
));
max_temp
=
max
(
max
(
max_temp
,
degHotend
(
h
)),
degTargetHotend
(
h
));
#if HAS(TEMP_BED)
#if HAS(TEMP_BED)
max_temp
=
max
(
max
(
max_temp
,
degTargetBed
()),
degBed
());
max_temp
=
max
(
max
(
max_temp
,
degTargetBed
()),
degBed
());
#endif
#endif
...
@@ -8677,6 +8656,19 @@ bool setTargetedExtruder(int code) {
...
@@ -8677,6 +8656,19 @@ bool setTargetedExtruder(int code) {
return
false
;
return
false
;
}
}
bool
setTargetedHotend
(
int
code
)
{
target_extruder
=
active_extruder
;
if
(
code_seen
(
'H'
))
{
target_extruder
=
code_value_short
();
if
(
target_extruder
>=
HOTENDS
)
{
ECHO_SMV
(
ER
,
"M"
,
code
);
ECHO_EMV
(
" "
SERIAL_INVALID_HOTEND
,
target_extruder
);
return
true
;
}
}
return
false
;
}
float
calculate_volumetric_multiplier
(
float
diameter
)
{
float
calculate_volumetric_multiplier
(
float
diameter
)
{
if
(
!
volumetric_enabled
||
diameter
==
0
)
return
1.0
;
if
(
!
volumetric_enabled
||
diameter
==
0
)
return
1.0
;
float
d2
=
diameter
*
0.5
;
float
d2
=
diameter
*
0.5
;
...
...
MK/module/MK_Main.h
View file @
5f774564
...
@@ -16,6 +16,9 @@ void manage_inactivity(bool ignore_stepper_queue = false);
...
@@ -16,6 +16,9 @@ void manage_inactivity(bool ignore_stepper_queue = false);
void
FlushSerialRequestResend
();
void
FlushSerialRequestResend
();
void
ok_to_send
();
void
ok_to_send
();
bool
setTargetedExtruder
(
int
code
);
bool
setTargetedHotend
(
int
code
);
#if MECH(DELTA)
#if MECH(DELTA)
float
probe_bed
(
float
x
,
float
y
);
float
probe_bed
(
float
x
,
float
y
);
void
set_delta_constants
();
void
set_delta_constants
();
...
@@ -24,7 +27,6 @@ void ok_to_send();
...
@@ -24,7 +27,6 @@ void ok_to_send();
void
home_delta_axis
();
void
home_delta_axis
();
void
calibration_report
();
void
calibration_report
();
void
bed_probe_all
();
void
bed_probe_all
();
void
set_default_z_probe_offset
();
void
set_delta_constants
();
void
set_delta_constants
();
void
save_carriage_positions
(
int
position_num
);
void
save_carriage_positions
(
int
position_num
);
void
calculate_delta
(
float
cartesian
[
3
]);
void
calculate_delta
(
float
cartesian
[
3
]);
...
@@ -44,6 +46,7 @@ void ok_to_send();
...
@@ -44,6 +46,7 @@ void ok_to_send();
extern
float
delta_radius
;
extern
float
delta_radius
;
extern
float
delta_diagonal_rod
;
extern
float
delta_diagonal_rod
;
#endif
#endif
#if MECH(SCARA)
#if MECH(SCARA)
void
calculate_delta
(
float
cartesian
[
3
]);
void
calculate_delta
(
float
cartesian
[
3
]);
void
calculate_SCARA_forward_Transform
(
float
f_scara
[
3
]);
void
calculate_SCARA_forward_Transform
(
float
f_scara
[
3
]);
...
@@ -103,17 +106,13 @@ extern float volumetric_multiplier[EXTRUDERS]; // reciprocal of cross-sectional
...
@@ -103,17 +106,13 @@ extern float volumetric_multiplier[EXTRUDERS]; // reciprocal of cross-sectional
extern
float
current_position
[
NUM_AXIS
];
extern
float
current_position
[
NUM_AXIS
];
extern
float
destination
[
NUM_AXIS
];
extern
float
destination
[
NUM_AXIS
];
extern
float
home_offset
[
3
];
extern
float
home_offset
[
3
];
extern
float
hotend_offset
[
3
][
HOTENDS
];
extern
float
min_pos
[
3
];
extern
float
min_pos
[
3
];
extern
float
max_pos
[
3
];
extern
float
max_pos
[
3
];
extern
float
zprobe_zoffset
;
extern
float
zprobe_zoffset
;
extern
uint8_t
axis_known_position
;
extern
uint8_t
axis_known_position
;
extern
uint8_t
axis_was_homed
;
extern
uint8_t
axis_was_homed
;
// Hotend offset
#if HOTENDS > 1
extern
float
hotend_offset
[
3
][
HOTENDS
];
#endif // HOTENDS > 1
#if HEATER_USES_AD595
#if HEATER_USES_AD595
extern
float
ad595_offset
[
HOTENDS
];
extern
float
ad595_offset
[
HOTENDS
];
extern
float
ad595_gain
[
HOTENDS
];
extern
float
ad595_gain
[
HOTENDS
];
...
@@ -123,13 +122,7 @@ extern uint8_t axis_was_homed;
...
@@ -123,13 +122,7 @@ extern uint8_t axis_was_homed;
extern
uint8_t
old_color
;
// old color for system NPR2
extern
uint8_t
old_color
;
// old color for system NPR2
#endif
#endif
#if MECH(DELTA)
#if ENABLED(Z_DUAL_ENDSTOPS)
extern
float
z_probe_offset
[
3
];
extern
float
endstop_adj
[
3
];
extern
float
tower_adj
[
6
];
extern
float
delta_radius
;
extern
float
delta_diagonal_rod
;
#elif ENABLED(Z_DUAL_ENDSTOPS)
extern
float
z_endstop_adj
;
extern
float
z_endstop_adj
;
#endif
#endif
...
...
MK/module/boards/502.h
View file @
5f774564
...
@@ -85,9 +85,9 @@
...
@@ -85,9 +85,9 @@
#define ORIG_TEMP_2_PIN 3 // PA22, analog pin on piggy
#define ORIG_TEMP_2_PIN 3 // PA22, analog pin on piggy
#define ORIG_TEMP_3_PIN 4 // PA6, analog on piggy
#define ORIG_TEMP_3_PIN 4 // PA6, analog on piggy
#define LED_PWM1_PIN
40 // PC8
#define LED_PWM1_PIN
36 // PC4
#define LED_PWM2_PIN 4
1 // PC9
#define LED_PWM2_PIN 4
0 // PC8
#define LED_PWM3_PIN
36 // PC4
#define LED_PWM3_PIN
41 // PC9
#define EXP_VOLTAGE_LEVEL_PIN 65
#define EXP_VOLTAGE_LEVEL_PIN 65
...
...
MK/module/language/language.h
View file @
5f774564
...
@@ -63,9 +63,13 @@
...
@@ -63,9 +63,13 @@
#if MECH(CARTESIAN)
#if MECH(CARTESIAN)
#define SERIAL_M115_REPORT "FIRMWARE_NAME:" BUILD_VERSION " FIRMWARE_URL:" FIRMWARE_URL " PROTOCOL_VERSION:" PROTOCOL_VERSION " MACHINE_TYPE:Cartesian EXTRUDER_COUNT:" STRINGIFY(EXTRUDERS) " UUID:" MACHINE_UUID "\n"
#define SERIAL_M115_REPORT "FIRMWARE_NAME:" BUILD_VERSION " FIRMWARE_URL:" FIRMWARE_URL " PROTOCOL_VERSION:" PROTOCOL_VERSION " MACHINE_TYPE:Cartesian EXTRUDER_COUNT:" STRINGIFY(EXTRUDERS) " UUID:" MACHINE_UUID "\n"
#elif MECH(COREXY)
#elif MECH(COREXY)
#define SERIAL_M115_REPORT "FIRMWARE_NAME:" BUILD_VERSION " FIRMWARE_URL:" FIRMWARE_URL " PROTOCOL_VERSION:" PROTOCOL_VERSION " MACHINE_TYPE:Core_XY EXTRUDER_COUNT:" STRINGIFY(EXTRUDERS) " UUID:" MACHINE_UUID "\n"
#define SERIAL_M115_REPORT "FIRMWARE_NAME:" BUILD_VERSION " FIRMWARE_URL:" FIRMWARE_URL " PROTOCOL_VERSION:" PROTOCOL_VERSION " MACHINE_TYPE:CoreXY EXTRUDER_COUNT:" STRINGIFY(EXTRUDERS) " UUID:" MACHINE_UUID "\n"
#elif MECH(COREYX)
#define SERIAL_M115_REPORT "FIRMWARE_NAME:" BUILD_VERSION " FIRMWARE_URL:" FIRMWARE_URL " PROTOCOL_VERSION:" PROTOCOL_VERSION " MACHINE_TYPE:CoreYX EXTRUDER_COUNT:" STRINGIFY(EXTRUDERS) " UUID:" MACHINE_UUID "\n"
#elif MECH(COREXZ)
#elif MECH(COREXZ)
#define SERIAL_M115_REPORT "FIRMWARE_NAME:" BUILD_VERSION " FIRMWARE_URL:" FIRMWARE_URL " PROTOCOL_VERSION:" PROTOCOL_VERSION " MACHINE_TYPE:Core_XZ EXTRUDER_COUNT:" STRINGIFY(EXTRUDERS) " UUID:" MACHINE_UUID "\n"
#define SERIAL_M115_REPORT "FIRMWARE_NAME:" BUILD_VERSION " FIRMWARE_URL:" FIRMWARE_URL " PROTOCOL_VERSION:" PROTOCOL_VERSION " MACHINE_TYPE:CoreXZ EXTRUDER_COUNT:" STRINGIFY(EXTRUDERS) " UUID:" MACHINE_UUID "\n"
#elif MECH(COREZX)
#define SERIAL_M115_REPORT "FIRMWARE_NAME:" BUILD_VERSION " FIRMWARE_URL:" FIRMWARE_URL " PROTOCOL_VERSION:" PROTOCOL_VERSION " MACHINE_TYPE:CoreZX EXTRUDER_COUNT:" STRINGIFY(EXTRUDERS) " UUID:" MACHINE_UUID "\n"
#elif MECH(DELTA)
#elif MECH(DELTA)
#define SERIAL_M115_REPORT "FIRMWARE_NAME:" BUILD_VERSION " FIRMWARE_URL:" FIRMWARE_URL " PROTOCOL_VERSION:" PROTOCOL_VERSION " MACHINE_TYPE:Delta EXTRUDER_COUNT:" STRINGIFY(EXTRUDERS) " UUID:" MACHINE_UUID "\n"
#define SERIAL_M115_REPORT "FIRMWARE_NAME:" BUILD_VERSION " FIRMWARE_URL:" FIRMWARE_URL " PROTOCOL_VERSION:" PROTOCOL_VERSION " MACHINE_TYPE:Delta EXTRUDER_COUNT:" STRINGIFY(EXTRUDERS) " UUID:" MACHINE_UUID "\n"
#elif MECH(SCARA)
#elif MECH(SCARA)
...
@@ -91,6 +95,7 @@
...
@@ -91,6 +95,7 @@
#define SERIAL_BEGIN_FILE_LIST "Begin file list"
#define SERIAL_BEGIN_FILE_LIST "Begin file list"
#define SERIAL_END_FILE_LIST "End file list"
#define SERIAL_END_FILE_LIST "End file list"
#define SERIAL_INVALID_EXTRUDER "Invalid extruder"
#define SERIAL_INVALID_EXTRUDER "Invalid extruder"
#define SERIAL_INVALID_HOTEND "Invalid hotend"
#define SERIAL_INVALID_SOLENOID "Invalid solenoid"
#define SERIAL_INVALID_SOLENOID "Invalid solenoid"
#define SERIAL_ERR_NO_THERMISTORS "No thermistors - no temperature"
#define SERIAL_ERR_NO_THERMISTORS "No thermistors - no temperature"
#define SERIAL_COUNT_X " Count X: "
#define SERIAL_COUNT_X " Count X: "
...
...
MK/module/mechanics.h
View file @
5f774564
...
@@ -5,7 +5,9 @@
...
@@ -5,7 +5,9 @@
#define MECH_UNKNOWN -1
#define MECH_UNKNOWN -1
#define MECH_CARTESIAN 0
#define MECH_CARTESIAN 0
#define MECH_COREXY 1
#define MECH_COREXY 1
#define MECH_COREXZ 2
#define MECH_COREYX 2
#define MECH_COREXZ 8
#define MECH_COREZX 9
#define MECH_DELTA 3
#define MECH_DELTA 3
#define MECH_SCARA 4
#define MECH_SCARA 4
...
...
MK/module/motion/planner.cpp
View file @
5f774564
...
@@ -511,7 +511,7 @@ float junction_deviation = 0.1;
...
@@ -511,7 +511,7 @@ float junction_deviation = 0.1;
// The target position of the tool in absolute steps
// The target position of the tool in absolute steps
// Calculate target position in absolute steps
// Calculate target position in absolute steps
//this should be done after the wait, because otherwise a M92 code within the gcode disrupts this calculation somehow
//this should be done after the wait, because otherwise a M92 code within the gcode disrupts this calculation somehow
long
target
[
NUM_AXIS
];
int32_t
target
[
NUM_AXIS
];
target
[
X_AXIS
]
=
lround
(
x
*
axis_steps_per_unit
[
X_AXIS
]);
target
[
X_AXIS
]
=
lround
(
x
*
axis_steps_per_unit
[
X_AXIS
]);
target
[
Y_AXIS
]
=
lround
(
y
*
axis_steps_per_unit
[
Y_AXIS
]);
target
[
Y_AXIS
]
=
lround
(
y
*
axis_steps_per_unit
[
Y_AXIS
]);
target
[
Z_AXIS
]
=
lround
(
z
*
axis_steps_per_unit
[
Z_AXIS
]);
target
[
Z_AXIS
]
=
lround
(
z
*
axis_steps_per_unit
[
Z_AXIS
]);
...
@@ -528,16 +528,22 @@ float junction_deviation = 0.1;
...
@@ -528,16 +528,22 @@ float junction_deviation = 0.1;
}
}
#endif
#endif
long
dx
=
target
[
X_AXIS
]
-
position
[
X_AXIS
],
int32_t
dx
=
target
[
X_AXIS
]
-
position
[
X_AXIS
],
dy
=
target
[
Y_AXIS
]
-
position
[
Y_AXIS
],
dy
=
target
[
Y_AXIS
]
-
position
[
Y_AXIS
],
dz
=
target
[
Z_AXIS
]
-
position
[
Z_AXIS
],
dz
=
target
[
Z_AXIS
]
-
position
[
Z_AXIS
],
de
=
target
[
E_AXIS
]
-
position
[
E_AXIS
];
de
=
target
[
E_AXIS
]
-
position
[
E_AXIS
];
#if MECH(COREXY)
#if MECH(COREXY)
long
da
=
dx
+
COREX_YZ_FACTOR
*
dy
;
int32_t
da
=
dx
+
COREX_YZ_FACTOR
*
dy
;
long
db
=
dx
-
COREX_YZ_FACTOR
*
dy
;
int32_t
db
=
dx
-
COREX_YZ_FACTOR
*
dy
;
#elif MECH(COREYX)
int32_t
da
=
dy
+
COREX_YZ_FACTOR
*
dx
;
int32_t
db
=
dy
-
COREX_YZ_FACTOR
*
dx
;
#elif MECH(COREXZ)
#elif MECH(COREXZ)
long
da
=
dx
+
COREX_YZ_FACTOR
*
dz
;
int32_t
da
=
dx
+
COREX_YZ_FACTOR
*
dz
;
long
dc
=
dx
-
COREX_YZ_FACTOR
*
dz
;
int32_t
dc
=
dx
-
COREX_YZ_FACTOR
*
dz
;
#elif MECH(COREZX)
int32_t
da
=
dz
+
COREX_YZ_FACTOR
*
dx
;
int32_t
dc
=
dz
-
COREX_YZ_FACTOR
*
dx
;
#endif
#endif
#if ENABLED(PREVENT_DANGEROUS_EXTRUDE)
#if ENABLED(PREVENT_DANGEROUS_EXTRUDE)
...
@@ -577,13 +583,12 @@ float junction_deviation = 0.1;
...
@@ -577,13 +583,12 @@ float junction_deviation = 0.1;
block
->
busy
=
false
;
block
->
busy
=
false
;
// Number of steps for each axis
// Number of steps for each axis
#if MECH(COREXY)
#if MECH(COREXY)
|| MECH(COREYX)
// corexy planning
// corexy planning
// these equations follow the form of the dA and dB equations on http://www.corexy.com/theory.html
block
->
steps
[
A_AXIS
]
=
labs
(
da
);
block
->
steps
[
A_AXIS
]
=
labs
(
da
);
block
->
steps
[
B_AXIS
]
=
labs
(
db
);
block
->
steps
[
B_AXIS
]
=
labs
(
db
);
block
->
steps
[
Z_AXIS
]
=
labs
(
dz
);
block
->
steps
[
Z_AXIS
]
=
labs
(
dz
);
#elif MECH(COREXZ)
#elif MECH(COREXZ)
|| MECH(COREZX)
// corexz planning
// corexz planning
block
->
steps
[
A_AXIS
]
=
labs
(
da
);
block
->
steps
[
A_AXIS
]
=
labs
(
da
);
block
->
steps
[
Y_AXIS
]
=
labs
(
dy
);
block
->
steps
[
Y_AXIS
]
=
labs
(
dy
);
...
@@ -624,13 +629,13 @@ float junction_deviation = 0.1;
...
@@ -624,13 +629,13 @@ float junction_deviation = 0.1;
// Compute direction bits for this block
// Compute direction bits for this block
uint8_t
dirb
=
0
;
uint8_t
dirb
=
0
;
#if MECH(COREXY)
#if MECH(COREXY)
|| MECH(COREYX)
if
(
dx
<
0
)
SBI
(
dirb
,
X_HEAD
);
// Save the real Extruder (head) direction in X Axis
if
(
dx
<
0
)
SBI
(
dirb
,
X_HEAD
);
// Save the real Extruder (head) direction in X Axis
if
(
dy
<
0
)
SBI
(
dirb
,
Y_HEAD
);
// ...and Y
if
(
dy
<
0
)
SBI
(
dirb
,
Y_HEAD
);
// ...and Y
if
(
dz
<
0
)
SBI
(
dirb
,
Z_AXIS
);
if
(
dz
<
0
)
SBI
(
dirb
,
Z_AXIS
);
if
(
da
<
0
)
SBI
(
dirb
,
A_AXIS
);
// Motor A direction
if
(
da
<
0
)
SBI
(
dirb
,
A_AXIS
);
// Motor A direction
if
(
db
<
0
)
SBI
(
dirb
,
B_AXIS
);
// Motor B direction
if
(
db
<
0
)
SBI
(
dirb
,
B_AXIS
);
// Motor B direction
#elif MECH(COREXZ)
#elif MECH(COREXZ)
|| MECH(COREZX)
if
(
dx
<
0
)
SBI
(
dirb
,
X_HEAD
);
// Save the real Extruder (head) direction in X Axis
if
(
dx
<
0
)
SBI
(
dirb
,
X_HEAD
);
// Save the real Extruder (head) direction in X Axis
if
(
dy
<
0
)
SBI
(
dirb
,
Y_AXIS
);
if
(
dy
<
0
)
SBI
(
dirb
,
Y_AXIS
);
if
(
dz
<
0
)
SBI
(
dirb
,
Z_HEAD
);
// ...and Z
if
(
dz
<
0
)
SBI
(
dirb
,
Z_HEAD
);
// ...and Z
...
@@ -647,7 +652,7 @@ float junction_deviation = 0.1;
...
@@ -647,7 +652,7 @@ float junction_deviation = 0.1;
block
->
active_driver
=
driver
;
block
->
active_driver
=
driver
;
// Enable active axes
// Enable active axes
#if MECH(COREXY)
#if MECH(COREXY)
|| MECH(COREYX)
if
(
block
->
steps
[
A_AXIS
]
||
block
->
steps
[
B_AXIS
])
{
if
(
block
->
steps
[
A_AXIS
]
||
block
->
steps
[
B_AXIS
])
{
enable_x
();
enable_x
();
enable_y
();
enable_y
();
...
@@ -655,7 +660,7 @@ float junction_deviation = 0.1;
...
@@ -655,7 +660,7 @@ float junction_deviation = 0.1;
#if DISABLED(Z_LATE_ENABLE)
#if DISABLED(Z_LATE_ENABLE)
if
(
block
->
steps
[
Z_AXIS
])
enable_z
();
if
(
block
->
steps
[
Z_AXIS
])
enable_z
();
#endif
#endif
#elif MECH(COREXZ)
#elif MECH(COREXZ)
|| MECH(COREZX)
if
(
block
->
steps
[
A_AXIS
]
||
block
->
steps
[
C_AXIS
])
{
if
(
block
->
steps
[
A_AXIS
]
||
block
->
steps
[
C_AXIS
])
{
enable_x
();
enable_x
();
enable_z
();
enable_z
();
...
@@ -815,14 +820,14 @@ float junction_deviation = 0.1;
...
@@ -815,14 +820,14 @@ float junction_deviation = 0.1;
* So we need to create other 2 "AXIS", named X_HEAD and Y_HEAD, meaning the real displacement of the Head.
* So we need to create other 2 "AXIS", named X_HEAD and Y_HEAD, meaning the real displacement of the Head.
* Having the real displacement of the head, we can calculate the total movement length and apply the desired speed.
* Having the real displacement of the head, we can calculate the total movement length and apply the desired speed.
*/
*/
#if MECH(COREXY)
#if MECH(COREXY)
|| MECH(COREYX)
float
delta_mm
[
6
];
float
delta_mm
[
6
];
delta_mm
[
X_HEAD
]
=
dx
/
axis_steps_per_unit
[
A_AXIS
];
delta_mm
[
X_HEAD
]
=
dx
/
axis_steps_per_unit
[
A_AXIS
];
delta_mm
[
Y_HEAD
]
=
dy
/
axis_steps_per_unit
[
B_AXIS
];
delta_mm
[
Y_HEAD
]
=
dy
/
axis_steps_per_unit
[
B_AXIS
];
delta_mm
[
Z_AXIS
]
=
dz
/
axis_steps_per_unit
[
Z_AXIS
];
delta_mm
[
Z_AXIS
]
=
dz
/
axis_steps_per_unit
[
Z_AXIS
];
delta_mm
[
A_AXIS
]
=
da
/
axis_steps_per_unit
[
A_AXIS
];
delta_mm
[
A_AXIS
]
=
da
/
axis_steps_per_unit
[
A_AXIS
];
delta_mm
[
B_AXIS
]
=
db
/
axis_steps_per_unit
[
B_AXIS
];
delta_mm
[
B_AXIS
]
=
db
/
axis_steps_per_unit
[
B_AXIS
];
#elif MECH(COREXZ)
#elif MECH(COREXZ)
|| MECH(COREZX)
float
delta_mm
[
6
];
float
delta_mm
[
6
];
delta_mm
[
X_HEAD
]
=
dx
/
axis_steps_per_unit
[
A_AXIS
];
delta_mm
[
X_HEAD
]
=
dx
/
axis_steps_per_unit
[
A_AXIS
];
delta_mm
[
Y_AXIS
]
=
dy
/
axis_steps_per_unit
[
Y_AXIS
];
delta_mm
[
Y_AXIS
]
=
dy
/
axis_steps_per_unit
[
Y_AXIS
];
...
@@ -842,9 +847,9 @@ float junction_deviation = 0.1;
...
@@ -842,9 +847,9 @@ float junction_deviation = 0.1;
}
}
else
{
else
{
block
->
millimeters
=
sqrt
(
block
->
millimeters
=
sqrt
(
#if MECH(COREXY)
#if MECH(COREXY)
|| MECH(COREYX)
square
(
delta_mm
[
X_HEAD
])
+
square
(
delta_mm
[
Y_HEAD
])
+
square
(
delta_mm
[
Z_AXIS
])
square
(
delta_mm
[
X_HEAD
])
+
square
(
delta_mm
[
Y_HEAD
])
+
square
(
delta_mm
[
Z_AXIS
])
#elif MECH(COREXZ)
#elif MECH(COREXZ)
|| MECH(COREZX)
square
(
delta_mm
[
X_HEAD
])
+
square
(
delta_mm
[
Y_AXIS
])
+
square
(
delta_mm
[
Z_HEAD
])
square
(
delta_mm
[
X_HEAD
])
+
square
(
delta_mm
[
Y_AXIS
])
+
square
(
delta_mm
[
Z_HEAD
])
#else
#else
square
(
delta_mm
[
X_AXIS
])
+
square
(
delta_mm
[
Y_AXIS
])
+
square
(
delta_mm
[
Z_AXIS
])
square
(
delta_mm
[
X_AXIS
])
+
square
(
delta_mm
[
Y_AXIS
])
+
square
(
delta_mm
[
Z_AXIS
])
...
...
MK/module/motion/stepper.cpp
View file @
5f774564
...
@@ -311,9 +311,9 @@ void checkHitEndstops() {
...
@@ -311,9 +311,9 @@ void checkHitEndstops() {
}
}
}
}
#if MECH(COREXY)
#if MECH(COREXY)
|| MECH(COREYX)
#define CORE_AXIS_2 B_AXIS
#define CORE_AXIS_2 B_AXIS
#elif MECH(COREXZ)
#elif MECH(COREXZ)
|| MECH(COREZX)
#define CORE_AXIS_2 C_AXIS
#define CORE_AXIS_2 C_AXIS
#endif
#endif
...
@@ -342,7 +342,7 @@ inline void update_endstops() {
...
@@ -342,7 +342,7 @@ inline void update_endstops() {
// TEST_ENDSTOP: test the old and the current status of an endstop
// TEST_ENDSTOP: test the old and the current status of an endstop
#define TEST_ENDSTOP(ENDSTOP) (TEST(current_endstop_bits, ENDSTOP) && TEST(old_endstop_bits, ENDSTOP))
#define TEST_ENDSTOP(ENDSTOP) (TEST(current_endstop_bits, ENDSTOP) && TEST(old_endstop_bits, ENDSTOP))
#if MECH(COREXY) || MECH(CORE
XZ
)
#if MECH(COREXY) || MECH(CORE
YX)|| MECH(COREXZ) || MECH(COREZX
)
#define _SET_TRIGSTEPS(AXIS) do { \
#define _SET_TRIGSTEPS(AXIS) do { \
float axis_pos = count_position[_AXIS(AXIS)]; \
float axis_pos = count_position[_AXIS(AXIS)]; \
...
@@ -357,7 +357,7 @@ inline void update_endstops() {
...
@@ -357,7 +357,7 @@ inline void update_endstops() {
#define _SET_TRIGSTEPS(AXIS) endstops_trigsteps[_AXIS(AXIS)] = count_position[_AXIS(AXIS)]
#define _SET_TRIGSTEPS(AXIS) endstops_trigsteps[_AXIS(AXIS)] = count_position[_AXIS(AXIS)]
#endif // COREXY || CORE
XZ
#endif // COREXY || CORE
YX || COREXZ || COREZX
#define UPDATE_ENDSTOP(AXIS,MINMAX) do { \
#define UPDATE_ENDSTOP(AXIS,MINMAX) do { \
SET_ENDSTOP_BIT(AXIS, MINMAX); \
SET_ENDSTOP_BIT(AXIS, MINMAX); \
...
@@ -368,7 +368,7 @@ inline void update_endstops() {
...
@@ -368,7 +368,7 @@ inline void update_endstops() {
} \
} \
} while(0)
} while(0)
#if MECH(COREXY) || MECH(CORE
XZ
)
#if MECH(COREXY) || MECH(CORE
YX)|| MECH(COREXZ) || MECH(COREZX
)
// Head direction in -X axis for CoreXY and CoreXZ bots.
// Head direction in -X axis for CoreXY and CoreXZ bots.
// If Delta1 == -Delta2, the movement is only in Y or Z axis
// If Delta1 == -Delta2, the movement is only in Y or Z axis
if
((
current_block
->
steps
[
A_AXIS
]
!=
current_block
->
steps
[
CORE_AXIS_2
])
||
(
TEST
(
out_bits
,
A_AXIS
)
==
TEST
(
out_bits
,
CORE_AXIS_2
)))
{
if
((
current_block
->
steps
[
A_AXIS
]
!=
current_block
->
steps
[
CORE_AXIS_2
])
||
(
TEST
(
out_bits
,
A_AXIS
)
==
TEST
(
out_bits
,
CORE_AXIS_2
)))
{
...
@@ -398,11 +398,11 @@ inline void update_endstops() {
...
@@ -398,11 +398,11 @@ inline void update_endstops() {
#endif
#endif
}
}
}
}
#if MECH(COREXY) || MECH(CORE
XZ
)
#if MECH(COREXY) || MECH(CORE
YX)|| MECH(COREXZ) || MECH(COREZX
)
}
}
#endif
#endif
#if MECH(COREXY)
#if MECH(COREXY)
|| MECH(COREYX)
// Head direction in -Y axis for CoreXY bots.
// Head direction in -Y axis for CoreXY bots.
// If DeltaX == DeltaY, the movement is only in X axis
// If DeltaX == DeltaY, the movement is only in X axis
if
((
current_block
->
steps
[
A_AXIS
]
!=
current_block
->
steps
[
B_AXIS
])
||
(
TEST
(
out_bits
,
A_AXIS
)
!=
TEST
(
out_bits
,
B_AXIS
)))
{
if
((
current_block
->
steps
[
A_AXIS
]
!=
current_block
->
steps
[
B_AXIS
])
||
(
TEST
(
out_bits
,
A_AXIS
)
!=
TEST
(
out_bits
,
B_AXIS
)))
{
...
@@ -420,11 +420,11 @@ inline void update_endstops() {
...
@@ -420,11 +420,11 @@ inline void update_endstops() {
UPDATE_ENDSTOP
(
Y
,
MAX
);
UPDATE_ENDSTOP
(
Y
,
MAX
);
#endif
#endif
}
}
#if MECH(COREXY)
#if MECH(COREXY)
|| MECH(COREYX)
}
}
#endif
#endif
#if MECH(COREXZ)
#if MECH(COREXZ)
|| MECH(COREZX)
// Head direction in -Z axis for CoreXZ bots.
// Head direction in -Z axis for CoreXZ bots.
// If DeltaX == DeltaZ, the movement is only in X axis
// If DeltaX == DeltaZ, the movement is only in X axis
if
((
current_block
->
steps
[
A_AXIS
]
!=
current_block
->
steps
[
C_AXIS
])
||
(
TEST
(
out_bits
,
A_AXIS
)
!=
TEST
(
out_bits
,
C_AXIS
)))
{
if
((
current_block
->
steps
[
A_AXIS
]
!=
current_block
->
steps
[
C_AXIS
])
||
(
TEST
(
out_bits
,
A_AXIS
)
!=
TEST
(
out_bits
,
C_AXIS
)))
{
...
@@ -495,7 +495,7 @@ inline void update_endstops() {
...
@@ -495,7 +495,7 @@ inline void update_endstops() {
#endif // !Z_DUAL_ENDSTOPS
#endif // !Z_DUAL_ENDSTOPS
#endif // Z_MAX_PIN
#endif // Z_MAX_PIN
}
}
#if MECH(COREXZ)
#if MECH(COREXZ)
|| MECH(COREZX)
}
}
#endif
#endif
#if ENABLED(NPR2)
#if ENABLED(NPR2)
...
@@ -569,8 +569,8 @@ FORCE_INLINE unsigned short calc_timer(unsigned short step_rate) {
...
@@ -569,8 +569,8 @@ FORCE_INLINE unsigned short calc_timer(unsigned short step_rate) {
/**
/**
* Set the stepper direction of each axis
* Set the stepper direction of each axis
*
*
* X_AXIS=A_AXIS and Y_AXIS=B_AXIS for COREXY
* X_AXIS=A_AXIS and Y_AXIS=B_AXIS for COREXY
or COREYX
* X_AXIS=A_AXIS and Z_AXIS=C_AXIS for COREXZ
* X_AXIS=A_AXIS and Z_AXIS=C_AXIS for COREXZ
or COREZX
*/
*/
void
set_stepper_direction
(
bool
onlye
)
{
void
set_stepper_direction
(
bool
onlye
)
{
...
@@ -1207,7 +1207,7 @@ long st_get_position(uint8_t axis) {
...
@@ -1207,7 +1207,7 @@ long st_get_position(uint8_t axis) {
float
st_get_axis_position_mm
(
AxisEnum
axis
)
{
float
st_get_axis_position_mm
(
AxisEnum
axis
)
{
float
axis_pos
;
float
axis_pos
;
#if
ENABLED(COREXY) | ENABLED(COREXZ
)
#if
MECH(COREXY) || MECH(COREYX) || MECH(COREXZ) || MECH(COREZX
)
if
(
axis
==
X_AXIS
||
axis
==
CORE_AXIS_2
)
{
if
(
axis
==
X_AXIS
||
axis
==
CORE_AXIS_2
)
{
CRITICAL_SECTION_START
;
CRITICAL_SECTION_START
;
long
pos1
=
count_position
[
A_AXIS
],
long
pos1
=
count_position
[
A_AXIS
],
...
...
MK/module/motion/stepper.h
View file @
5f774564
...
@@ -25,8 +25,9 @@
...
@@ -25,8 +25,9 @@
/**
/**
* Axis indices as enumerated constants
* Axis indices as enumerated constants
*
*
* A_AXIS and B_AXIS are used by COREXY printers
* A_AXIS and B_AXIS are used by COREXY or COREYX printers
* X_HEAD and Y_HEAD is used for systems that don't have a 1:1 relationship between X_AXIS and X Head movement, like CoreXY bots.
* A_AXIS and C_AXIS are used by COREXZ or COREZX printers
* X_HEAD and Y_HEAD and Z_HEAD is used for systems that don't have a 1:1 relationship between X_AXIS and X Head movement, like CoreXY bots.
*/
*/
enum
AxisEnum
{
X_AXIS
=
0
,
A_AXIS
=
0
,
Y_AXIS
=
1
,
B_AXIS
=
1
,
Z_AXIS
=
2
,
C_AXIS
=
2
,
E_AXIS
=
3
,
X_HEAD
=
4
,
Y_HEAD
=
5
,
Z_HEAD
=
5
};
enum
AxisEnum
{
X_AXIS
=
0
,
A_AXIS
=
0
,
Y_AXIS
=
1
,
B_AXIS
=
1
,
Z_AXIS
=
2
,
C_AXIS
=
2
,
E_AXIS
=
3
,
X_HEAD
=
4
,
Y_HEAD
=
5
,
Z_HEAD
=
5
};
enum
EndstopEnum
{
X_MIN
=
0
,
Y_MIN
=
1
,
Z_MIN
=
2
,
Z_PROBE
=
3
,
X_MAX
=
4
,
Y_MAX
=
5
,
Z_MAX
=
6
,
Z2_MIN
=
7
,
Z2_MAX
=
8
,
E_MIN
=
9
};
enum
EndstopEnum
{
X_MIN
=
0
,
Y_MIN
=
1
,
Z_MIN
=
2
,
Z_PROBE
=
3
,
X_MAX
=
4
,
Y_MAX
=
5
,
Z_MAX
=
6
,
Z2_MIN
=
7
,
Z2_MAX
=
8
,
E_MIN
=
9
};
...
...
MK/module/sanitycheck.h
View file @
5f774564
...
@@ -1190,7 +1190,7 @@
...
@@ -1190,7 +1190,7 @@
#error DEPENDENCY ERROR: Missing setting MANUAL_Z_HOME_POS
#error DEPENDENCY ERROR: Missing setting MANUAL_Z_HOME_POS
#endif
#endif
#endif
#endif
#if MECH(COREXY) || MECH(CORE
XZ
)
#if MECH(COREXY) || MECH(CORE
YX) || MECH(COREXZ) || MECH(COREZX
)
#if DISABLED(COREX_YZ_FACTOR)
#if DISABLED(COREX_YZ_FACTOR)
#error DEPENDENCY ERROR: Missing setting COREX_YZ_FACTOR
#error DEPENDENCY ERROR: Missing setting COREX_YZ_FACTOR
#endif
#endif
...
@@ -1280,8 +1280,14 @@
...
@@ -1280,8 +1280,14 @@
#if DISABLED(TOWER_C_DIAGROD_ADJ)
#if DISABLED(TOWER_C_DIAGROD_ADJ)
#error DEPENDENCY ERROR: Missing setting TOWER_C_DIAGROD_ADJ
#error DEPENDENCY ERROR: Missing setting TOWER_C_DIAGROD_ADJ
#endif
#endif
#if DISABLED(Z_PROBE_OFFSET)
#if DISABLED(X_PROBE_OFFSET_FROM_EXTRUDER)
#error DEPENDENCY ERROR: Missing setting Z_PROBE_OFFSET
#error DEPENDENCY ERROR: Missing setting X_PROBE_OFFSET_FROM_EXTRUDER
#endif
#if DISABLED(Y_PROBE_OFFSET_FROM_EXTRUDER)
#error DEPENDENCY ERROR: Missing setting Y_PROBE_OFFSET_FROM_EXTRUDER
#endif
#if DISABLED(Z_PROBE_OFFSET_FROM_EXTRUDER)
#error DEPENDENCY ERROR: Missing setting Z_PROBE_OFFSET_FROM_EXTRUDER
#endif
#endif
#if DISABLED(Z_PROBE_DEPLOY_START_LOCATION)
#if DISABLED(Z_PROBE_DEPLOY_START_LOCATION)
#error DEPENDENCY ERROR: Missing setting Z_PROBE_DEPLOY_START_LOCATION
#error DEPENDENCY ERROR: Missing setting Z_PROBE_DEPLOY_START_LOCATION
...
@@ -1346,9 +1352,12 @@
...
@@ -1346,9 +1352,12 @@
* Babystepping
* Babystepping
*/
*/
#if ENABLED(BABYSTEPPING)
#if ENABLED(BABYSTEPPING)
#if
MECH(COREXY
) && ENABLED(BABYSTEP_XY)
#if
(MECH(COREXY) || MECH(COREYX)
) && ENABLED(BABYSTEP_XY)
#error CONFLICT ERROR: BABYSTEPPING only implemented for Z axis on CoreXY.
#error CONFLICT ERROR: BABYSTEPPING only implemented for Z axis on CoreXY.
#endif
#endif
#if (MECH(COREXZ) || MECH(COREZX))
#error CONFLICT ERROR: BABYSTEPPING not implemented for CoreXZ or CoreZX.
#endif
#if MECH(SCARA)
#if MECH(SCARA)
#error CONFLICT ERROR: BABYSTEPPING is not implemented for SCARA yet.
#error CONFLICT ERROR: BABYSTEPPING is not implemented for SCARA yet.
#endif
#endif
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment