Go Down

Topic: The Motor Driver for ladyada's Motor Shield (Read 4915 times) previous topic - next topic


Apr 13, 2010, 06:54 am Last Edit: Apr 14, 2010, 05:32 am by bdragon123 Reason: 1
Is anyone using ladyada's Motor Shield?

Feel free to try this motor driver.



AMC(Analog Motor Control) library is base on ladyada's Arduino Motor Shield.


AMC can drive both DC Motor and Stepper Motor in the same time.     With the Arduino's Servo library , the motor shield can also drive two extra servo motors.

Feature :
- Easy to use
- Analog drive up to four DC Motors for bi-direction control
- Analog drive two stepper motors in the same time , it does not need to wait until the other one finished stepping
- Stepper Motor Support : Bi-polar , Unipolar 4 phases , Unipolar 3 phases

Arduino Motor Shield Hardware :
- 74HCT595N
The 74HC/HCT595 is an 8-stage serial shift register with a
storage register and 3-state outputs.

- L293D
The L293 and L293D are quadruple high-current
half-H drivers. The L293 is designed to provide
bidirectional drive currents of up to 1 A at voltages
from 4.5 V to 36 V. The L293D is designed to
provide bidirectional drive currents of up to
600-mA at voltages from 4.5 V to 36 V. Both
devices are designed to drive inductive loads such
as relays, solenoids, dc and bipolar stepping
motors, as well as other high-current/high-voltage
loads in positive-supply applications.


With the Arduino's Servo library , the motor shield can also drive two extra servo motors.

With the current servo library, a standard Arduino can drive up to 12 servos motors


I'm using the Adafruit motor shield to drive my CNC machine, I have two steppers for horizontal movement and one servo for vertical (the vertical isn't for 3d printing, it's just to lift the tool so it can move to a different area to cut).


With Arduino's servo library , it may drive 12 servo , because all the pins are free.

But for the motor shield , two servo.

And you wont only need servo in reality I think. ;)


Parcanman ,

may I have a look at your Arduino CNC machine?   I'm interested in this project also.



Apr 14, 2010, 06:30 am Last Edit: Apr 14, 2010, 06:36 am by Parcanman Reason: 1
I still have some work to do, (not the least of which, finding my digital camera), but I'll get some pics up real soon.  Basically, it's built as cheaply as possible, mainly out of 1"x3" pine "strapping".  I have two old bipolar steppers I salvaged out of an old DJ light (they're the same ones used in printers).  I have a threaded rod running through skateboard ball bearings with a nut connected (zip tied) to a flat aluminum strip so that when the motor turns the rod, the nut moves the strip back and forth the length of the machine.  Above the rod is a 4'x1' pine board for a work surface, with small aluminum angle-irons for rails.  The gantry (also made of strapping) rides on shower curtain rollers (the ones for the big glass shower curtains) which ride on the top and sides of the angle-irons.  The gantry has a cog belt from an inkjet printer I found on the side of the road which moves a piece of strapping with nylon spacers used as bushings that ride on 3/8' steel rods.

I built the whole thing for about $100 bucks (including the Arduino and motor shield, but not including the motors and printer parts).  Right now it just draws squares with a sharpie, but I'm trying to calibrate it and get it working with ReplicatorG.

I have no prior CNC machine experience, so the main purpose of this machine is to figure out how to build a working one, and hopefully use it to make parts for a better one in the future.

The motor shield works great for the two stepper motors (they're relatively small) and I'll have a servo for vertical movement.  Right now I'm just focusing on cutting 2D shapes out of wood with a RotoZip tool, the vertical axis is just for picking up the tool to move to another place and for plunging into the wood, I'll worry about 3D printing on my next build.  The chips on the board get somewhat warm (but not hot) when the motors have been running hard for a while, so I'm not sure I'd recommend it for motors bigger than those in a printer without the use of heat sinks.  I'm powering the motor driver (and thus the motors) on 12vdc from an old ATX computer power supply, this also gives me 5vdc that could power the logic circuits (the Arduino), but for now I'm just running that off USB.

The problem with the motor shield is that it can only handle two stepper motors, which is why I'm not focusing on 3D printing just yet (I don't really trust the servo to get the same accuracy as the steppers).  I remember seeing something in the documentation for the stepper library about wiring a ULN2003/4 chip to run a motor with only 2 wires to the Arduino instead of 4, so I'm going to look into that before I start getting into 3D printing.  The problem with the motor shield is that it uses 4 wires per stepper, so there's 8 less pins I can use for other things (like limit switches), but it does leave pins 2 and 13 open as well as all of the analog pins.  I'm probably going to use pin 2 for a bunch of limit switches wired in series.

Pin 13 is not used, but unlike pin 2 which is wired to a separate terminal hole for use, pin 13 is just terminated on the board.  When I soldered the board together, I stuck an LED in with the leads jammed into the holes with the header pins for GND and 13 so I can use that as a status LED.  I wouldn't really want to use pin 13 for anything other than an LED since it already has one on it which could give strange readings.

Overall, I like the Adafruit motor shield, it's great for plug and play robotics and stuff, but I think I'm going to go the RepRap way and just make my own board with the ATMega328 and motor controllers all on one board to simplify things.


Sounds interesting :)

I tried the Servo library , its very accurate and reliable than driving stepper motor in my view point.    Because stepper motor lost steps , especially the cheaper one , drain a lot of power and did nothing.

For the 2 wire Stepper motor , that's bipolar stepper motor in Full Step Drive.    Since the other two wire are always drive inverted , so you can just add two inverters for them.


Let me rephrase my previous statement on servo accuracy:

I don't have much money left to spend on this project and I don't trust the servo I have on hand to be as accurate as the steppers that I have on hand.


But for the motor shield , two servo.

For anyone reading this thread that wants to drive more than two servos, that shield has solder pads for the 6 analog pins that can be used as digital outputs to drive another 6 servos


The servo headers on the shield are wired to pins 9 and 10 which are PWM pins, do you need PWM to drive a servo or is it just coincidental?


The servo headers on the shield are wired to pins 9 and 10 which are PWM pins, do you need PWM to drive a servo or is it just coincidental?
The Servo library that was used in release 0016 and earlier only works on pins 9 & 10 so those pins are natural choice.

The servo library from 0017 onwards does not use PWM and can work on any pin.


I have a question , if people use more than 2 servo on this motor shield , will this motor shield still be able to drive 4 DC Motors or 2 stepper motor in the same time?


I upload the video.

For debug , I made 2 LED panels , so the user be able to see what really happen when operating a stepper motor.


I'm using Arduino with Ladyada Motor Shield.
Everything works fine with ladyada library, but I can't make it works with the AMC one. When I run the example sketch, motors freak out.

Must I plug my motors differently than with adafruit library (Unipolar - 5 wires ) ?
Is there a tutorial which explain how to use AMC library ?

Thank you !

Go Up