0% found this document useful (0 votes)
1K views

Custom Stepper Motor With Creality 4.2.2 Mainboard

This document provides instructions for adding an additional stepper driver to a Creality 4.2.2 main board without soldering. It describes using unused header pins on the board to connect a TMC2208 driver and control a second Z-axis stepper motor. Changes to the Marlin firmware are also required, involving reassigning pins and enabling dual Z-axis support in the configuration files. Testing involves checking the wiring and motor direction before fully integrating the second stepper.

Uploaded by

Kraka
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1K views

Custom Stepper Motor With Creality 4.2.2 Mainboard

This document provides instructions for adding an additional stepper driver to a Creality 4.2.2 main board without soldering. It describes using unused header pins on the board to connect a TMC2208 driver and control a second Z-axis stepper motor. Changes to the Marlin firmware are also required, involving reassigning pins and enabling dual Z-axis support in the configuration files. Testing involves checking the wiring and motor direction before fully integrating the second stepper.

Uploaded by

Kraka
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

How To Add Another Stepper Driver to

the Stock Creality 4.2.2 Main Board


Without soldering directly on the mainboard!

Last Revised: 3/12/2022 - willsside

Please be careful when working with electronics and/or high voltages. All actions described in this tutorial
are performed at your own risk. The author is not responsible for any damages.

This tutorial will describe how to add an additional stepper driver to the stock
Creality 4.2.2 board. The stock board that is shipped with most Ender 3/Pro/V2s have
four integrated stepper drivers onboard (typically TMC2208). These are fine for a
standard printer, however the maximum of four stepper drivers are a limitation when
new features are desired, such as a second extruder or a second z axis stepper motor.

One way to do this is to solder new wires to unused pins on the main integrated
circuit (IC) onboard the 4.2.2 board (STM32F103RET6). However, soldering on the tiny
pins, or on other tiny surface mounted components is very difficult and could cause
damage to your mainboard. Thankfully, there are a few extra headers on the board
that are unused and directly connect to pins on the main IC! This means that we
don’t need to get a soldering iron anywhere near the main board; adding a stepper
driver may be as simple as plug-and-play! (assuming changes in Marlin)
For this tutorial, I’ll be adding a second z-axis stepper. However, the tutorial is
essentially the same for driving any other type of stepper (2nd extruder, 2nd x-axis, etc).

Materials:
- Creality 4.2.2 board (should also work with 4.2.7 board)
- Spare TMC2208 Driver (example)
- 100µF 35v Capacitor (example)
- Dual Z Stepper kit (example kit)
- 42-34 Stepper Motor (42mm x 42mm x 34mm)
- Threaded Rod (365mm)
- Z coupler

If you don’t want to solder or make your own JST / Dupont wires, you can get these:
- Dupont wires (breadboard wires) (example)
- Stepper JST to Dupont wires (example)
- Tiny Breadboard (example) if you don’t want to solder!
Wiring:
On the Creality 4.2.2 board there are 4 pins right above the LCD port that are unused
and exposed (they might be covered with hot glue).

If there are no headers on these 4 pins (just holes), you will need to solder wires or
headers on the board (sorry). However, I think most boards come with these pins.

Two of these pins are VCC and GND (3.3 V and Ground, respectively) and the middle
two are SWDIO and SWCLK. You don’t have to know what they are, but what’s important is that
they are directly connected to pins PA13 and PA14 on the mainboard IC! Therefore, we can

Page 2
reprogram the chip through Marlin firmware to command another stepper driver through these
two pins.
For this case, we will be using our additional TMC2208 driver in STANDALONE mode:
therefore NOT in UART mode. This means that Marlin can’t use UART to talk to the driver to
change max current or for fancy features like linear advance. However, this is okay because all
four integrated TMC2208s in this Creality 4.2.2 board are already in STANDALONE mode. This
also simplifies the wiring, because we will only need two pins to communicate with the driver.
(If you want to use UART, u/LookAtDaShinyShiny has a great tutorial for unlocking the
functionality on the 4.2.2 board too! I wish I’d seen this before I did my mod, it would have saved
me a ton of time!)

Wiring Diagram:
The TMC2208 stepper driver requires only two data pins (STEP and DIR) for use in
STANDALONE mode. Along with those pins, it requires an I/O voltage (VCC) and ground
(GND). You can use dupont wires to directly connect these.

In addition, the driver requires the motor voltage (24V). This can be done with dupont
wires as well, but I’d recommend using some thicker wire (like 22 AWG) to be safe.
The capacitor is to smooth out fluctuations in the 24V line and it should be installed as
close to the stepper driver as possible.
NOTE: In STANDALONE mode (without UART), the MS1 and MS2 pins need to be set
high (VCC) so that the steps are assumed to be 16 microsteps per step. Other configurations
are located on the TMC2208 datasheet (3.4 Configuration Pins). In addition, I set the ENABLE
pin to be always set to GND. This means that this driver is always enabled (cannot be disabled).

Page 3
Personally, I decided to solder the driver to a piece of prototyping board and solder down
the wires too. You can also use a tiny breadboard if you don’t want to solder. Triple check your
connections!

I used a large breadboard first to test functionality

Page 4
Now, it is important to make sure that your stepper motor wires are correct. The four pins
below must be connected to the correct 4 pins on the stepper motor. From the picture below,
M1A and M1B should be connected to RED and GRN (Wires 1 and 2) and M2A and M2B
should be connected to YEL and BLU (Wires 3 and 4).
NOTE: If you get these pins wrong, your stepper motor may make some truly terrible sounds
and vibrate. As far as I know, the stepper motors are NOT damaged from these vibrations. It
seems that different manufacturers may have different coil configurations. No worries though,
you have two options:
1. Use a multimeter to probe the pins on the stepper motor and see which two have
continuity (use the continuity mode on your multimeter). Two continuous pins should connect to
M1A and M1B, and the other two pins should be on M2A and M2B.
2. If you don’t have a multimeter, you can simply try different combinations. Try to switch
two wires at a time (start with inner two and outer two) and try to run the motor briefly.
If you’re using the dupont to JST stepper wires, follow each wire to make sure that they
are going to the correct pins. If they are not, it is very easy to swap pins on dupont connectors.
Also, if the stepper motor is moving the wrong way, you can either switch the M2 and M1 pins
OR change the direction in software (Marlin). Software is much easier.

Last but not least, make sure that no pins can short! For my soldered solution, I put
electrical tape all along the bottom of the perf board. This prevents a short if the board is
touching the printer’s metal housing. If you have a breadboard, you will probably be fine, but just
look out for potential shorts! A multimeter with connectivity checks helps a ton.
After you’ve triple checked your connections, you’re done with wiring! Congrats! Now
time for firmware....

Page 5
Firmware Changes in Marlin:
If you haven’t ever compiled your own Marlin firmware, I’d highly recommend you check
out this video from Teaching Tech about compiling Marlin firmware first. You will need to make
changes in THREE files in Marlin:

Marlin\src\pins\stm32f1\pins_CREALITY_V4.h
Marlin\Configuration.h
Marlin\Configuration_adv.h

This tutorial is specifically for adding a second z-axis stepper driver, but if you are adding
the driver as a second extruder the firmware changes will be different. The changes in
pins_CREALITY_V4.h will be the same, however multiple extruders will need to be defined in
Configuration.h and Configuration_adv.h.

Marlin\src\pins\stm32f1\pins_CREALITY_V4.h
This will reroute the new pins we used to a new stepper motor. After all of the stepper
motor definitions in the file (or honestly, just anywhere), add:

//
// Add custom stepper motor (dual z)
//
#define E1_ENABLE_PIN PC3 //(connect to ground to
always enable)
#define E1_STEP_PIN PA14 //SWCLK (STEP - pulled low)
#define E1_DIR_PIN PA13 //SWIO (DIR - pulled high)

Also, don’t forget to comment out the following check:

// #if HOTENDS > 1 || E_STEPPERS > 1


// #error "Creality V4 only supports one hotend / E-stepper. Comment out
this line to continue."
// #endif

Marlin\Configuration.h
You will need to add a new stepper motor in the Configuration file. In the “Stepper
Motors” Section, make sure to uncomment and define:

#define Z2_DRIVER_TYPE TMC2208_STANDALONE

Page 6
Marlin\Configuration_adv.h
Finally, you will need to configure the new stepper driver to be a second z-axis stepper.
In the “Dual Steppers” Section, make sure to define:

#define NUM_Z_STEPPER_DRIVERS 2 // (1-4) Z options change based on how many

If your stepper turns out to be going the wrong direction, uncomment this line as well:

#define INVERT_Z2_VS_Z_DIR

My config and pin files are uploaded HERE for reference. With these changes, you
should be ready to compile and flash to your printer!

Testing the New Stepper Driver / Motor


Now that you’ve compiled your new firmware and placed the .bin file on the printer’s SD
card, it’s time to test!!!
IMPORTANT:
Triple check your connections and make sure there are no shorts. We don’t want
to release the magic smoke on your mainboard or your extra stepper driver; there’s no
way to put it back.
Also, make sure to first unscrew the original z-stepper motor’s coupling to the
threaded rod. This will make sure that the steppers don’t fight each other if the new
stepper motor turns the wrong direction.

When you are confident that the connections are correct, reinsert your SD card with the
new firmware and turn on the printer. You should hear the new stepper motor go “THUNK” as it
is enabled automatically (nothing wrong with the sound). Once you’ve confirmed that nothing
has broken, you can start to test!
Now, go into your printer’s menu and command the printer to move up or down 5 mm. If
the second stepper motor starts moving, you did it!!!
Before you reinstall the original stepper motor, make sure that your stepper moves
exactly how much you command it to. Get a ruler and check that the x-gantry moved up 5 mm. If
it is moving double the commanded amount (10 mm), make sure that your microsteps are set
correctly (refer to MS1 and MS2 in the Wiring section).
Finally, reinstall the original z-stepper motor coupler and command the z-axis to move up
or down 5 mm. If both are moving fine (and at the same speed), congrats!!! You officially have
added a new stepper driver to the stock Creality 4.2.2 board!!!

Error Modes:
- Nothing fried, but the stepper motor doesn’t move when I command it.

Page 7
- Check your wiring (make sure the STEP and DIR pins aren’t flipped: if they are,
you can just swap the pins in the pins_CREALITY_V4.h file)
- Check your firmware
- My stepper motor is moving twice as fast / slow as the original stepper motor
- Your microsteps are probably set incorrectly. On the Creality 4.2.2 board, the
drivers are set to 16 microsteps per step. You will have to make sure that the
MS1 and MS2 pins are correctly configured (look at the wiring diagram).
- My stepper motor is moving in the opposite direction that it should be
- You can change the direction of the stepper motor in the firmware by
uncommenting:
#define INVERT_Z2_VS_Z_DIR
In configuration_adv.h. OR:

- You can swap the M1(a/b) and M2(a/b) pins on the dupont wires connected to
the stepper driver

Getting G34 (Z-Stepper Auto Alignment)


To make G34 work, you will need some type of probe, like a BLTouch, installed on your
machine. Once you have one installed, you will just need to uncomment and define one line in
your configuration_adv.h file:

#define Z_STEPPER_AUTO_ALIGN

You can keep all of the settings as defaults, or change them to your liking. The only thing
I changed was increasing the number of iterations to 10, but that’s not really necessary:

#define Z_STEPPER_ALIGN_ITERATIONS 10 // Number of iterations to apply


during alignment

Once you recompile and flash onto your printer, you should be able to run
auto-alignment and have a PERFECTLY aligned x-gantry for the rest of your life!
I’d recommend setting up a gcode file called “G34” that only has the G34 command
inside it. Then, you can run it whenever you turn on the printer to make sure that the x-gantry is
aligned (you can also make the printer run G34 the second it turns on!).

HERE is a video of G34 in action on my Ender 3 V2 with the stock 4.2.2 board!

Page 8
Finishing Touches
Don’t forget to change the reference voltage on the new stepper motor! Because we are
in STANDALONE mode, the stepper current cannot be changed in firmware. You will need to
change the reference voltage via the screw on the driver itself. Teaching Tech has a great video
describing how to do this (I’d recommend doing it to your integrated drivers as well).

Where do you put the extra stepper driver?? I actually found just enough space to the
left of the main board and hot glued the new stepper driver there. However, if you use one of the
small breadboards you may need to find a place outside the mainboard compartment to leave
the stepper. Just make sure that the heatsink has some airflow to cool it down and mount it
somewhere safe so it doesn’t short!

If you’re interested…

Thank you for making it through my tutorial! I hope it helped. If you are feeling extra grateful, I’d
love if you could buy me a coffee / donate a bit. Thank you!

Page 9

You might also like