Skip to content

Commit

Permalink
Squashed commit of the following: (#79)
Browse files Browse the repository at this point in the history
commit bb3a1c3
Author: Javier97sm <[email protected]>
Date:   Tue Mar 28 16:49:45 2023 +0200

    Squashed commit of the following:

    commit 37f7555
    Author: Javier97sm <[email protected]>
    Date:   Thu Jan 26 11:26:49 2023 +0100

        update to v0.18.0 (#76)

        Co-authored-by: Javier97sm <[email protected]>

    commit 81b3ee3
    Author: bcn3d-emasdeu <[email protected]>
    Date:   Wed Feb 23 13:00:43 2022 +0100

        Marlin v.0.14.0 release (#75)

    commit 8ebad35
    Author: bcn3d-emasdeu <[email protected]>
    Date:   Thu Jan 20 12:48:42 2022 +0000

        Marlin v.0.13.0 release (#74)

        * Marlin v.0.13.0 release

    commit 4bb8a0e
    Merge: 438f949 61c27ee
    Author: bcn3d-emasdeu <[email protected]>
    Date:   Tue Nov 23 16:26:40 2021 +0100

        Merge pull request #72 from BCN3D/develop

        Merge develop into master

    commit 438f949
    Merge: f63a986 8d6abe0
    Author: Enric Masdeu <[email protected]>
    Date:   Thu Oct 28 13:45:06 2021 +0200

        Merge branch 'develop'

    commit f63a986
    Author: bcn3d-emasdeu <[email protected]>
    Date:   Wed Oct 13 11:20:13 2021 +0200

        Update changelog.md

    commit 2858da4
    Author: bcn3d-emasdeu <[email protected]>
    Date:   Thu Oct 7 12:51:04 2021 +0200

        Create changelog.yml

    commit 5f1d550
    Merge: 3768065 b812765
    Author: Enric Masdeu <[email protected]>
    Date:   Thu Oct 7 12:49:07 2021 +0200

        Merge remote-tracking branch 'origin/develop'

    commit 3768065
    Merge: dbf16cb 4848b1a
    Author: monell1997 <[email protected]>
    Date:   Fri Aug 20 10:49:35 2021 +0200

        Merge pull request #65 from BCN3D/release/v0.11.2

        Release/v0.11.2

commit 9f76278
Author: Javier97sm <[email protected]>
Date:   Tue Mar 28 16:43:53 2023 +0200

    1.6.x (#77)

    * Create changelog.yml

    * Update changelog.md

    * Marlin v.0.13.0 release (#74)

    * Marlin v.0.13.0 release

    * Marlin v.0.14.0 release (#75)

    * update to v0.18.0 (#76)

    Co-authored-by: Javier97sm <[email protected]>

    * update marlin to 0.20.0

    ---------

    Co-authored-by: monell1997 <[email protected]>
    Co-authored-by: Enric Masdeu <[email protected]>
    Co-authored-by: bcn3d-emasdeu <[email protected]>
    Co-authored-by: Javier97sm <[email protected]>
  • Loading branch information
Javier97sm authored Mar 28, 2023
1 parent 37f7555 commit ea150fe
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 51 deletions.
2 changes: 1 addition & 1 deletion Marlin/Marlin.h
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ void report_current_position();
PROBE_PT_RAISE, // Raise to "between" clearance after run_z_probe
PROBE_PT_BIG_RAISE // Raise to big clearance after run_z_probe
};
float probe_pt(const float &rx, const float &ry, const ProbePtRaise raise_after=PROBE_PT_NONE, const uint8_t verbose_level=0, const bool probe_relative=true, const uint16_t time_delay = 0);
float probe_pt(const float &rx, const float &ry, const ProbePtRaise raise_after=PROBE_PT_NONE, const uint8_t verbose_level=0, const bool probe_relative=true, const uint16_t time_delay = 0, const bool probe_twice = true);
#define DEPLOY_PROBE() set_probe_deployed(true)
#define STOW_PROBE() set_probe_deployed(false)
#else
Expand Down
112 changes: 63 additions & 49 deletions Marlin/Marlin_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2697,7 +2697,7 @@ void clean_up_after_endstop_or_probe_move() {
*
* @return The raw Z position where the probe was triggered
*/
static float run_z_probe() {
static float run_z_probe(const bool probe_twice) {

#if ENABLED(DEBUG_LEVELING_FEATURE)
if (DEBUGGING(LEVELING)) DEBUG_POS(">>> run_z_probe", current_position);
Expand All @@ -2708,7 +2708,9 @@ void clean_up_after_endstop_or_probe_move() {
const float z_probe_low_point = TEST(axis_known_position, Z_AXIS) ? -zprobe_zoffset + Z_PROBE_LOW_POINT : -10.0;

// Double-probing does a fast probe followed by a slow probe
#if MULTIPLE_PROBING == 2
float first_probe_z;

if (probe_twice) {

// Do a first probe at the fast speed
#if defined(BCN3D_MOD)
Expand All @@ -2725,7 +2727,7 @@ void clean_up_after_endstop_or_probe_move() {
return NAN;
}

float first_probe_z = current_position[Z_AXIS];
first_probe_z = current_position[Z_AXIS];

#if ENABLED(DEBUG_LEVELING_FEATURE)
if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPAIR("1st Probe Z:", first_probe_z);
Expand All @@ -2734,19 +2736,7 @@ void clean_up_after_endstop_or_probe_move() {
// move up to make clearance for the probe
do_blocking_move_to_z(current_position[Z_AXIS] + Z_CLEARANCE_MULTI_PROBE, MMM_TO_MMS(Z_PROBE_SPEED_FAST));

#else

// If the nozzle is well over the travel height then
// move down quickly before doing the slow probe
float z = Z_CLEARANCE_DEPLOY_PROBE + 5.0;
if (zprobe_zoffset < 0) z -= zprobe_zoffset;

if (current_position[Z_AXIS] > z) {
// If we don't make it to the z position (i.e. the probe triggered), move up to make clearance for the probe
if (!do_probe_move(z, MMM_TO_MMS(Z_PROBE_SPEED_FAST)))
do_blocking_move_to_z(current_position[Z_AXIS] + Z_CLEARANCE_BETWEEN_PROBES, MMM_TO_MMS(Z_PROBE_SPEED_FAST));
}
#endif
}

#if MULTIPLE_PROBING > 2
float probes_total = 0;
Expand All @@ -2755,7 +2745,7 @@ void clean_up_after_endstop_or_probe_move() {

// move down slowly to find bed
#if defined(BCN3D_MOD)
if (do_probe_move(z_probe_low_point, MMM_TO_MMS(120))) {
if (do_probe_move(z_probe_low_point, MMM_TO_MMS(400))) {
#else
if (do_probe_move(z_probe_low_point, MMM_TO_MMS(Z_PROBE_SPEED_SLOW))) {
#endif
Expand Down Expand Up @@ -2790,8 +2780,13 @@ void clean_up_after_endstop_or_probe_move() {
}
#endif

float measured_z;
// Return a weighted average of the fast and slow probes
const float measured_z = (z2 * 3.0 + first_probe_z * 2.0) * 0.2;
if (probe_twice) {
measured_z = (z2 * 3.0 + first_probe_z * 2.0) * 0.2;
} else {
measured_z = z2;
}

#else

Expand All @@ -2816,7 +2811,7 @@ void clean_up_after_endstop_or_probe_move() {
* - Raise to the BETWEEN height
* - Return the probed Z position
*/
float probe_pt(const float &rx, const float &ry, const ProbePtRaise raise_after/*=PROBE_PT_NONE*/, const uint8_t verbose_level/*=0*/, const bool probe_relative/*=true*/, const uint16_t time_delay/*=0*/) {
float probe_pt(const float &rx, const float &ry, const ProbePtRaise raise_after/*=PROBE_PT_NONE*/, const uint8_t verbose_level/*=0*/, const bool probe_relative/*=true*/, const uint16_t time_delay/*=0*/, const bool probe_twice/*=true*/) {
#if ENABLED(DEBUG_LEVELING_FEATURE)
if (DEBUGGING(LEVELING)) {
SERIAL_ECHOPAIR(">>> probe_pt(", LOGICAL_X_POSITION(rx));
Expand Down Expand Up @@ -2868,7 +2863,7 @@ void clean_up_after_endstop_or_probe_move() {

float measured_z = NAN;
if (!DEPLOY_PROBE()) {
measured_z = run_z_probe() + zprobe_zoffset;
measured_z = run_z_probe(probe_twice) + zprobe_zoffset;

const bool big_raise = raise_after == PROBE_PT_BIG_RAISE;
if (big_raise || raise_after == PROBE_PT_RAISE)
Expand Down Expand Up @@ -7837,50 +7832,72 @@ inline void gcode_M542() {//post Stop

inline void gcode_G120()
{
bool isPETG_ABS_PP = false;
SERIAL_ECHOLN("GCODE G120");
if (!parser.seen('S')) {
SERIAL_ECHOLNPGM("G120 without S parameter, omiting");
return;
}

float targetTemperature = parser.floatval('S');

active_extruder = 0;
fanSpeeds[0] = 255U;

// The following three lines allow the printer to turn on the fan and delay the movement for 15s in the case of M2
// The following three lines allow the printer to turn on the fan and delay the movement for 15s in the case of D2
// If these lines are not executed, the fan is not turned on and the delay starts anyway
// This is due to the fact that the fan is powered by the software and the firmware runs the next line, which corresponds to the delay (safe_delay(15000)), before the fan turns on
active_extruder = 0;
fanSpeeds[0] = 255U;
current_position[X_AXIS] = -53;
planner.buffer_line(current_position[X_AXIS],current_position[Y_AXIS],current_position[Z_AXIS],current_position[E_AXIS], MMM_TO_MMS(6000),active_extruder);
planner.synchronize();
/* END */

// First delay (before movements)
if(parser.seen('M')){
if(parser.intval('M') == 1)
isPETG_ABS_PP = true;
else if(parser.intval('M') == 2)
safe_delay(15000);
}
safe_delay(parser.floatval('M')*1000.0);
}

// Second delay (between movements)
float secondDelay;
if(parser.seen('N'))
secondDelay = parser.floatval('N')*1000.0;
else
return;

// First position when cleaning (left position)
float firstPos;
if(parser.seen('F') && parser.seen('I'))
firstPos = (parser.floatval('I')>0 ? 1.0 : -1.0)*parser.floatval('F');
else
return;

// Second position when cleaning (right position)
float secondPos;
if(parser.seen('P') && parser.seen('J'))
secondPos = (parser.floatval('J')>0 ? 1.0 : -1.0)*parser.floatval('P');
else
return;

// Movements to clean until current temperature is lower than target temperature
while (thermalManager.degHotend(target_extruder) > targetTemperature) {
current_position[X_AXIS] = -30;

// First position (left)
current_position[X_AXIS] = firstPos;
planner.buffer_line(current_position[X_AXIS],current_position[Y_AXIS],current_position[Z_AXIS],current_position[E_AXIS], MMM_TO_MMS(6000),active_extruder);
planner.synchronize();

if(!isPETG_ABS_PP)
safe_delay(2000);
// Wait
safe_delay(secondDelay);

current_position[X_AXIS] = -53.5;
// Second position (right)
current_position[X_AXIS] = secondPos;
planner.buffer_line(current_position[X_AXIS],current_position[Y_AXIS],current_position[Z_AXIS],current_position[E_AXIS], MMM_TO_MMS(6000),active_extruder);
planner.synchronize();

if(!isPETG_ABS_PP)
safe_delay(2000);
// Wait
safe_delay(secondDelay);
}

fanSpeeds[0] = 0U;

SERIAL_ECHOLNPGM("no moves");
}

inline void gcode_G238() { //Rise
Expand Down Expand Up @@ -9019,26 +9036,23 @@ inline void gcode_G292(){//BCN3D Mesh Bed leveling piezo
}

inline void gcode_G293(){//BCN3D Mesh Bed leveling piezo

//Disable leveling just in case its active (this will prevent a crush during this process)
set_bed_leveling_enabled(false);

SYNC_PLAN_POSITION_KINEMATIC();
//Disable leveling just in case its active (this will prevent a crush during this process)
set_bed_leveling_enabled(false);

//const float start_x = x_probe_left_extr[1];
//const float shift_x = (xBedSize-start_x*2)/2;

//const float start_y = y_probe_left_extr[1];
//const float shift_y = (yBedSize-start_y*2)/2;
//Disable leveling just in case its active (this will prevent a crush during this process)
set_bed_leveling_enabled(false);

//const float x_probe_mesh_points[mbl.max_points_x] = {start_x, start_x + shift_x/2, start_x + shift_x, start_x + shift_x*3/2, start_x + shift_x*2};
//const float y_probe_mesh_points[mbl.max_points_y] = {start_y, start_y + shift_y/2, start_y + shift_y, start_y + shift_y*3/2, start_y + shift_y*2};
SYNC_PLAN_POSITION_KINEMATIC();

float x_probe_mesh_points[mbl.max_points_x];
float y_probe_mesh_points[mbl.max_points_y];

const float shiftX = (xBedSize-MESH_INSET*2.0f)/(mbl.max_points_x-1);
const float shiftY = (yBedSize-MESH_INSET*2.0f)/(mbl.max_points_y-1);
const int8_t speedBetweenProbes = 100; // 100mm/s which are 6000mm/min

for (uint8_t i = 0; i < mbl.max_points_x; i++) {
x_probe_mesh_points[i] = MESH_INSET + shiftX*i;
Expand All @@ -9063,7 +9077,7 @@ inline void gcode_G293(){//BCN3D Mesh Bed leveling piezo

G293_move = true;
setup_for_endstop_or_probe_move();
mesh_z_points[x][y_aux] = probe_pt(x_probe_mesh_points[x], y_probe_mesh_points[y_aux], PROBE_PT_RAISE, 3, true, 2000);
mesh_z_points[x][y_aux] = probe_pt(x_probe_mesh_points[x], y_probe_mesh_points[y_aux], PROBE_PT_RAISE, 3, true, 1000, false);
mbl.z_values[x][y] = mesh_z_points[x][y_aux];
clean_up_after_endstop_or_probe_move();
G293_move = false;
Expand Down Expand Up @@ -9123,8 +9137,8 @@ inline void gcode_G293(){//BCN3D Mesh Bed leveling piezo
SERIAL_ECHOPAIR(" p55:",mesh_z_points[4][4]);
SERIAL_EOL();

SERIAL_ECHOLN("meshCalibration: noError");

SERIAL_ECHOLN("meshCalibration: noError");
SERIAL_ECHOLN("no moves");
}

inline void gcode_G294(){//BCN3D Piezo Bed leveling
Expand Down
2 changes: 1 addition & 1 deletion Marlin/Version.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
* Marlin release version identifier
*/

#define SHORT_BUILD_VERSION "v0.18.0"
#define SHORT_BUILD_VERSION "v0.20.0"

/**
* Verbose version identifier which should contain a reference to the location
Expand Down

0 comments on commit ea150fe

Please sign in to comment.