[1.1.x] More complete Trinamic driver options#10101
[1.1.x] More complete Trinamic driver options#10101thinkyhead merged 4 commits intoMarlinFirmware:bugfix-1.1.xfrom
Conversation
9d70074 to
7c3c8b7
Compare
Marlin/configuration_store.cpp
Outdated
There was a problem hiding this comment.
No N argument needed?
tmc_hybrid_threshold array should be indexed according to the N argument and not P_AXIS.
Each driver can have their unique threshold.
There was a problem hiding this comment.
Already patched. It is needed as an index for the array.
61d6b30 to
7d68ff2
Compare
|
Currently the |
ca55aac to
4d9e8ba
Compare
|
@teemuatlut Submitted for your approval…. |
teemuatlut
left a comment
There was a problem hiding this comment.
I don't see anything obvious why something wouldn't work. The most noteworthy is if the if conditions work as expected.
Marlin/Marlin_main.cpp
Outdated
There was a problem hiding this comment.
Will this work alright? What's the boolean result of assigning a value to a variable as it is not a comparison in itself?
There was a problem hiding this comment.
Non-zero evaluates as true in all C-like languages.
Marlin/Marlin_main.cpp
Outdated
There was a problem hiding this comment.
I believe this will change the behavior of M906 so that the values are no longer reported when setting a new value.
This also applies to the following TMC gcodes.
There was a problem hiding this comment.
Correct. That is the intent. We don't want the EEPROM loading to spew more information than the M503 report already produces. So the tmc setters no longer repeat the set value. It's also a standard of Marlin to stay quiet when setting values, but to report values when a command is given without arguments.
Marlin/configuration_store.cpp
Outdated
There was a problem hiding this comment.
Something like TMC_COUNT would probably be a bit closer but doesn't really matter.
There was a problem hiding this comment.
The EEPROM needs to save placeholders for all potential axes. It shouldn't resize based on flexible options. MAX_EXTRUDERS will only change when Marlin gains support for more extruders.
Marlin/configuration_store.cpp
Outdated
There was a problem hiding this comment.
Reminds me that we could remove setCurrent from tmc_init functions in stepper_indirection.cpp as we already set current (and some other parameters) here already. The newer versions of the libraries support a push method that re-sends all the shadow registers to the driver in case the driver was not powered by 12V when initially booting the machine, like when PS_DEFAULT_OFF is enabled. But let's not do that yet as it will require testing.
There was a problem hiding this comment.
As another standard behavior, Marlin initialized all settings-based values in the EEPROM load and reset code, so yes, if they are also being initialized in stepper_indirection then we can eliminate the redundancy.
There was a problem hiding this comment.
Reminds me that we could remove setCurrent from tmc_init functions
It looks like tmc2130_init call would still be needed in response to the M80 command powering the board, unless we can enable those shadow registers.
There was a problem hiding this comment.
Yes, but the push command isn't yet even copied into the TMC2208Stepper library.
There was a problem hiding this comment.
Looks like we will need to add our own "shadow registers" because if you power down with M81 and then re-power with M80 the settings will revert to those in the configuration, and won't use the ones saved in the EEPROM.
There was a problem hiding this comment.
The word hysterisis should be hysteresis.
I'll fix that but it'll break Marlin for a bit. See stepper_indirection.cpp.
settings.reset or settings.load don't handle all the configuration parameters so we still need to call init. Although there may very well still be some that are duplicates.
M80 can call st.push() to sync to the drivers anything that was attempted while there was no 12V power. I'll add this to TMC2208Stepper v0.0.4 as well.
There was a problem hiding this comment.
I'll add this to TMC2208Stepper v0.0.4 as well.
Sounds good. I hope we can get that before the 1.1.9 release. In the meantime for this PR I need to come up with some kind of alternative solution.
Note that the settings.load/settings.reset method is called before the stepper.init function. It looks like we'll need to call stepper.init first. But I hope there's not some "Catch-22" here, where we can't call stepper.init before or during EEPROM loading because it depends on having values already loaded from EEPROM.
There was a problem hiding this comment.
If stepper.init is called before settings.load then we no longer have to call tmc_init_cs_pins in setup.
There was a problem hiding this comment.
TMC2208Stepper v0.0.4 released.
Adds the push method and fixes the same typo that was in TMC2130Stepper.
There was a problem hiding this comment.
I've updated Marlin to use the latest libraries. I hoped to check the version number in the SanityCheck.h but it's not visible to the preprocessor. For the next version that would be a useful addition.
Marlin/configuration_store.cpp
Outdated
There was a problem hiding this comment.
Same thing here as I said with the v2.0.0 PR. Need to account for dual steppers and possibility for a better output format.
1e265a4 to
ff8841e
Compare
bd31a3f to
67c8ef4
Compare
67c8ef4 to
312bebf
Compare
Addressing #10087
M913Hybrid Threshold.TMC_AxisEnumto match EEPROM storage.Tparameter toM906/M913to specific which extruder.I(index) parameter toM906/M913/M914to specify which dual axis stepper.Concise Diff
Counterpart to #10102