Welcome! Log In Create A New Profile

Advanced

Gen 2 OnABoard

Posted by mccoyn 
Gen 2 OnABoard
March 09, 2010 06:18PM
I've been designing a single PCB to handle all the gen 2 electronics that does not require any surface mount soldering. My main reason for doing this is to reduce the rats nest of wires that make a mess and sometimes comes loose, but it also ends up being a little cheaper than having many boards since there are fewer connectors and less PCB space is used to support the connectors.

This first image is the silk screen. Silkscreen


The lower right is an Arduino mini board. I plan to use one with an ATMega328 chip I got from [www.nkcelectronics.com]

Across the middle I have 4 pololu stepper drivers. [www.pololu.com]

Below that is two PWM drivers for the fan and heater. I didn't have enough pins to support a heated platform. To do that you would have sacrifice two of the max sensors.

Below that is a 24-pin ATX connector. I'm using the 5V standby to power the Arduino and I have a pin on the Arduino connected to the power switch wire so that the Arduino will be able to turn the power supply on and off. There is also a 2.7K load resistor on the 5V line, which is to help the regulator in the power supply.

Here is the traces. Traces



I made all the traces that carry significant current thicker. Most of these are 0.05 inch.

Most of the traces on the top half of the board are on the bottom layer with a ground plane filling the top layer. I hope this will help to cool the stepper drivers, but I am uncertain if I can efficiently transfer heat through the pins from the breakout board.

Since there isn't much going on under the stepper drivers I filled the bottom layer in that area with a +12V power plane. The idea here is to limit interference between the stepper drivers each pulling from the same supply.

I'm estimating this will cost about $150 for the prototype board. A big part of that is $40 to order the PCB from BatchPCB. I'm looking for another option. I know a couple people who are interested in the board so I might be able to order one prototype now and then a few (5 or 10) later when it is tested to get a better deal.

This is largely inspired by the electronics in use by Triffed_Hunter and BodgeIt

Any comments, suggestions or experiences would be experienced.

Edit1: There is now a Wiki page that will contain the most up to date design notes and will eventually hold the assembly instructions.

Edit2: Changed thread subject to reflect upcoming name change.

Edit3: Updated wiki link.

Edit4: Removed old thread name. The new name has been around long enough that people won't get lost.

Edited 4 time(s). Last edit at 04/07/2010 04:15PM by mccoyn.



Darwin clone, Gen 2 electronics, Arduino Duemilanove w/ AtMega328, 5D Firmware, Pinchwheel extruder
[www.codeerrors.com]
Re: Gen 2 Backplane (looking for comments)
March 09, 2010 08:11PM
You are farther along then I am. I may decide to jump on _your_ bandwagon rather then re-invent the wheel again myself.

I am on a different listserver for the gEDA open source schematic capture and PCB layout software. Some just asked where is the best place to get prototypes done, and BatchPCB is one of the ones mentioned. Once you get the bugs worked out, there are also Chinese companies with longer lead times, but lower costs.

Others mentioned were
PCB Express high quality, rapid turnaround
Advanced Circuits high quality, rapid turnaround
Sierra Circuits (protoexpress.com). good for beginner
PCB Train: [www.pcbtrain.co.uk] in the UK
www.olimex.com

The Pololu breakout board looks great. That is the lowest price I have seen yet on a stepper driver with micro stepping in a breakout board. The price for A4983 chips individually is under $5 a piece, but then you have to solder the leedless SMD, and still add the capacitors and resistors, so buying the breakout board at such a cheap price makes sense.

I was planning on using an ATMega directly, rather than buying one of the Arduino boards with a bootloader already installed. Since I have already done a lot of C coding directly into ATMegas and ATtinys, this does not present a problem for me. A word of caution. Using the Arduino Mini board, you are getting a smaller ATMega, with only 32K of flash memory. I was planing on using one of the ATMega128X series microcontrollers, because they have 128Kbytes of flash and 4K bytes of RAM. If you program in C or assembly, you should have no trouble with the 32K, but it may be too small to program with the Arduino languages.

Mike


Team Open Air
Blog Team Open Air
rocket scientists think LIGHTYEARS outside the box!
madscifi
Re: Gen 2 Backplane (looking for comments)
March 09, 2010 11:42PM
You might also check out Seeed Studio Depot - they have a prototyping service for open source hardware that looks interesting. Disclaimer: I have not tried the service nor do I have any connection to the organization.

[EDIT: madscifi, As requested, I've purged this post of your email address so that spam bots don't sniff it out. -Sebastien]

Edited 1 time(s). Last edit at 03/10/2010 04:45AM by SebastienBailard.
Re: Gen 2 Backplane (looking for comments)
March 10, 2010 04:02AM
I didn't have enough pins to support a heated platform. To do that you would have sacrifice two of the max sensors.

One thought I had a while ago is that every axis only needs one end sensor to be active at a time - depending on the direction it is moving in. So we could multiplex two sensors into one pin using the DIR signal to switch between the sensors.

This means that if you add something like a CD4053 to your board you can free up 3 input pins on the Arduino. I even expect this to work with existing firmware (but haven't tried yet).


You could take this a step further and OR the three outputs from this modification together into a single Arduino pin. However this will need a firmware modification: when an end stop has been reached the firmware will need to toggle the DIR signals to find out which particular endstop(s) triggered.

So there you have 5 pins to reap if you want to :-)
Re: Gen 2 Backplane (looking for comments)
March 10, 2010 04:14AM
Request: add a fuse to the 5v supply.

The first time I fired up my electronics I evaporated a track off one of my motor driver boards. It turned out one of my endstop boards was poorly soldered - 0 and 5v were shorted out. A fuse would have saved me from the dismantling and repair work on the motor board (not to mention the acrid smell in my room :-)
Re: Gen 2 Backplane (looking for comments)
March 10, 2010 04:37AM
You could try to eliminate the 6 PCBs for the opto endstops by moving their electronics to your board - another (small) costs saving.
Re: Gen 2 Backplane (looking for comments)
March 10, 2010 12:53PM
rocket_scientist:

I'm not using the ATMega128X because I couldn't find a DIP version of these chips and I'm trying to avoid surface mount. I use the ATMega328 in my RepRap now and it is sufficient for the job. It does not leave many extra pins.

I haven't priced out what it would cost to build an Arduino into the board using a DIP socket. That will likely be cheaper than the Mini breakout board.

A note on the Pololu breakout board: It likely does not have sufficient heat sinking to driver 2 A by itself. I've attempted to build more heatsinking into my board to compensate, but I'll have to test it to see if that works.


madscifi:

Seeedstudio has great prices and a distribution model that may be very useful later. I have to order 10 boards from them, but it costs the same $40 that I would have spent at BatchPCB for 1 board. That will give me nine to resell if they work.


Reinout Heeck:

What if I build the fuse into the board? I'm using .01 inch traces everywhere, but I could put a .008 trace between two pins that all the 5V lines are connected to. If enough current is drawn to burn a trace, it will likely burn that .008 trace and you can fix the board by installing a fuse on those pins (or shorting it if you think you'll never make the same mistake twice).

I would have to make two of these internal fuses, one for 5V and one for the 5V standby that powers the Arduino. I wouldn't put a fuse on the 12 V line.

Question: Will a .008 trace be a good enough fuse to prevent a .01 trace from burning up?

The opto PCBs are also used to mount the optos and provide connections for the leads on the sensor. I'm not sure what could be moved without making the sensor really annoying to mount. I wouldn't be surprised if there is something on Mouser that is equivalent to our opto sensor board all in one simple package.



Darwin clone, Gen 2 electronics, Arduino Duemilanove w/ AtMega328, 5D Firmware, Pinchwheel extruder
[www.codeerrors.com]
Re: Gen 2 Backplane (looking for comments)
March 10, 2010 02:38PM
I think I can use one of these as a fuse. It has low resistance as long as the current is less than 1 A and then it gets very high resistance until the current drops back down. That should be sufficient to make it impossible to damage the traces by drawing too much current through any connector, and it won't have to be replaced every time you mess up.



Darwin clone, Gen 2 electronics, Arduino Duemilanove w/ AtMega328, 5D Firmware, Pinchwheel extruder
[www.codeerrors.com]
Re: Gen 2 Backplane (looking for comments)
March 10, 2010 03:00PM
Yes I regularly use polyfuses to protect PCBs and wiring


[www.hydraraptor.blogspot.com]
Re: Gen 2 Backplane (looking for comments)
March 10, 2010 04:03PM
mccoyn,
The board looks really good, nice tight design and logically laid out. I would still recommend a bigger chip (and possibly 20Mhz crystal) to have enough extra pins to handle a bed heater, and maybe a second extruder head. Look at Mouser ATMega1284-PU . This is a 128Kbyte flash, 16Kbyte RAM, 20Mhz in a 40 pin DIP that still has 32 pins open plus a total of 4 counter/timers to set a different frequency for each stepper motor. Both Digikey and Mouser list it as not in stock, Mouser claiming 26 weeks lead time. I recently bought some 40 pin DIP ATMega164Ps from Digikey and the delay was only as few weeks. Still not as fast as getting the Arduino Pro Minis, but ultimately a cheaper, with better time base and more memory and I/O.

For the ZI/O Pins, I count:
(4) stepper motors, 2 each 8
(6) limit switches, 1 each 6
Extruder temp, analog 1
Bed heater temp, analog 1
Fan power 1
Extruder heater power 1
Bed heater power 1
Second extruder 4
SPI programming interface 3
USART 3
total 29

This still leaves 3 more I/O pins for future expansion, as well as already setting aside 4 pins for a second extruder.

Mike


Team Open Air
Blog Team Open Air
rocket scientists think LIGHTYEARS outside the box!
Re: Gen 2 Backplane (looking for comments)
March 10, 2010 05:12PM
rocket_scientest,

Do you think the ATmega644P would work. It comes in the same 40 pin DIP package and has 32 IO pins. The advantage is that it is the same chip that is used in the Sanguino. Any firmware that works for the Sanguino will work for this board and someone has already figured out how to make it work with the Arduino host.



Darwin clone, Gen 2 electronics, Arduino Duemilanove w/ AtMega328, 5D Firmware, Pinchwheel extruder
[www.codeerrors.com]
Re: Gen 2 Backplane (looking for comments)
March 10, 2010 06:07PM
mccoyn,
The ATMeaga644P is a good chip, but a step down from the 1284. Besides the difference in flash memory, 64Kbytes vs. 128Kbytes, which you said is more than enough, the 644P has only 3 independent timers. You will have to implement at least one stepper controller frequency in software. This should not be a major problem, and even the 1284 does not have enough independent hardware timers to do a second extruder head.

Other than that, there is not an major differences. Same 32 I/O pins, 8 channels of 10 bit analog input, two separate UASRTs, and the same 3 I/O pins used for the Software Programing In-circuit (SPI) port. I am confused about the price at Mouser, but it looks good and the lead time is much shorter. If you switch to using that chip, I will dump all my designs and use yours. Especially if the new layout is as good as the first. Perhaps move the axis limits to the right hand side, the power connector to the bottom, T2 below T1, and then you should have room to expand the Arduino socket into a 40 pin plus a crystal/resonator. The time base only needs to be accurate enough that the extruder temp/speed works well, and +/- 0.5% from a resonator should be adequate, although a crystal and two 10pf caps is not much extra expense/room.

If we were doing this for a Mendel, I would recommend looking for an SD card breakout board or Arduino shield so that the entire 3D part's g-code could be stored in the memory and work without a computer connected. This board should be capable of running a Mendel, or some of the other simple next gen repraps, but I can also see how modularizing the controller, and offloading the frequency/speed generation for each stepper would allow for more upgradable software on the main microchip

In short, yes, you can also use the 40 pin DIP ATMega644P.

Mike
Re: Gen 2 Backplane (looking for comments)
March 10, 2010 08:49PM
There is now a Wiki page that will contain the most up to date design notes and will eventually hold the assembly instructions.

I'd like to come up with a different name for this board since I just discovered there is another active project that is calling itself a backplane. I'd call it a motherboard, but that name is used as well. Any ideas?



Darwin clone, Gen 2 electronics, Arduino Duemilanove w/ AtMega328, 5D Firmware, Pinchwheel extruder
[www.codeerrors.com]
Re: Gen 2 Backplane (looking for comments)
March 10, 2010 09:21PM
I have my doubts about the pololu stepper drivers working well in that configuation.

Any attempt to draw heat out through the mounting pins seems fishy to me.

Especially when you consider that the current capacity of the stepper driver is limited by accumulated heat. The faster you draw heat out, the more amperage it can handle.

For that reason, I'd assume you'll need a heatsink with fan on those.

However, since I have yet to even attach my pololu stepper driver, much less overheat it, I really have no direct experience with it.


--
I'm building it with Baling Wire
Re: Gen 2 Backplane (looking for comments)
March 11, 2010 12:15AM
I found my pololu drivers were limited to 0.5A with no heatsink. I stuck a chipset cooler with fan on 4 of them with great success. see my blog for details.


-----------------------------------------------
Wooden Mendel
Teacup Firmware
Re: Gen 2 Backplane (looking for comments)
March 11, 2010 01:26AM
mccoyn,
we could call it the Master Board because it controlls all functions. We could call it the brain stem board because it runs the 'autonomic' functions but still depends on an external computer to feed it g-code. Since it provides all functions, we could call it 'reprap on a board'. We could shorten that to show that this is expected to be used on repStraps like the McWire, Wolgang, MikeWire, etc and call it the 'Strap board. Since it is the board behind the curtain plulling all the levers, controlling all the fire and noise, we could call it the "Oz Board".

And if we wanted to get technical and cryptic, it is the 2nd gen board with 4 steppers and one heated bed control, it could be "G2S4H". THAT out to confuse them and slow them down! smiling smiley

Mike
Re: Gen 2 Backplane (looking for comments)
March 11, 2010 02:57PM
I'm going to get a Pololu driver to run some tests on. I plan to connect it to a stripboard with a block of aluminum attached to the ground pin. This will be a partial simulation of the way it will be mounted in the new board. I'll hook up the stepper motors I have to it and see if I can overheat it. I'll also run it in my RepRap to see if it can keep up to actual working conditions on each axis.

Any other ideas of how I can test this? Can I connect 6 Ohm (25W) resistors in place of the two coils to simulate a motor that draws 2A continuously?

I like the idea of calling it RepRap on a board.



Darwin clone, Gen 2 electronics, Arduino Duemilanove w/ AtMega328, 5D Firmware, Pinchwheel extruder
[www.codeerrors.com]
Re: Gen 2 Backplane (looking for comments)
March 12, 2010 03:18AM
use 2 ohm 10w wirewound resistors, maybe with a choke in series for extra inductance. don't underestimate the inductive component of a motor winding!

Here's the electrical specification of my motors:

Voltage: 2.77V (55V Max)
Current: 1.68A
Resistance: 1.68ohm
Inductance: 3.0mH


-----------------------------------------------
Wooden Mendel
Teacup Firmware
Re: Gen 2 Backplane (looking for comments)
March 15, 2010 12:53PM
mccoyn,
If you decide to use SeedStudio to get 10 boards for $40, I will gladly split that and $20 plus shipping to get one of the first boards to experiment with also. Between the two of us, we should be able to work out all the design flaws and design a better mark 2 board that we can then share with everyone else.

Now that the robotic competition that I was mentoring is finished, I hope to start constructing the modified McWire tonight.

Mike

Edited 1 time(s). Last edit at 04/02/2010 02:43PM by rocket_scientist.
Re: Gen 2 Backplane (looking for comments)
March 16, 2010 11:05PM
Update: I haven't had a lot of time to work on this in the last week. Today I tried to replace the Arduino mini with the ATMega644P in a DIP package. There was not enough room on the PCB for it. I was using the free version of Eagle to do the PCB layout, which has a size limit. I'm going to redo the board in geda, which doesn't have that restriction.



Darwin clone, Gen 2 electronics, Arduino Duemilanove w/ AtMega328, 5D Firmware, Pinchwheel extruder
[www.codeerrors.com]
Re: Gen 2 OnABoard (was Gen 2 BackPlane)
March 17, 2010 10:01PM
I've come up with pin assignments.

The last 7 items are not used on the board, and I will likely bring those pins out to a header so that an expansion can be added. I attempted to choose these pins in such a way that they could be used for RS-485, an SD card reader or a second extruder. I'm not sure the specific requirements of operating these devices, so it might not work.

AUX will be connected to a three pin header similar to the temperature sensors. It is available for any purpose.

Most of the pin assignments were taken from pins.h (lines 48-75). Y_ENABLE, Z_MAX and FAN were changed.

Edit: Updated link.

Edited 1 time(s). Last edit at 03/18/2010 09:46AM by mccoyn.



Darwin clone, Gen 2 electronics, Arduino Duemilanove w/ AtMega328, 5D Firmware, Pinchwheel extruder
[www.codeerrors.com]
Re: Gen 2 OnABoard (was Gen 2 BackPlane)
March 17, 2010 11:21PM
mccoyn,
it is looking good. How about some postscript files of the top and bottom layers so that we can try the old laser printer approach? I still haven't had time to start the mechanical on my repstrap, but I should have time this weekend to work on stuff.

Mike
Re: Gen 2 OnABoard (was Gen 2 BackPlane)
March 18, 2010 08:18AM
I'm redoing it with gEDA so that I can make the board 4" x 4" and include all the suggestions I have gotten. Right now I am about half way through the schematic. I'll post printable images when I get to that point.

I've realized that D8 and D9 are used to communicate with the host PC. So, the free TX and RX used for RS-485 will have to be D10 and D11. I'm also thinking of making an encoder connector. This would contain GND, D0, D1 and +5V. D0 and D1 are both interrupt pins. These two changes will leave me short a few pins. I'm thinking about connecting all of the stepper enables to D3. Z_MAX will also be changed to A0 so that there is another analog sensor option.



Darwin clone, Gen 2 electronics, Arduino Duemilanove w/ AtMega328, 5D Firmware, Pinchwheel extruder
[www.codeerrors.com]
Re: Gen 2 OnABoard (was Gen 2 BackPlane)
March 18, 2010 01:07PM
mccoyn,
Let see if I can help with the pin loading.

Most of the repraps only use 3 opto-switches, and they use them only for indexing the stepper count. I had assumed that any opto-switches would be used as true limit switches, i.e. immediate stop to prevent mechanical damage. As someone else has pointed out, if you are _only_ using the opto-switches for indexing, then you can easily combine all three on pin, preferably an interrupt pin like PC4. The next level is to use all six as both index points and emergency stop signals, and have the interrupt routine decide which is appropriate. This is easily done in the firmware by seting a flag during the re-indexing process, drive one axis at a time, when the interrupt triggers, set the count to zero and then back off that axis and start the next axis. Or, you may decide that the most critical emergency stop is when the Z axis tries to go negative, and have one interrupt line for it, and a separate one for the other 5.

The stepper drive enables are good to prevent wasted power and motor/controller over heating. However, we also expect that the Z axis will be used rarely, and then only to go up one step, while the X and Y axes will be working most of the time. So I would recommend combining the X_Enabble and the Y_Enable. Since we are using few analog inputs, these slowly changing digital outputs can be placed on Port A pins without risk of loosing critical alternative functions.

What is the function of PS_ON on Port C pin 1? If you are monitoring the external power supply, it would be more useful to use a resistor divider to divide the 12V main bus down to 4volts and read that with an analog pin. That way, you could detect voltage sags or overloading while there is still enoug power to operate the ATMega or Sanguino.

I am glad to see that you caught the MOSI, MISO, SCK pins for in-circuit programming. Don't forget to add the reset pin, (pin 9 on the 40 pin DIP) as the fourth signal on the programming cable, plus power and ground.

Depending on how you want to do it, that could save up to 6 pins without a real lose of functionality, just more work for the software.

Nice design work so far. I am looking forward to the gEDA masks. I have been using gEDA at home myself, but still have lots more learning to do.

Mike


Team Open Air
Blog Team Open Air
rocket scientists think LIGHTYEARS outside the box!
Re: Gen 2 OnABoard (was Gen 2 BackPlane)
March 18, 2010 06:50PM
I've updated the pin assignments.

I'm hoping to be able to use the existing firmware with only a modification to pins.h and parameters.h. For this reason, I'm avoiding doubling up the min and max pins. My assumption is that most people won't use the max sensors and those pins will be available for something else.

I have the exact same 4 pins available for RS-485 as the gen 3 motherboard uses. If I have space I'll add the 8 pin chip to run RS-485 and at least one connector. That way, multiple extruders can be added by using the gen 3 extruder board.

AUX and ENCODER will be brought out to 3 pin headers with +5 V and GND so that new sensors can be added. AUX is an ADC pin and ENCODER is an interrupt pin.

PS_ON is connected to the green wire on the ATX connector. See this thread for more details.

There will be an expansion header, or possibly two headers so that a shield could be made that will stay in position. The unused pins will be on this header as well as some optional pins and power pins. I expect it to have the following: MOSI, MISO, SCK, RS485 IN, RS485 OUT, RS485 Tx Enable, RS485 Rx Enable, ENCODER, AUX, X_MAX, Y_MAX, Z_MAX, GND, +12 V, GND +5 V, RESET.



Darwin clone, Gen 2 electronics, Arduino Duemilanove w/ AtMega328, 5D Firmware, Pinchwheel extruder
[www.codeerrors.com]
Re: Gen 2 OnABoard (was Gen 2 BackPlane)
March 18, 2010 08:56PM
I added an image of the schematic to the Wiki and also uploaded my project directory, which should be loadable into gEDA.



Darwin clone, Gen 2 electronics, Arduino Duemilanove w/ AtMega328, 5D Firmware, Pinchwheel extruder
[www.codeerrors.com]
Re: Gen 2 OnABoard (was Gen 2 BackPlane)
March 20, 2010 06:03PM
I've created the board layout in PCB Designer. I still want to spend some time inspecting it for mistakes before I send it out.

I've updated the Wiki page with new images and a new project archive. The project archive contains the gerber files. You can load them with an open source program called Gerbv and print them out to scale or convert them to other formats.



Darwin clone, Gen 2 electronics, Arduino Duemilanove w/ AtMega328, 5D Firmware, Pinchwheel extruder
[www.codeerrors.com]
Re: Gen 2 OnABoard (was Gen 2 BackPlane)
March 22, 2010 12:50PM
It is a nice looking board! I downloaded the zip file last night. Problem is, my main Ubuntu partition is still having graphics driver problems and not loading. SuSe loads, but does not know how to talk postscript to the printer. So I have not yet been able to print the masks and make a board. Soon, I hope.

Do you have a list of components or BOM yet? I bought the SparkFun Easydrive before I learned of the cheaper, more micro steps stepper drivers from Polulu. ANd I will need to but the different ATMega, unless a pin check matches the ATMega168Ls that I already have in DIP format.

Mike


Team Open Air
Blog Team Open Air
rocket scientists think LIGHTYEARS outside the box!
Re: Gen 2 OnABoard (was Gen 2 BackPlane)
March 22, 2010 09:27PM
I'm working on the BOM now. You can see it here. This includes everything on the board, but does not include the connectors you need to connect to the headers.

If the ATMega you have fits the socket I wouldn't be surprised if you can get it to work. The big issue is that all the ground power and oscillator pins are in the right place. If not, you could modify the circuit before making it.

Edited 1 time(s). Last edit at 03/22/2010 09:28PM by mccoyn.



Darwin clone, Gen 2 electronics, Arduino Duemilanove w/ AtMega328, 5D Firmware, Pinchwheel extruder
[www.codeerrors.com]
Re: Gen 2 OnABoard (was Gen 2 BackPlane)
March 26, 2010 11:15AM
I'm trying to decide which connector to use for the heaters and fan. I don't like the screw terminals used by the PWM board because they sometimes come loose.

The .156" connector used by the stepper boards has served me well. It stays put and is easy to remove when I want it to. So, I used a 2 pin version of this in my first draft.

Now, I'm thinking about switching it to a .100" 3 pin connector that matches the pinout of a typical computer fan. The advantage is that if you want to mount a fan near the board to cool the stepper drivers there won't be any need to change the connector. The disadvantage is that it is the same connector that is used for the min and max sensors. Accidentally plugging a sensor that expects 5V into a 12V plug could cause some damage.



Darwin clone, Gen 2 electronics, Arduino Duemilanove w/ AtMega328, 5D Firmware, Pinchwheel extruder
[www.codeerrors.com]
Sorry, only registered users may post in this forum.

Click here to login