Difference between revisions of "Projets:Perso:2011:Motorshield"

From Electrolab
Jump to: navigation, search
 
(23 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Project
+
= Introduction =
|name= Motorshield
+
What should you do if you wanna plug motors to your Arduino ? There's [http://ladyada.net/make/mshield/index.html this cool Motorshield from Adafruit industries], but it handles such little currents ! Fortunately, there are other nice chips out there...
|author= Clément
+
|proposal_date= 25/10/2011
+
|abstract1=So there's this cool Motorshield from Adafruit industries, but it handles such little currents !
+
|abstract2=And there's this chip, quite cool, which handles a bit more...
+
|abstract3=OpenHW is about commiting patches, right ? So here's mine !
+
|tags=arduino motor
+
|where=Anywhere
+
|for_who=Anyone using the motorshield and in need of a few more amps
+
|official_electrolab_project= not yet
+
|budget= 0 (perso)
+
|number_of_members= 1, on the shoulders of many others
+
|estimated_time= few nights of work for the first prototype
+
}}
+
  
TODO:
+
OpenHW is about commiting patches, right ? So here's mine !
Move those pics to a sub-page/download, or sort them.
+
[[File:Motorshield-overview.jpg|400px|center|thumb]]
Add a true overview pic with the board and adapted motors/loads.
+
<center>The current prototype.</center>
Create assembly sub-page
+
Clean this page
+
Add history/release notes in an explicit way
+
  
[[File:Motorshield_ALL.png|thumb|overview]]
+
== Latest news ==
[[File:Motorshield_top.jpg|thumb|Top view of the current prototype]]
+
* This project has been put to good use for a student project, stay tuned for more information/pics !
[[File:Motorshield_bot.jpg|thumb|Bottom view of the current prototype]]
+
* Almost everything is ready to launch the first production batch. Pre-order will be opened soon.
[[File:Motorshield_SCH.png|thumb|Schematic]]
+
* This design serves as a reference for the ongoing tests on PCB fabrication. We're pretty close to being able to manufacture stuff like that in the lab :)
[[File:Motorshield_TOP.png|thumb|Top copper]]
+
[[File:Motorshield_BOT.png|thumb|Bottom copper]]
+
  
= Introduction =
 
 
== Design goals ==
 
== Design goals ==
The goal of this project is to '''replace the weak L293D''' of Adafruit's Motorshield with a stronger chip, a [http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=MC33932&fsrch=1&sr=2|Freescale MC33932], which is a fully integrated dual H-bridge rated at 5.0A (vs 0.6A for the L293D).
+
* The goal of this project is to '''replace the weak L293D''' of Adafruit's Motorshield with a stronger chip, a [http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=MC33932&fsrch=1&sr=2|Freescale MC33932], which is a fully integrated dual H-bridge rated at 5.0A (vs 0.6A for the L293D).
One major constraint is to '''keep a full pin/function compatibility''', so that this shield can be a drop-in replacement for Adafruit's version.
+
* One major constraint is to '''keep a full pin/function compatibility''', so that this shield can be a drop-in replacement for Adafruit's version.
I also chose to use mostly '''SMD components''', because I am fed up with all those thruhole resistors: people should live with their time, and in my opinion, those are a thing of the past.
+
* I also chose to use mostly '''SMD components''', because I am fed up with all those thruhole resistors: people should live with their time, and in my opinion, those are a thing of the past.
  
Because this project is intended as a patch/commit for adafruit's motorshield, I've decided to follow the organization of their webpage documenting their version. Please check [http://ladyada.net/make/mshield/index.html|their own webpage] for further information and full credits.
 
  
Note that I might call this shield "the Arduino sHHHHield - an Arduino shield with four H bridges" and am presently claiming full fame and credits and everything for such a lame joke name :-)
+
Note that I decided to call this shield "the Arduino sHHHHield - an Arduino shield with four H bridges" and am proudly claiming full fame and credits and everything for such a lame name :-)
  
 
== Features ==
 
== Features ==
Line 64: Line 44:
 
Yeah, I know, I hate those "see conditions below" things, but hey, this is only a prototype at the moment, so live with it :)
 
Yeah, I know, I hate those "see conditions below" things, but hey, this is only a prototype at the moment, so live with it :)
  
= Make it! =  
+
= Current version =
As you can see, the board design wasn't really optimised for DIY processes:
+
Please note that this is an ongoing project: this page itself is a work in progress. Use at your own risk :)
 +
 
 +
Current prototype ''do work'', but a better version is expected sometime soon enough.
 +
 
 +
You can also check past versions of this project:
 +
* nope, actually this one is the first :-)
 +
 
 +
== Make it! ==
 +
Because there are quite a lot of pictures of the build, check the sub-page describing the [[Projets:Perso:2011:Motorshield:assembly|assembly process]].
 +
[[File:Motorshield-lab.jpg|400px|center|thumb]]
 +
<center>A nice SMD assembly station, isn't it ?</center>
 +
 
 +
The current board design wasn't really optimised for DIY processes:
 
* 6 mil spacing (0.15mm), 12mil tracks: so to speak "class 5" (not sure this is an international thing ; the higher the class, the harder to manufacture. It is probably a french standard).
 
* 6 mil spacing (0.15mm), 12mil tracks: so to speak "class 5" (not sure this is an international thing ; the higher the class, the harder to manufacture. It is probably a french standard).
 
* 0.3 mm vias
 
* 0.3 mm vias
 
These are Pcb Pool standard process parameters - board house I went with for the first prototypes.
 
These are Pcb Pool standard process parameters - board house I went with for the first prototypes.
 +
[[File:Motorshield_TOP.png|400px|center|thumb]]
 +
[[File:Motorshield_BOT.png|400px|center|thumb]]
 +
<center>Don't try this at home, kids !</center>
  
 
You can either:
 
You can either:
 
* go for a pro fab house
 
* go for a pro fab house
 +
* buy one of our prototypes
 
* tweak the current design to adapt to your manufacturing abilities
 
* tweak the current design to adapt to your manufacturing abilities
* come with us tweak the lab pcb fab equipment to achieve such results. Amusing fact: just for fun (like 3am on a wednesday stupid challenge ;), we tried to make the bottom layer with our not-yet-trimmed pcb-process at the lab, and it went out suprisingly well. It is highly probable that in a rather near future we will be able to actually manufacture such PCB directly at the lab (of course, without metal vias, soldermask and silkscreen: those are for quite later on ;)
+
* come with us tweak the lab pcb fab equipment to achieve such results
 +
''Amusing fact: just for fun (at 3am we get sweet spots for stupid challenges ;), we tried to make the bottom layer with our not-yet-trimmed pcb-process at the lab, and it went out suprisingly well. It is highly probable that in a rather near future we will be able to actually manufacture such PCB directly at the lab (of course, without metal vias, soldermask and silkscreen: those are for quite later on ;)''
  
Because there are quite a lot of pictures associated with that, check the sub-page describing the [[Projets:Perso:2011:Motorshield:assembly|assembly process]].
+
== Use it! ==
 
+
= Use it! =
+
 
There's no deep, thorough tutorial about this yet. Check what is done with the original adafruit version, and come back later to check what we are using this for - once I document the related projects ;)
 
There's no deep, thorough tutorial about this yet. Check what is done with the original adafruit version, and come back later to check what we are using this for - once I document the related projects ;)
 
Spoiler alert: one of them is related to Physical Etoys/Squeakbot (STFW :)
 
Spoiler alert: one of them is related to Physical Etoys/Squeakbot (STFW :)
 
Hint: having 8 half bridge on a board means you could control, like, 8 lamps. Or whatever requires few amps.
 
Hint: having 8 half bridge on a board means you could control, like, 8 lamps. Or whatever requires few amps.
  
== Things you should know ==
+
More info on the [[Projets:Perso:2011:Motorshield:use|related sub-page]].
Remember, YMMV: this is a prototype, not a commercial product.
+
* PWM frequency shall be under 11 kHz according to datasheet. It can be selected when you create a ''AF_DCMotor'' object: "AF_DCMotor motor_1_or_2(1,MOTOR12_2KHZ);" or "AF_DCMotor motor_3_or_4(3,MOTOR34_2KHZ);"
+
* I think I ended up messing with signals, that is motor x forward/backward isn't 100% garanteed to be the same as for Adafruit's version. That's lame, but it seems okay to me, given that it is a prototype. One can still pilot all four DC motors, you just have to figure out which one is where and goes which way  - or wait for the final HW revision, or the specific SW library.
+
* because of previous issue, stepper support most probably won't work out of the box.
+
* speed value is messed up, see below.
+
* you can read each H-bridge status flags (see datasheet: indicates if everything's fine), if you have the right 0 ohm resistor soldered.
+
  
== Setting speed for DC motors ==
+
= Resources =
The PWMing for speed is an active low on the MC33932 vs an active high on the L293D. I have been lazy to implement a HW thing to compensate for that. I suppose I'll have to decide what I end up doing: either keep the hw simple or respect full pin/sw compatibility.
+
== Download ==
Anyway, on this prototype, speed values are inversed ! that means, "motorX.setSpeed(255);" will stop the motor and "motorX.setSpeed(0);" will have it go fullspeed.
+
Check adafruit version of the library required to use this shield. It works okay. See previous section for limitations and some example code.
  
== Current feedback feature ==
+
Come back later for full eagle files of this design, I'm still trying to figure out a way to upload any kind of file on this wiki !
To use the current feedback feature, you should:
+
[[File:Motorshield_SCH.png|center|400px]]
* have the right 0 ohm (eg, bridge) resistors in place (check schematic)
+
<center>I know, it sucks to have only a .png</center>
* do something like "analogRead(MOTORX_FBPIN)" with "const int M1_FB = A0;//M1 current feedback","const int M2_FB = A1;//M2 current feedback","const int M3_FB = A3;//M3 current feedback","const int M4_FB = A4;  //M4 current feedback".
+
* use the datasheet, schematic and your brain to find the value ! Or read below.
+
  
How to find the right code to have a meaningful value:
+
Contact me directly if the images on this page aren't enough for you. As soon as I figure a way to upload the Eagle design files on here, I will.
*The current mirror on feedback pin is 0.24% of load current.
+
*The resistor in place has a value of 270 ohm (standard precision).
+
*Therefore, a 5A current will achieve 5*0.0024*270 = 3.24 volts seen on the ADC
+
*The ADC is 10bits with a 5v reference, so this 5A current will result in 3.24/5*1024 = 664 approx.
+
*Then 5/664 (or 0.00753) is the factor to have a value in amps.
+
*An almost correct code might be something like "value_miliamps = 8*analogRead(MOTORX_FBPIN);". Remember that the Arduino doesn't like floating point variables nor making divisions (no dedicated hw) and there are imprecisions here and there, so a x8 factor should be good enough.
+
*Note that at 6.5A the overcurrent protection kicks in, so the ADC should be fine in any case.
+
  
== Code example ==
+
== Links ==
formating sucks, sorry !
+
<nowiki>
+
// Adafruit Motor shield library
+
// copyright Adafruit Industries LLC, 2009
+
// this code is public domain, enjoy!
+
// adapted for Electrolab Motorshield prototype
+
 
+
#include <AFMotor.h>
+
const int STATUS_FLAG_1 = A2;//H-bridge1 status flag
+
const int STATUS_FLAG_2 = A5;//H-bridge2 status flag
+
const int M1_FB = A0;  //M1 current feedback 
+
const int M2_FB = A1;  //M2 current feedback
+
const int M3_FB = A3;  //M3 current feedback
+
const int M4_FB = A4;  //M4 current feedback
+
 
+
//we need PWM freq < 11kHz
+
AF_DCMotor motor1(1,MOTOR12_8KHZ);
+
AF_DCMotor motor2(2,MOTOR12_8KHZ);
+
AF_DCMotor motor3(3,MOTOR34_8KHZ);
+
AF_DCMotor motor4(4,MOTOR34_8KHZ);
+
 
+
void setup() {
+
  Serial.begin(9600);
+
  Serial.println("Motor test! Everyone full forward !");
+
 
+
  //enable status flag reading
+
  pinMode(STATUS_FLAG_1, INPUT);//Status flag1
+
  pinMode(STATUS_FLAG_2, INPUT);//Status flag2
+
 
+
  // turn off (!!) all motors
+
  motor1.setSpeed(255); 
+
  motor2.setSpeed(255); 
+
  motor3.setSpeed(255); 
+
  motor4.setSpeed(255);
+
  motor1.run(RELEASE);
+
  motor2.run(RELEASE);
+
  motor3.run(RELEASE);
+
  motor4.run(RELEASE);
+
 
+
  // turn on (!!) all motors
+
  motor1.setSpeed(0);
+
  motor2.setSpeed(0);
+
  motor3.setSpeed(0);
+
  motor4.setSpeed(0);
+
  motor1.run(FORWARD);
+
  motor2.run(FORWARD);
+
  motor3.run(FORWARD);
+
  motor4.run(FORWARD);
+
}
+
 
+
void loop() {
+
  int tempval;
+
 
+
  Serial.print("motor1 current(mA):");
+
  tempval = 3*analogRead(M1_FB);//check the datasheet & schematic, value in mA
+
  Serial.println(tempval);
+
 
+
  Serial.print("motor2 current(mA):");
+
  tempval = 3*analogRead(M2_FB);//check the datasheet & schematic, value in mA
+
  Serial.println(tempval);
+
 
+
  Serial.print("motor3 current(mA):");
+
  tempval = 3*analogRead(M3_FB);//check the datasheet & schematic, value in mA
+
  Serial.println(tempval);
+
 
+
  Serial.print("motor4 current(mA):");
+
  tempval = 3*analogRead(M4_FB);//check the datasheet & schematic, value in mA
+
  Serial.println(tempval);
+
 
+
 
+
  Serial.print("status flag1:");
+
  if(HIGH==digitalRead(STATUS_FLAG_1))
+
    Serial.println("ok");
+
  else
+
    Serial.println("nok");
+
 
+
 
+
  Serial.print("status flag2:");
+
  if(HIGH==digitalRead(STATUS_FLAG_2))
+
    Serial.println("ok");
+
  else
+
    Serial.println("nok");
+
   
+
  Serial.println("");   
+
  delay(1000);
+
}
+
</nowiki>
+
 
+
= Download =
+
Check adafruit version of the library required to use this shield. It works okay. See previous section for limitations and some example code.
+
 
+
Come back later for full eagle files of this design, I'm still trying to figure out a way to upload any kind of file on this wiki ! Contact me directly if the images on this page aren't enough for you. As soon as I figure a way to upload the Eagle design files on here, I will.
+
 
+
= Resources =
+
 
* http://www.adafruit.com/products/81
 
* http://www.adafruit.com/products/81
 
* http://www.ladyada.net/make/mshield/
 
* http://www.ladyada.net/make/mshield/
 
* http://shop.snootlab.com/powerduino/87-rotoshield.html
 
* http://shop.snootlab.com/powerduino/87-rotoshield.html
  
= Buy Kit =
+
== Buy Kit ==
 
This is just a prototype at the moment. Check its smaller/older brother on adafruit, snootlab, or get in touch with contact@electrolab.fr if you ''really'' wanna buy one of the prototypes.
 
This is just a prototype at the moment. Check its smaller/older brother on adafruit, snootlab, or get in touch with contact@electrolab.fr if you ''really'' wanna buy one of the prototypes.
  
Please note that price would be significantly higher than that of the Motorshield, like above 50€. That's because:
+
Please note that price would be significantly higher than that of the Motorshield, like 50€ or even more. That's because:
 
* that's what they cost me right now
 
* that's what they cost me right now
* the MC33932 a stronger but more expensive than L293D: even in a production run, costs would be higher
+
* the MC33932 is stronger but more expensive than L293D: even in a production run, costs would be higher
 
* these are still prototypes, with tiny volume (eg: more expensive pcb and components, because volume is what drives prices down)
 
* these are still prototypes, with tiny volume (eg: more expensive pcb and components, because volume is what drives prices down)
* the prototype boards are assembled by hand. Even if I happily give some of my time to design stuff, assembling batches is boring and then my time isn't totally free (as in free beer). Somehow, we will never reach volumes similar to those of Adafruit, therefore a higher price would be inevitable.
+
* the prototype boards are assembled by hand. Even if I happily give some of my time to design stuff, assembling batches is boring and thus my time doing so isn't totally free (as in free beer. But you can offer me one :-).
 
+
= Forums/contact =
+
Check all the ressources associated with the original version of this shield. For anything regarding this particular version, you can contact me directly through the electrolab mailing list, or on IRC: clmnt/#electrolab on freenode networks.
+
 
+
= FAQ =
+
Please start with reading [http://www.ladyada.net/make/mshield/faq.html Adafruit own FAQ], here are only additionnal answers specific to this version.
+
 
+
== What additionnal features does this version have to offer ? ==
+
* More amps !
+
* Less thru-holes !
+
* a way to measure the current consumed on each of your motors
+
* a way to get a feedback on the H-bridge status
+
 
+
== Can I really use all bridges at full power ? ==
+
No. It'll hurt the chips by overheating if you dont take care of that. But at least, it wont self destroy (or less often ;) if you short the outputs, and at current levels which would destroy the L293D, the MC33932 is still rather cool. When people say "that many amps", it is usually in the best possible environment, so it is safe to assume in real life, it'll be less. Check the datasheet and design files if you wanna know more about that.
+
 
+
== It makes annoying noises ==
+
Maybe that's because it is being PWMed at a rather low frequency. Change your setup in the lib. Live with it, because those chips cant handle a higher pwming frequency, or design a similar board with different, better chips :)
+
 
+
== Suggested motors ==
+
we use bigger ones, like [http://www.conrad.fr/motoreducteurs_puissants_p_50802_51488_845284_486281_FAS that thing], but any DC motor of an appropriate size/spec should work.
+
 
+
== I wanna understand what's really going on inside/with this shield ==
+
Well... check with your local hackerspace, or come to visit us !
+
  
== I wanna make some modifications to this design ==
+
= More info =
Please do ! And document it. That's the very goal of the chosen licensing, and I really hope people will improve on this design.
+
Check all the ressources associated with the original version of this shield.
  
== Looks very similar to Adafruit's version ==
+
For anything regarding this particular version, you can contact me directly through the electrolab mailing list, or on IRC: clmnt/#electrolab on freenode networks.
That's a compliment if you can't see the differences ! Being as similar as possible is actually a ''design goal''.
+
If your point is that this patch is small/irrelevant, then... check previous Q&A ;)
+
  
== Will this shield be produced in volume ==
+
You can check the [[Projets:Perso:2011:Motorshield:faq|Frequently Asked Questions]] sub page for more info & troubleshooting.
I've designed it because I needed it. If people ask for a production run, I/we (Electrolab) may consider it.
+
  
== Troubleshooting ==
+
= TODOs =
It'd be way too easy if I document this for you ;)
+
== Wishlist for next revisions ==
 +
* be sure the HW is 100% compatible. Today, it is not the case !
 +
** check signal names (eg motor x forward should behave as expected)
 +
** decide on high/low PWMing in HW (inverter, or other enable - even if not recomended by spec). Should be done somehow.
 +
* enhance features & slight rework
 +
** protect reverse polarity on power plug
 +
** do something about the poor servo power design (including move that 2pinheader that shorts on the USB connector... what a pitty !)
 +
** think about polyfuse on Vin jumper (protect arduino 5v reg)
 +
** change led resistor value (maybe 5k or even less)
 +
** bring available digital I/O to headers
 +
** bring led on D13 up ?
 +
** bring analog I/O to headers, in case some features are not wanted
 +
** add holes for heatsink mounting + make some space for it
 +
** design a better silkscreen (eg servo1 & servo1...)
 +
** SMD condo ?
 +
* manufacturing
 +
** add revision info sticker on pcb (datecode, SN)
 +
** make the pcb easier to manufacture (DIY friendly)
 +
** implement end of line testability in a more easy manner (eg testpoints)
 +
** check/think about a small volume production price
 +
* code & support:
 +
** release a proper lib/code examples for specific features
 +
** clean up related pages
 +
** add troubleshooting and examples robot
 +
** document testing
 +
* crazy features
 +
** check how hard it'd be to be able to chain two of such boards to drive 4 steppers (RAMPS style) : mostly connector issues to chain shift registers + SW to drive it, I suppose... even it'd be more clever to do an all in one platform directly.
 +
** experiment with paralleling outputs and max power
 +
** try to mess with a current-loop mode firmware
 +
** mega version (eg, with more features, like RAMPS, or full robotic platform ?)
 +
** your wildest dream here ! :)
  
= TODO/Wishlist for next revisions =
+
== TODO for this page/project doc ==
* check signal names (eg motor x forward should behave as expected)
+
* <strike>Move those pics to a sub-page/download, or sort them.</strike>
* protect reverse polarity on power plug
+
* <strike>Add a true overview pic with the board and adapted motors/loads.</strike>
* do something about the poor servo power design (including move that 2pinheader that shorts on the USB connector... what a pitty !)
+
* <strike>Create assembly sub-page</strike>
* think about polyfuse on Vin jumper (protect arduino 5v reg)
+
* <strike>Clean this page</strike>
* bring led on D13 up
+
* <strike>Add history/release notes in an explicit way</strike>
* decide on high/low PWMing in HW (inverter, or other enable - even if not recomended by spec)
+
* translate either in french or english assembly page
* add revision info sticker on pcb (datecode, SN)
+
* clean "use it" page.
* make the pcb easier to manufacture (DIY friendly)
+
* find a way to upload eagle files & source code --> See [http://www.mediawiki.org/wiki/Manual:FAQ#How_do_I_allow_uploading_of_additional_formats.3F LocalSettings.php]
* add option for unused pins wire soldering
+
* find a way to display source code --> [http://www.mediawiki.org/wiki/Extension:SyntaxHighlight_GeSHi SyntaxHighlight_GeSHi extension]
* change led resistor value (maybe 5k or even less)
+
* organize the beta testing phase + reports
* release a proper lib/code examples for specific features
+
* prepare the RC1 rework phase
* design a better silkscreen (eg servo1 & servo1...)
+
* add holes for heatsink mounting
+
* check how hard it'd be to be able to chain two of such boards to drive 4 steppers (RAMPS style) : mostly connector issues to chain shift registers + SW to drive it, I suppose... even it'd be more clever to do an all in one platform directly.
+
* experiment with paralleling outputs and max power
+
* implement end of line testability in a more easy manner (eg testpoints)
+
* try to mess with a current-loop mode firmware
+
* check/think about a small volume production price
+
* your wildest dream here ! :)
+

Latest revision as of 14:18, 18 May 2012

Introduction

What should you do if you wanna plug motors to your Arduino ? There's this cool Motorshield from Adafruit industries, but it handles such little currents ! Fortunately, there are other nice chips out there...

OpenHW is about commiting patches, right ? So here's mine !

Motorshield-overview.jpg
The current prototype.

Latest news

  • This project has been put to good use for a student project, stay tuned for more information/pics !
  • Almost everything is ready to launch the first production batch. Pre-order will be opened soon.
  • This design serves as a reference for the ongoing tests on PCB fabrication. We're pretty close to being able to manufacture stuff like that in the lab :)

Design goals

  • The goal of this project is to replace the weak L293D of Adafruit's Motorshield with a stronger chip, a MC33932, which is a fully integrated dual H-bridge rated at 5.0A (vs 0.6A for the L293D).
  • One major constraint is to keep a full pin/function compatibility, so that this shield can be a drop-in replacement for Adafruit's version.
  • I also chose to use mostly SMD components, because I am fed up with all those thruhole resistors: people should live with their time, and in my opinion, those are a thing of the past.


Note that I decided to call this shield "the Arduino sHHHHield - an Arduino shield with four H bridges" and am proudly claiming full fame and credits and everything for such a lame name :-)

Features

As intended, this shield is very similar to Adafruit's current version:

  • 2 connections for 5V 'hobby' servos - still the huge drawback of pumping on the 5v regulators, which means you cannot expect to use torque-full servos.
  • Up to 4 bi-directional DC motors with individual 8-bit speed selection (so, about 0.5% resolution)
  • Up to 2 stepper motors (unipolar or bipolar) with single coil, double coil, interleaved or micro-stepping.
  • Pull down resistors keep motors disabled during power-up
  • Big terminal block connectors to easily hook up wires (10-22AWG) for motor and power supply
  • Arduino reset button brought up top
  • 2-pin terminal block to connect external power, for seperate logic/motor supplies
  • Tested compatible with Duemilanove & UNO. Not tested on Mega yet, but should work as the original shield. Not tested for steppers yet neither (see below: there might be issues with the current prototype, but it'll be corrected on final version).

There are some differences tho:

  • Max voltage is 28v for the H-bridge [1]
  • Mostly compatible with easy-to-use Arduino software libraries from Adafruit [2]
  • 4 H-Bridges: MC33932 chipset can provide 5.0A per bridge (at 6.5A overcurrent kicks in) [3]
  • Current feedback readable directly on four of the analog inputs of the Arduino [4]
  • Status flag for each chip on two other analog inputs [4]
  1. As I've done the design rather in a hurry for another project in a 12v environment, condensators have been chosen for this value (actually, 16v max if I remember well). Mount other values and you'll be able to get closer to the MC33932 max voltage rating. Be reasonable: at full amps, it'll get you close to 500w, even with high efficiency it'll fry the chip - or at least get it in thermal protection very fast - without additional cooling.
  2. Most notably, the enable (and thus PWM and speed control) works the opposite way at the moment, that is setspeed(255) will get stop and setspeed(0) will get fullspeed. See sections below for details.
  3. This is RMS (eg: mean over time). Actually depends on how well you cool it. This chipset implements a thermal shutdown protection and short circuit/over current protection. I've tested it for quite a quile at 2.5A per bridge "stock", eg without any additionnal heatsink, and it went hot but not too hot.
  4. Check below for details on how to use this

Yeah, I know, I hate those "see conditions below" things, but hey, this is only a prototype at the moment, so live with it :)

Current version

Please note that this is an ongoing project: this page itself is a work in progress. Use at your own risk :)

Current prototype do work, but a better version is expected sometime soon enough.

You can also check past versions of this project:

  • nope, actually this one is the first :-)

Make it!

Because there are quite a lot of pictures of the build, check the sub-page describing the assembly process.

Motorshield-lab.jpg
A nice SMD assembly station, isn't it ?

The current board design wasn't really optimised for DIY processes:

  • 6 mil spacing (0.15mm), 12mil tracks: so to speak "class 5" (not sure this is an international thing ; the higher the class, the harder to manufacture. It is probably a french standard).
  • 0.3 mm vias

These are Pcb Pool standard process parameters - board house I went with for the first prototypes.

Motorshield TOP.png
Motorshield BOT.png
Don't try this at home, kids !

You can either:

  • go for a pro fab house
  • buy one of our prototypes
  • tweak the current design to adapt to your manufacturing abilities
  • come with us tweak the lab pcb fab equipment to achieve such results

Amusing fact: just for fun (at 3am we get sweet spots for stupid challenges ;), we tried to make the bottom layer with our not-yet-trimmed pcb-process at the lab, and it went out suprisingly well. It is highly probable that in a rather near future we will be able to actually manufacture such PCB directly at the lab (of course, without metal vias, soldermask and silkscreen: those are for quite later on ;)

Use it!

There's no deep, thorough tutorial about this yet. Check what is done with the original adafruit version, and come back later to check what we are using this for - once I document the related projects ;) Spoiler alert: one of them is related to Physical Etoys/Squeakbot (STFW :) Hint: having 8 half bridge on a board means you could control, like, 8 lamps. Or whatever requires few amps.

More info on the related sub-page.

Resources

Download

Check adafruit version of the library required to use this shield. It works okay. See previous section for limitations and some example code.

Come back later for full eagle files of this design, I'm still trying to figure out a way to upload any kind of file on this wiki !

Motorshield SCH.png
I know, it sucks to have only a .png

Contact me directly if the images on this page aren't enough for you. As soon as I figure a way to upload the Eagle design files on here, I will.

Links

Buy Kit

This is just a prototype at the moment. Check its smaller/older brother on adafruit, snootlab, or get in touch with contact@electrolab.fr if you really wanna buy one of the prototypes.

Please note that price would be significantly higher than that of the Motorshield, like 50€ or even more. That's because:

  • that's what they cost me right now
  • the MC33932 is stronger but more expensive than L293D: even in a production run, costs would be higher
  • these are still prototypes, with tiny volume (eg: more expensive pcb and components, because volume is what drives prices down)
  • the prototype boards are assembled by hand. Even if I happily give some of my time to design stuff, assembling batches is boring and thus my time doing so isn't totally free (as in free beer. But you can offer me one :-).

More info

Check all the ressources associated with the original version of this shield.

For anything regarding this particular version, you can contact me directly through the electrolab mailing list, or on IRC: clmnt/#electrolab on freenode networks.

You can check the Frequently Asked Questions sub page for more info & troubleshooting.

TODOs

Wishlist for next revisions

  • be sure the HW is 100% compatible. Today, it is not the case !
    • check signal names (eg motor x forward should behave as expected)
    • decide on high/low PWMing in HW (inverter, or other enable - even if not recomended by spec). Should be done somehow.
  • enhance features & slight rework
    • protect reverse polarity on power plug
    • do something about the poor servo power design (including move that 2pinheader that shorts on the USB connector... what a pitty !)
    • think about polyfuse on Vin jumper (protect arduino 5v reg)
    • change led resistor value (maybe 5k or even less)
    • bring available digital I/O to headers
    • bring led on D13 up ?
    • bring analog I/O to headers, in case some features are not wanted
    • add holes for heatsink mounting + make some space for it
    • design a better silkscreen (eg servo1 & servo1...)
    • SMD condo ?
  • manufacturing
    • add revision info sticker on pcb (datecode, SN)
    • make the pcb easier to manufacture (DIY friendly)
    • implement end of line testability in a more easy manner (eg testpoints)
    • check/think about a small volume production price
  • code & support:
    • release a proper lib/code examples for specific features
    • clean up related pages
    • add troubleshooting and examples robot
    • document testing
  • crazy features
    • check how hard it'd be to be able to chain two of such boards to drive 4 steppers (RAMPS style) : mostly connector issues to chain shift registers + SW to drive it, I suppose... even it'd be more clever to do an all in one platform directly.
    • experiment with paralleling outputs and max power
    • try to mess with a current-loop mode firmware
    • mega version (eg, with more features, like RAMPS, or full robotic platform ?)
    • your wildest dream here ! :)

TODO for this page/project doc

  • Move those pics to a sub-page/download, or sort them.
  • Add a true overview pic with the board and adapted motors/loads.
  • Create assembly sub-page
  • Clean this page
  • Add history/release notes in an explicit way
  • translate either in french or english assembly page
  • clean "use it" page.
  • find a way to upload eagle files & source code --> See LocalSettings.php
  • find a way to display source code --> SyntaxHighlight_GeSHi extension
  • organize the beta testing phase + reports
  • prepare the RC1 rework phase