New Feature: Z_DUAL_ENDSTOPS

Z_DUAL_ENDSTOPS is a feature to enable the use of 2 endstops for both Z
steppers - Let's call them Z stepper and Z2 stepper.
That way the machine is capable to align the bed during home, since both
Z steppers are homed.
There is also an implementation of M666 (software endstops adjustment)
to this feature.
After Z homing, this adjustment is applied to just one of the steppers
in order to align the bed.
One just need to home the Z axis and measure the distance difference
between both Z axis and apply the math: Z adjust = Z - Z2.
If the Z stepper axis is closer to the bed, the measure Z > Z2 (yes, it
is.. think about it) and the Z adjust would be positive.
Play a little bit with small adjustments (0.5mm) and check the
behaviour.
The M119 (endstops report) will start reporting the Z2 Endstop as well.
This commit is contained in:
alexborro
2015-03-24 14:06:44 -03:00
parent 512a0056a9
commit 0ce3576685
8 changed files with 228 additions and 19 deletions

View File

@ -67,6 +67,9 @@
*
* filament_size (x4)
*
* Z_DUAL_ENDSTOPS
* z_endstop_adj
*
*/
#include "Marlin.h"
#include "language.h"
@ -165,6 +168,10 @@ void Config_StoreSettings() {
EEPROM_WRITE_VAR(i, delta_radius); // 1 float
EEPROM_WRITE_VAR(i, delta_diagonal_rod); // 1 float
EEPROM_WRITE_VAR(i, delta_segments_per_second); // 1 float
#elif defined(Z_DUAL_ENDSTOPS)
EEPROM_WRITE_VAR(i, z_endstop_adj); // 1 floats
dummy = 0.0f;
for (int q=5; q--;) EEPROM_WRITE_VAR(i, dummy);
#else
dummy = 0.0f;
for (int q=6; q--;) EEPROM_WRITE_VAR(i, dummy);
@ -326,7 +333,12 @@ void Config_RetrieveSettings() {
EEPROM_READ_VAR(i, delta_radius); // 1 float
EEPROM_READ_VAR(i, delta_diagonal_rod); // 1 float
EEPROM_READ_VAR(i, delta_segments_per_second); // 1 float
#elif defined(Z_DUAL_ENDSTOPS)
EEPROM_READ_VAR(i, z_endstop_adj);
dummy = 0.0f;
for (int q=5; q--;) EEPROM_READ_VAR(i, dummy);
#else
dummy = 0.0f;
for (int q=6; q--;) EEPROM_READ_VAR(i, dummy);
#endif
@ -459,6 +471,8 @@ void Config_ResetDefault() {
delta_diagonal_rod = DELTA_DIAGONAL_ROD;
delta_segments_per_second = DELTA_SEGMENTS_PER_SECOND;
recalc_delta_settings(delta_radius, delta_diagonal_rod);
#elif defined(Z_DUAL_ENDSTOPS)
z_endstop_adj = 0;
#endif
#ifdef ULTIPANEL
@ -629,6 +643,14 @@ void Config_PrintSettings(bool forReplay) {
SERIAL_ECHOPAIR(" R", delta_radius );
SERIAL_ECHOPAIR(" S", delta_segments_per_second );
SERIAL_EOL;
#elif defined(Z_DUAL_ENDSTOPS)
SERIAL_ECHO_START;
if (!forReplay) {
SERIAL_ECHOLNPGM("Z2 Endstop adjustement (mm):");
SERIAL_ECHO_START;
}
SERIAL_ECHOPAIR(" M666 Z", z_endstop_adj );
SERIAL_EOL;
#endif // DELTA
#ifdef PIDTEMP