Jump to content

Inaccurate Steppers?


Recommended Posts

Not quite sure where to take this... Been having issues with dimensional accuracy pretty much from day one, often showing up as holes skewed oval in the horizontal planes. 

Base machine is an Ender 3, with a number of modifications (dual Z screws, SKR mini E3, belt adjusters, Nitehawk toolhead in a Stealthburner printhead, other small stuff.)

Finally got fed up with it, and got a metric 25mm travel dial indicator and physically measured the amount of travel when entering 20mm for five cycles per axis, measuring both positive and negative ( g91 -->  g1 x20 f100, then g1 x-20 f100 ) same for Y and Z.  i did NOT get 20mm for any axis, that much is certain.  Y and Z gave solid, repeatable results; =+Y was 19.18 every time, and -Y back to 0.00 every time.  Z was the pick of the litter, with +Z was 19.92, and -Z back to 0.00, also every time.  This seems to rule out variables such as loose motor mounts, Z screws, belts and/or lockscrews (mine are all pressed-on anyway) or other mechanical issues, and suggests to me that the ROTATION_DISTANCE setting of 40, while technically correct for a machine running a Gates 2mm pitch G2 belt and 2mm pitch, 20 tooth drive and idler gears, is not yielding the commanded amount of travel by a significant amount.  Seems that setting of 40 should be slightly bigger, but that's another issue I've run into; there's no combination of whole and micro-steps that will whittle that error down to the 0.01 or 0.05 range (in real-world travel.)

The X axis is more problematic, giving different results for each out and back cycle, with a low of 19.46, and a high of 19.53, for an average of 19.49.  I suspect the differing results there DO suggest some mechanical issue - - I've modified the X-axis carriage, adding an MGN12 linear rail and a stealthburner print head (and shifting the Y axis 30mm to the front to compensate for the greater forward distance of the nozzle) ... had to come up with an adapter to connect the ends of the X belt to, since the Ender setup is totally different from the Voron setup.  The adapter is TIGHT on the burner 'mount' print, the burner 'mount' is tightly affixed to the linear rail carriage.  The belts took some effort to get into the adapter recess for them, they don't move around at all; the adjuster seems set correctly (I start loose and watch the belt; if it pulls up in one direction then dips in the other, that's too loose and I tighten up the adjuster until there's no more vertical belt movement with a direction change, then add another half turn and call it good.) 

Approaching a full millimeter short of a commanded input seems an awfully large error to me (and this is at TWENTY mm, which would be double that at 40mm, no?).  I'm wondering at this point if switching the 1.8 degree steppers to 0.9 degree steppers with 400 steps per revolution will enable me to fine-tune the error to about a micro-step's worth of distance, if Klipper even has provision for such, which it appears that it does not.)  It's a lot easier to set this in Marlin, since they use "steps-per-millimeter' instead of rotation distance; Klipper seems to "assume" that given a certain set of hardware, a fixed and predictable result is a given, with no real provision to fine-tune it if it differs from that prediction (unless I'm reading the config reference wrong... not that I *ever* do that!)

The math is straightforward enough: a 1.8 degree stepper has 200 full steps per revolution, and 16 micro-steps per full step (3200 micro steps per revolution.)  Given a 'rotation distance' of 40mm, each full step *should* give 0.2mm of travel per step, and 0.0125 for each micro-step.  The numbers all work, but the real-world travel at the nozzle ain't lining up with the numbers, falling short of that mark and that's where I'm stuck for a fix.  Working with the actual travel -vs- commanded travel, I even tried adding an additional micro-step for every (#number) of steps (every tenth, every 20th, etc, not even knowing if that's possible), just as an intellectial exercise to get the numbers to jive with the results - - best I could do was one additional micro-step for every fifty full steps, which yields 40.05 mm of real-world travel.  Close enough for government work!  Which adds yet another problem, though; what if the stepper is moving less then fifty steps?  

This mess has got me thinking in circles - - an outside perspective would be extremely welcome!!  

Link to comment
Share on other sites

Did you change the belts? I had an Ender 3, my first printer before the Trident. It had press on sprockets that are NOT G2 profile. I forget the profile name, and it is a 2mm pitch, but not the same tooth profile. If using G2 belts, try removing the original sprockets and replace them with G2 sprockets.

 

Link to comment
Share on other sites

It could be anything unfortunately. Sounds like you are after a few ideas?

This is a good watch on calibration by CNC kitchen and here is the model in the video if you wish to follow this path:

Vector 3D Califlower Mk2 – 3D Printer Calibration & Skew Fix

Calilantern Calibration Tool – Vector 3D

I would follow the standard math for distance as that is what klipper expects. Run longer measurements - 20mm could be masking 1mm of play (loose pulley, loose mounts, loose frame, loose stepper, damaged stepper etc etc etc) so try several longer lengths to see if the error is a consistent measurement or a consistent percentage.

Some ideas for diagnostics; Klipper is super flexible so you can swap steppers, swap stepper cables, swap ports on your main board etc to confirm it is not electronic. Check the grub screws on your steppers are tight. 

 

 

 

 

Link to comment
Share on other sites

@VDZ: I did change the belt on the X axis when I modified it with the Stealthburner, with a genuine OEM Gates belt.  I'm still running the stock gears though... I've ordered OEM Gates idlers for X & Y, but they aren't here yet.  Looks like I'll be ordering the drive gears as well!

@lawson.brian: Longer measurements are problematic; my dial indicator is a typical 25mm travel, so I worked in 20mm increments.  50mm travel dial indicators get pretty pricey for something I'll be seldom using.  Not sure a vernier will be accurate enough.  The drive gears are all pressed on, no set-screws in use.  To the best of my ability to tell, they're still tight on the shafts.  I colored half of the gear AND shaft with black marker to see if there was any visible change in the alignment of the mark on the shaft and the mark on the gear (a misalignment of the black on the shaft with the mark on the gear will easily show if there's looseness)- - none seen.

I'll check those links and the video - - I was already aware that so-called calibration cubes are a dismal way to test the accuracy of the printer's axes, which is why I went with a dial indicator.  Figured even s short throw indicator was better than a printed cube!

Thanks both for the replies!

Link to comment
Share on other sites

If I'm understanding you correctly, you didn't have enough X belt to work with, so you created a printed part to act as a belt extender. Is that right? I think step one should be to get rid of that extender. Replace the belt with a longer one. I believe you when you say you have good reasons to think the extender is not the problem. However, this is an unusual configuration and since you're having problems, the only way to validate that the extender is not the source is to take it out of the system and see if that makes a difference.

It's unlikely that an 0.9 degree stepper would make any difference.

You mention that your X excursion is varying on each trial, but you don't say whether the zero point changes over time. If it does change, I'd suspect that your X stepper is skipping steps or microsteps. In that case, you can increase the stepper current and see if that helps.

 

Link to comment
Share on other sites

9 hours ago, kharrisma said:

 

@lawson.brian: Longer measurements are problematic; my dial indicator is a typical 25mm travel, so I worked in 20mm increments. 

 

For X, you have a 2.5% error over 20mm. Run, say, 150mm and see if it is still 2.5% overall - that you can measure with a typical ruler:

2.5% of 150mm = 3.75mm thus ~ 4mm

That will tell you if you have a consistent rotational error or if it is an error at the start of the move. From there it is a bit easier to identify places to look.

Upload your current printer.cfg as well. Which BTT SKR E3 version is it?

Link to comment
Share on other sites

Hi Garth,

I bought a 2 meter piece of GT2 Gates OEM belting and cut it to length.  The problem with the X belt anchors is that the stealthburner is designed (primarily) for the Voron family of coreXY printers; the belts are oriented vertically (teeth facing forward or back), and the attachment on the stealthburner 'base' print has the anchors formed accordingly.  The Ender series belts are oriented horizontally, teeth facing up/down, so there's no way to link up to the print head withouit introducing a half-twist in the belt, something I wasn't willing to do.  The piece I printed was a block screwed to the backside of the 'base' (with a thick 'lug' that fits closely into a recess on the backside of that 'base' piece to avoid twisting or movement) with slots and  cavities to accept an 'anchor' (the round ferrules provided with the new belt.)  Belt enters through the slot, wraps around the ferrule, and exits back through the same slot, with the belt teeth engaged with each other like meshed gears, forming a no-slip loop.  Whole thing had to be pushed in firmly, not at all a 'slip fit.'    It IS an unusual configuration, but my choices were to find a pre-existing adapter, make one, or forego the linear rail and find an adapter that would adapt the stealthburner to the OEM Ender carriage.  Wanted both the rail and the 'burner, and the adapter I found was ideal... but wouldn't print, too many mesh errors  and was just an .stl, no editable cad drawing.  So I cobbled up this thing instead.  I'll see if I can get a decent pic of the backside showing the block.

The zero is consistent for Y and Z, but I got one return to 0.05mm and two to 0.02mm out of five cycles.  Not ideal, but a very small distance I didn't think was worth pursuing.  Maybe I should re-think that.

Just now had a thought about that adapter... the Voron belt setup anchors the beltS (a pair per side) directly over the linear rail carriage for a straight pull (red line = carriage, blue lines = belts):

image.png.7cbfafce4dea66d5fe7c9ac9bb87bafa.png

 

and the adapter fits into the recess on the backside for the probe's height adjustment feature (sliding 'blue' plate with two threaded inserts) :

image.png.abb679c701794d24126bd66f3ead95e1.png

The "lug" on the backside of the adapter fills that recess where the (blue) anchor plate would be, were I using it.  This makes for a very solid anchor point... BUT it also places the belt pull below the rail carriage instead of directly over it, which may well be imparting a tendency to 'twist' the rail carriage a bit; tight as the linear rail carriages are, there's still some small amount of clearance to allow for free movement.  Might be enough to introduce a measurable amount of movement of the 'burner body when moving it back and forth??  The dial indicator was reading directly off the 'burner shell at the level of the print-cooling (upper) fan, about as far above the rail carriage as the adapter is below it.   I used a very slow speed (100mm per minute) to avoid any errors created by rapid movement, but that might not make any difference here.

 

Hi Brian,

That sounds do-able enough.  I guess as you say, accuracy to three decimal places isn't needed to find out what you're looking for here, so the verniers should suffice (or even a ruler - - though my lousy vision is why I use the more easily-readable digital verniers to begin with!  😉   )  Printer.cfg is attached, and it's a version 3.0 SKR, not the 3.1 (not sure what the difference is between them.)

config-20250520-115158.zip

  • Like 1
Link to comment
Share on other sites

Posted (edited)

Ok this is the one from my switchwire with the same board but 42.40 motors, not the enders 42.34

(Below changes assume you are using GT2 belts and a 20 tooth pulley)

A couple of things to try:

  • You don't have the full steps per rotation on yours - assume standard 1.8 deg steppers: use full_steps_per_rotation: 200
  • turn off stealthchop by specifying stealthchop_threshold: 0
  • interpolate: False
  • microsteps - 16 is fine.
  • run current - I think the 42.34's are fine on 0.580

#     X Stepper Settings Switchwire

[stepper_x]
step_pin: PB13
dir_pin: PB12
enable_pin: !PB14
rotation_distance: 40
full_steps_per_rotation: 200
microsteps: 32
endstop_pin: ^PC0
position_endstop: 250
position_min: 0
position_max: 250
homing_speed: 70
homing_positive_dir: true

[tmc2209 stepper_x]
uart_pin: PC11
tx_pin: PC10
uart_address: 0
run_current: 0.8
interpolate: False
stealthchop_threshold: 0

 

A blurb from the Klipper docs on stealthchop: 

TMC drivers - Klipper documentation

 

Setting "spreadCycle" vs "stealthChop" Mode

By default, Klipper places the TMC drivers in "spreadCycle" mode. If the driver supports "stealthChop" then it can be enabled by adding stealthchop_threshold: 999999 to the TMC config section.

In general, spreadCycle mode provides greater torque and greater positional accuracy than stealthChop mode. However, stealthChop mode may produce significantly lower audible noise on some printers.

Tests comparing modes have shown an increased "positional lag" of around 75% of a full-step during constant velocity moves when using stealthChop mode (for example, on a printer with 40mm rotation_distance and 200 steps_per_rotation, position deviation of constant speed moves increased by ~0.150mm). However, this "delay in obtaining the requested position" may not manifest as a significant print defect and one may prefer the quieter behavior of stealthChop mode.

It is recommended to always use "spreadCycle" mode (by not specifying stealthchop_threshold) or to always use "stealthChop" mode (by setting stealthchop_threshold to 999999). Unfortunately, the drivers often produce poor and confusing results if the mode changes while the motor is at a non-zero velocity.

Note that the stealthchop_threshold config option does not impact sensorless homing as Klipper automatically switches the TMC driver to an appropriate mode during sensorless homing operations.

 

 

 

TMC interpolate setting introduces small position deviation

The TMC driver interpolate setting may reduce the audible noise of printer movement at the cost of introducing a small systemic positional error. This systemic positional error results from the driver's delay in executing "steps" that Klipper sends it. During constant velocity moves, this delay results in a positional error of nearly half a configured microstep (more precisely, the error is half a microstep distance minus a 512th of a full step distance). For example, on an axis with a 40mm rotation_distance, 200 steps_per_rotation, and 16 microsteps, the systemic error introduced during constant velocity moves is ~0.006mm.

For best positional accuracy consider using spreadCycle mode and disable interpolation (set interpolate: False in the TMC driver config). When configured this way, one may increase the microstep setting to reduce audible noise during stepper movement. Typically, a microstep setting of 64 or 128 will have similar audible noise as interpolation, and do so without introducing a systemic positional error.

If using stealthChop mode then the positional inaccuracy from interpolation is small relative to the positional inaccuracy introduced from stealthChop mode. Therefore tuning interpolation is not considered useful when in stealthChop mode, and one can leave interpolation in its default state.

 

 

Edited by lawson.brian
Link to comment
Share on other sites

Ah, I gotcha. Thanks for the explanation. I'm not sure if the belt attaching away from the axis of the rail is enough to give you a wiggle. If you grab the toolhead in your hand and twist it a bit (around the Y axis), does it feel like it's displacing?

I think you're right that with the displacements you're seeing (~0.05mm), it's probably not worth worrying about. The important thing is to rule out something on the X axis slipping (e.g., the motor losing microsteps or a pulley that's not fully screwed on).

Any digital caliper should be good enough for this sort of calibration. That'll let you print calibration objects that are ~125mm on an axis and spread out the measurement error. The cheap ones are a hassle to deal with, but they're still capable of taking good measurements.

Link to comment
Share on other sites

Brian, thanks for the input!  I'll implement those changes you suggested and see if things improve.

Garth, guess I'll cobble something up to solidly hold the vernier in a fully open position, zero it, and have the moving carriages depress the plunger (like a depth measurement) and see what that nets me.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...