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

[FR] Support for Trinamic TMC2660 #8138

Closed
alexxy opened this issue Oct 28, 2017 · 192 comments
Closed

[FR] Support for Trinamic TMC2660 #8138

alexxy opened this issue Oct 28, 2017 · 192 comments
Labels
T: Feature Request Features requested by users.

Comments

@alexxy
Copy link
Contributor

alexxy commented Oct 28, 2017

Hi all!

I have a Azteeg X5 GT board with TMC2660 (Bigfoot BSD2660), and seems like Marlin has support for some types of TMC drivers. How to enable TMC2660?

@Spawn32
Copy link
Contributor

Spawn32 commented Oct 29, 2017

Did you get the TMC2660's working ?
I am designing a new controller board that uses them, so would be nice to know :)

@alexxy
Copy link
Contributor Author

alexxy commented Oct 29, 2017

Currently no. Seems like we need new lib to get them working =)

@Spawn32
Copy link
Contributor

Spawn32 commented Oct 29, 2017

To bad, have a look at the bottom of #8063 (comment) to see what i am working on :)

@teemuatlut
Copy link
Member

Yea the drivers need a new library for Marlin to be able to communicate with them. I could expand my TMC2130 or TMC2208 libraries to support them but I don't have the drivers to test. Nor really a board that would support the layout.

@alexxy
Copy link
Contributor Author

alexxy commented Oct 29, 2017

@teemuatlut if you extend you're lib i'd be glad to test =) Currently i have working Marlin on Azteeg X5 GT (standart drivers work, but i have 2660 ones) #8139

@Spawn32
Copy link
Contributor

Spawn32 commented Oct 29, 2017

And i can test when i get my board ready, probably be about 2 weeks...
Have a bootloader sorted, but will need a HAL and TMC2660 drivers :/

@alexxy
Copy link
Contributor Author

alexxy commented Oct 29, 2017

@Spawn32 stm32 based board? I actualy have an idea to create stm32 board with 6-8 steppers =)

@Spawn32
Copy link
Contributor

Spawn32 commented Oct 29, 2017

STM32F7 and 6x TMC2660 :)

@alexxy
Copy link
Contributor Author

alexxy commented Oct 29, 2017

Its a monster that can even run linux

@teemuatlut
Copy link
Member

I'm not too keen on developing for something I don't actually have. While it may take me from a couple of days to a week to get the library running, it'll be months or years of supporting it. Old and new features that need testing, bug fixes, interacting with users and helping them solve problems. I don't really want to put myself in a position where my best is only a guess.
I'll try contacting Panucatt and see if they'd be interested in providing samples so that I may bring Marlin/Arduino support for their drivers.

@alexxy
Copy link
Contributor Author

alexxy commented Oct 29, 2017

Actualy seems like duet3d board uses same drivers and very similar setup

@Spawn32
Copy link
Contributor

Spawn32 commented Oct 29, 2017

Yes, the Duet3d uses the TMC2660's...
DuetWifi_Schematic_v1.02.pdf

@Roxy-3D
Copy link
Member

Roxy-3D commented Oct 29, 2017

I'll try contacting Panucatt and see if they'd be interested in providing samples so that I may bring Marlin/Arduino support for their drivers.

@teemuatlut Roy has been very helpful trying to get an official 32-bit branch of Marlin going. When we were discussing how to seed the Marlin developers with 32-bit boards, it kind of felt like his preference was to use the Azteeg X5 GT 32bit Motion Controller as the reference platform. (It may be I'm just imagining that. But that is what I think.)

With the Azteeg X5 GT 32bit Motion Controller you can plug in the Bigfoot BSD2660 sub modules.

It says they are "Based on TMC2660. SPI setup and configuration including current limit and microstepping. 3A 30V. For 3D printing and CNC applications. Super quiet and smooth. 1/256 microstepping. "

Part of the reason I was pushing for the Re-ARM as the reference platform is because it would keep costs down. But we are now at the point where just one developer having an Azteeg X5 GT can make good progress. If you contact Roy, please include a link to this post so he knows I'm supportive. I should get around to sending him an updated status report also.

@alexxy
Copy link
Contributor Author

alexxy commented Oct 29, 2017

Yeah, Azteeg X5 GT is interesting board. I already done pinout for marlin #8139 . Only thing missing is 2660 steppers.

@teemuatlut
Copy link
Member

Quick update. I got a response from Roy at Panucatt and he was happy to provide me with the drivers, so now I'll need to create a new driver library to support the TMC2660. It'll likely be ready (as can be) before my drivers get here but you can test them before I can.

@Roxy-3D Roy asked me about the progress with LPC HAL and I gave him a brief summary but also said that you'd be contacting soon with a more in depth update about it. Hope you don't mind =)

@Roxy-3D
Copy link
Member

Roxy-3D commented Oct 30, 2017

I gave him a brief summary but also said that you'd be contacting soon with a more in depth update about it. Hope you don't mind =)

Not a problem! I'll try to do that in the next day or two...

@Spawn32
Copy link
Contributor

Spawn32 commented Oct 30, 2017

@Roxy-3D @teemuatlut and the rest of you:

Nice, is just a incredible job you guy's do here. thank you :)

@Spawn32
Copy link
Contributor

Spawn32 commented Nov 14, 2017

@teemuatlut
Any news on TMC2660 ? 😃

@teemuatlut
Copy link
Member

I think the hardware is on its' way so I could theoretically start with the library. I just have a bunch of other stuff too that I should be doing.

@alexxy
Copy link
Contributor Author

alexxy commented Dec 5, 2017

Hi!
Any news about this drivers?

@alexborro
Copy link
Contributor

alexborro commented Dec 5, 2017 via email

@teemuatlut
Copy link
Member

teemuatlut commented Dec 5, 2017

@alexxy I've started working on a universal TMC driver library that would support 5 driver models. This is quite a big task and requires a completely new architecture inside the library to do it in a way that makes sense. That said, I did take a look at the TMC2660 communication information and it seems to differ a bit from the other drivers. Makes me think that they're a slightly older driver design.

Edit: Steppers are turning now so I've established basic communications.

@alexxy
Copy link
Contributor Author

alexxy commented Dec 6, 2017

@cool are there some branch to test?

@Spawn32
Copy link
Contributor

Spawn32 commented Dec 6, 2017

Good work @teemuatlut looking forward to testing it :)

@teemuatlut
Copy link
Member

@alexxy No not yet. I'll first try to get the library examples to work on TMC2660 as well as 2130, 2208, 2224 and 5130.
The final Marlin integration on a basic level is actually quite simple and shouldn't take much time.

@alexxy
Copy link
Contributor Author

alexxy commented Dec 19, 2017

@teemuatlut hows youre universal tmc lib going?

@teemuatlut
Copy link
Member

TMC5130 and TMC2130 compile the Simple example. I've been busy with other tasks for a while now but the new library is on the agenda over the christmas holidays because I can't do much CAD work on the laptop.
I've pretty much decided that TMC2660 has to be an entity on its' own because of a drastically different register structure. TMC2208 needs some fundamental changes to work properly.

@alfredanil
Copy link

@teemuatlut TMC 5130 has an integrated velocity ramp generator, do you plan to implement the ramp generator function as well? apart from standard trapezoidal ramp it also has a six point ramp function, which seems pretty cool. To test TMC2660 there is a readily available shield for Uno called TOS100 for Arduino and it can be purchased from Watterott Electronic for about 25 Euro. TMC2660 was also used in T-Bone cape for beagle bone (project available on GitHub) tried and tested lib available for all functions.

@teemuatlut
Copy link
Member

I do have full support for Trinamic's TRAMS board in the works but it's been pushed back ever since the summer. But IIRC it did do movements and homing and other basic functions.
Regarding the TMC2660, I have the bigfoot drivers from Panucatt and I've also got an Azteeg X5 GT to go along with them so testing is not a problem. I've already been able to communicate them and set the TOFF to have some movement. Mostly it's a matter of writing the methods in a more user friendly way.

@teemuatlut
Copy link
Member

teemuatlut commented Dec 23, 2017

Some progress.
Obviously not finished but you should be able to get the driver moving with toff(4); cs(10);.

Also see the Simple.ino example that's currently configured for TMC2660.

@alexxy
Copy link
Contributor Author

alexxy commented Aug 27, 2018

@teemuatlut I used your master branch and updated library. Configs attached
configs.zip

@alexxy
Copy link
Contributor Author

alexxy commented Sep 6, 2018

@teemuatlut seems issue comes from this commit 94735bdc5fe7833840a7dc2c21925742db8e2827

commit 94735bdc5fe7833840a7dc2c21925742db8e2827
Author: teemuatlut teemu.mantykallio@live.fi
Date: Wed Apr 11 17:53:23 2018 +0300

Add TMC LCD section

@teemuatlut
Copy link
Member

I've been working on the branch again and I did confirm your issue. That was an easy fix but lead to another issue. Will hopefully fix it this weekend and get the whole thing compiling nicely again.

@alexxy
Copy link
Contributor Author

alexxy commented Sep 8, 2018

@teemuatlut thank you =D

@teemuatlut
Copy link
Member

Pushed the new code and tested with your config files. No promises on it actually working though. Let me know what happens.

@alexxy
Copy link
Contributor Author

alexxy commented Sep 13, 2018

@teemuatlut I tested youre branch. It works without problems for me.

@alexxy
Copy link
Contributor Author

alexxy commented Sep 19, 2018

@teemuatlut

is it normal?

Recv: Driver registers:
Recv: X = 0x00000:00:00 Bad response!
Recv: Y = 0x00:00:00:00 Bad response!
Recv: Z = 0x00:00:00:00 Bad response!
Recv: E = 0x00:00:00:00 Bad response!
Recv: E1 = 0x00:00:00:00 Bad response!

@teemuatlut
Copy link
Member

teemuatlut commented Sep 19, 2018

No. When did that start happening?

EDIT: I used your latest config files to upload to an Azteeg board and got

Driver registers:
		X = 0x00:04:4C:00
		Y = 0x00:04:4C:00
		Z = 0x00:04:4C:00
		E = 0x00:0C:4C:00
		E1 = 0x00:0F:FC:FF

This is with my latest master branch and not all commits are online just yet. I still need to fix some compile issues before pushing.

@alexxy
Copy link
Contributor Author

alexxy commented Sep 19, 2018

Build of your master branch, drivers work =) i can print
But i need to set current again and seems like m122 dont work

@thinkyhead
Copy link
Member

M122 requires TMC_DEBUG so double-check that it’s enabled.

@teemuatlut
Copy link
Member

If it would be disabled, there would be no output at all.
This is a case where the SPI communication failed for some reason during a call to the driver and the response was an all low level signal.
Which is curious because if the communication channel would be completely broken, I don't think the drivers would work at all. Nor do I think it's a case of initializing order either.
I don't think I've done anything that should break things in the past week or two...

@thinkyhead
Copy link
Member

Probably a hardware issue, then.

@alexxy
Copy link
Contributor Author

alexxy commented Sep 19, 2018

Drivers work, I can change current. m122 dont. So i'm curiose what's the problem
I didnt change anything hw related...

@AnHardt
Copy link
Member

AnHardt commented Sep 19, 2018

If you can set a value at the TMC, for SPI that means MOSI, CS and CLK do work. If you can't read MISO is broken.
Or on an asynchronous serial TX works but not RX.
Bad contact? Correctly wired? To much load? Pull-up/down required? Bad GND level? Rx shorted to Vcc or GND? Correct Vcc? Noise? Motor power for the TMCs on before config? Right pin? Pin capable for the use? Other parts of Marlin use the pin? ...

@monterman
Copy link

HI could you please help me, I can't compile after adding my settings...

I used Teemuatlut's master build.

thanks!

`SYSTEM: LPC1768 100MHz 32KB RAM (512KB Flash)
DEBUG: CURRENT(custom) ON-BOARD(cmsis-dap) EXTERNAL(blackmagic, jlink)
Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF MODES: FINDER(off) COMPATIBILITY(soft)
Collected 3 compatible libraries
Scanning dependencies...
Dependency Graph

|-- 0.0.0
|-- 0.4
|-- 0.2.0

Unable to find destination disk. File must be copied manually.

Compiling .pioenvs\LPC1768\src\src\feature\pause.o
Compiling .pioenvs\LPC1768\src\src\feature\solenoid.o
Compiling .pioenvs\LPC1768\src\src\feature\tmc_util.o
Compiling .pioenvs\LPC1768\src\src\feature\twibus.o
Marlin\src\feature\pause.cpp:306:84: error: missing binary operator before token "("
#if (E0_ENABLE_PIN != X_ENABLE_PIN && E1_ENABLE_PIN != Y_ENABLE_PIN) || E0_IS_TMC(2660) || E1_IS_TMC(2660)
^
*** [.pioenvs\LPC1768\src\src\feature\pause.o] Error 1
[ERROR] Took 17.48 seconds
Environment LPC1768 [ERROR]`

@teemuatlut
Copy link
Member

teemuatlut commented Sep 19, 2018

Working on that one right now. Trying to get the Travis builds to finish.
Perhaps within the hour or tomorrow as it's getting late here.

EDIT: Travis builds now.

@monterman
Copy link

awesome thanks!

my build is using dual extruders with one X motor and parking and electromagnet.

@alexxy
Copy link
Contributor Author

alexxy commented Oct 3, 2018

Hi!

I tested your fresh master branch:
Problems if enabled DRIVERS_SOFTWARE_ENABLE (like Azteeg X5 + 2660) branch cannot build

Compiling .pioenvs/LPC1768/src/src/feature/Max7219_Debug_LEDs.o
In file included from Marlin/src/module/stepper.h:224:0,
from Marlin/src/Marlin.cpp:36:
Marlin/src/Marlin.cpp: In function 'void enable_all_steppers()':
Marlin/src/module/stepper_indirection.h:387:62: error: 'E0_ENABLE_ON' was not declared in this scope
#define E0_ENABLE_WRITE(STATE) stepperE0.toff((STATE)==E0_ENABLE_ON ? stepperE0.savedToff() : 0)
^
Marlin/src/Marlin.h:116:26: note: in expansion of macro 'E0_ENABLE_WRITE'
#define  enable_E0() E0_ENABLE_WRITE( E_ENABLE_ON)
^~~~~~~~~~~~~~~
Marlin/src/Marlin.cpp:288:3: note: in expansion of macro 'enable_E0'
enable_E0();
^~~~~~~~~
Marlin/src/module/stepper_indirection.h:387:62: note: suggested alternative: 'E_ENABLE_ON'
#define E0_ENABLE_WRITE(STATE) stepperE0.toff((STATE)==E0_ENABLE_ON ? stepperE0.savedToff() : 0)
^
Marlin/src/Marlin.h:116:26: note: in expansion of macro 'E0_ENABLE_WRITE'
#define  enable_E0() E0_ENABLE_WRITE( E_ENABLE_ON)
^~~~~~~~~~~~~~~
Marlin/src/Marlin.cpp:288:3: note: in expansion of macro 'enable_E0'
enable_E0();
^~~~~~~~~
Marlin/src/Marlin.cpp: In function 'void disable_e_steppers()':
Marlin/src/module/stepper_indirection.h:387:62: error: 'E0_ENABLE_ON' was not declared in this scope
#define E0_ENABLE_WRITE(STATE) stepperE0.toff((STATE)==E0_ENABLE_ON ? stepperE0.savedToff() : 0)
^
Marlin/src/Marlin.h:117:26: note: in expansion of macro 'E0_ENABLE_WRITE'
#define disable_E0() E0_ENABLE_WRITE(!E_ENABLE_ON)
^~~~~~~~~~~~~~~
Marlin/src/Marlin.cpp:297:3: note: in expansion of macro 'disable_E0'
disable_E0();
^~~~~~~~~~
Marlin/src/module/stepper_indirection.h:387:62: note: suggested alternative: 'E_ENABLE_ON'
#define E0_ENABLE_WRITE(STATE) stepperE0.toff((STATE)==E0_ENABLE_ON ? stepperE0.savedToff() : 0)
^
Marlin/src/Marlin.h:117:26: note: in expansion of macro 'E0_ENABLE_WRITE'
#define disable_E0() E0_ENABLE_WRITE(!E_ENABLE_ON)
^~~~~~~~~~~~~~~
Marlin/src/Marlin.cpp:297:3: note: in expansion of macro 'disable_E0'
disable_E0();
^~~~~~~~~~
Marlin/src/Marlin.cpp: In function 'void disable_e_stepper(uint8_t)':
Marlin/src/module/stepper_indirection.h:387:62: error: 'E0_ENABLE_ON' was not declared in this scope
#define E0_ENABLE_WRITE(STATE) stepperE0.toff((STATE)==E0_ENABLE_ON ? stepperE0.savedToff() : 0)
^
Marlin/src/Marlin.h:117:26: note: in expansion of macro 'E0_ENABLE_WRITE'
#define disable_E0() E0_ENABLE_WRITE(!E_ENABLE_ON)
^~~~~~~~~~~~~~~
Marlin/src/Marlin.cpp:307:13: note: in expansion of macro 'disable_E0'
case 0: disable_E0(); break;
^~~~~~~~~~
Marlin/src/module/stepper_indirection.h:387:62: note: suggested alternative: 'E_ENABLE_ON'
#define E0_ENABLE_WRITE(STATE) stepperE0.toff((STATE)==E0_ENABLE_ON ? stepperE0.savedToff() : 0)
^
Marlin/src/Marlin.h:117:26: note: in expansion of macro 'E0_ENABLE_WRITE'
#define disable_E0() E0_ENABLE_WRITE(!E_ENABLE_ON)
^~~~~~~~~~~~~~~
Marlin/src/Marlin.cpp:307:13: note: in expansion of macro 'disable_E0'
case 0: disable_E0(); break;
^~~~~~~~~~
*** [.pioenvs/LPC1768/src/src/Marlin.o] Error 1

if i disabled it i get another error

Compiling .pioenvs/LPC1768/src/src/gcode/bedlevel/G42.o
Marlin/src/feature/tmc_util.cpp: In function 'uint8_t get_status_response(TMC2130Stepper&, uint32_t)':
Marlin/src/feature/tmc_util.cpp:60:82: error: 'uint8_t TMC2130Stepper::status_response' is protected within this context
static uint8_t get_status_response(TMC2130Stepper &st, uint32_t) { return st.status_response & 0xF; }
^~~~~~~~~~~~~~~
In file included from Marlin/src/feature/tmc_util.h:28:0,
from Marlin/src/feature/tmc_util.cpp:27:
.piolibdeps/TMCStepper_ID5513/src/TMCStepper.h:334:11: note: declared protected here
uint8_t status_response;
^~~~~~~~~~~~~~~
*** [.pioenvs/LPC1768/src/src/feature/tmc_util.o] Error 1

@ghent360
Copy link
Contributor

ghent360 commented Oct 4, 2018

I also get 'uint8_t TMC2130Stepper::status_response' is protected within this context
Looking at TMCStepper.h from the new TMCStepper library the field is indeed protected, making it public fixes the compile issue.

@teemuatlut
Copy link
Member

@ghent360 Use the latest commit from github.

@alexxy I've fixed the issues and I'll be pushing the changes today. There's also a new PR that brings upstream support for TMC2660 so you don't have to keep using a forked development branch.

@alexxy
Copy link
Contributor Author

alexxy commented Oct 4, 2018

@teemuatlut Ok. I'll test PR and youre branch

@boelle
Copy link
Contributor

boelle commented Feb 19, 2019

was TMC2660 not added recently? i remember to see it mentioned in the config's

@snmcma
Copy link

snmcma commented Jul 28, 2019

Guys, tell me how to run this driver. I assembled it on the standard scheme (https://www.trinamic.com/support/eval-kits/details/tmc2660-bob/) is the power supply of the circuit, the power to the motor, the signal -dir -step too. the motor is not spinning
Do you need to use the other pins? pin en need to connect to the ground?

@l29ah
Copy link

l29ah commented Feb 3, 2020

You need to configure it after powering it up before it can drive anything.

@sjasonsmith
Copy link
Contributor

TMC2660 is an available option in our configurations. I'm assuming was added sometime in the 3 years since this was opened.
Closing this as presumed complete.

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked and limited conversation to collaborators Nov 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
T: Feature Request Features requested by users.
Projects
None yet
Development

No branches or pull requests