Difference between revisions of "Electronics"

From ShapeOko
Jump to: navigation, search
Line 6: Line 6:
The typical choice for the ShapeOko is an [[Arduino]], an inexpensive microcontroller board which provides a very good price for the needed precision.
The typical choice for the ShapeOko is an [[Arduino]], an inexpensive microcontroller board which provides a very good price for the needed precision.
==Stepper Shield==
==Stepper Shield==

Revision as of 08:34, 22 March 2014

As noted on the Electronics Overview page, there are a number of components necessary to move the axes of a machine.


A CNC machine needs to be able to take instructions to move to specific coordinates, and convert them into moment-by-moment, movement-by-movement signals for the Stepper Motors by sending electronic signals through the Stepper Drivers.

The typical choice for the ShapeOko is an Arduino, an inexpensive microcontroller board which provides a very good price for the needed precision.


Stepper Shield

In addition to the microcontroller, the machine needs a system to take in the voltage necessary to move the motors and send it to the Stepper Motors.

Since, the gShield (formerly known as GrblShield) has become the standard choice --- this change was made to reduce the cost of the system and match its specifications with the machine's capabilities.

gShield (Arduino Shield for GRBL from Synthetos.com)

Please see the Advanced Electronics page for details on [Advanced_Electronics#Alternative_Stepper_Drivers|Alternative Stepper Drivers].

Pololu A4988 Stepper Drivers


Pololu A4988 stepper driverDriver with labels.jpg

The A4988 stepper motor driver carrier is a breakout board for Allegro’s easy-to-use A4988 microstepping bipolar stepper motor driver and is a drop-in replacement for the A4983 stepper motor driver carrier. The driver features adjustable current limiting, overcurrent protection, and five different microstep resolutions. It operates from 8 – 35 V and can deliver up to 2 A per coil (MAX).

The potentiometers (POTS) on the drivers must be adjusted to control the current passing through the drivers. *See notes on heat below* We want to limit the driver to 1.0 amps without a heatsink and up to 1.5 amps with a heatsink, so we adjust the POT until we measure 0.4-0.6 volts at the marked point. Calculate this for yourself with the formula V(ref) = I(limit) * 0.4

TIP: You'll need a really small screw driver to get the pot to turn.

The ground pin to measure is not circled in the above drawing. It is the pin in the corner closest to the potentiometer screw. Verify this by looking on the bottom at the driver, the silkscreen will say gnd. TOUCHING ANY OF THE PINS SIMULTANEOUSLY (e.g. if the ground from your meter contact two of the closely spaced pins) COULD IMMEDIATELY FRY THE DRIVER. One method to deal with this is to tack a jumper wire to the ground pin with a bit of solder before any power is applied. You can then wrap the other end of the wire around your voltmeters ground lead and place it to the side and free a hand to either turn the pot or contact the marked point.

See the buildlog.net driver shield user guide for more information.

Pololu offered the following advice on setting the current level:

We usually recommend that you do not use the VREF to set the current limit for the driver as this method is harder to get right compared to adjusting the limiting while measuring the actual coil current with a multimeter or similar tool. When setting the current limiting by measuring the actual coil current, you should have your motor hooked up and powered on. If you have to use VREF to set the current, you do not have to have the motor hooked up, or the output enabled.

Here is some advise to new users experiencing heat related problems:

A 24V power supply is overkill in my opinion and is creating many problems for new users with overheating. By default, the driver boards you received will be calibrated for 1A current at 12V. If you fail to adjust the potentiometer down before using them in a stepper shield with a 24V power supply, you are essentially using them at 1.6 - 2 amps, Very close to the max rated current and you may destroy them if there is no heat sink.

Although the allegro a4988 "Pololu" drivers are rated to 35V, Using them at anything above 15-18V creates tremendous excess heat. My advise is to turn down your 24V power supply to 18V. Then adjust your driver current limit pots down before you plug them in. Finally, tune the pot *VERY SLOWLY* to achieve smooth stepper operation. You can tell that the setting is correct by the sound of your steppers and the fact that your chips will be very warm to the touch during continuous operation. The sound should be smooth and quite buzzing. If your chips are so hot you cannot touch them then you are running too high voltage / too much current.

I have seen many different suggestions about tuning the pot by measuring the vref voltage and calculating the current (including the instructions linked above). Again, in my opinion this is totally unnecessary. Just start low and slowly work your way up for smooth operation. No measurements required. Note that it is not necessary to achieve any specific current setting, regardless of what your steppers are rated for.

In addition, if you really have a boner for using 24V, go right ahead. Just be sure to start with the pot VERY low and adjust VERY VERY VERY slow just like outlined above.

Assembling the electronics

Assemble the stepper driver shield If you purchased the Stepper Driver Shield as a kit, you'll need to solder the parts yourself.

Tip A great way to get the pins aligned properly is to actually plug the un-soldered header pins into the Arduino, and then set the driver shield on top. The pins will be aligned and allow you to easily solder them in place.

A complete video guide to assembling the buildlog shield is available http://j.mp/Lal92X

The stepper shield allows you to configure the drivers to use microstepping by adding jumpers to the pins along the center of the shield. We want to use microstepping on the x-axis and y-axis, but not the z-axis. Connect all three pairs of jumpers for X and Y to indicate 16 microsteps. Leave the pins "un-jumpered" for Z and A.

Stepper Shield from buildlog.net

Solder headers to the drivers You'll need to solder the headers to the drivers, too.

Tip You can use the same trick to solder the headers to the drivers and you did to solder the headers to the driver shield. Plug the headers into the driver shield and set the driver on top. The pins will be aligned and allow you to easily solder them in place.

Pololu A4988 stepper driver

Keeping things separated The shield sits extremely close to the Arduino. If it looks like components on the shield are going to touch the Arduino, you'll need to do something to keep them separated. Either insert some insulating material between them, or insert a set of headers between the Arduino and shield.

Driver shield sitting a little too close to the ArduinoDriver shield separated by an extra set of headers Driver shield separated by an extra set of headers


Another option to help seperate the stepper shield from the arduino is to buy the Googly Eye Shield from evilmadscience.com!

Googly Eye Shield from Evil Mad Science

Power Supply

Any power supply that can produce 4.2A - 6A at 18-30v.

Note: We have successfully used 18V and 24v power supplies between 4A and 6A. Other power supplies may work. If you are unsure about anything related to powering the machine: STOP AND FIND A QUALIFIED PERSON TO ASSIST YOU!

I used an old power cord and connected the Load, Neutral, and Ground to the black, white, and green wires.

The COM connection on the power supply should be connected to the - on the driver shield. The +V connects to the + on the driver shield.

Power supply and arduino.JPG

Stepper Motors

The ShapeOko requires at least three stepper motors, one for each axis (Dual-drive Y-Axis is a popular upgrade and is now standard on the ShapeOko 2). The 58 oz-in motors listed are sufficient to drive the Shapeoko, but larger motors can be used. Forum Discussion. See Stepper Motors for more detail.


Ventilation and Cooling

Two 12 volts DC fans in series can be connected directly to the power supply to cool everything as each one will have a voltage drop of around 12 volts. There has been some discussion in the Forums indicating this should not be done. Please research and consider the electrical aspects before doing this.

Further Alternatives

See also Advanced Electronics