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

Expose slope_control field on TMC2240. #6771

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

liampwll
Copy link
Contributor

The chip has a default value of 0, corresponding to 100V/µs. The default is overridden with 2 here, corresponding to 400V/µs to approximately match the TMC2209. This should also solve some overheating issues as it lowers the power dissipation at a 50kHz chopper frequency by around 1W.

This is currently untested.

The chip has a default value of 0, corresponding to 100V/µs. The default
is overridden with 2 here, corresponding to 400V/µs to approximately
match the TMC2209. This should also solve some overheating issues as it
lowers the power dissipation at a 50kHz chopper frequency by around 1W.

Signed-off-by: Liam Powell <[email protected]>
@Sineos
Copy link
Collaborator

Sineos commented Dec 28, 2024

Would it make sense to expose DRV_CONF register bits 1..0 as well. This seems to be a nice way to tune the driver closer to the actual motor current (see data sheet, page 47).
I'm currently using 01 instead of the default 11 on my z-axis and at least have the feeling that it somewhat reduced z-banding (could be wishful thinking, but at least no negative effect observed).

@liampwll
Copy link
Contributor Author

It probably makes more sense for Klipper to do that internally based off the current specified by the user, but it wouldn't hurt to have an override that the user can specify.

@nefelim4ag
Copy link
Contributor

nefelim4ag commented Dec 29, 2024

Slope control defines how fast the MOSFETs gates will be charged/discharged.
*Didn't know that, so it is for someone who will also struggle with that.

For now, I can confirm the information about power dissipation:
image
The green line is fan PWM. 0->2 looks like a lot of difference (83C->69C).
*With fan forced to 100%, there will be 83C->62C

@nefelim4ag
Copy link
Contributor

Would it make sense to expose DRV_CONF register bits 1..0 as well. This seems to be a nice way to tune the driver closer to the actual motor current (see data sheet, page 47). I'm currently using 01 instead of the default 11 on my z-axis and at least have the feeling that it somewhat reduced z-banding (could be wishful thinking, but at least no negative effect observed).

image
2A. next one 1A
image

It is calculated and set automatically, based on your desired current.

@wight554
Copy link

wight554 commented Dec 30, 2024

Have to check regressions, but did speed and resonance tests so far on mellow drivers and results are amazing.
I've got temp drop from from 100-110C to 70-75C on 1.414A.
Was able to raise current to 2.5A motors RMS (~1.77A) with temp at 85-90C level vs overtemp error before the change.

Have to mention that I use LH Stinger Ebox with 2 8025 fans blowing on all electronics inside and TMC Autotune enabled (it has different change to drop temps on 2240, by dropping freqs iirc, so idk if these play well together)

@liampwll
Copy link
Contributor Author

liampwll commented Dec 30, 2024 via email

@KevinOConnor
Copy link
Collaborator

Thanks for working on this. We can certainly add a new driver_SLOPE_CONTROL config option.

However, I'd be leery about setting a default that differs from the Trinamic default, unless we can find some strongly worded statement from Trinamic that indicates the setting should be changed. That is, I'm unsure we'll be able to select a better default that Trinamic can.

If we can find a strong indication from Trinamic that the default should be different, then we'll need to document the change in docs/Config_Changes.md .

-Kevin

@liampwll
Copy link
Contributor Author

liampwll commented Dec 31, 2024

The only things that are impacted by this setting outside of the switching losses should be EMI and power supply ripple. As noted earlier, setting this to 400V/µs matches the typical value of the TMC2209 that is widely used on stepsticks on DIY boards (see attached image), so I doubt that will cause any issues for users of DIY boards. It might be an issue for any non-DIY vendors that have gone through proper EMI testing or are pushing what the caps on their boards can handle, but if they're just blindly applying updates then that's their own problem.

I think the fact that no one has made a PR to expose this setting before now makes a good case for making this the default as it shows that most users will not read the datasheet to investigate why their drivers are overheating and will instead reduce the current or reduce the chopper frequency, which can both decrease performance.

image

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

Successfully merging this pull request may close these issues.

5 participants