Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix 2.0.x update #2

Merged
merged 22 commits into from
Feb 1, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
2822c08
Set up DIAG endstops for BTT SKR 1.4 / 1.4 Turbo (#16727)
StoneColdCrazy Jan 30, 2020
e8e25b8
Extend RX/TX pins for up to 8 extruders
thinkyhead Jan 30, 2020
62f52eb
Fix up, improve endstop pin auto-assignment
thinkyhead Jan 30, 2020
e4679c1
(21) PT100 for MCUs with 3.3v logic (#16731)
petrzmax Jan 31, 2020
dabf393
[cron] Bump distribution date (2020-01-31)
thinkyhead Jan 31, 2020
02f6183
Add sanity-check for new Advanced Pause option
thinkyhead Jan 31, 2020
c4df5cf
Include macros for delta ABC
thinkyhead Jan 31, 2020
0a6ae66
Update Russian language (#16745)
Acenotass Feb 1, 2020
300b81b
Fix BTT SKR 1.4 extra endstop pins (#16738)
rebel1 Feb 1, 2020
5b3d968
Option for Trigorilla 1.4 with add-on endstops board (#16737)
sjasonsmith Feb 1, 2020
9a8de23
Consistent M112 with Emergency Parser (#16747)
sjasonsmith Feb 1, 2020
1af0579
Improve mfadd helper script
thinkyhead Feb 1, 2020
e64b7a3
Clean up i2c encoder, sanitize serial
thinkyhead Feb 1, 2020
43d3463
Misc cleanup, whitespace
thinkyhead Feb 1, 2020
90b6324
Encapsulate probe as singleton class (#16751)
thinkyhead Feb 1, 2020
e58d1bf
G34 automatic point assignment (#16473)
InsanityAutomation Feb 1, 2020
c3cab37
Fix Temperature::over_autostart_threshold (#16749)
sjasonsmith Feb 1, 2020
832d33c
Update Russian language (#16750)
Acenotass Feb 1, 2020
0d342ba
Fix CURRENT_STEP_DOWN compile error
thinkyhead Feb 1, 2020
5296af9
Drop obsolete SD special char handling
thinkyhead Feb 1, 2020
995a923
Probe singleton patch
thinkyhead Feb 1, 2020
8367ccf
Fix RGB / Neopixel white color bug
thinkyhead Feb 1, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Marlin/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,8 @@
* 13 : 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE"
* 15 : 100k thermistor calibration for JGAurora A5 hotend
* 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327
* 20 : Pt100 with circuit in the Ultimainboard V2.x
* 20 : Pt100 with circuit in the Ultimainboard V2.x with 5v excitation (AVR)
* 21 : Pt100 with circuit in the Ultimainboard V2.x with 3.3v excitation (STM32 \ LPC176x....)
* 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x
* 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950
* 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup
Expand Down
53 changes: 36 additions & 17 deletions Marlin/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -668,35 +668,54 @@
*/
//#define Z_STEPPER_AUTO_ALIGN
#if ENABLED(Z_STEPPER_AUTO_ALIGN)
// Define probe X and Y positions for Z1, Z2 [, Z3]
#define Z_STEPPER_ALIGN_XY { { 10, 190 }, { 100, 10 }, { 190, 190 } }
// Define probe X and Y positions for Z1, Z2 [, Z3 [, Z4]]
// If not defined, probe limits will be used.
// Override with 'M422 S<index> X<pos> Y<pos>'
//#define Z_STEPPER_ALIGN_XY { { 10, 190 }, { 100, 10 }, { 190, 190 } }

/**
* Orientation for the automatically-calculated probe positions.
* Override Z stepper align points with 'M422 S<index> X<pos> Y<pos>'
*
* 2 Steppers: (0) (1)
* | | 2 |
* | 1 2 | |
* | | 1 |
*
* 3 Steppers: (0) (1) (2) (3)
* | 3 | 1 | 2 1 | 2 |
* | | 3 | | 3 |
* | 1 2 | 2 | 3 | 1 |
*
* 4 Steppers: (0) (1) (2) (3)
* | 4 3 | 1 4 | 2 1 | 3 2 |
* | | | | |
* | 1 2 | 2 3 | 3 4 | 4 1 |
*
*/
#ifndef Z_STEPPER_ALIGN_XY
//#define Z_STEPPERS_ORIENTATION 0
#endif

// Provide Z stepper positions for more rapid convergence in bed alignment.
// Currently requires triple stepper drivers.
// Requires triple stepper drivers (i.e., set NUM_Z_STEPPER_DRIVERS to 3)
//#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS
#if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS)
// Define Stepper XY positions for Z1, Z2, Z3 corresponding to
// the Z screw positions in the bed carriage.
// Define one position per Z stepper in stepper driver order.
#define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } }
#else
// Amplification factor. Used to scale the correction step up or down.
// In case the stepper (spindle) position is further out than the test point.
// Use a value > 1. NOTE: This may cause instability
#define Z_STEPPER_ALIGN_AMP 1.0
// Amplification factor. Used to scale the correction step up or down in case
// the stepper (spindle) position is farther out than the test point.
#define Z_STEPPER_ALIGN_AMP 1.0 // Use a value > 1.0 NOTE: This may cause instability!
#endif

// Set number of iterations to align
#define Z_STEPPER_ALIGN_ITERATIONS 3

// Enable to restore leveling setup after operation
#define RESTORE_LEVELING_AFTER_G34

// On a 300mm bed a 5% grade would give a misalignment of ~1.5cm
#define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle

// Stop criterion. If the accuracy is better than this stop iterating early
#define Z_STEPPER_ALIGN_ACC 0.02
#define G34_MAX_GRADE 5 // (%) Maximum incline that G34 will handle
#define Z_STEPPER_ALIGN_ITERATIONS 5 // Number of iterations to apply during alignment
#define Z_STEPPER_ALIGN_ACC 0.02 // Stop iterating early if the accuracy is better than this
#define RESTORE_LEVELING_AFTER_G34 // Restore leveling after G34 is done?
#endif

// @section motion
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/MarlinCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -977,7 +977,7 @@ void setup() {
#endif

#if HAS_Z_SERVO_PROBE
servo_probe_init();
probe.servo_probe_init();
#endif

#if HAS_PHOTOGRAPH
Expand Down
20 changes: 10 additions & 10 deletions Marlin/src/core/utility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,42 +83,42 @@ void safe_delay(millis_t ms) {
#if HAS_BED_PROBE

#if !HAS_PROBE_XY_OFFSET
SERIAL_ECHOPAIR("Probe Offset X0 Y0 Z", probe_offset.z, " (");
SERIAL_ECHOPAIR("Probe Offset X0 Y0 Z", probe.offset.z, " (");
#else
SERIAL_ECHOPAIR_P(PSTR("Probe Offset X"), probe_offset.x, SP_Y_STR, probe_offset.y, SP_Z_STR, probe_offset.z);
if (probe_offset.x > 0)
SERIAL_ECHOPAIR_P(PSTR("Probe Offset X"), probe.offset_xy.x, SP_Y_STR, probe.offset_xy.y, SP_Z_STR, probe.offset.z);
if (probe.offset_xy.x > 0)
SERIAL_ECHOPGM(" (Right");
else if (probe_offset.x < 0)
else if (probe.offset_xy.x < 0)
SERIAL_ECHOPGM(" (Left");
else if (probe_offset.y != 0)
else if (probe.offset_xy.y != 0)
SERIAL_ECHOPGM(" (Middle");
else
SERIAL_ECHOPGM(" (Aligned With");

if (probe_offset.y > 0) {
if (probe.offset_xy.y > 0) {
#if IS_SCARA
SERIAL_ECHOPGM("-Distal");
#else
SERIAL_ECHOPGM("-Back");
#endif
}
else if (probe_offset.y < 0) {
else if (probe.offset_xy.y < 0) {
#if IS_SCARA
SERIAL_ECHOPGM("-Proximal");
#else
SERIAL_ECHOPGM("-Front");
#endif
}
else if (probe_offset.x != 0)
else if (probe.offset_xy.x != 0)
SERIAL_ECHOPGM("-Center");

SERIAL_ECHOPGM(" & ");

#endif

if (probe_offset.z < 0)
if (probe.offset.z < 0)
SERIAL_ECHOPGM("Below");
else if (probe_offset.z > 0)
else if (probe.offset.z > 0)
SERIAL_ECHOPGM("Above");
else
SERIAL_ECHOPGM("Same Z as");
Expand Down
40 changes: 22 additions & 18 deletions Marlin/src/feature/I2CPositionEncoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,15 +162,17 @@ void I2CPositionEncoder::update() {
if (errIdx == 0) {
// In order to correct for "error" but avoid correcting for noise and non-skips
// it must be > threshold and have a difference average of < 10 and be < 2000 steps
if (ABS(error) > threshold * planner.settings.axis_steps_per_mm[encoderAxis] &&
diffSum < 10 * (I2CPE_ERR_ARRAY_SIZE - 1) && ABS(error) < 2000) { // Check for persistent error (skip)
if (ABS(error) > threshold * planner.settings.axis_steps_per_mm[encoderAxis]
&& diffSum < 10 * (I2CPE_ERR_ARRAY_SIZE - 1)
&& ABS(error) < 2000
) { // Check for persistent error (skip)
errPrst[errPrstIdx++] = error; // Error must persist for I2CPE_ERR_PRST_ARRAY_SIZE error cycles. This also serves to improve the average accuracy
if (errPrstIdx >= I2CPE_ERR_PRST_ARRAY_SIZE) {
float sumP = 0;
LOOP_L_N(i, I2CPE_ERR_PRST_ARRAY_SIZE) sumP += errPrst[i];
const int32_t errorP = int32_t(sumP * RECIPROCAL(I2CPE_ERR_PRST_ARRAY_SIZE));
SERIAL_ECHO(axis_codes[encoderAxis]);
SERIAL_ECHOLNPAIR(" - err detected: ", errorP * planner.steps_to_mm[encoderAxis], "mm; correcting!");
SERIAL_ECHOLNPAIR(" : CORRECT ERR ", errorP * planner.steps_to_mm[encoderAxis], "mm");
babystep.add_steps(encoderAxis, -LROUND(errorP));
errPrstIdx = 0;
}
Expand All @@ -189,7 +191,8 @@ void I2CPositionEncoder::update() {
if (ABS(error) > I2CPE_ERR_CNT_THRESH * planner.settings.axis_steps_per_mm[encoderAxis]) {
const millis_t ms = millis();
if (ELAPSED(ms, nextErrorCountTime)) {
SERIAL_ECHOLNPAIR("Large error on ", axis_codes[encoderAxis], " axis. error: ", (int)error, "; diffSum: ", diffSum);
SERIAL_ECHO(axis_codes[encoderAxis]);
SERIAL_ECHOLNPAIR(" : LARGE ERR ", int(error), "; diffSum=", diffSum);
errorCount++;
nextErrorCountTime = ms + I2CPE_ERR_CNT_DEBOUNCE_MS;
}
Expand Down Expand Up @@ -243,17 +246,14 @@ bool I2CPositionEncoder::passes_test(const bool report) {
}

float I2CPositionEncoder::get_axis_error_mm(const bool report) {
float target, actual, error;

target = planner.get_axis_position_mm(encoderAxis);
actual = mm_from_count(position);
error = actual - target;

if (ABS(error) > 10000) error = 0; // ?
const float target = planner.get_axis_position_mm(encoderAxis),
actual = mm_from_count(position),
diff = actual - target,
error = ABS(diff) > 10000 ? 0 : diff; // Huge error is a bad reading

if (report) {
SERIAL_ECHO(axis_codes[encoderAxis]);
SERIAL_ECHOLNPAIR(" axis target: ", target, ", actual: ", actual, ", error : ",error);
SERIAL_ECHOLNPAIR(" axis target=", target, "mm; actual=", actual, "mm; err=", error, "mm");
}

return error;
Expand All @@ -278,21 +278,25 @@ int32_t I2CPositionEncoder::get_axis_error_steps(const bool report) {
//convert both 'ticks' into same units / base
encoderCountInStepperTicksScaled = LROUND((stepperTicksPerUnit * encoderTicks) / encoderTicksPerUnit);

int32_t target = stepper.position(encoderAxis),
error = (encoderCountInStepperTicksScaled - target);
const int32_t target = stepper.position(encoderAxis);
int32_t error = encoderCountInStepperTicksScaled - target;

//suppress discontinuities (might be caused by bad I2C readings...?)
const bool suppressOutput = (ABS(error - errorPrev) > 100);

errorPrev = error;

if (report) {
SERIAL_ECHO(axis_codes[encoderAxis]);
SERIAL_ECHOLNPAIR(" axis target: ", target, ", actual: ", encoderCountInStepperTicksScaled, ", error : ", error);
if (suppressOutput) SERIAL_ECHOLNPGM("Discontinuity detected, suppressing error.");
SERIAL_ECHOLNPAIR(" axis target=", target, "; actual=", encoderCountInStepperTicksScaled, "; err=", error);
}

errorPrev = error;
if (suppressOutput) {
if (report) SERIAL_ECHOLNPGM("!Discontinuity. Suppressing error.");
error = 0;
}

return (suppressOutput ? 0 : error);
return error;
}

int32_t I2CPositionEncoder::get_raw_count() {
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/feature/baricuda.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*
*/

#include "../inc/MarlinConfig.h"
#include "../inc/MarlinConfigPre.h"

#if ENABLED(BARICUDA)

Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/feature/bedlevel/ubl/ubl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,10 @@
serialprintPGM(csv ? PSTR("CSV:\n") : PSTR("LCD:\n"));
}

// Add XY probe offset from extruder because probe_at_point() subtracts them when
// Add XY probe offset from extruder because probe.probe_at_point() subtracts them when
// moving to the XY position to be measured. This ensures better agreement between
// the current Z position after G28 and the mesh values.
const xy_int8_t curr = closest_indexes(xy_pos_t(current_position) + probe_offset_xy);
const xy_int8_t curr = closest_indexes(xy_pos_t(current_position) + probe.offset_xy);

if (!lcd) SERIAL_EOL();
for (int8_t j = GRID_MAX_POINTS_Y - 1; j >= 0; j--) {
Expand Down
Loading