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

Added driver_cs #570

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

Conversation

HonestBrothers
Copy link
Contributor

The driver_CS parameter has been added to tmc5160. The ideal driver_cs value may be found by setting the CS value on the tmc5160_calculations.xlsx spreadsheet, under the chopper tab, so that the Rsense value in the spreadsheet matches sense_resistor as defined in printer.cfg. While it's not necessary to change the CS value, it can be helpful to reach adequate hystersis values on high current drivers paired with low current motors. The default for this value is 31, meaning only globalscaler will be used to scale the current during normal operation. Errors will be invoked if the CS value is set too low, as the target current will not be able to be reached.

Update tmc5160.py

Checklist

  • pr title makes sense
  • squashed to 1 commit
  • added a test case if possible
  • if new feature, added to the readme
  • ci is happy and green

The `driver_CS` parameter has been added to tmc5160. The
ideal driver_cs value may be found by setting the CS value on the
tmc5160_calculations.xlsx spreadsheet, under the chopper tab, so that
the Rsense value in the spreadsheet matches `sense_resistor` as defined
in printer.cfg. While it's not necessary to change the CS value, it can
be helpful to reach adequate hystersis values on high current drivers paired
with low current motors. The default for this value is 31, meaning only
globalscaler will be used to scale the current during normal operation.
Errors will be invoked if the CS value is set too low, as the target
current will not be able to be reached.

Update tmc5160.py
@HonestBrothers HonestBrothers requested a review from a team as a code owner February 3, 2025 23:41
klippy/extras/tmc5160.py Outdated Show resolved Hide resolved
klippy/extras/tmc5160.py Outdated Show resolved Hide resolved
klippy/extras/tmc5160.py Outdated Show resolved Hide resolved
"GLOBALSCALER(%d) calculation out of bounds.\n"
"The target current can't be achieved with the given "
"CS(%d) value. Please adjust your configuration.\n"
"You most likely need to increase your driver_cs value in this case.\n"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Roger asked to remove this line ("you most likely need to increase your driver_CS value in this case")
I am also not sure whether the "reasonable starting point is good
@rogerlz can you chime in?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd be okay removing the reasonable starting point. I'll let @rogerlz make that call.

klippy/extras/tmc5160.py Outdated Show resolved Hide resolved
klippy/extras/tmc5160.py Outdated Show resolved Hide resolved
klippy/extras/tmc5160.py Outdated Show resolved Hide resolved
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.

2 participants