Introduction: Making the GShield Circuit
I have always been interested in computer numeric control (CNC) and how a a 3D printer works. I have a Monoprice maker Select and i love it, but i wanted to know more about how it worked from an electrical engineering standpoint. So for my project for a class was to make the grbl shield or gShield circuit, and have this circuit interpret gcode and move the stepper motors accordingly. I wanted to do this as anyone can buy the gShield and make it work, but i wanted to delve in and understand it more. So what i did was look at the circuit schematic for the gShield and made the circuit from scratch on a breadboard. As time progressed, i started to realize this was an extremely ambitious, and the project went from assembling 3 stepper motors working with gcode to trying to just have 1 work! I have been working on this project for about 3 months, and in the end it does not work, but what is more important than a working product is what i have learned from doing the entire thing.
This gshield works in unison with an arduino in order to work. The basic principle is that you have a computer or laptop send gcode to an arduino loaded with the gshield firmware, and then the arduino was used to implement the control signals used in the stepper motor driver.
Step 1: Research and Things Learned
ALWAYS READ THE DATASHEET! So many issues and questions i had were solved by reading through the data sheet. This includes the range of values a pin can take, including minimum, nominal (recommended), and maximum values. This can also tell you what a pin is pulled to if left floating, like being pulled to ground or Vcc. The IC that i used in this circuit is a DRV8818, a motor controller with 2 H-Bridges. This datasheet for this chip was extremely helpful as it gave good explanations on what a pin did and how it would operate.
2) SMD Soldering:
One of the difficulties i had with this project was the motor driver chip was 28-pin HTSSOP, which meant it was SMD and had to use an adapter to get it to plug into a breadboard. SMD soldering can be harder than through-hole, but the method i used made it pretty easy. This method is the tack and re-flow method. This consists of putting flux onto the pads of the 28-pin HTSSOP adapter, lining up the chip on the adapter, then soldering one corner pin, then the pin diagonally across. This holds the chip in place as you solder all of the other pins. It is very important at this point to re-flux the pins/pads, as the flux put down before has now burned off from the previous soldering. Now the trick is to not try and solder each pin individually, but run the solder iron down and away from the chip on the pin. You should put a little solder on the iron tip, making sure to not to put to much or to little. Once there is enough solder on the iron tip and flux on the pin/pads, then "brush" the pins with the iron. Here is a great video showing this method.
3) How a Stepper motor driver works
For the DRV8818, the 3 main control pins we need to be concerned about are enable, direction, and step. Both enable and direction can only be logic high or logic low, and from the datasheet you know that the enable pin is an active low, meaning logic high will disable the motor. The step pin will tell the chip to step the motor once on every positive edge. This would mean for a 200step/rev motor would need 200 rising clock edges to rotate 1 full rotation.
4) Use an oscilloscope to probe a circuit
A very helpful this i learned to do was to use an oscilloscope to see how far along the data was getting in the circuit, and to see if everything was behaving accordingly. Using the scope, i was able to determine that the commands being sent were fine, and all the control signals acted as they should have.
Always check polarity when building a circuit, especially when dealing with electrolytic capacitors. Note: Ceramic and tantalum capacitors do not have polarity, and electrolytic capacitors do.
Step 2: Difficulties Encountered
One problem i had was in the beginning the circuit was not doing anything at all. After many hours of diagnosing and checking my work, i had found out that i had hooked up Vm (Motor voltage, 12V+) to the Vcc rail, which meant the chip was receiving 12V (30V at one time) for Vcc. So after fixing that issue and making sure the power was straightened out, the motor finally had a response to the gcode.
The most difficult problem i encountered was the motor driver burning 7 times. This was due to me not knowing what exactly was causing the burning. I rebuilt the circuit on another breadboard but still encountered the same problem. But after i had almost given up, i was browsing around the internet about motor drivers in general and had learned that you CAN NOT unplug a stepper motor and change the phase wires while there is power to the system. This was what had caused all of the motor drivers to burn. This was a very important lesson learned. In general, always turn off power to a circuit when changing something in the circuit, not only for your own safety, but for the safety for all the parts in the circuit.
Step 3: Workspace
This project was done in a maker space called M5 at the University of Massachusetts Amherst. It is always important to have a well equipped lab/work space for doing all of you projects at. While the space had most things need for doing projects like this, some things could be done better and i believe should be a standard for all work spaces for use on similar projects.
Each station should have :
oscilloscope - useful for diagnosing issues in a circuit. 2 channels are great
bench power supply - 2 channels to help isolate power. could be useful to have 2 power supplies, i needed 2
multi meter - helpful diagnose problems in a circuit
small screwdriver set - helpful for terminal blocks and other uses
pair of wire strippers - useful for making jumpers. I really like my personal one, but regular ones are a must.
small needle nose spring action pliers - extremely annoying to use non-spring pliers, more annoying when they are to big for what you need.
a set of good tweezers - A must for SMD, helpful for delicate and precise work
transistor tester - extremely helpful to test the values of parts.
It is also good practice to keep the work space clean and organized, as it being messy can lead frustration when something it not going right and you are having a hard time finding a tool that you swear was right there a minute ago.
Step 4: Accomplishments
In this whole endeavor, i have learned many important ideas that i know will always come in handy This includes SMD soldering, how a stepper motor works and a stepper motor driver works, compact bread boarding a circuit, fundamentals of an H-Bridge, fundamentals of a full bridge rectifier, how a MOSFET works, troubleshooting and diagnosing a circuit.
Even though my project does not work in the end, i have learned so much about a variety of things. When doing projects, it is important to remember that even in failure, you still learn so many new things. It is important to take what you have learned and apply it wherever possible.
If someone wanted to do something similar to what i have done, i recommend when buying the parts, buying either buying bulk variety packs of resistors and capacitors, or buying a couple more than need, just in case.
What i think i should do next is try and rebuild the circuit once again, but maybe try a different motor driver chip, like the DRV8825.
5 years ago
Good instructable, thanks for sharing :)