MarlinFirmware / Marlin

Marlin is an optimized firmware for RepRap 3D printers based on the Arduino platform. Many commercial 3D printers come with Marlin installed. Check with your vendor if you need source code for your specific machine.
https://marlinfw.org
GNU General Public License v3.0
16.27k stars 19.23k forks source link

[BUG] Cannot use negative values for Z_SAFE_HOMING_X_POINT & #define MIN_PROBE_EDGE #15478

Closed ZS1FJK closed 5 years ago

ZS1FJK commented 5 years ago

Hello When setting Z_SAFE_HOMING_X_POINT (negative value) & #define MIN_PROBE_EDGE (negative value) I get an error when compiling.

error is as follows

sketch\src\module/planner.h:271:84: error: could not convert '-19' from 'int' to 'XYval::'

     static constexpr xy_pos_t level_fulcrum = { X_TILT_FULCRUM, Y_TILT_FULCRUM };

                                                                                ^

sketch\src\module/planner.h:271:84: error: too many initializers for 'const xy_pos_t {aka const XYval}'

I am using Arduino 1.9.0 to compile and have tried the stable release also. The config is for a Lulzbot Taz 6.

When i change the value to positive is compiles fine.

Marlin.zip

Powerprobot commented 5 years ago

What the Hell you need a negative Homing Point? If you need the 0-Point in the middle or no matter where, you can configure at BED_CENTER_AT_0_0 and:

// Travel limits (mm) after homing, corresponding to endstop positions.
#define X_MIN_POS 0
#define Y_MIN_POS 0
#define Z_MIN_POS 0
#define X_MAX_POS X_BED_SIZE
#define Y_MAX_POS Y_BED_SIZE

here you can use negative values. I hope you understand my explain.

ZS1FJK commented 5 years ago

My Z_SAFE_HOMING_X_POINT is next to the print bed. It is not inside the print area. Also the auto bed leveling is done outside of the print area.

Powerprobot commented 5 years ago

Define the movement length as bed-size and define X and Y_MIN_POS at the need negative value. This was my suggestion. Z-Safe off

ZS1FJK commented 5 years ago

I have done this. Should i then change the value for Z_SAFE_HOMING_X_POINT 1

` // The size of the print bed

define X_BED_SIZE (280)

define Y_BED_SIZE (280)

// Travel limits (mm) after homing, corresponding to endstop positions.

define X_MIN_POS -20

define Y_MIN_POS -20

define Z_MIN_POS 0

define X_MAX_POS 300

define Y_MAX_POS 303

define Z_MAX_POS 270

`

ZS1FJK commented 5 years ago

I have looked at the Lulzbot repository and see that there config files are very similar to mine with the negative values.

Powerprobot commented 5 years ago

Have you a link or more information? And i think this is not a bug from Marlin in root configuration, it is a modification from lulzbot and here ist not the right place to discuss a lulzbot modification.

ZS1FJK commented 5 years ago

Here is a link to the config files. https://code.alephobjects.com/diffusion/MARLIN/browse/devel/config/examples/AlephObjects/Oliveoil_TAZ6/Tilapia_SingleExtruder/

ZS1FJK commented 5 years ago

I Changed Z_SAFE_HOMING_X_POINT 1 and i get this error.

sketch\src\module/planner.h:271:84: error: could not convert '1' from 'int' to 'XYval::'

     static constexpr xy_pos_t level_fulcrum = { X_TILT_FULCRUM, Y_TILT_FULCRUM };

                                                                                ^

sketch\src\module/planner.h:271:84: error: too many initializers for 'const xy_pos_t {aka const XYval}'

ZS1FJK commented 5 years ago

Is this not a bug ?

thinkyhead commented 5 years ago

It is a bug! The solution is this:

static constexpr xy_pos_t level_fulcrum = { float(X_TILT_FULCRUM), float(Y_TILT_FULCRUM) };

I'll patch it in a moment.

thinkyhead commented 5 years ago

Hmm… Well, that should have worked. But the compiler Arduino is using is very confused. I think this is actually turning out to be a compiler bug.

thinkyhead commented 5 years ago

While this is definitely a compiler bug, it was not hard to work around. Marlin has now been patched so should build successfully for Archim 2.

ZS1FJK commented 5 years ago

@thinkyhead Unfortunately Platform IO does not work for archim boards. Thank you for patching. I will compile tonight when i get home.

github-actions[bot] commented 4 years ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.