Welcome! Log In Create A New Profile

Advanced

need help with marlin

Posted by coverguy 
need help with marlin
June 24, 2018 01:40PM
static_assert(X_MAX_LENGTH >= X_BED_SIZE && Y_MAX_LENGTH >= Y_BED_SIZE,
"Movement bounds ([XY]_MIN_POS, [XY]_MAX_POS) are too narrow to contain [XY]_BED_SIZE.");
keep getting this error need help figuring this out. i have put together a custom duel extrusion 300 x 300 x 500 using a ramps v1.4 on a adruino
Re: need help with marlin
June 25, 2018 07:34AM
It appear that your configuration.h file may need some work. Would like to see this file in order to correct.
Post a link to the download if possible. I use (Google Drive for my links)

Edited 1 time(s). Last edit at 06/25/2018 08:39PM by Roberts_Clif.
Re: need help with marlin
June 28, 2018 01:26PM
It's always helpful to someone who would like to assist when you make the configuration.h file available.

But reading the error message it means that the bed size for X or Y is bigger than the max position.
By default Marlin sets the X_MAX_POS equal to the X_BED_SIZE and obviously the same for the Y-Axis

Below is my code, see the parts in red.

// The size of the print bed
#define X_BED_SIZE 215
#define Y_BED_SIZE 200

// 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
#define Z_MAX_POS 200

Did you at some point when you fiddled with the code set a custom size for the max position ?
If you did indeed set the X_MAX_POS & Y_MAX_POS to not be the same as the bed size for a particular reason then you need to set X_MAX_POS & Y_MAX_POS bigger than the Bed size parameters.

FYI I tested it and I can reproduce the error.

Hope it helps.
Re: need help with marlin
June 29, 2018 08:43PM
here is a copy of the configuration.h file
Attachments:
open | download - Configuration.h (63.9 KB)
Re: need help with marlin
June 30, 2018 08:15AM
Quote

// 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 300
//#define Y_MAX_POS Y_BED_SIZE 300
//#define Z_MAX_POS 400


should be

#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
#define Z_MAX_POS 400 << set this to your Z max

Edited 1 time(s). Last edit at 06/30/2018 08:30AM by obewan.
Re: need help with marlin
January 20, 2020 02:13PM
Quote
obewan
Quote

// 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 300
//#define Y_MAX_POS Y_BED_SIZE 300
//#define Z_MAX_POS 400


should be

#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
#define Z_MAX_POS 400 << set this to your Z max

Sorry for bringing up an old post, but, it happens to match my issue completely. I am using Marlin 2.0(well, trying to) and I need to limit the travel on the x-axis because my probe is 38mm to the right of the nozzle. If I use the 260mm X 260mm for x and y bed size the probe ends up completely off the bed on the right side. The probe is equal to the nozzle on the y-axis. My way of thinking would be to subtract 38mm from the 260 and use that number for x_max, set z_max to 350, leave y_max as is and use 0 for the rest. I am assuming that the endstops are being set to 0 automatically by the firmware. Unfortunately my way of thinking does not work. I just cannot grasp the logic for some reason.
Re: need help with marlin
January 20, 2020 05:48PM
If you have set the probe to nozzle offsets correctly, the firmware should limit the X max movement automatically.
See in configuration.h

Quote
/**
* Z Probe to nozzle (X,Y) offset, relative to (0, 0).
*
* In the following example the X and Y offsets are both positive:
*
* #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 }
*
* +-- BACK ---+
* | |
* L | (+) P | R <-- probe (20,20)
* E | | I
* F | (-) N (+) | G <-- nozzle (10,10)
* T | | H
* | (-) | T
* | |
* O-- FRONT --+
* (0,0)
*
* Specify a Probe position as { X, Y, Z }
*/
#define NOZZLE_TO_PROBE_OFFSET { 38, 0, -2 }

Re: need help with marlin
January 23, 2020 04:34PM
Quote
obewan
If you have set the probe to nozzle offsets correctly, the firmware should limit the X max movement automatically.
See in configuration.h

Quote
/**
* Z Probe to nozzle (X,Y) offset, relative to (0, 0).
*
* In the following example the X and Y offsets are both positive:
*
* #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 }
*
* +-- BACK ---+
* | |
* L | (+) P | R <-- probe (20,20)
* E | | I
* F | (-) N (+) | G <-- nozzle (10,10)
* T | | H
* | (-) | T
* | |
* O-- FRONT --+
* (0,0)
*
* Specify a Probe position as { X, Y, Z }
*/
#define NOZZLE_TO_PROBE_OFFSET { 38, 0, -2 }


I changed the settings to this format because it is easier for me to understand,

#define X_NOZZLE_TO_PROBE_OFFSET +38 // X offset: -left +right [of the nozzle]
#define Y_NOZZLE_TO_PROBE_OFFSET 0 // Y offset: -front +behind [the nozzle]
#define Z_NOZZLE_TO_PROBE_OFFSET -2 // Z offset: -below +above [the nozzle]

and I have the bed defined as

#define X_BED_SIZE 260
#define Y_BED_SIZE 260

// 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
#define Z_MAX_POS 350

What I end up with is the nozzle travels at a screwed up distances on the xy axis. If I enter G1 X130 the nozzle goes to the opposite edge of the bed instead of stopping at the halfway point. I started with the X0 Y0. It is a 2:1 offset for some reason. I am starting off with my configuration.h file from my working 8 bit setup. I changed the motherboard to a 32 bit board. In my way of thinking, Marlin should take the xy-limit switches as being 0 when triggered, and then use the defined bed size as the furthest point to go, after considering the nozzle to probe offset.

Where is it getting the setting to change the bed size to half what it physically is? There is the #define DEFAULT_AXIS_STEPS_PER_UNIT { 100, 100, 400, 168 } definition, but, it is the one that worked with the previous motherboard.

Also, for some reason now I cannot see the SD card from my notebook anymore. I used to be able to connect to it when it was inserted into the motherboard, but not anymore. I have to physically move it to my notebook to copy the new firmware build to it. I don't know when exactly it stopped being accessible, but, could it be from changing #define SERIAL_PORT 0 to #define SERIAL_PORT -1?
Re: need help with marlin
January 28, 2020 12:15AM
I have got the notebook to be able to see the SD card when it is inserted in the slot on the motherboard. I changed the #define SERIAL_PORT -1 to #define SERIAL_PORT 0 and had Visual Studio Code compile and upload the new firmware to the SD card that was inserted into the notebook. Moved the SD card to the reader on the motherboard and pressed the orange button on the motherboard to reset and install the new firmware.

Now I can see the SD card on my notebook under both Serial and Virtual on the PIO Homepage. I then changed the #define SERIAL_PORT 0 back to #define SERIAL_PORT -1 and rebuilt and uploaded the firmware to the SD card on the motherboard. Reset to install the new firmware. I have been using this connection to build and install firmware without any issues of losing access to the SD card on the motherboard. I have no idea why it stopped working in the first place, even if it became corrupt somehow, the many rebuilds and manual uploads should have fixed it. I will try to keep track of changes i am making in the hopes that i somehow break it again, I will have the reason. But for now, anyone that loses access to the SD card in the motherboard from a notebook, just set it back to 0, build, copy, reset motherboard, then edit configurations.h and change it back to the -1, build, upload, reset, and your access will be restored.

I cannot find why I can't manage to get proper range/access to the complete bed. I have even gone back to the very first configurations.h file from the 8 bit source zip from FLSUN and corrected the changed function names and then rebuilt and uploaded. No difference. If I enter G1 X0 the nozzle goes to the x-axis limit switch and stops. If I then enter G1 X220 the nozzle goes past the end of the bed and chatters the belt trying to move the nozzle through the frame of the chassis. If I enter G1 X130 instead, the nozzle stops at the end of the bed. There is some setting somewhere that must define how many "steps" to travel 1mm, I cannot find it.
Sorry, only registered users may post in this forum.

Click here to login