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

Stepstick Lookup Table and Config Options #340

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

Conversation

lraithel15133
Copy link
Contributor

@lraithel15133 lraithel15133 commented Jul 18, 2024

see: #325

This PR adds a lookup table for known stepsticks (more will be added as time goes on), some logic for a new config option called 'stepstick_type', and documentation on the logic.

Heres the rundown:

If sense_resistor is defined: use it with full priority, no exceptions

else if stepstick_type is defined: use its lookup table value for sense_resistor

else use tmc default and warn user

if stepstick_type is defined: use its max_current value

else use tmc default

Screenshot 2024-07-18 114600

While I agree we should not have defaults set for configuration options like this, I also am not a fan of breaking everyones configs at this state in the project.

@lraithel15133 lraithel15133 requested a review from a team as a code owner July 18, 2024 16:40
bwnance
bwnance previously approved these changes Jul 18, 2024
klippy/extras/stepstick_defs.py Outdated Show resolved Hide resolved
klippy/extras/stepstick_defs.py Show resolved Hide resolved
klippy/extras/tmc.py Outdated Show resolved Hide resolved
@lraithel15133
Copy link
Contributor Author

Current state of this:
Everything seems to be working, except I broke set_tmc_current with the interface rework.

docs/Stepstick_Types.md Outdated Show resolved Hide resolved
docs/Stepstick_Types.md Outdated Show resolved Hide resolved
docs/Stepstick_Types.md Outdated Show resolved Hide resolved
docs/Stepstick_Types.md Outdated Show resolved Hide resolved
@lraithel15133
Copy link
Contributor Author

I think this is good, just need someone else to test

| Stepstick Type | Config Name | Sense Resistor | Max Current |
|-----------------------------------------|-------------------------|----------------|-------------|
| BTT Kraken S1-4 | KRAKEN_2160_8A | 0.022 | 8 |
| BTT Kraken S5-8 | KRAKEN_2160_3A | 0.022 | 3 |
Copy link
Contributor

@miklschmidt miklschmidt Oct 29, 2024

Choose a reason for hiding this comment

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

These (5-8) use the default 0.075 ohm sense resistor.

"REFERENCE_2209": (0.11, 2),
"REFERENCE_5160": (0.075, 3),
"KRAKEN_2160_8A": (0.022, 8),
"KRAKEN_2160_3A": (0.022, 3),
Copy link
Contributor

Choose a reason for hiding this comment

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

should be 0.075

"config",
f"""Neither 'stepper_driver_type' or 'sense_resistor' is defined for [{self.name}].
Using default value of {self.sense_resistor} ohm sense resistor.
If this is incorrect, your drivers or board may be damaged.""",
Copy link
Contributor

Choose a reason for hiding this comment

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

drivers, steppers or board.

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

Successfully merging this pull request may close these issues.

6 participants