MarlinFirmware / Marlin

Marlin is an optimized firmware for RepRap 3D printers based on the Arduino platform. Many commercial 3D printers come with Marlin installed. Check with your vendor if you need source code for your specific machine.
https://marlinfw.org
GNU General Public License v3.0
16.28k stars 19.24k forks source link

M122 - TMC Debugging does not display data for my E0 driver (TMC2130). #11430

Closed HansJakob closed 6 years ago

HansJakob commented 6 years ago

Description

I have a DIY CoreXY printer with an MKS Gen 1.4 controller. All drivers are TMC2130 connected to SPI. I'm using hardware spi, but CS is not connected to standard pins. CS-X is pin 44, CS-Y is pin 40, CS-Z is pin 42 and CS-E0 is pin 59.

All drivers are configured correctly via the Marlin configuration, and they all work properly.

My problem is that I can not get data from my extruder driver when I send an M122 (TMC debug) command to the printer. I only receive data from X Y and Z. This did not happen in version 1.1.8. Here I received data from X Y Z and E0 as expected. I have not changed my hardware since I updated Marlin from 1.1.8 to 1.1.9.

If I send an M906 (TMC Motor Current), I also do not get data from E0, but only from X Y and Z.

However, if I send an M911 (TMC OT Pre-Warn Condition), I get data from all four drivers. Ie the M911 command works as expected.

Steps to Reproduce

I updated from Marlin version 1.1.8 to version 1.1.9.

Expected behavior: I expected the M122 and M906 commands to give me information about all four TMC2130 drivers mounted on my controller.

Actual behavior: I only receive data from the X Y and Z drivers and lack data from the E0 driver.

Additional Information

I have included my configuration files in a zip package. The files are: Configuration.h Configuration_adv.h pins_RAMPS.h

Marlin.zip

teemuatlut commented 6 years ago

1.1.9 broke a few things for configurable drivers and needs a hotfix patch.

teemuatlut commented 6 years ago

https://github.com/teemuatlut/Marlin/tree/bf1_fix_smart_drivers

HansJakob commented 6 years ago

This fix definitely resolved my problem. I can now see data for all four drivers.

Hywelmartin commented 6 years ago

It worked for me as well. Thanks @teemuatlut for a quick fix

ddjikic commented 6 years ago

@teemuatlut thank you it worked for me also

dmitry-kutergin commented 6 years ago

Will it be integrated into a main repo?

teemuatlut commented 6 years ago

In time. In one form or another.

thinkyhead commented 6 years ago

Please test with the latest bugfix-1.1.x (and/or bugfix-2.0.x) branch to see where it stands. There are still some issues with M122 but it should at least show all the axes now.

npmomchev commented 6 years ago

My hardware config: RuRAMPS4D v1.3 + ArdiunoDUE + 4 x TMC2130 software: PlatformIO (full updated) with Athom + Marlin bugfix-2.0.x (last)

M122
                X       Y       Z       E0
Enabled         false   false   false   false
Set current     1000    1000    1000    1000
RMS current     994     994     994     550
MAX current     1402    1402    1402    776
Run current     17/31   17/31   17/31   17/31
Hold current    8/31    8/31    8/31    8/31
CS actual       8/31    8/31    8/31    31/31
PWM scale       0       0       0       255
vsense          0=.325  0=.325  0=.325  1=.18
stealthChop     true    true    true    true
msteps          32      32      32      0
tstep           1048575 1048575 1048575 4294967295
pwm
threshold       0       0       0       0
[mm/s]          -       -       -       -
OT prewarn      false   false   false   true
OT prewarn has
been triggered  false   false   false   false
off time        5       5       5       15
blank time      24      24      24      54
hysteresis
-end            2       2       2       12
-start          3       3       3       8
Stallguard thrs -10     -10     0       0
DRVSTATUS       X       Y       Z       E0
stallguard                              X
sg_result       0       0       0       1023
fsactive                                X
stst            X       X       X       X
olb                                     X
ola                                     X
s2gb                                    X
s2ga                                    X
otpw                                    X
ot                                      X
Driver registers:
        X = 0x80:08:00:00
        Y = 0x80:08:00:00
        Z = 0x80:08:00:00
        E0 = 0xFF:FF:FF:FF

For Test I replaced the E0 TMC2130 with X1 TMC2130 - the result is the same.

Help if you know the solution to the problem

github-actions[bot] commented 4 years ago

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.