Skip to content
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

Microsteps setting #211

Open
krzyzankowskig opened this issue Oct 30, 2024 · 10 comments
Open

Microsteps setting #211

krzyzankowskig opened this issue Oct 30, 2024 · 10 comments

Comments

@krzyzankowskig
Copy link

Guide says: "Autotune gives better results, both dimensionally and quality, by using interpolation and as many microsteps as feasible". So... Should we set it in config? Or auto tune sets it according to driver and motor specs automatically?
If we set it, is there any suggested value?

@LabunskyA
Copy link

You should set it according to your driver. TMC 2209 can use max of 64, for example

@charredchar
Copy link

You should set it according to your driver. TMC 2209 can use max of 64, for example

Are you sure about this? I know the datasheet says a max of 64 when using the dir and step pins but I've tested speeds with every microstep setting between 16 and 256 and found an improvement each step above 64, even at 256. If it was in fact limited to 64 I would be curious to know why 64 was actually one of the worst settings for me.

@andrewmcgr
Copy link
Owner

andrewmcgr commented Jan 2, 2025 via email

@LabunskyA
Copy link

LabunskyA commented Jan 2, 2025

You should set it according to your driver. TMC 2209 can use max of 64, for example

Are you sure about this? I know the datasheet says a max of 64 when using the dir and step pins but I've tested speeds with every microstep setting between 16 and 256 and found an improvement each step above 64, even at 256. If it was in fact limited to 64 I would be curious to know why 64 was actually one of the worst settings for me.

You can set them to 256. But it may lead to skipped steps depending on your currents and speeds. Maximum safe value is 64 with virtual interpolation to 256 steps. Use higher values on your own risk (not really a risk, as the worst thing is just wasted plastic). And yes, as Andrew said: not every MCU can handle high values. For example, Robin Nano 2.1 with 3 steppers on a delta can handle up to 32 steps without any problems, but will fail some movements with 'timer too close' error even at 64

@krzyzankowskig
Copy link
Author

krzyzankowskig commented Jan 2, 2025

And we come back to my oryginał question: should we set it or autorune is handling it :)

Ps. How you can set number of interpolated steps?

@Sonnenwerk
Copy link

I have the same question, as it is not clear which parameter

  1. must stay in driver section
  2. should /can stay Driver section
  3. shall not! stay in Driver section

@LabunskyA
Copy link

LabunskyA commented Jan 2, 2025

And we come back to my oryginał question: should we set it or autorune is handling it :)

Ps. How you can set number of interpolated steps?

You should set it manually. Klipper will not let you left microsteps unspecified, it's a required option :)
Set it to the highest safest amount the driver allows. For TMC2209 it's 64 (you can go higher if you personally want to, but it may lead to problems) with interpolation on

A basic stepper config example (taken from flsun v400 with 1.8 motors on TMC2209):

[stepper_a]
step_pin: PE3 
dir_pin: PE2
endstop_pin: ^PA15
enable_pin: !PE4
microsteps: 64
rotation_distance: 40

[tmc2209 stepper_a]
uart_pin: PD5
run_current: 1.5
interpolate: true
sense_resistor: 0.110 

[autotune_tmc stepper_a]
motor: flsun-v400-42

@krzyzankowskig
Copy link
Author

So if you set 64 micro steps and add interpolate, will it now to interpolate it to 256? How it works is little unclear to me :)

@LabunskyA
Copy link

LabunskyA commented Jan 2, 2025

So if you set 64 micro steps and add interpolate, will it now to interpolate it to 256? How it works is little unclear to me :)

Basically, in the example above, Klipper calculates movement with assumed 64 microsteps of a driver motor. Then it sends calculated steps to the TMC2209 driver through the MCU. The driver accepts those steps, interpolates additional points between them, and sends 256 actual microsteps to the motor. That way the movement is more fluid and quieter

The drawback is the delay between accepting original steps and executing interpolated ones. It provides a small positional error and thus is not recommended by the official Klipper docs. But the error is proportional to the specified microsteps count. It may be somewhat significant if you're using interpolation with 16 microsteps (~0.006 mm) in some applications, but negligible with 64 (~0.0015 mm) on 99.9% of home-use printers

@andrewmcgr
Copy link
Owner

andrewmcgr commented Jan 2, 2025 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants