# How to line up (x,y) print area between hardware and software?

I'm trying to line up the physical print bed of my printer (Printrbot Simple Metal) to the virtual print area of the slicer (Cura). So far, they've never been properly aligned. It was never that big a problem because, worst case scenario, my print would simply not be dead-center on the bed. But I've decided to try and fix it.

Here are pictures of a test model in Cura, and the resulting physical print:

What's the proper way to align the two? It seems I just got lucky with the x-axis here (though note that the BuildTak surface is a bit off center). But obviously the y-axis needs fixing. The print needs to start a little lower, because print-head couldn't reach the highest point, and the y-axis motor slipped to compensate.

Ideally, the fixed parameters of the print bed size and offset would be set by the Marlin firmware (EEPROM?). But I also need to be able to do a little offset tweaking on the software side for when I need to replace the BuildTak mat.

Edit: I tried M206 (home offset) commands, but the result is definitely not what we want. I cancelled these early.

The upper print has M206 Y-15, the lower print has M206 Y15. What seems to happen is that the coordinate system is not physically shifted. Instead, the area is 'cropped'. All filament that should go outside the boundaries is actually extruded 'on the edge', resulting in an ugly blob.

• I have not used cura software, but is there a 'calibration' function? – J. Roibal - BlockchainEng Jun 12 '16 at 15:11
• The word 'calibration' is usually used for the number of stepper-motor steps per mm, or bed-leveling (z-axis). That's what Cura uses that term for, anyway, and it doesn't look like it can play with the Firmware. (Also, Cura is not actually connected to my printer in any way. My printer runs from an OctoPrint server.) In any case, I know how to change the EEPROM values, but I don't know which values to change and how. – mhelvens Jun 12 '16 at 15:25
• If there were lines connecting the squares (horizontal and vertical) to make a grid, where would the error begin to be seen? May need to be tested. – J. Roibal - BlockchainEng Jun 12 '16 at 15:52
• Also--what if the upper-left most square (where the extruder is rattling) was lower (say, 2 cm), would the squares still become offset? – J. Roibal - BlockchainEng Jun 12 '16 at 15:59
• I recall experiencing a bug with Marlin, where the auto leveling feature can cause a shift in the axis positions. Basically, if the probing positions aren't symmetric with respect to the bed (e.g. you probe at y=20 and y=160 with a 200mm wide bed) it would offset the y axis. Changing the probe positions to be symmetric (e.g. y=40 and y=160 or y=20 and y=180) fixed this for me. If this turns out to be the issue I can add it to my answer. – Tom van der Zanden Jun 12 '16 at 16:10

The problem you are experiencing is because the position where the y endstop is triggered does not correspond to y = 0, but perhaps corresponds to y = 15 (replace 15 by the offset you're seeing). You can perhaps solve this by adjusting the endstop to trigger at the correct point, but you can also adjust this behavior in software: In your start G-code, after the homing (G28) command, insert a G92 Y15 to tell the printer that the current position (reached after homing) is actually y = 15.
Another option is to use the M206 command to permanently store the offset in EEPROM (rather than needing to provide it in the start code each time).
• Hi @Tom: I'd like to put this in EEPROM, but the M206 command is not the way to go, it seems. I edited the question to show the results. – mhelvens Jun 12 '16 at 17:53