Introduction: THB6064AH Nema 23 Motor Driver

The THB6064AH chip can be used to drive a nema 23 stepper motor using the commands from an Arduino. This instructable depicts the assembly of a version 1.1 Massmind 6064 stepper motor kit.

Step 1: Set Up

Take stock of the components. In addition to what you see in the picture, a heat-sink, thermal paste, solder, soldering gun, magnifying glass, bright lamp, clamp, various pliers, drill, drill bit, and 3 screws are also required.

Step 2: Soldering

Secure the pcb in a clamp and plan the order that you will solder the components. Start with the two surface mounted R200s and test pins at VREF and GND. Next solder the LEDs, the small resistors, the small capacitors, the network resistors, potentiometer, medium capacitor, jumpers, terminal block, then the shrouded header. In general I started with the smallest components and progressively worked towards the largest ones. At this point align the THB6064AH pins on their respective solder points and ensure the chip is also aligned appropriately relative to the three mounting holes on your heatsink. After soldering the chip then bend the legs of the big capacitor and solder it in last.

Notes:

Be mindful of the placement of the resistors and the LEDs - they can be easy to confuse. It is advisable to use a multimeter to test all of the resistors prior to soldering them. I found it useful to create a mockup of the resistor placements prior to soldering them.

The IC will generate some heat when the motor driver is being used. The heat is disipated with a heat-sink. The THB6064AH will have to lie flat with respect to the heat-sink surface so align the IC and then drill holes in the heat-sink before soldering the IC to the PCB. I found it necessary to use a few thin spacers between the pcb and the heatsink to maintain good alignment. Three screw holes need to be drilled into the heat-sink. One hole to mount the pcb and two holes to mount the IC.

Apply a thin coat of thermal paste between the THB6064AH and the heat-sink. Secure the IC with screws.

Step 3: Connecting the PCB to Your Ramps Board.

The version 1.4 ramps board has 5 carriers for the Allegro Pololu A4988 stepper driver. Each of these drivers uses 16 pins but the THB6064AH only needs 4 pins: Step, Dir, VDD and GND. I made a small PCB that sits where an A4988 normally does but just makes the pins accessable so that I could easily and securely run a cable to the THB6064AH board.

The Driver can also be connected directly to an arduino. If you want to run it this way here is a simple test sketch for the arduino.

/*
Date: Nov 16 2015 Build: 0.0.1c

Title: Stepper_Test_02

*/

Variable declarations int stepPin8 = 8;

int dirPin9 = 9; int minDelay = 100;

int maxDelay = 2000;

boolean rotation = LOW; //low = cw, high = ccw

void setup() {

// initialize pin input and output

pinMode(stepPin8, OUTPUT);

pinMode(dirPin9, OUTPUT);

digitalWrite(stepPin8, LOW);

digitalWrite(dirPin9, LOW);

}

void loop() {

for (int speedUpDelay = maxDelay; speedUpDelay > minDelay; speedUpDelay--)

//reduce the delay to increase the rate of rotation

{ digitalWrite(stepPin8, HIGH);

delayMicroseconds (speedUpDelay);

digitalWrite(stepPin8, LOW);

delayMicroseconds (speedUpDelay); }

for (int fullRotation = 25600; fullRotation > 0; fullRotation --) // 25600 = 1/16 stepping mode

{ digitalWrite (stepPin8, HIGH);

delayMicroseconds (minDelay);

digitalWrite(stepPin8, LOW);

delayMicroseconds (minDelay); }

for (int slowDownDelay = minDelay; slowDownDelay < maxDelay; slowDownDelay++) // increase delay to decrease rate of rotation

{ digitalWrite(stepPin8, HIGH);

delayMicroseconds (slowDownDelay);

digitalWrite(stepPin8, LOW);

delayMicroseconds (slowDownDelay); }

rotation = !rotation;

digitalWrite (dirPin9, rotation);

}

Step 4: Testing the Driver.

1a.) Connect the stepper motor to the driver. (In my case I pluged Blue to B-, Red to B+, Green to A-, and Black to A+.)

1b.) Connect a 24V 3A power source to the driver's M+ and motor GND. Don't power up the 24V supply yet.

2.) Connect your driver to your arduino. I used an Arduino Micro without any kind of shield.

2a.) I plugged the driver's +5V to a 5V power souce (I used a usb cable attached to an old keyboard encoder but you could use any +5V source)

2b.) I plugged the driver's ground into the usb source's ground.

2c.) Connect pin 8 from the arduino to Step on the driver.

2d.) Connect pin 9 from the arduino to Dir on the driver.

3.) Plug your arduino into your computer and upload the test program

4.) Turn on your 24V power supply.

Step 5: Extra Precautions

If you intend to place the driver in an enclosed space you may choose to enhance the cooling capacity of the unit by adding a fan. Pictured here is a 12 volt case fan screwed onto the heatsink.

Comments

author
JamesNewton made it! (author)2014-02-05

This is a nice overview! Thank you for posting this. For /detailed/ assembly instructions, PLEASE use the manual at:
http://www.massmind.org/Techref/io/stepper/THB6064/index.htm
because there are additional details in the assembly that are not covered here. Especially related to the placements of the error LED and some resistors.

THB6064AHv1top.jpg
author
JamesNewton (author)JamesNewton2014-02-05

In fact, the placement of the red error LED in the pictures above is incorrect. The instructions say: "On the Rev 1.1 PCB, with a standard build, the Red LED should be installed between the ERR and Q1 labeled holes (long pin in the square hole as always) and NOT at the position labeled ERR near the 5V indicator LED."

It also says "On the Rev 1.1, PCB the "ERROR LED" resistor (originally R36) is labeled R7 on the new board and is the 4K7 resistor. The red LED should be installed to the right of R2 above J7 with the long lead in the square hole marked Q1 and the short lead up and to the right in the round hole nearest the "E" in ERR. R2 is not used. This provides a simple error indicator via the LED and no amplification of the error signal."

There is is an /option/ to add error feedback to the motion controller from the driver with a transistor and the other LED position.

author

The tutorial has been updated to reflect these changes.

author

I would be *very appreciative* to see high res closeup images (front and back) of a completed Version 1.1 THB6064AH kit. The online manual only shows the version one. Please help!

author

I've just completed a video assembly guide for rev 1.1 PCB at

It's rather long, but you can jump to any part pretty quickly using the links in the comments (click "show more"). And here is a high resolution photo of the finished board. I'll be posting this today on the web page as well. Feel free to copy it here if you like.

IMG_20140212_123918_749.jpg
author

Win Win Win Win Win Win Win

About This Instructable

17,772views

29favorites

License:

More by McColm_Robotics:THB6064AH Nema 23 Motor Driver
Add instructable to: