-
-
Notifications
You must be signed in to change notification settings - Fork 19.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Wrong Z height after long print, Z-shifting #27347
Comments
Do you see any difference if you reduce your Z axis acceleration and max feedrates? Set them as low as you can tolerate and give a few tests, and maybe try some extra high values too just for comparison. |
I´ve testet some settings to find potential reasons for this behavior.
It looks like there is a constant amount of missed / added steps independend from the speed (no change at smaller acceleration = smaller velocity), moved distance, pulse density, number of steps, etc. The only constant is the number of directional changes. Did you try the test-gcode on one of your machines to validate if it´s a general firmware issue or a problem specifically related to my hardware? |
I did some more test:
Apparently, the acceleration has no impact on this problem. What do you think? |
I did even more tests:
Was anyone able to reproduce this problem on their machine? |
Not on the Z axis... but this whole thing reminds me of something. Recently I upgraded my Prusa MK2S But: This was using the 2.1.2.4 release. I then tried bugfix-2.1.x just to find out it simply wouldn't home Wanted to post this but forgot about it, the problem with your Z axis does sound like what I've seen The problem did NOT occur when disabling IS. I never enabled IS on the Z axis, wanted to see how it |
I have an idea:
But this wont work because as soon as the next absolute Z-move is executed, the additional offset will be deleted. |
So far I'm wondering if anyone was able to confirm the theory of a fixed shift per z move...? At 1280 steps/mm each step is 0.00078125mm - roughly 42 times of your calculated value. How do you know it's 0.000019mm for each move and not 0.0002mm for a single move every now and then, did you run your test with 1000/1500/2000 iterations or how did you verify this? Or did you simply divide 0.28mm/15000?
Based on the timeline we've both likely been using bugfix releases around the same time with tons of changes... while I had been loosing steps on Y when IS was enabled I didn't enable IS when my Z axis was behaving strangely... the thing I didn't really notice initially was you reporting the problem with 2.1.2.1. I'm running that release on multiple printers, so I wanted to test this. Because of the different steps/mm you're using I did not want to test your gcode on the printer I mentioned, but I did
Also added 3 times moving to z=3 and z=0 at the start to verify the position when the test starts. Usually my Z axis is running at 400 steps/mm, so it's running at > 60mm/s for this test and I did expect to see some trouble here, but no:
https://www.youtube.com/watch?v=af9SPdLW4G4 While there is a TINY difference (way below 1/100th mm) it's nowhere near the ~0.25 or 0.3mm reported and I'm inclined to say that's more likely my hastily designed dial gauge mount and the decades old indicator itself which might be slightly off. Been using 2.1.2.1 for quite a while and I'm using Z hop/lift on many prints, so I'm having a hard time to believe it's a generic problem like being off by a constant fraction of a step on each z move. But I'm also missing the equipment to reliably come up with something like 0.000019mm/move, I have to admit. |
@parallyze
It definitely is a 0,0078125mm - step every now and then (after 42 Z-moves, as you said), the motor cannot perform a smaller move than a single step. In fact I simply divided 0,28/15000. Could you send me your config so that I can compare it to mine? Maybe there are other settings different which I could try to test. |
Sorry, not really into testing again right now (already did two 18 minute runs without any indications of something wrong). But there was no Z-Shift, and I did not hit the endstop. As mentioned I was using a BLtouch, so there was no endstop to hit.
I said "roughly 42 times of your calculated value". That's quite different from "loosing a single step every 42 z moves". And I am a bit confused now:
Are you saying there's something off on every MOVE or every now and then? Edit:
Have you tried changing your test script? Instead of +0.2/-0.2 in each "loop" moving 2x +0.2 and 1x -0.4 instead? That might give a clue if it's tied to the amount of moves (3 instead of 2) or the amount of directional changes (still only 1).
2.5mm vs 2.44mm is a difference of ~77 steps, so this sounds awkwardly rounded to fit other calculations. Have you actually tested if any of this happens when using z moves only? Or Z+X only? Right now I'm just getting more confused because of all the stuff not fitting together. Initially this was reported:
but from your second post on it's always about -0.28mm....?! Initially you said:
while your config clearly states:
does also not fit your configs or following posts. Right now I can't see any coherence here or reliable steps to recreate the problem reported, sorry. And mind you, I'm using TR8x2/4 rods, so at 16x microstepping there's 400 steps/mm and the problem would've been even more visible. The 0.2mm z moves from your gcode equalled 0.64mm on that printer.
The config from that printer is vastly different. It's using dual Z, Trinamics, BLtouch and IS (which was disabled during the tests), so I highly doubt that'll show up anything interesting. |
Thanks for clarification. So it seems indeed to be a problem isolated to my hardware or firmware config. There are some mismatches between the config I´ve uploaded and the values I mentioned later (XY Steps/mm and acceleration), I forgot to mention that I changed some values in the EEPROM.
Since neither the acceleration nor the move distance seemed to have an impact on the issue, I assumed it wasn´t necessary to get too much into the detail here. I apologize for the confusion. I just wanted to say that the estimated error per Z-Move or Z-directional change which I calculated according to my test g-code is roughly the same as what I´ve seen on the initial failed print, but not to the very last decimal place. To clarify the timeline:
I did some more tests:
So I must modify my earlier assumption: The error doesn´t happen after each Z-move or Z-directional-change, but each time a Z-move is directly followed by a XY-move ore vice versa. This explains why there was also no error when the Z-move was embedded by M400-commands which I testet earlier: It look like the error happens when Z-move is directly followed by a XY-move ore vice versa inside the move buffer. |
I got a little further with the investigation of this problem: I had the idea to set the timing for the Z-axis to 15000/15000 and leave the other axes at 3000/5000, but it looks like this isn´t possible with marlin: The timing is always set to the highest value of each configured stepper driver. I have another printer which has the same JMC-motor, but for the X - and Y - axes. It runs with Repetier-Firmware and the timing is set to 3000 (step)/5000(dir). There, I don´t have any problems. So i don´t think that the motor is the problem. What I also noticed is that the noise of the Z-Motor is slightly different when it runs alone compared to when it runs together with the XY-axes:
For me it looks like Marlin has some problems to get the step timings right at this specific situation, which may not causes problems for fast TMC-Drivers, but is a problem for slower leadshine or JMC-drivers. |
Hmm... this is just an uneducated guess - but there's been minor changes to this, in 2.1.2.1 this was defined as microseconds: #27113 While you did have problems using 2.1.2.1 it was different from the bugfix ones. I wonder if those minor changes also did have any impact on the timings set... |
Success!!
The DIR_DELAY is now 6 times longer than it usually has to be with this motor, I have no idea why. I´m currently printing the failed 24h-print again to check if the problem also disappears under real conditions, but I am very confident.
Yes, I remember, there was a change. The current value for STEPPER_PULSE (3000ns) is longer than the pulse time mentioned in the motor manual (2,5ys = 2500 ns), so I kept this in regard. |
Did you test the latest
bugfix-2.1.x
code?Yes, and the problem still exists.
Bug Description
I discovered a problem after I finished a 24h print: The part which I wanted to print should have been 15mm tall, but was only 12,5mm.
After I manually moved the Z-Axis down, the nozzle touched the printbed at a displayed Z-height of 2,5mm. So the Z-height apparently has been shifted by 2,5mm during the print.
After I discovered this, I checked the mechanics of the machine: Everything sits properly, there is nothing loose, all belts are tensioned, pulleys are fixed. There is no measurable backlash on the z-axis.
When I move the Z-axis manually, even 10 times several 100mm +-, the shift doesn´t appear.
It only seems to appear at a high number of small movements.
Then, I wrote a test gcode file which rapidly performs a small Z-movement followed by a small XY-movement which mimics a complex print with many small islands with Z-hops 7500 times in total with an additional Z+0,2 every 500 cycles.
I´ve run this test G-Code with 3 different Marlin firmware versions:
Version 2.1.2.1: Z+0,25mm
Version 2.1.x (bugfix) from 11. Jun. 2024: Z-0,32mm
Version 2.1.x (bugfix) from 09. Aug. 2024 (latest version): Z-0,32mm
Z+ means the axis is higher than it is supposed to be (gap between nozzle and printbed at Z=0),
Z- means the axis is lower than it is supposed to be (nozzle crashes into printbed at Z=0).
The results are repeatable, always with identical values.
As shown above, the value and the direction of the z-shift changes depending on the firmware version. This clearly shows that this problem is firmware related and cannot be caused by other mechanical or electrical reasons.
I´ve attached the test g-code and the config file.
My Z-axis runs with 1280 steps/mm, 300mm/s² acceleration and 0 jerk. X-Axis is 160,22 steps/mm, Y-Axis 128,28 steps/mm, both 5000 mm/s² acceleration and 10mm/s jerk.
When you test this G-Code, you should set your machine to equal values if possible to reproduce the results, especially for the Z-axis.
Bug Timeline
Discovered a few weeks ago
Expected behavior
I expect no position shift in the Z-Axis. Even after a long print, Z=0 has to remain at the same position as at the beginning of the print.
Actual behavior
Z-Axis shifts after a high number of Z-hops.
Steps to Reproduce
Version of Marlin Firmware
2.1.x Bugfix from 07.08.2024
Printer model
custom built
Electronics
BIGTREETECH Manta M8P with Raspberry Pi 4
LCD/Controller
None
Other add-ons
closed loop servo motors and external steper drivers
Bed Leveling
None
Your Slicer
Simplify3D
Host Software
Other (explain below)
Don't forget to include
Configuration.h
andConfiguration_adv.h
.Additional information & file uploads
Host Software: Repetier Server
Configuration.zip
Test Z+-0.2 (total +3Z) +XY rel x7500.zip
The text was updated successfully, but these errors were encountered: