This is the driver’s manual
Okay, I think I’m reasonably up to speed on the BTT TMC5160 Plus Stepper Drivers Module. I was quite familiar with the TMC5160 before this and after reviewing the Plus schematic, I see it as a fairly powerful application of the TMC5160 but nothing surprising or out of specification. The JMSL1008A N-Channel MOSFET is a good selection for the application.
TMC5160 and driver MOSFET datasheets:
TMC5160A_datasheet_rev1.17.pdf (2.9 MB)
JMSL1008AG_Rev3.3.pdf (289.0 KB)
First off, there is no need to change the Rsense. As can be seen in the TMC5160 datasheet, it gives the maximum current output:
Current output is defined by the GLOBALSCALER register:
Using the formula defined here:
If you want to limit the current going to the motors, Klipper, using the [tmc5160 ...]
statement, allows you to specify the Rsense resistor value (0.022Ω for the BTT TMC5160 Plus module) so you can accurately specify the current provided to the motors:
[tmc5160 stepper_x]
cs_pin:
# The pin corresponding to the TMC5160 chip select line. This pin
# will be set to low at the start of SPI messages and raised to high
# after the message completes. This parameter must be provided.
#spi_speed:
#spi_bus:
#spi_software_sclk_pin:
#spi_software_mosi_pin:
#spi_software_miso_pin:
# See the "common SPI settings" section for a description of the
# above parameters.
#chain_position:
#chain_length:
# These parameters configure an SPI daisy chain. The two parameters
# define the stepper position in the chain and the total chain length.
# Position 1 corresponds to the stepper that connects to the MOSI signal.
# The default is to not use an SPI daisy chain.
#interpolate: True
# If true, enable step interpolation (the driver will internally
# step at a rate of 256 micro-steps). The default is True.
run_current:
# The amount of current (in amps RMS) to configure the driver to use
# during stepper movement. This parameter must be provided.
#hold_current:
# The amount of current (in amps RMS) to configure the driver to use
# when the stepper is not moving. Setting a hold_current is not
# recommended (see TMC_Drivers.md for details). The default is to
# not reduce the current.
#sense_resistor: 0.075
# The resistance (in ohms) of the motor sense resistor. The default
# is 0.075 ohms.
#stealthchop_threshold: 0
# The velocity (in mm/s) to set the "stealthChop" threshold to. When
# set, "stealthChop" mode will be enabled if the stepper motor
# velocity is below this value. The default is 0, which disables
# "stealthChop" mode.
#coolstep_threshold:
# The velocity (in mm/s) to set the TMC driver internal "CoolStep"
# threshold to. If set, the coolstep feature will be enabled when
# the stepper motor velocity is near or above this value. Important
# - if coolstep_threshold is set and "sensorless homing" is used,
# then one must ensure that the homing speed is above the coolstep
# threshold! The default is to not enable the coolstep feature.
#high_velocity_threshold:
# The velocity (in mm/s) to set the TMC driver internal "high
# velocity" threshold (THIGH) to. This is typically used to disable
# the "CoolStep" feature at high speeds. The default is to not set a
# TMC "high velocity" threshold.
#driver_MSLUT0: 2863314260
#driver_MSLUT1: 1251300522
#driver_MSLUT2: 608774441
#driver_MSLUT3: 269500962
#driver_MSLUT4: 4227858431
#driver_MSLUT5: 3048961917
#driver_MSLUT6: 1227445590
#driver_MSLUT7: 4211234
#driver_W0: 2
#driver_W1: 1
#driver_W2: 1
#driver_W3: 1
#driver_X1: 128
#driver_X2: 255
#driver_X3: 255
#driver_START_SIN: 0
#driver_START_SIN90: 247
# These fields control the Microstep Table registers directly. The optimal
# wave table is specific to each motor and might vary with current. An
# optimal configuration will have minimal print artifacts caused by
# non-linear stepper movement. The values specified above are the default
# values used by the driver. The value must be specified as a decimal integer
# (hex form is not supported). In order to compute the wave table fields,
# see the tmc2130 "Calculation Sheet" from the Trinamic website.
#driver_MULTISTEP_FILT: True
#driver_IHOLDDELAY: 6
#driver_TPOWERDOWN: 10
#driver_TBL: 2
#driver_TOFF: 3
#driver_HEND: 2
#driver_HSTRT: 5
#driver_FD3: 0
#driver_TPFD: 4
#driver_CHM: 0
#driver_VHIGHFS: 0
#driver_VHIGHCHM: 0
#driver_DISS2G: 0
#driver_DISS2VS: 0
#driver_PWM_AUTOSCALE: True
#driver_PWM_AUTOGRAD: True
#driver_PWM_FREQ: 0
#driver_FREEWHEEL: 0
#driver_PWM_GRAD: 0
#driver_PWM_OFS: 30
#driver_PWM_REG: 4
#driver_PWM_LIM: 12
#driver_SGT: 0
#driver_SEMIN: 0
#driver_SEUP: 0
#driver_SEMAX: 0
#driver_SEDN: 0
#driver_SEIMIN: 0
#driver_SFILT: 0
#driver_DRVSTRENGTH: 0
#driver_BBMCLKS: 4
#driver_BBMTIME: 0
#driver_FILT_ISENSE: 0
# Set the given register during the configuration of the TMC5160
# chip. This may be used to set custom motor parameters. The
# defaults for each parameter are next to the parameter name in the
# above list.
#diag0_pin:
#diag1_pin:
# The micro-controller pin attached to one of the DIAG lines of the
# TMC5160 chip. Only a single diag pin should be specified. The pin
# is "active low" and is thus normally prefaced with "^!". Setting
# this creates a "tmc5160_stepper_x:virtual_endstop" virtual pin
# which may be used as the stepper's endstop_pin. Doing this enables
# "sensorless homing". (Be sure to also set driver_SGT to an
# appropriate sensitivity value.) The default is to not enable
# sensorless homing.
An appropriate [tmc5160 ...]
statement is given in the BTT TMC5160 Plus User Manual.
Second, the phrase “active cooling” in the User Manual is essentially meaningless. There is no suggestion as to what it is, what it needs to accomplish or what are its specifications.
The module itself appears to have an attractive machined metal (probably aluminum) case with cooling louvers.
As you are running at 24V/36V with maximum current of less than 2A and not at the stated extremes for the module, 60V and peak current of 15A, you are using a small fraction of the power that it is capable of.
Therefore, I don’t think “active cooling” is a concern at this point in time, but as we understand what’s going on here better, we may revisit it.
Going back to the original post, I just watched the attached videos (nice looking printer BTW) and I have some requests:
- Could you provide the
klippy.log
as you were requested when you made your first post? I’ve looked at yourprinter.cfg
and nothing unusual there but theklippy.log
often has some unexpected gems. - Could you provide a wiring diagram (hand drawn is okay) for the printer with a focus on the Octopus to BTT TM5160 Plus wiring (to the Octopus as well as the Toolhead controllers, if my assumption in the previous point is correct)? I’m especially interested in the power wiring. Along with this, could you provide photographs of how things are wired?
- Now, it is my understanding that the Z1 & Z2 as well as the X left and X Right steppers are a problem but you’re not mentioning the Y axis stepper. What makes it different from the others?
Absolutely true, they are powerful and well-built, but unfortunately the wrong driver for the steppers or the wrong steppers for these drivers, however you want to put it.
I cannot repeat this often enough, because I think what the manufacturers like BTT, Mellow or alike, are doing is close to a scam.
They are marketing and selling drivers to uninformed users that are way beyond specification for the intended use and put this under headlines like seen here:
This is all wrong for a standard 3D printer as we know and use. The only correct statement is “drives high-power motors”.
- The current regulation is done by measuring the voltage drop over R_{sense} via an ADC
- The full range of the ADC of this driver is 0 A to 15 A
- In reality, only a fraction (mostly around 2 A or below) are used of this full range
- Not even NEMA23 motors are needing this. One needs to enter the NEMA34 class to even come close to 6 A
- I do not even want to know how many users are running an 800 mA pancake stepper with such drivers
→ The drivers are basically crippled, because the ADC cannot do its job properly
I do not understand why the manufacturers are not offering correctly setup drivers for the intended use and educate their customers in the sense of “get the right driver for the right stepper”. Instead, they resort to dishonest marketing blabla of “the more the better”.
Here are the klippy.log and the dump_tmc output.
DUMP_TMC.txt (6.0 KB)
klippy.log (262.8 KB)
I’ll try to answer to as many questions as possible
mykepredko
-As stated by Sineos, the issue here SEEMS to be the fact that the driver are sized for a completely different current range. I myself might have been “fooled” by the driver’s manual stating that the drivers are the perfect choice for 42, 57, 86 motors in general. It still has to be verified if this is actually the cause of my problems.
As you can see by my cfg file, I have the current and the sense reistor set correctly
-At the moment I don’t have a wiring diagram for the printer control cabinet. I’ll leave a picture below (It looks a bit messy, mostly due to the see through back panel). The connection between the octopus pro and the drivers however is quite straigh forward, as they include the adapter stepstick and cables in the drivers box.
-The Y axis at the moment is not using an actual stepper motor. To drive the 10mm Y axis ballscrew fast enought I opted for a JMC IHSV57 bldc servo. So we can rule that out for now.
Sineos:
This morning I had a chance to try replacing one of the 5160s with a 2209 stepstick and guess what? Enabling StealthChop I get the same vibrations I get with the over-sized 5160. I was limiting the motor to 1.5A to avoid cooking the stepstick, but the fact that it sounds exactly the same as the other driver makes me belive that the issue is not ONLY the sense resistor (I understand that it’s stil a sub-optimal condition a least).
Searching a bit online I see that it’s quite a common issue with these drivers, even with nema17…
honestly it looks like I should just avoid Stealthchop. At this point I could have just kept my old drivers…
edit: this dude on the other hand seems to have fixed the issue with a sense resistor swap…
Thanx - that helps give me an idea on how things are set up.
Nothing caught my eye.
I don’t think we’re ready to reach that conclusion yet.
I don’t see a picture and you didn’t give the wiring diagram I asked for.
I’m not looking to embarrass you but many times somebody has a problem like this it has to do with their wiring.
Personally, I always want to know how Ground and Power are wired, both at a high level as well as practically.
You’ve got reasonably hefty steppers in your printer and I’m surprised that you’re having these issues with the BTT product when you didn’t with the previous drivers. My first thought is to look at how things are wired - I have no idea what you mean by “straigh[t] forward”.
Same comments as above, how did you wire them and I would like you to post a diagram and pictures? I’m also interested in how the serial connection is made (most stepstick boards I see don’t have the TMC2209 connection).
Like the previous drivers, I would like to see your klippy.log
.
(60W and just multiply of current to voltage here)
My 2 cents, this is not exactly correct. Motor resistance is “constant” and the driver does PWM to ensure configured current.
So, heat is more or less constant. While moving there will be more power dissipation, because the driver will recharge coils.
So, fo reference:
LDO 2504, 1.768A RMS and 52V power.
While standstill they use 10W, and while moving around 35W.
I measured the current between the PSU and motherboard, so my measurements did not account for a possible drop in voltage under load here.
I powered them from 70W Meanwell LRS.
You’ve got reasonably hefty steppers in your printer and I’m surprised that you’re having these issues with the BTT product when you didn’t with the previous drivers. My first thought is to look at how things are wired - I have no idea what you mean by “straigh[t] forward”.
The drivers come in this kit, you just plug the stick on the board and connect power to the driver and you are done.
The octopus already has support for spi, so no other wiring is required.
The previous driver didn’t have stealthchop, so no issues there (I don’t have issues with the new ones either if I leave stealthchop disabled, they just seem to heat up the motors a little bit more).
Same comments as above, how did you wire them and I would like you to post a diagram and pictures? I’m also interested in how the serial connection is made (most stepstick boards I see don’t have the TMC2209 connection).
Same as above. The octopus has integrated uart support, you just need to put 1 jumper in the right place. I just plugged the driver on the board and connected the motor to the board. Unfortunately I can’t provide a klippy log for that as I already put back to the 5160.
Same behaviour tho: no issue with stealthchop disabled, vibrations with SC on, which however seems to be a quite common thing if you look at the videos linked above.
This is the picture of the electronics.
Thanx for the picture, that gives me a better idea of what you’re doing but…
There still needs to be a wiring diagram. Ideally also one of how the TB6600s were wired in.
I’m looking at primarily how the power supplies and the various grounds are interconnected. The picture shows wires going between the two power supplies and the Octopus (I’m guessing you turn one or the other on?) but I can’t see how the stepper drivers are powered.
With wiring this complex, you really need a good schematic for yourself, never mind me.
Yeah, I definetly have to take a moment a draw a schematic before it’s too late.
At the moment the 36V psu is only connected to the Y axis motor (in the picture it was powering the 4 tmc5160s too, but it was just a test).
The 24v psu powers the 4 TMC drivers directly (you can see the 2 equipotetial bars above the drivers), the octopus board and the 2 toolhead boards.
The heatbed is AC powered via the SSR you can see in the picture, so it doesn’t steal power from the motors.
AC power to the bed and PSUs is controlled by the yellow safety relay, that allows the machine to cut power to itself in case of errors / thermal runaway etc (the relay on the bottom - right corner is controlled by klipper via an output_pin, and can open the e-stop line in case of errors).
Please take that moment and draw out the schematic.
Hi, can you confirm that these are the 2 resistors I’d have to replace?
In the meantime I started drawing the schematic, but I’ll have to wait till I have the machine on hand to finish it (1 week).
edit: an interesting thing: at page 59 of this datasheet there is a diagram of the correct startup procedure necessary to obtain a good autotune result for the motors.
It shows that the motor should stand still for at least 130ms, and I think that just letting the homing procedure turn the motors on does not satisfy this requirement. The distance of movement of the homing routine might also be insufficient.
No, you don’t have to replace them.
You’re looking for a quick fix and that’s not the case here.
Again, I highly recommend that you draw out the wiring in your system and post it here. If things were working fine with the TB6600 Drivers and then you got the noise after changing to the BTT TMC5160+ drivers then that suggests to me a wiring issue.
The image that you provided shows that you have a very complex wiring set up for your printer and I would like to verify that you don’t have any grounding issues or voltage rail mismatches. Either of these could be causing your problems.
There is some concern that they are mismatched for your motors. That’s certainly possible.
Now, you report that when you try a TMC2209 stepstick driver, you still have the same problem.
My questions to you are:
- What else did you change when you put in the BTT TMC5160+ drivers?
- Could you provide a schematic of your printer?
as stated above:
In the meantime I started drawing the schematic, but I’ll have to wait till I have the machine on hand to finish it (1 week).
Nothing else has been changed when I replaced the drivers.
I don’t get noise with TMC5160, I get noise with StealthChop, on TMC5160s and on TMC2209. When operating in SpreadCycle the noise level with the new drivers is the same as with the old ones (a bit better actually).
I just took a look around and found three people with similar problems to yours with 5160s and Marlin.
Nobody reported a solution. The things that were suggested was a) to run the steppers faster, the claim being that the current waveform will be smoother at higher speeds, b) Increase the power supply, c) reduce the output current to half of the stepper’s rated current and d) try different steppers.
I don’t know if you’ve tried any of these things (I think you’ve tried both 24V and 36V as well as playing around with the current).
The only thing I would suggest is try a Nema 17 with both the 5160 and 2209 drivers (along with the different modes) and see if that improves anything.
Hook the Nema 17 motor to one of your X axis connections and try to do a homing operation (as that will allow the motor to run indefinitely before you hit the “Emergency Stop” allowing you to characterize the sound and the stepper’s operation).
If you see an improvement, then try one of your Nema 23 motors (without a load) and see if you get the same results.
The only other thing I can suggest is to try and invoke the StealthChop automatic tuning procedure to see if that helps get things working the way they ought to me:
Sorry there doesn’t seem to be a hard and fast solution to your problem.
Yeah, looking around I noticed too that a) it’s not a rare issue b) nobody actually solved it without swapping motors till a combination that somehow works is found.
That would be a bit difficoult, it would require to swap out the Z axis ballscrews or build some kind of belt/pulley reduction.
I tried 24v and 36V, with currents between 1.5 and 3A, but the issue was still there.
I was thinking about trying nema17 motors, at least on the Z axis which is the one with more issues.
Regarding that diagram, as soon as i’ll have the machine on hand i’ll try manually enabling the motors to let them rest on idle for a while, and then launch homing (possibly starting from a good distance from the limit switch), to see if a correct autotuning cycle helps. I don’t have much hope tho, because I could hear the squealing upon deceleration of the X axis improving and disappearing with time, while the Z axis vibration seemd always the same. There is some kind of compatibility issue between those motors and the drivers I guess.
Maybe I should just replace the 2 76mm motors of the Z axis with 56mm ones (same as the X axis).
I found the time to go a couple of hours to our workshop and finished the schematic. It should be reasonably detailed for our purpose.
schema_elettrico_stampante.pdf (2.1 MB)
Other than that I tryed implementing the correct startup procedure (I modified the homing routine to manually turn on the motors and then wait for 3 seconds before movement). I didn’t see any difference at all.
Thank you - that’s helpful.
Now, looking at your schematic and the schematic of the BTT TMC5160+ here:
You have a ground loop here:
Going back over the photograph of your wiring, the wire length is fairly large and you do have a number of steppers going back and forth.
Could I get you to try something? I would like to break the ground loop and see if that improves things - can’t guarantee that it will but it might and, at the very least, it will eliminate one variable in trying to figure out what’s wrong.
The steps that I want you to take are:
- In your
printer.cfg
, reduce the XR Stepper current to 1A. This is to ensure the ribbon cable between the Octopus Pro and the BTT TMC5160+ doesn’t get damaged by excess current. - Verify that the right toolhead still moves and, if possible, record the movement sound in StealthChop. I would recommend turning off the steppers and moving the associated toolhead to the far end of the gantry and do a homing operation - that should give you a few seconds to get a good sound sample and it’s easily repeated.
- Disconnect the Negative Voltage “-” at the terminal on the XR BTT TMC5160+ module like:
By doing this, you’ll only have one ground path to each of the BTT TMC5160+ modules like so:
- Test your printer’s movement and record the movement sound in StealthChop.
If your problem is caused by a ground loop, then you will hear a marked change in the sound the steppers make. Hopefully it will be quieter and smoother.
If this doesn’t change the sound, then I guess you have a mismatched stepper to your drivers.
Again, thank you for taking the time to make the schematic. It really helped me to see what you’re doing here.
I have 2 question:
- can this be dangerous? I see that on the manual they are very clear about powering the driver before powering the motherboard (to be honest I didn’t do much to ensure that that is the case, I just relied on the power-on time of the motherboard as a delay). And having the current flowing back to the motherboard via the signal wires seems a bit sketchy
- Wouldn’t that be something that they should have taken care of? I don’t see how I could power the drivers without creating such loop.
You still have a ground connection through the motherboard as I showed in my last drawing. By disconnecting the “-” on the BTT TMC5160+ you’re just eliminating the loop.
In my instructions for the experiment, I specified lowering the motor drive current to 1A so that there would be no danger of damaging currents running through the cable between the Octopus Pro and the BTT TMC5160+.
I’m guessing that with their power sequencing message in red:
BTT is assuming that the user knows that they must have a separate power supply for their BTT TMC5160+ module and how to wire it in without ground loops.
To be fair, they should have provided a diagram how to do it.
If the experiment succeeds in lowering the noise/vibration then I’ll ask you to add another 24V power supply to your printer and I’ll show you how to wire it to the XL, XR, Z1 & Z2 BTT TMC5160+ drivers so there isn’t a ground loop.
This second power supply will have to be turned on first and turned off last when using the printer.
The wiring really isn’t that difficult; I’ll have you connect the BTT TMC5160+'s “+” and “-” terminals to the new power supply and use the BTT TMC5160’s internal ground connection to provide a common ground with the Octopus Pro’s. We’ll have to make sure that the digital ground is not connected to AC “Earth” but, going by your schematic, that doesn’t look like it will be much of a concern.
Regardless, this is an experiment. I’m looking at your schematic and seeing a ground loop which could be the cause of your problems. It’s a fairly easy experiment to perform with no danger of damaging any components or to you.
However, if there isn’t a difference, then you’re going to have to look at the steppers and we’ll try to find ones that are a better match to the drivers.