[GUIDE] Getting the TMC2130 to work with the K8400

Hello there!

After a few weeks of experimenting with the K8400 and the TMC2130, which can work without the SPI functionality on the original FW with a small modification.
But then you basically get a TMC2100 which I don’t really want (and I guess you too, since you’re reading thins)

Before we start want you to know that you’re doing this on your own risk and if you bork your printer it’s not my fault.

So lets get going.

What you need:

Watterott TMC2130 with heatsinks (watterott drivers are recommended, the ebay ones from china gave me a lot of trouble)
A bunch of jumper cables
Header pins and connectors

I’d recommend you to first watch Tom Sanladerers video on the drivers, he’ll give you the information you need on how to solder pins etc.

Okay first you need to take out the main board from your printer since you need to do some soldering.
We will be using the pins located here:

So if you have the RGB leds installed I’m not 100% sure this will work since we need some pins from there for Chip Select.

But anyway, solder pins to the connectors make sure the pins point upwards, and then put the board back.

Now we need to find the SPI pins, and they are conveniently placed in the middle of the board.

Use some of the jumper pins and solder 5 (4 if you only have 1 extruder) cables to a header connector use some heat shrink tube if you want to make it tidy.
Do this so you have 5 cables from MOSI, MSIO and SCK.

Now you should connect everything like this.

To all drivers

And the CS pins
From board to driver
PIN PG1 to CS on Z axis
PIN PG0 to CS on Y axis
PIN PB6 to CS on X axis
PIN PH4 to CS on E0
PIN PH3 to CS on E1 (if you have dual extruder)

Now the hardware part is finished and now we need a modified FW to run it.
I used the latest version on Marlin which is, at the moment 1.1.8

Download if from marlins website and do the following modifications.

Unpack the file and copy Configuration.h and Configuration_adv.h from …\example_configurations\Velleman\K8400
Make sure you copy the right config file. and past it in the Marlin root folder and overwrite the original files (or make a backup of them if you want).

Use the latest version of arduino for this.

Now edit the following
In Configuration.h

#define INVERT_X_DIR false
#define INVERT_Y_DIR true
#define INVERT_Z_DIR true


#define INVERT_X_DIR true
#define INVERT_Y_DIR false
#define INVERT_Z_DIR false


#define INVERT_E0_DIR false
#define INVERT_E1_DIR true


#define INVERT_E0_DIR true
#define INVERT_E1_DIR false

and edit

#define DEFAULT_AXIS_STEPS_PER_UNIT { 134.74, 134.74, 4166.66, 148.7}


#define DEFAULT_AXIS_STEPS_PER_UNIT { 67.37, 67.37, 2133.33, 74.35}

Since the old drivers had 32 steps/mm and these has default 16 steps/mm

Then in Configuration_avd.h

//#define HAVE_TMC2130


#define HAVE_TMC2130


//#define X_IS_TMC2130
//#define X2_IS_TMC2130
//#define Y_IS_TMC2130
//#define Y2_IS_TMC2130
//#define Z_IS_TMC2130
//#define Z2_IS_TMC2130
//#define E0_IS_TMC2130
//#define E1_IS_TMC2130
//#define E2_IS_TMC2130
//#define E3_IS_TMC2130
//#define E4_IS_TMC2130

#define X_IS_TMC2130
//#define X2_IS_TMC2130
#define Y_IS_TMC2130
//#define Y2_IS_TMC2130
#define Z_IS_TMC2130
//#define Z2_IS_TMC2130
#define E0_IS_TMC2130
#define E1_IS_TMC2130
//#define E2_IS_TMC2130
//#define E3_IS_TMC2130
//#define E4_IS_TMC2130

In pins_RAMPS.h
Look for

#define X_CS_PIN
#define Y_CS_PIN
#define Z_CS_PIN
#define E0_CS_PIN
#define E1_CS_PIN

look change the pin number so they match the pins we soldered earlier.

So X pin should be 12
Y sould be 41
Z sould be 40
E0 sould be 7
And E1 sould be 6

This is the setting we needed to make basic TMC2130 SPI functions to work.
Tom has more tips and tricks on the different functions

Now we need to install a required library to make the FW be able to communicate with the drivers.

Open the Stetch menu > Include Library > Library manager
And just search for TMC2130 and install the library from teemuatlut

Now we’re ready for compilation.
If you have a heated bed or other mods, make sure you do the necessary changes in the FW before you upload.

Upload and test your setup

Congratulations you now have a smart K8400! :slight_smile:

1 Like

We love seeing these kinds of stuff

1 Like

Excellent info, thank you!

Adding one more info here (not really related to this, but will help others trying to do the same.

There is a bug in latest Marlin fw 1.1.8 in Velleman K8400 configuration.h file, so you can not compile it directly. (Lots of people have minimal capability to find out what is wrong).

Problem is on line 788 where the Y_MIN_POS is set to 20, sanity check gives error as the bed size is over bounds.

Change value 20 -> 0 (zero) and you can compile without errors

Issued a bugfix request in https://github.com/MarlinFirmware/Marlin/issues/10750

Oh, and the Z steps original value with original controllers is not 4166.66, but 4266.66 :wink:

1 Like

Thanks for this great guide!

i could successfully implement this solution to the k8400

also i need to mention a few points:

first and very important step dont use the stable build 1.1.8
the 2130 is not working good with that, i’ve wasted several hours of trying to succeed.

use the latest version of 1.1.x

The daily bugfix build (bugfix-1.1.x.zip — Proceed with Caution!)

there everything is almost perfect for the upper scenario, i did not try the homing without the endstops.

you need to enable the TMC2130 in the configuation.h file


  • Specify Stepper Driver types
  • The options are used to determine driver pulse timings as well as more advanced functionality.
  • Stepper timing options can be overridden in Configuration_adv.h
  • Options: A4988, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100,
  •      TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE,
  •      TMC5130, TMC5130_STANDALONE
  • :[‘A4988’, ‘DRV8825’, ‘LV8729’, ‘L6470’, ‘TB6560’, ‘TB6600’, ‘TMC2100’, ‘TMC2130’, ‘TMC2130_STANDALONE’, ‘TMC2208’, ‘TMC2208_STANDALONE’, ‘TMC26X’, ‘TMC26X_STANDALONE’, ‘TMC2660’, ‘TMC2660_STANDALONE’, ‘TMC5130’, ‘TMC5130_STANDALONE’]
    #define X_DRIVER_TYPE TMC2130
    #define Y_DRIVER_TYPE TMC2130
    #define Z_DRIVER_TYPE TMC2130
    #define X2_DRIVER_TYPE A4988
    #define Y2_DRIVER_TYPE A4988
    #define Z2_DRIVER_TYPE A4988
    #define E0_DRIVER_TYPE A4988
    #define E1_DRIVER_TYPE A4988
    #define E2_DRIVER_TYPE A4988
    #define E3_DRIVER_TYPE A4988
    #define E4_DRIVER_TYPE A4988

and i also had to decrease the Travel Acceleration


  • Default Max Acceleration (change/s) change = mm/s
  • (Maximum start speed for accelerated moves)
  • Override with M201
  •                                  X, Y, Z, E0 [, E1[, E2[, E3[, E4]]]]

#define DEFAULT_MAX_ACCELERATION { 1000, 1000, 70, 10000 }


  • Default Acceleration (change/s) change = mm/s
  • Override with M204
  • M204 P Acceleration
  • M204 R Retract Acceleration
  • M204 T Travel Acceleration
    #define DEFAULT_ACCELERATION 800 // X, Y, Z and E acceleration for printing moves
    #define DEFAULT_RETRACT_ACCELERATION 1000 // E acceleration for retracts
    #define DEFAULT_TRAVEL_ACCELERATION 1000 // X, Y, Z acceleration for travel (non printing) moves

cheers and have fun

1 Like

Thank you for implementing those drivers!

I had to enable endswitches like that :slight_smile:
In the configuration.h file :

// Enable pullup for all endstops to prevent a floating state
// Disable ENDSTOPPULLUPS to set pullups individually

Now it works!

PS: heatsinks are required, otherwise it will lose position and printe anything but the right gcode. At least that’s my experience! I also recommend cooling the heatsink with a silent fan.

1 Like

Thank you everyone for the feedback, I am now in the moment of testing it with the latest stable 1.1.9 build.

and as @unclescrooge said, heatsinks are required, I even replaced the cooling fan to a bigger one right over the board to deal witht he heat.

I’ll come back with results when I have time since I studiying right now and finals are at the corner

Hi Enduro,

Thanks for your guide. Made the hardware and going to modify the software now. Did you use 1.1.9 already? Are there any more remarks to make before I start this creepy job?

@enduro @creisey @poteroa

I can’t manage the firmware, can’t find some above mentioned items…
Please, does anyone have a working firmware with TMC2130 for me?
I would be very grateful.

Some time later: Tried some things, but it doesn’t work. Can’t use an old Configuration_adv.h in a new sketch… If I use a new adv.h, it doesn’t work either.

Please could someone put a firmware here?

update 2: Managed now to compile the sketch and upload it succesfull to the printer, but then the display freezes, can’t do anything with the scroll-knob. It happens both with Marlin 1.1.8 and 1.1.9
Can upload the old firmware again without problems.

update 3: Why does the guide not mention to copy the old ultralcd.cpp file too, to get a working display?
The display shows text now but is still freezing.

Please, please, is there somebody around who can provide me with a working TMC2130 Firmware for the Vertex?


You already have the working firmware.
The firmware provided from the original link is the one you need.

There is just some stuff you need to modify in Marlin to use the alternative settings for TMC2130. Just follow the guide and check my remarks.

Oh, one thing.

The original motors are just too much for the TMC2130, the TMC is rated to much lower amps in continuous load, so they will start to cause troubles in long prints.
Only way to fix this is to change the motors to 804´s, I went through this problem so I am talking from experience. Or, you have to lower the speed considerably, like 50%.


Thank you very much for your answer. After a week I managed to get the firmware up and running. I couldn’t upload the firmware without errors. But ultimately, it succeeded with Marlin 1.1.9 with copied and pasted text of the configuration.h and adv.h.
With stealthChop I get layer shifts, but in spreadCycle stepping mode it’s running fine. But didn’t do long prints yet.

My default print speed is 60 mm/s. Is that too fast?
And what do you mean by ‘804s’? Which max. current should it be?

Thanks again.

Hi svdv.

I mean with the “804´s”, motors that have near same characteristics
as 811 ones, but they consume much less Amperage in use, so the layer shifting should not happen. TMC 2130 can not hold the high current draw that the original motors take, they are rated to max 1.2A, with short time 2.5A peak.

So, I noticed that if the head slightly touches the print, the layer will shift as the stepper can not provide the current needed to push through the “blob”.

The power supply is also too small, if I recall right its only 150W, I will upgrade it soon to 200-250w.

So, the original motors are wantai 42BYGHW811, they have rated current at 2.5A max.
Alternative motors which will work with the TMC2130 are 42BYGHW804, with rated max amps of 1.25A. TMC2130 will work much better with them.

The are some things you need to consider though, the bed should (Z axle) still remain with the original stepper controller and 811 motor. Same with the extruder motors, as stated earlier.

So you really only need to replace the X & Y motors + TMC2130´s for them to get the printer significantly quieter.

I do run my printer quite slow, as it gives better print quality and I have e3dv6 head in it.

I think I am running mostly at 40-45mm/s, I have also added a fan to cool the TMC´s.


42BYGHW804 is some what weaker than 811, but if everything is set ok, there should not be any issues running the Vertex with them. Check of course that belts are not too tight and the head assembly moves easily, and remember to lubricate the metal rods. I use grease made for sleeve bearings that I also use in my RC heli´s.

Specs of the motors:


You can get those motors (D-shaft) from 16-30€ / pce, so not very expensive.

Cheers. :wink:

Thanks again for your reply. In the mean time I am printing fine with the existing stepper motors and I swapped all four stepper drivers (1 printhead). I don’t know if this matters but I’ve also got the stepstick-protectors in between.
Earlier I changed the belts and pulleys to GT2 20 teeth and a 300 Watt PSU for the motors and another 24V PSU for the heatbed. Stepper drivers with heat sinks and an additional cooling fan.
And as I mentioned before I use the spreadCycle stepping mode with 60 mm/s speed and it’s doing well.
My longest print till now is 1h 30, so maybe the misery has yet to come…

With kind regards.