-
Notifications
You must be signed in to change notification settings - Fork 205
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
Add TMC2240 #270
base: master
Are you sure you want to change the base?
Add TMC2240 #270
Conversation
@teemuatlut |
There are TMC2240-related changes that I need to bring over from https://github.com/z1996xm/B1-SE-Plus-TMC2240/tree/main/B1-SE-Plus and I might have already started a Marlin branch with TMC2240 additions that's sitting in my work pile frmmthe day I made this PR. I can check on that and I'll push a PR with the necessary pieces to the Marlin project soon. In the meantime you should be able to build that B1-SE-Plus branch using the TMCStepper branch that forms the basis of this PR. |
First of all thank you for answering that quickly. 😊 👍🏻
That would be great!
I did eventually manage to compile, but I am not sure if all is setup correctly, since the repo provided by the seller is not 100% identical to the one you referenced. The version that was provided to me appears to be a tad newer, but I'm not sure if that's the case. Since I don't want to ruin my brand new Do I have to do any thing about the Here is the link to the provided repo: thanks in advance |
I went ahead and created the PR MarlinFirmware/Marlin#25974 to add support for this new stepper driver to Marlin. It looks like it has the same capabilities as the TMC2209 but we'll need to confirm that further. That PR may be updated temporarily to point to my working copy of TMCStepper which forms the basis of this PR so that it can try to run some CI tests, and then once this is merged –and before that PR is merged– it can be reverted to point to the regular TMCStepper. Hopefully I didn't make too many errors, and we'll get this all merged soon! |
Thank you very much! 😃👍This is definitely highly appreciated. once more: |
@teemuatlut — Apparently TMC2240 drivers can operate in SPI or UART mode, but BTT plans to ship their drivers with SPI as the default (with a solder-pad to switch to UART), so I will need to add SPI support to this. I will follow the existing drivers as the example, assuming there is nothing special about 2240 compared to other SPI-based drivers. Is it possible to have a driver support both SPI and UART in the same class, or must they use just one of these interfaces? If necessary, we can add one class for SPI and one for UART and then in Marlin add use driver type enums: |
9e8cec7
to
efdef25
Compare
I've incorporated changes from https://github.com/z1996xm/tmc2240_lib/tree/master here and will test a build with them over the next day or two. The way that @z1996xm implemented It looks like the 2240 may be more closely aligned with the 2130/5130/2160/5160 than the 2208/9 as it seems to use the |
I think the best way for me is to accept this as is when you say it's ready and rework the changes into v1.0 whenever I manage to get back into it again. |
@thinkyhead |
I've been on a mental vacation and lately catching up on other Marlin stuff. I will get back to this issue pretty soon. |
Greetings, |
@thinkyhead Are you still planning to implement this? 👉🏻👈🏻 |
It will definitely be completed and merged before the next (2.2.0) release. |
Hopefully in 2024 ;) |
Juggling a lot of tasks ahead of the next release, but this is near the top of the list. Things got changed over at the tmc2240 branch leading to the conundrum of whether to implement UART or SPI or both, and if both then finding a good example of that. Anyway, I'll aim for whatever BTT is favoring first and if it needs to be extended then it can get extended later. |
f002206
to
8176388
Compare
Thank you very much! 👍🏻I'm so excited to be finally able to implement the 2240 into my setup. 😀 |
Happy to help! I only wish I wasn't stuck on the fine details. I've reached out to BTT for some help with this, so maybe we'll finally get it done after all this time. |
From my experience I can say that they are very cooperative, even the sellers from Aliex... are very responsive, courteous & obliging. I have had to contact several of them and in most cases they have been able to help me, except for this particular issue. 😅 Hopefully they won't let us down in this case. |
8176388
to
8c092df
Compare
8c092df
to
fe7e42a
Compare
Hey @thinkyhead, we are currently trying to get some TMC2240's running for an additive manufacturing research project. While trying to setup your fork, we ran into the problem that the functions |
fe7e42a
to
8f76701
Compare
TMC2240 support was quietly added by @z1996xm for BTT over at https://github.com/z1996xm/TMC2240-Lib for the benefit of the BIQU B1-SE-Plus so here's a PR to get it into the upstream repo for all to enjoy!
It's not clear whether it was implemented 100% according to the standard, as it doesn't inherit from
TMCStepper
, but then again neither doesTMC2660Stepper
, so it's probably fine.Meanwhile, there is also a branch by @bigtreetech for TMC2240 put together by @alanma at https://github.com/bigtreetech/Marlin/tree/tmc2240 which (along with B1-SE-Plus-TMC2240) I'm cleaning up so TMC2240 can be added to upstream Marlin.
The
CHOPPER_TIMING
used in that branch is{ 3, -1, 6 }
(i.e.,chopconf.toff = 3; .hend = 2; .hstrt = 5;
)so maybe that deserves a new
CHOPPER_*
define intmc_util.h
depending on whether it's for some common stepper type. I'll need to examine the B1-SE-Plus-TMC2240 branch to see what it's all about.Thanks and have a great day!