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

re-arm pins file tmc2208 #12757

Closed
boelle opened this issue Dec 29, 2018 · 26 comments
Closed

re-arm pins file tmc2208 #12757

boelle opened this issue Dec 29, 2018 · 26 comments

Comments

@boelle
Copy link
Contributor

boelle commented Dec 29, 2018

quick Q:

are there any reason for tmc2208 not being in the pins file yet?

i ASSUME that marlin does not support the ethernet addon and was going to use those pins for the 2208's, but are there anything wrong in doing so?

would inserting this block at line 109 in pins_RAMPS_RE_ARM.h be ok/work?

#if HAS_DRIVER(TMC2208)
  /**
   * TMC2208 stepper drivers
   *
   * Hardware serial communication ports.
   * If undefined software serial is used according to the pins below
   */
  //#define X_HARDWARE_SERIAL  Serial1
  //#define X2_HARDWARE_SERIAL Serial1
  //#define Y_HARDWARE_SERIAL  Serial1
  //#define Y2_HARDWARE_SERIAL Serial1
  //#define Z_HARDWARE_SERIAL  Serial1
  //#define Z2_HARDWARE_SERIAL Serial1
  //#define E0_HARDWARE_SERIAL Serial1
  //#define E1_HARDWARE_SERIAL Serial1
  //#define E2_HARDWARE_SERIAL Serial1
  //#define E3_HARDWARE_SERIAL Serial1
  //#define E4_HARDWARE_SERIAL Serial1

  /**
   * Software serial
   */

  #define X_SERIAL_TX_PIN    P1_16   // (70)  J12-3
  #define X_SERIAL_RX_PIN    P1_17   // (71)  J12-4
  #define X2_SERIAL_TX_PIN   -1
  #define X2_SERIAL_RX_PIN   -1

  #define Y_SERIAL_TX_PIN    P1_15   // (72)  J12-5
  #define Y_SERIAL_RX_PIN    P1_14   // (73)  J12-6
  #define Y2_SERIAL_TX_PIN   -1
  #define Y2_SERIAL_RX_PIN   -1

  #define Z_SERIAL_TX_PIN    P1_09   // (74)  J12-7
  #define Z_SERIAL_RX_PIN    P1_10   // (75)  J12-8
  #define Z2_SERIAL_TX_PIN   P1_08   // (76)  J12-9
  #define Z2_SERIAL_RX_PIN   P1_04   // (77)  J12-10

  #define E0_SERIAL_TX_PIN   P1_00   // (78)  J12-11
  #define E0_SERIAL_RX_PIN   P1_01   // (79)  J12-12
  #define E1_SERIAL_TX_PIN   -1
  #define E1_SERIAL_RX_PIN   -1
  #define E2_SERIAL_TX_PIN   -1
  #define E2_SERIAL_RX_PIN   -1
  #define E3_SERIAL_TX_PIN   -1
  #define E3_SERIAL_RX_PIN   -1
  #define E4_SERIAL_TX_PIN   -1
  #define E4_SERIAL_RX_PIN   -1
#endif

@gloomyandy
Copy link
Contributor

Do you have things working with the pins defined above? I thought that you needed an interrupt capable pin for software serial input (and I think only port 0 and port 1 have interrupt capable pins).

@boelle
Copy link
Contributor Author

boelle commented Dec 29, 2018

nope, it will be another 4 days before i have the re-arm in my hands

just preparing things and making a list of other parts i need

@gloomyandy
Copy link
Contributor

Sorry there is a typo in my post above, only ports 0 and 2 have gpio interrupt pins, so I'm not sure if the ones you have selected will work or not. I'm sure I read something that said the RX pin must be able to generate an interrupt (which makes sense).

@boelle
Copy link
Contributor Author

boelle commented Dec 29, 2018

yeah, and it also explains why 2208's have not beed added to the list :-( a shame thou as these runs cooler and can handle more current compared to the 2130's

but well i will then order the 2130's as that is the only option of semi silent operation

@Nuttavoot
Copy link

So Re-ARM can not be use with TMC2208, just know that, I thought it was a drop-in compatible, almost buy them.

@gloomyandy
Copy link
Contributor

You can use a TMC2208 with Re-arm no problem if you use it in stand alone mode. If you want to use the more advanced options then you/someone needs to work out how to connect it to the ReArm this may or may not be possible depending upon what other features you are using (as there may not be enough interrupt enabled pins available to allow the use of the serial connections). How easy/hard this is will depend upon how many TMC2208s you want to use and what other devices you have connected (as things like displays etc. will use some of the pins). At the moment it seems that no-one has worked out a good configuration.

@Nuttavoot
Copy link

You can use a TMC2208 with Re-arm no problem if you use it in stand alone mode. If you want to use the more advanced options then you/someone needs to work out how to connect it to the ReArm this may or may not be possible depending upon what other features you are using (as there may not be enough interrupt enabled pins available to allow the use of the serial connections). How easy/hard this is will depend upon how many TMC2208s you want to use and what other devices you have connected (as things like displays etc. will use some of the pins). At the moment it seems that no-one has worked out a good configuration.

Do I need to change the driver to TMC2208 in the configuration.h file ? I tried that and it compiled fail with error like TMC2208 needs some pins.

@gloomyandy
Copy link
Contributor

If you are using the TMC2208 in standalone mode you need to define it as TMC2208_STANDALONE not as TMC2208

@boelle boelle closed this as completed Dec 30, 2018
@necris38
Copy link

necris38 commented Feb 1, 2019

Hello,
I try (hard!) for a week to configure my Re-arm/RAMPS1.6 board with UART TMC2208.
Did you finally successfull with your configuration ?
I think we can find free pin on re-arm for RX/TX but I don't know where define it as in "pins_RAMPS_RE_ARM.h" there is no more "#if HAS_DRIVER(TMC2208)" section.
a little help would be appreciated because I'm starting to get a little confuse !

@boelle
Copy link
Contributor Author

boelle commented Feb 1, 2019

it's not possible, there are not enough interrupt able pins left

at most you can drive 1 stepper with serial

i have ditched the idea and will... at some point.... go for tmc2130

@boelle
Copy link
Contributor Author

boelle commented Feb 1, 2019

there are plenty of free pins... but they are not interrupt able :-(

@necris38
Copy link

necris38 commented Feb 1, 2019

Arff :-(
what a pitty !
Standalone mode is so restrictive...
Do you think HYBRID_THRESHOLD is usuable in STANDALONE mode ?

@necris38
Copy link

necris38 commented Feb 1, 2019

If I want to drive 1 stepper, wich pin is interrupt capable ?

@boelle
Copy link
Contributor Author

boelle commented Feb 1, 2019

no idea.... and i did not investigate any further since only 1 stepper is a waste of time

@necris38
Copy link

necris38 commented Feb 1, 2019

OK.
Thanks for your answer.

@necris38
Copy link

necris38 commented Feb 1, 2019

in Datasheet https://www.nxp.com/docs/en/data-sheet/LPC1769_68_67_66_65_64_63.pdf
you can read:
image

So... ??

@boelle
Copy link
Contributor Author

boelle commented Feb 1, 2019

your guess is as good as mine, maybe @thinkyhead knows

@necris38
Copy link

necris38 commented Feb 2, 2019

image

@gloomyandy
Copy link
Contributor

Yes we are well aware of how the various pins can be used. The issue is are any suitable pins available on the re-arm/ramps board (especially if you have other devices like an LCD attached) and if they are does the software serial and TMC library actually work correctly. I don't think anyone has actually come up with an answer for this so far. Feel free to investigate and post your results.

@necris38
Copy link

necris38 commented Feb 2, 2019

I would love to investigate too but I am a little beginner. Do you know in which file I have to declare the TMC2208 library to start my research?

@gloomyandy
Copy link
Contributor

The TMC library is already included, it will be used when define a TMC device in your configuration, so you don't need to declare it anywhere. If you want to look at the source code for that library you can find it here: https://github.com/teemuatlut/TMCStepper
Be aware though that Marlin is a pretty complex project and may not be easy to understand if you have not had much experience with this sort of hardware and software.

@necris38
Copy link

necris38 commented Feb 2, 2019

No experience... but very curious ! 😄

@chrisqwertz
Copy link
Contributor

chrisqwertz commented Apr 25, 2019

I got 4x TMC2208 working on my RAMPS1.4 + Re-Arm setup!

M122
                X       Y       Z       E
Enabled         false   false   false   false
Set current     400     400     800     350
RMS current     718     718     1436    607
MAX current     1012    1012    2025    856
Run current     12/31   12/31   25/31   10/31
Hold current    6/31    6/31    12/31   5/31
CS actual               31/31   31/31   31/31   31/31
PWM scale       36      36      36      36
vsense          0=.325  0=.325  0=.325  0=.325
stealthChop     true    true    true    true

msteps          8       8       8       8
tstep           max     max     max     max
pwm
threshold               79      79      164     95
[mm/s]          50.04   50.04   6.03    5.01
OT prewarn      false   false   false   false
OT prewarn has
been triggered  false   false   false   false
off time                3       3       3       3
blank time      36      36      36      36
hysteresis
-end            -3      -3      -3      -3
-start          6       6       6       6
Stallguard thrs
DRVSTATUS       X       Y       Z       E
stst            X       X       X       X
olb
ola
s2gb
s2ga
otpw
ot
157C
150C
143C
120C
s2vsa
s2vsb
Driver registers:
                X       0xC0:1F:00:00
                Y       0xC0:1F:00:00
                Z       0xC0:1F:00:00
                E       0xC0:1F:00:00


Testing X connection... OK
Testing Y connection... OK
Testing Z connection... OK
Testing E connection... OK

I am using the following pins in my Marlin\src\pins\pins_RAMPS_RE_ARM.h for them:

#if HAS_DRIVER(TMC2208)
  /**
   * TMC2208 stepper drivers
   *
   * Hardware serial communication ports.
   * If undefined software serial is used according to the pins below
   */

  /**
   * Software serial
   */

   // P2_08 E1-Step
   // P2_13 E1-Dir

  #define X_SERIAL_TX_PIN    P2_06
  #define X_SERIAL_RX_PIN    P2_06

  #define Y_SERIAL_TX_PIN    P2_11
  #define Y_SERIAL_RX_PIN    P2_11

  #define Z_SERIAL_TX_PIN    P2_08
  #define Z_SERIAL_RX_PIN    P2_08

  #define E0_SERIAL_TX_PIN   P2_13
  #define E0_SERIAL_RX_PIN   P2_13

#endif

A heads up: you need a jumper with a current limiting resistor in series. I use a 1k per jumper:

20190425_171640

Can we mark this as solved?

@chrisqwertz
Copy link
Contributor

chrisqwertz commented Apr 25, 2019

Very important: Make sure that you use the latest TMCStepper master.zip !
https://github.com/teemuatlut/TMCStepper/archive/master.zip

The half duplex mode has been fixed just recently (d27257900a14ee8cd8df7d5c9b01f1f60c3c4d0b)

@ej0rge
Copy link

ej0rge commented May 4, 2019

I got 4x TMC2208 working on my RAMPS1.4 + Re-Arm setup!
...
Can we mark this as solved?

Just successfully testing a similar setup here with 3x tmc2208 and an lcd-for-melzi hooked up as though it were an rrd full graphic controller (which needed P2_11)

#if HAS_DRIVER(TMC2208)
/**

  • TMC2208 stepper drivers
  • Hardware serial communication ports.
  • If undefined software serial is used according to the pins below
    */

/**

  • Software serial
    */

// P2_08 E1-Step
// P2_13 E1-Dir

#define X_SERIAL_TX_PIN P2_06
#define X_SERIAL_RX_PIN P2_06

#define Y_SERIAL_TX_PIN P2_13 // E1-Dir
#define Y_SERIAL_RX_PIN P2_13

#define Z_SERIAL_TX_PIN P2_08 // E1-Step
#define Z_SERIAL_RX_PIN P2_08

#endif

@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 Jul 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants