3
\$\begingroup\$

I made a 6-layer board with an ESP32-S3 and two TMC5160 stepper drivers, with external H-bridge MOSFETs (WSD4098DN56 from Winsok). I copied the schematic of common "StepStick" TMC5160 boards from BigTreeTech and Fysetc, and double-checked everything is correct by comparing it to the schematic of the TMC5160 evaluation kit. Here's what I came up with, and how I routed everything on the PCB:

My TMC5160 schematic My TMC5160 routing

Layers 2 and 5 are ground planes, 3 and 4 are power planes (24V DC). I did my best to follow all the PCB layout and routing advices in the driver's datasheet. I placed the MOSFETs on the bottom to dissipate heat to my enclosure. Decoupling and boostrap capacitors are all connected with short, wide traces. All the SPI, DIR, STEP and EN singnals are connected to the GPIOs of the ESP32-S3.

I received my boards pre-assembled from JLCPCB and made sure every connection is correct with a multimeter. Next, I checked the SPI communication and made sure the ESP32 can talk to the two TMC5160 using the TMCStepper library. Finally, I tried using the AccelStepper library to move the motors. The code I wrote is in this GitHub Gist.

While the SPI communication works perfectly, the drivers simply don't power the motor up and move it. The coils are never energized. My code shows these contents of the TMC5160 registers when running my code (it's the same for both drivers):

- GSTAT register: 0x2
    - Reset: 0
    - Error: 1
    - Charge pump undervoltage: 0
- Driver status: 0xE0000000
    - Overtemperature pre-warning: 0
    - Overtemperature: 0
    - Short to ground (phase A): 0
    - Short to ground (phase B): 0
    - Open load (phase A): 1
    - Open load (phase B): 1
    - Standstill: 1
    - CS ACTUAL: 0
- IOIN: 0x30000050
    - ENABLE: 0
    - STEP: 0
    - DIR: 0
    - VERSION: 48
    - Setting driver parameters...
Press enter to continue.
    - Enabling mount drivers...
    - ENABLE pin status: 1
Press enter to continue.
    - Stepper motor motion test...
Press enter to continue.
    - Disabling mount drivers...
    - ENABLE pin status: 0

I can definitely exclude soldering issues, I checked the board under a microscope, and also the same behavior is present on the two drivers on my board, plus on all the other boards. SPI communication works, and I also checked that the TMC5160 sees the STEP, DIR and EN pins changing (I can read their value using the IOIN TMC5160 register). 24V is present in the drivers and H-bridges, and the 5V and 12V internal regulators of the TMC5160 work. I really don't understand why the "open load" bits are set, my NEMA 23 is wired up correctly (triple-checked with multimeter). The GSTAT error bit is also unexplainable, because - according to the TMC5160 datasheet - open load bits do not result in errors, they are only informative bits.

If someone has some experience with Trinamic drivers and has some clue on why the coils are never energized, please let me know and I will make all the tests I can! Thanks in advance

EDIT: Thanks to @MF3, I realized I made a huge mistake when creating the MOSFET footprint (see his answer below):

MOSFET footprint

\$\endgroup\$

1 Answer 1

4
\$\begingroup\$

I use this driver and the open load problem is there when there is a connection problem. But in this case, it looks to me that the footprint of the WSD4098 is wrong: enter image description here

Based on this picture, the Pin 4 should be a Gate and it should not be connected to a Drain, but it does in the next picture: enter image description here

From the same transistor, the Pin 3 is connected to Pin 37 of the TMC5160. This pin is used to control the Gate but it is connected to S2 of the transistor. So same problem.

By the way, if you are planning to redesign, I would consider adding low RG (gate resistors).

\$\endgroup\$
3
  • 1
    \$\begingroup\$ Oh no, when creating the footprint I swapped a gate and a source! Damn, I need to order new boards! Thank you very much. Why do you think gate resistors are necessary? StepSticks don't have them, and the datasheets states that they are optional \$\endgroup\$ Commented Apr 11, 2023 at 12:20
  • 1
    \$\begingroup\$ It is just to reduce losses. If you are going to drive an small motor (24V/2A), don't worry about it. We are actually using a Diode and a Resistor in the gate. \$\endgroup\$
    – MF3
    Commented Apr 11, 2023 at 12:38
  • 1
    \$\begingroup\$ Oh ok, I will research about using a gate resistor. Thanks \$\endgroup\$ Commented Apr 11, 2023 at 13:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.