-
Notifications
You must be signed in to change notification settings - Fork 22
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
LPC176x Build Fails with TMC2130's (listed as experimental) #5
Comments
Yes, I'd love to help- have the time and hardware. FWIW- it's a custom built foam cutter (using standard ball screws) with end stops for the minimums connected to a BTT SKR 1.4 Turbo with four TMC2130's. Also- the library change above worked great. I was able to build using the BL_0x4000 and my board accepted the files enough for Grbl HotWire Mega 5X (v5.02) to 'see' it, but I could not get it to move. More info than you asked, but wanted to give you an idea of my setup. |
Try
Great, I will switch over to a SKR 1.4 board during the weekend (with TMC5160 drivers) and check the basic stuff. When that is done I will upload the complete project and come back with a link for download. |
Do you kow if the source available on github for this sender? Since it is based on Grbl Panel I believe I am able to patch it (I have patched Grbl Panel - but since it is archived I cannot create a PR). grblHAL defaults to normally closed switches for safety reasons, try with ioSender can be used to configure the controller, its Settings: Grbl tab is easy to use and has support for all the new settings in grblHAL. |
Updated LPC176x project and ioSender are now available for download here. LPC176x project tested with TMC2130 and TMC5160 drivers, the basic stuff works. Trinamic driver related settings and M-codes documented here. FYI ioSender has a Trinamic tuner tab that can be used to plot live Stallguard result (load) and query driver status (M122), this is work in progress... |
Cool- I pulled your files, created a new project in MCUXpresso, and only updated the number of axis in config.h, and then change to my SKR 1.4 and 2130's in my_machine.h and everything built great. Starting with compatability_level 0 in config.h and it (effectively) works out of the box with ioSender! (sweet program btw!) I have something not quite right as 1) A/E0 doesn't spin (although it sounds like one of the motors is trying- I think maybe Z, but need to try again later today) and 2) my steps/mm aren't right as they done spin as far as they should (calibration issue I haven't looked at). Right now, I have a 2130 populating X, Y, Z, and E0 (and motors are connected to the same). All are decoupled to individual Nema 17's. I run 24v power to the SKR and power the motors directly from the board- really just FYI as I'm not trying some very custom setup. So far- this is awesome! Edit- didn't answer your other question. The Grbl Hotwire is from here: https://rckeith.co.uk/file-downloads/ and the CNCJS is I think just an apt install from a Debian 10 (buster) terminal. Edit 2: Played with it a little more and I see that nuts_bolts.h defines axis (such as the A_AXIS) as soon as N_AXIS > 3. This A axis is the only one that doesn't work and I've confirmed the points match what's in btt_skr_1.4.turbo_map.h to here: (https://github.com/bigtreetech/BIGTREETECH-SKR-V1.3/blob/master/BTT%20SKR%20V1.4/Hardware/SKR-V1.4-Turbo-pinout.jpg)
What am I missing? |
Have you set
Well, then I guess the source code is not available and I cannot make a PR. |
When I try to move A, the X motor physically feels and sounds like it's energizing. Note, I currently have my min limit switch reversed from the others so I will see the board is communicating with it. I forget if it's NC or NO, but the red square should go out when it is seen (I'm basing this on the operation of the others). Here's my settings.txt from ioSender:
|
It looks like enabling the A-axis driver fails... Are all motors listed when you press "Get status, all drivers" in the Trinamic tab? And has the status register content for the A motor at the bottom of the list a sensible value if so? Set I have checked the STEP, DIR and EN signals with a scope on the SKR 1.3 I have and they look ok, I will check with a fourth driver and a motor (if I can find one) later. |
Ok, then UART communication fails for the A-motor. If communication fails for one none are enabled. I'll look into this later - I have some outside work to take care of. |
Thank you! I'll experiment moving the 2130's and motor connections around to make sure there isn't something mechanically/electrically wrong.... trying to eliminate variables. |
There is a typo here: Line 166 in d60e133
should be: Same in line 172. Perhaps fixing this will solve it... I am busy for a while more - perhaps you can check before I get to do it? |
All steppers now report, but when trying to move A, X still tries to move and the limit switch (for A) isn't reporting correctly. My Z and A are setup identical (same 2130's and same steppers), so I swapped them to make sure it wasn't the hardware and same result. FWIW I still get an "out of range" error with $7=15, but $338=15, and $37=15 work. $37=15 gives an audible motor-holding noise on just my Z axis. Edit- held the wife & kids up from photos to test this- so I'll play with it some more tonight when we get back. |
I still get an "out of range" error with $7=15 My bad, should be A (and B) limit inputs are not read as it should here: Lines 559 to 563 in d60e133
Add after line 562:
I have now tested with a SKR v1.3 board and all axes are working, why not for the v1.4 board I do not know as the pin mappings are according to the schematic. Could be due to $4 not set to 15? Edit: FYI the low level comms code for the drivers do not support ganged axes - I'll fix that tomorrow. |
That is the correct port. Voltage on the EN pin should be checked. Is it 0V during motion? |
Confirmed at ~0VDC on E0's EN-GND (matches that on Z's similar pins). By comparison, my E1's EN-GND is just shy of 4VDC. Edit- some additional info. While the heat sinks on X, Y, & Z drivers are warm (I'd guess 50-60C, but will find my IR temp probe), the A driver is cold. Also, I have three TMC5161's around here that could be used if you think diagnosing with an additional driver would help. Unfortunately, I don't have access to another 2130 for a month or so. |
Good.
It is left floating so I guess that is ok.
That is odd, the EN pin is always 0V and it still does not get warm? This indicates the motor coils are not energized for some reason. The A driver does not get initialized correctly? I see that your Stallguard settings (
IIRC they the same as 5160, just with lower RDSon MOSFETs? Meaning that the 5160 code can be used? |
I've done a bit more refactoring of the driver and fixed a bug in ioSender (Get status for A-axis did not work) and uploaded the changes. |
It is the status register value, not a MAC address... The least significant 10 bits are the Stallguard sg_result. Can you turn the A motor easily when EN is 0V? If you can then the motor is not energized as it should. Is VM (motor voltage) ok? (I guess it is since the A status register is non-zero). Try inverting the A step output with |
Measuring STP -> Gnd, I get the ~3V for the Z axis when I invert the set pulse, but ~0VDC on A with either it inverted or noninverted. And yes, dead stick on A- no resistance. |
Hmm, an error in the schematic? But it does not explain why the motor is not energized. Bad TMC2130? But it is working with Marlin? |
Haha- I just swapped only the TMC2130's on Z and A and nothing was moving... forgot I had $338=8. Putting $338=15, I have the same issue, Z moves (with the 2130 I just pulled from A). I'll flip back to the Marlin code before. I think I only was getting 3 axis to work, but attributed that to software that wasn't designed to do, so I started looked at grbl. Let me circle back to it and make sure I can get all four to move with Marlin. Edit- Just confirmed, I have all four axis working with Marlin (X, Y, Z, and E0)- based on this code: Here are the files I changed: |
How can I add the 2209, the only options are 2130 and 5120 I swapped 2130 for 2209 as i see the 2209 hal is there but got a bunch of errors when it compiled .. thank you |
You have to add UART low-level driver code required. But does the board support UART mode Trinamic drivers? And if so is the UART pins connected to hardware UART capable MCU pins or must software UART code be implemented? |
Hello, i have BTT SKR 1.4T with BTT TMC 2209. And cant get it working. The jumper setting is different from SPI mode: https://github.com/bigtreetech/BIGTREETECH-SKR-V1.3/blob/master/BTT%20SKR%20V1.4/BTT%20SKR%20V1.4%20Instruction%20Manual.pdf BTW how do i add UART low-level driver code ? |
It is both, IMO bad design choice by BTT that requires software UART code to be added.
One approach would be to implement similar code as used in Marlin, others could be searching the internet for ideas or come up with something from scratch. The easy part will be to send data as the TMC2209 is quite forgiving when it comes to the baud rate, a bit more tricky (I guess) would be to receive and decode data, at least one timer has to be used to time the bit transitions? And perhaps interrupts has to be disabled so that timing of the bit stream isn't disturbed too much? Or maybe @fitch22 can help as it seems he has software serial working for BTT SKR-2 boards. Here is an example how UART mode is implemented in a STM32F411 driver when a hardware UART is available and lowlevel UART driver code is available. It is the code inside |
@jimmejames Did you resolve the A-axis issue? As I do not get a notification when a comment is edited I have not noticed your addition before now. |
I just found this in Marlin but this stuff is out of my programing league. So i will wait if @fitch22 can get something to work and as backup plan i will order new drivers with SPI. |
@terjeio Unfortunately, no. I changed to GRBL and got all four working with that. |
All,
I believe I have the software serial stuff working now with skr-2 and tmc2209’s. However, what has taken so long is that the skr-2 has the ability to fry the tmc2209 drivers. According to BTT, this was only with a rev a board, but I have rev b as do others with the problem. I have just begun my analysis of the board design and root cause of the failures. I have managed to kill 9 of these guys and it is getting expensive:-). For now, I don’t think I would recommend anyone mixing tmc2209’s and the skr-2 until this is well understood.
There are several issues listed in the Bigtreetech GitHub site for the skr-2, some even with the 2208’s and there are links to Marlin issues, too.
I should have more information in a few days.
Bill
…Sent from my iPad
On Oct 3, 2021, at 12:05 PM, drom89 ***@***.***> wrote:
I just found this in Marlin but this stuff is out of my programing league. So i will wait if @fitch22 can get something to work and as backup plan i will order new drivers with SPI.
https://github.com/MarlinFirmware/Marlin/blob/a185ce22cf6e4fb15250815c5c39318606a7e65a/Marlin/src/module/stepper/trinamic.cpp
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
|
@fitch22 |
At this point it is STM32 only, but you might be able to modify it a bit to work with the LPC176x boards. If still interested, let me know.
Bill
From: drom89 ***@***.***>
Sent: Sunday, October 3, 2021 3:01 PM
To: grblHAL/LPC176x ***@***.***>
Cc: fitch22 ***@***.***>; Mention ***@***.***>
Subject: Re: [grblHAL/LPC176x] LPC176x Build Fails with TMC2130's (listed as experimental) (#5)
@fitch22 <https://github.com/fitch22>
So can you upload the code somewhere ? I would like to try it.
I have SKR 1.4T not SKR-2 so it should be ok...
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#5 (comment)> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/ACQUGITMFAUB35BX6Y33GTLUFDHBVANCNFSM5BVAJBPQ> .
Triage notifications on the go with GitHub Mobile for iOS <https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android <https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub> . <https://github.com/notifications/beacon/ACQUGITRNAIIJX5LFPLYP5LUFDHBVA5CNFSM5BVAJBP2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOG6OPCMI.gif>
|
I'm getting the seventeen build errors listed below. Trying to build for a BTT SKR 1.4 Turbo with four TMC2130's. If I comment out the #define TRINAMIC_ENABLE 2130 in my_machine.h it builds just fine. This is from a current (Aug 5, 21) git recurse-submodules pull.
Description Resource Path Location Type c:/nxp/mcuxpressoide_11.4.0_6224/ide/plugins/com.nxp.mcuxpresso.tools.win32_11.4.0.202103011116/tools/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/lib/thumb/v7-m/nofp\libc.a(lib_a-closer.o): in function
_close_r': GRBL Driver LPC176x C/C++ Problemc:/nxp/mcuxpressoide_11.4.0_6224/ide/plugins/com.nxp.mcuxpresso.tools.win32_11.4.0.202103011116/tools/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/lib/thumb/v7-m/nofp\libc.a(lib_a-fstatr.o): in function
_fstat_r': GRBL Driver LPC176x C/C++ Problem c:/nxp/mcuxpressoide_11.4.0_6224/ide/plugins/com.nxp.mcuxpresso.tools.win32_11.4.0.202103011116/tools/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/lib/thumb/v7-m/nofp\libc.a(lib_a-isattyr.o): in function
_isatty_r': GRBL Driver LPC176x C/C++ Problemc:/nxp/mcuxpressoide_11.4.0_6224/ide/plugins/com.nxp.mcuxpresso.tools.win32_11.4.0.202103011116/tools/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/lib/thumb/v7-m/nofp\libc.a(lib_a-lseekr.o): in function
_lseek_r': GRBL Driver LPC176x C/C++ Problem c:/nxp/mcuxpressoide_11.4.0_6224/ide/plugins/com.nxp.mcuxpresso.tools.win32_11.4.0.202103011116/tools/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/lib/thumb/v7-m/nofp\libc.a(lib_a-readr.o): in function
_read_r': GRBL Driver LPC176x C/C++ Problemc:/nxp/mcuxpressoide_11.4.0_6224/ide/plugins/com.nxp.mcuxpresso.tools.win32_11.4.0.202103011116/tools/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/lib/thumb/v7-m/nofp\libc.a(lib_a-signalr.o): in function
_getpid_r': GRBL Driver LPC176x C/C++ Problem c:/nxp/mcuxpressoide_11.4.0_6224/ide/plugins/com.nxp.mcuxpresso.tools.win32_11.4.0.202103011116/tools/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/lib/thumb/v7-m/nofp\libc.a(lib_a-signalr.o): in function
_kill_r': GRBL Driver LPC176x C/C++ Problemc:/nxp/mcuxpressoide_11.4.0_6224/ide/plugins/com.nxp.mcuxpresso.tools.win32_11.4.0.202103011116/tools/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/lib/thumb/v7-m/nofp\libc.a(lib_a-writer.o): in function
_write_r': GRBL Driver LPC176x C/C++ Problem make: *** [makefile:40: Firmware.axf] Error 1 GRBL Driver LPC176x C/C++ Problem undefined reference to
_close' GRBL Driver LPC176x line 0 C/C++ Problemundefined reference to
_fstat' GRBL Driver LPC176x line 0 C/C++ Problem undefined reference to
_getpid' GRBL Driver LPC176x line 0 C/C++ Problemundefined reference to
_isatty' GRBL Driver LPC176x line 0 C/C++ Problem undefined reference to
_kill' GRBL Driver LPC176x line 0 C/C++ Problemundefined reference to
_lseek' GRBL Driver LPC176x line 0 C/C++ Problem undefined reference to
_read' GRBL Driver LPC176x line 0 C/C++ Problemundefined reference to
_write' GRBL Driver LPC176x line 0 C/C++ Problem
The text was updated successfully, but these errors were encountered: