<p>During printing, my printer occasionally makes some mystery moves: it will very slowly move either the X or Y axis all the way to the left/front, before very slowly moving back to its original position and resuming the print as normal. I've checked my G-code files, and the moves are definitely not part of the G-code. What could be causing this?</p>

<p>I'm printing from an SD card on a Cartesian printer.</p>

[{'answer_id': 963, 'author': 'Tom van der Zanden', 'author_id': 26, 'author_profile': 'https://3dprinting.stackexchange.com/users/26', 'pm_score': 4, 'selected': True, 'text': "<p>The issue was due to a corrupt SD-card, which was occasionally having some garbage read from it. It turns out that Marlin will try interpret a corrupt move command like <code>G0 X1q3.54</code> and still read as many numbers as it can. In this example, it would be interpreted as <code>G0 X1</code> rather than (as might have been intended) <code>G0 X103.54</code>.</p>\n\n<p>This explains my symptoms perfectly:</p>\n\n<ul>\n<li><p>X and Y always moved to (approximately) their home positions, but it was always only one of them (it's quite unlikely that both moves are corrupted).</p></li>\n<li><p>Z was not affected because Z moves are much rarer in the G-code (only on layer change) and thus it was very unlikely that a Z move would be affected.</p></li>\n<li><p>E was not affected since a request to move E to near 0 would be prevented by Marlin's long extrusion prevention.</p></li>\n</ul>\n"}, {'answer_id': 6700, 'author': 'Trish', 'author_id': 8884, 'author_profile': 'https://3dprinting.stackexchange.com/users/8884', 'pm_score': 1, 'selected': False, 'text': "<p>Beides a corrupt SD card that stores worng bits, leading to absurd commands, it's also possible that ithers parts in the Creatin of the file are compromised:</p>\n\n<p>This can for example happen if the card is removed during writing - but in this case it should be mostly an incomplete file on importing into an interpreter.</p>\n\n<p>More a random distribution of bad commands would appear if the writing process in itself is faulty, for example if the SD Port is defect or the adapter hast a error. Another way that writing can fail is if the drivers for the SD card adapter/port are corrupted. </p>\n\n<p>To detect a bad file or corrupted card is possible by re-importing the G-Code into a slicer (for example CURA allows this) and look at the tool paths. If any port does this with any card, software is to blame: See if it persists after a driver update (rare!) and a reinstall of the slicer. If it fails in one port but works in a different the port or adapter might bei at fault and might need replacement. If it is endemic to one card, this one is corrupt and to be thrown out. If it is endemic to a single file, overwrite it with a new one - sometimes writing fails for reasons that are almost impossible to understand.</p>\n\n<p>If the file&amp;card are fine but read wrongly at the printer, then the card reader in the printer or the board are to blame.</p>\n"}]
['https://3dprinting.stackexchange.com/questions/962', 'https://3dprinting.stackexchange.com', 'https://3dprinting.stackexchange.com/users/26/']