Sanguinololu

From RepRap
Revision as of 03:20, 20 March 2011 by Joem (talk | contribs) (Testing the Sanguinololu)
Jump to: navigation, search

This page is a development stub. Please enhance this page by adding information, cad files, nice big images, and well structured data!

Crystal Clear action run.png
Sanguinololu

Release status: experimental

Sanguinololu.jpg
Description
Revision 0.7-RC
License
unknown
Author
Contributors
Based-on
[[]]
Categories
CAD Models
Eagle
External Link


Introduction

Here is a project I've been working on. It started in this forum thread. I would like a nice clean board to control my currently un-born Reprap, and due to its cost and simplicity I've chosen to use the Sanguino Arduino compatible board paired with a set of Pololu Allegro A4983 Stepper Motor Driver Carrier boards. In order to keep things tidy, I've mushed all this into one board. Since I like to have the ability to expand later on, all the unused Sanguino pins are broken out into an expansion header supporting I2C, SPI, UART, as well as a few ADC pins.

Latest Updates

Latest revision: 0.7-RC Updated March 18, 2011

Revision 0.7 seems pretty stable, with no issues in testing, so I've nominated it as a release candidate, to be promoted to 1.0 if no other major issues or bugs are found. The images and schematic have been updated accordingly - in the wiki as well as git.

The revision 0.5 boards have arrived, and they are of pretty good quality. I've updated the assembly instructions below.

Features

Assembled rev 0.1 board
Mostly Assembled rev 0.5 board
Assembled rev 0.6 board with Ad-hoc VREG on Stripboard
  • Small design - board is 100mm x 50mm (4" x 2") - barely an inch longer than a business card!
  • Sanguino clone, Atmel's ATmega644P - ATmega1284 drop-in compatible!!
  • Up to 4 Pololu (or Pololu compatible) on-board (X,Y,Z,Extruder) (A4983 without voltage regulator)
  • Supports multiple power configurations
-- Logic & Motors supplied by ATX power supply (needs molex harddrive connector, and optional 4pin atx connector for additional 12v)
-- Motors supplied by 5mm screw terminal 7-24V (25v if you install larger caps)
-- Logic supplied by USB bus
-- Logic supplied by optional on-board voltage regulator (molex harddrive connector cannot be installed at the same time)
Supports multiple communication configurations
-- FT232RL on-board for USB connectivity
-- USB2TTL header is available for FTDI cable, or BlueSMIRF bluetooth module
  • 2 thermistor connectors with circuitry
  • 2 N-MOSFETs for extruder/bed, or whatever
  • Selectable 12v/5v endstop voltage
  • Edge connectors for all wire connections, for vertical jumpers or right-angle tidyness, with or without polarizing tab
  • Silkscreen for connectors on both sides of the board, facilitating bottom cable connections for even more tidyness
  • 14 Extra pins available for expansion and development - 6 analog and 8 digital, with the following capabilities
-- UART1 (RX and TX)
-- I2C (SDA and SCL)
-- SPI (MOSI, MISO, SCK)
-- PWM pin (1)
-- Analog I/O (6)
  • All through-hole components (except FTDI chip) for easy DIY soldering

Schematic & Board Images

These images are from the working 0.7 branch and may not reflect the latest EAGLE files.

EAGLE files, parts list

Schematics, board, images: https://github.com/mosfet/Sanguinololu

Parts: https://github.com/mosfet/Sanguinololu/tree/master/rev0.7/parts.txt


You will also need Pololu or Pololu compatible stepper drivers such as StepStick (Coming soon)

Mouser part projects

Everything you need except the PCB!

Project Name Project Description Price (as of 3-3-2011)
Sanguino 0.7-RC Core The base project. Does not include FTDI implementation or power connectors. Chose this and then chose add-ons from below. $21.80 (USD)
ATX power connector kit Vertical plugs for using the ATX power supply's ATX+4 12V connector and 4 pin HDD connector. If you install this, you can't install the Screw terminal & Voltage regulator kit... but why would you want to anyway. $1.86 (USD)
Screw terminal & Voltage regulator kit 5mm Screw terminal and voltage regulator (and supporting parts) for those not wanting to use an ATX power supply, or would rather use a single volt power supply, 7-24V (25v if you install larger caps). If you've been following along, you know that if you install this, you can't install the ATX power connector kit. $1.63 (USD)
FTDI & USB plug kit This kit includes a USB type B connector and a SSOP FTDI FT232RL chip (and supporting parts) commonly used for serial communication over USB. $5.26 (USD)
Polarized Connector Kit Polarized right-angle connectors for the edge, and matching cable housings. Cable side is easy pinch type connectors, so no soldering or crimping is needed. $4.30 (USD)

Before purchasing parts, always export a part list from the EAGLE files to ensure the Mouser projects are at the latest revision.

Revision 0.5/0.6 Assembly Instructions

NOTE: There is an issue on the 0.5 and 0.6 boards that needs a fix. Do not install the resistors R17 and R18. Also solder a jumper wire between these pads on the back of the board:

Sanguino-rev06-top-usbfix.jpg


Purchase the kit for the Sanguinololu 0.7 and FTDI kit. Revision 0.5 does not have the footprints and holes for the voltage regulator, though you can use screw terminal for the power input. This photo shows the pieces for Sanguinololu 0.7 core, FTDI kit, and VREG and Screw Terminal kit. (We won't be using all of these parts on this installation - no footprint for it, but there are [ways to get around that]).

Sanguinololu.0.7.parts.jpg


I like to solder the SMT FTDI chip first as it ensures nothing else is in the way. Use your favorite SMT soldering method for this. After soldering, check with a multimeter to ensure no pins are touching, and that gnd is not shorted to 5v.

Sanguinololu.0.5.install.1.jpg


Solder the 5v endstop voltage selector solderpad (left bottom) and then the wire fix required for FTDI (right bottom).

Sanguinololu.0.5.install.2.jpg


Solder the passive components for the FTDI chip. C7, C8, C11, C13

Sanguinololu.0.5.install.3.jpg


Solder the USB port. After this is a good time to plug the board into your PC to ensure the FTDI chipset was installed correctly. You won't be able to do any communication over the usbcomport, but the device should be recognized by windows or show up in dmesg.

Sanguinololu.0.5.install.4.jpg


Solder the female sockets next. The holes will be very tight and it may take some wiggling and cursing to get the female pinstrips completely in the holes, but it ensures they are straight and vertical. Before soldering, test to ensure pololus will fit.

Sanguinololu.0.5.install.5.jpg


Solder the microstepping jumpers. It helps to put the shunt on the jumper before you solder, so it is lined up with the socket and doesn't waste any room. Install the 100k resistors for the pololus as well as the 1.5k resistor for the LED. R2, R3, R4, R5, R1

Sanguinololu.0.5.install.6.jpg


Solder the decoupling caps. Make sure you bend the leads first so that the capacitor lays down and doesn't interfere with pololu installation C1, C2, C3, C4

Sanguinololu.0.5.install.7.jpg


Solder the passives that sit between the pololus and the atmega. R6, R7, R8, C5, C6, R9

Sanguinololu.0.5.install.8.jpg


Solder the DIP socket and the resonator Y1. Ensure the DIP socket's notch lines up with the silkscreen.

Sanguinololu.0.5.install.9.jpg


Solder the large 1000uF cap as well as the components needed for the thermistors. Solder the reset button. C9, C10, C12, R10, R11

Sanguinololu.0.5.install.10.jpg


Solder the mosfets and your edge wire connectors. Also solder the Power LED.

Sanguinololu.0.5.jpg


Solder the ATX power connector and Molex 4 pin hard-drive connector.

Sanguinololu.0.5.install.12.jpg


Solder the edge connectors.

Sanguinololu.0.5.install.13.jpg

Optionally solder the ISP and/or extension port headers.

Sanguinololu.0.5.install.14.jpg

I soldered the ISP header here so that I could bootload the chip with AVR ISP MKII. It had no problems bootloading, though make sure the Pololus aren't installed. The AVR programmer required the board to be powered, so I used the 4 pin molex hdd connector to power it. I was able to boot load it, and now I can communicate with it via USB FTDI and upload sketches through the Arduino development environment.

Testing the Sanguinololu

Testing the stepper motors Here is a quick sketch that enables the driver, steps the motor, and changes direction, eventually stopping the driver.

This only tests one motor at a time, so set the pin constants as according to the pinout sheet.

 const int enablePin = 2;  //x=20 y=23 z=5 e=2
 const int dirPin = 0;     //x=22 y=6 z=3 e=0
 const int stepPin = 1;    //x=21 y=7 z=4 e=1
   
 int loopCount=0;
 
 void setup() {
   pinMode(enablePin, OUTPUT); 
   pinMode(stepPin, OUTPUT);  
   pinMode(dirPin, OUTPUT);      
   digitalWrite(enablePin, LOW); //enable the driver  
 }
 
 void loop()
 {
   if(loopCount >= 2000){
     if(!digitalRead(enablePin))
         digitalWrite(enablePin, HIGH); //disable the driver
   }
   else
   {
     loopCount++;
     digitalWrite(stepPin, HIGH);
     delay(1);
     digitalWrite(stepPin, LOW);
     delay(2);
 
     if(loopCount % 200 == 0)
       digitalWrite(dirPin, !digitalRead(dirPin));
   }
 }

Testing the Mosfets This sketch enabled and disables the hotbed and hottip mosfets in a 10 second interval - 10 seconds on, 10 seconds off - five times. Run this sketch while using a multimeter connected to the hotbed connector, then to the hotend connector. You must have a 12v supply hooked to Sanguinololu to test this. I just used the 4 pin molex hdd connector, since it provides more than enough 12v current for this test. You should see the multimeter read go from 12v to 0v every 10 seconds, for 5 times.

 const int bedPin=13;
 const int endPin=14;
 int loopCount=0;
 void setup() {
   pinMode(bedPin, OUTPUT); 
   pinMode(endPin, OUTPUT);       
   digitalWrite(bedPin, LOW);
   digitalWrite(endPin, LOW);
 }
 void loop()
 {
   if(loopCount >= 5){
     //do nothing
   }
   else
   {
     loopCount++;
     digitalWrite(bedPin, HIGH);
     digitalWrite(endPin, HIGH);
     delay(10000);
     digitalWrite(bedPin, LOW);
     digitalWrite(endPin, LOW);
     delay(10000);
   }
 }

Revision 0.5 - 0.6 Pin Assignment

NOTE: THIS IS FOR SANGUINOLOLU REVISIONS 0.5 AND 0.6 ONLY -- NEWER REVISIONS HAVE DIFFERENT PINOUT

 e-enable      (D 2) PB2
 e-dir         (D 0) PB0
 e-step        (D 1) PB1
 z-enable      (D 5) PB5
 z-dir         (D 3) PB3
 z-step        (D 4) PB4
 y-enable      (D 23) PC7
 y-dir         (D 6) PB6
 y-step        (D 7) PB7
 x-enable      (D 20) PC4
 x-dir         (D 22) PC6
 x-step        (D 21) PC5
 hotbed        (D 13) PD5
 hotend        (D 14) PD6
 b-therm (AI 6 / D25) PA6
 e-therm (AI 7 / D24) PA7
 x-stop        (D 17) PC1 
 y-stop        (D 18) PC2 
 z-stop        (D 19) PC3

Revision History

Rev 0.7 Added more pins to the expansion header, made I2C and SPI available for use. Combined all stepper motor enable nets into one pin.

Added footprints for voltage regulator for those wanting to use laptop power brick, etc. The vreg component footprints are hidden under the ATX power supply for space saving and to prevent both from being in use.

Enabled USB bus power for logic side.

Connected the 5v pin on the USB2TTL header so that either a: ftdi cable can power the board, or b: The board can power a bluetooth serial module (bluesmirf).


Rev 0.6 Made changes suggested regarding putting power pin in the middle of endstop sense connector.

Shrunk board to metric specifications for boardhouse - board size now 100mm x 50mm - just a tad smaller than 4"x2"

Increased spacing between connectors to facilitate polarized or locking connector types / wire headers

Changed orientation of MS1/2/3 jumpers to (hopefully) make it easier to remove / put on, and give more room to the pololu decoup caps

Sent design to boardhouse for prototypes


Rev 0.3 MS1/2/3 for each motor separated. Unfortunately the best place for this to go is under the pololus, needing you to remove the pololu to change it's microstepping settings. Oh well, I'm hoping this is a set-it-and-forget-it type of thing.

Added optional 4-pin atx 12v connector to support large hotbed or extruder loads, up to 20A. 3A if just using the hdd connector

Adjusted schematic to put MOSFETs gates on PWM pins for less software intense temp control.

Moved endstop connectors to other side of board.

Added 12V power connectors in their place, for always on fan, or whatever. Watch out for current rating. Maybe a couple of fuses is in order....


Rev 0.1 First prototype, first design, first PCB ordered, first assembled, etc.