Dangerous Prototypes

In development => Project logs => Topic started by: bearmos on October 20, 2012, 08:10:06 am

Title: CNC Stepper Controller
Post by: bearmos on October 20, 2012, 08:10:06 am
Here's a concept for a CNC stepper controller.  Actual step/direction path generation is performed by a PC running EMC2 (or equivalent) and is passed to this board over the parallel port.  I wrote a full post (http://http://twilightrobotics.com/electronics/cnccontroller) describing some of the details of the design.



Goals:
This board is mainly designed to be inexpensive, have lots of indicators for showing what's going on (making troubleshooting a bit easier).  It includes integrated driver chips (not modules that need to be purchased at $15 ea), which should also help out with heat dissipation. 

The only (relatively) novel thing about this design is that it includes some circuitry to automatically reduce the current (~1/3 of "active" current) to the stepper motors after they're inactive for a period of time (probably around 1 sec).  A small PIC, an analog mux, and a resistor network are included to take care of this task.

Input power is fairly flexible, an ATX header is included so the whole thing can be powered from a computer power supply (although the 12V won't drive steppers super-fast).  Secondary inputs for 5V (logic) and a higher motor voltage (up to 30V I think).  On-board logic can also be powered from an included LDO and only use the motor voltage input (hopefully the LDO doesn't overheat - if it does, that's what the external 5V connection is for ;-)).

If the board form-factor looks familiar, that's because it's based on a DP10080.  I had started the board out with the max dimensions of eagle, towards the end I rounded the corners and nudged mounting holes a bit to get it into the "standard" form factor.

Rendering was done with Eagleup and Kerkythea, following the excellent guides on the DP wiki (http://http://dangerousprototypes.com/docs/Category:3D_Rendering).  All additional models that were required are in the DP SVN (http://https://code.google.com/p/dangerous-prototypes-open-hardware/source/browse/#svn%2Ftrunk%2FEagle_Part_Library%2FSketchUp_Part_Models%2Fcontrib).

Design Review
I'd love to hear some feedback before I send it off to fab.  Unfrotunately, A4982's in QFN's have fallen off the face of the earth until early 2013 - so I'm either going to have to wait on them or redesign for the TSSOP version of the driver. . .

Source
* A jpeg of the SCH that's too small to be useful: [attachment=1]
* SCH PDF: [attachment=0]
* PCB screenshot: [attachment=2]
* A sketchup model (current in Twilight Robotics SVN (http://http://svn.twilightrobotics.com/viewvc.cgi/boards/stepDriveInterface/trunk/docs/))
NOTE: This sketchup model can't be added, the skp extension isn't allowed and max file size is 1MB.

A [s:]up-to-date[/s:] bleeding edge schematic/board can be found in the trunk (http://http://svn.twilightrobotics.com/viewvc.cgi/boards/stepDriveInterface/trunk/) of StepDriveInterface (http://http://svn.twilightrobotics.com/viewvc.cgi/boards/stepDriveInterface).

[update]
This version has been tagged revA (http://http://svn.twilightrobotics.com/viewvc.cgi/boards/stepDriveInterface/tags/revA/).
Title: Re: CNC Stepper Controller
Post by: fcobcn on October 20, 2012, 05:17:42 pm
Fantastic work!
I would happily change my current setup for something like your driver:

[attachment=0]

viewtopic.php?f=19&t=2414#p23139 (http://dangerousprototypes.com/forum/viewtopic.php?f=19&t=2414#p23139)

Only one suggestion, think of adding a fourth axis driver, I'm currently planning to add a divisor head to my small CNC for jewelry work, having everything on a single PCB would be really cool.
Title: Re: CNC Stepper Controller
Post by: bearmos on October 21, 2012, 02:47:27 am
Thanks, fcobcn. 

Right now the board is at the limits of the eagle free edition, so I'm not sure that a fourth axis would be possible without trading off some of the other features I wanted.  The predecessor to this board was basically a parallel port breakout board with some DE9 connectors that went to individual drivers on each stepper - similar to the setup you currently have, except that each drive was intended to be mounted close to the motor - this gives a lot more wiggle room for extra axes without creating boards that are enormous (i.e. expensive).  I'll definitely keep it in mind for future revisions, though.
Title: Re: CNC Stepper Controller
Post by: arakis on October 22, 2012, 11:36:26 am
Awesome design. The PCB looks similar to our standard PCBs, but it's not right...
Title: Re: CNC Stepper Controller
Post by: bearmos on October 22, 2012, 01:03:04 pm
[quote author="arakis"]Awesome design. The PCB looks similar to our standard PCBs, but it's not right...[/quote]

Originally, the board was 100% of eagle's max dimensions, I realized you had a 100x80 SoB so I imported the footprint and moved the hole locations to match, adding the arch's to the cutout as well.  A smaller keepout was used around the mounting holes than recommended, mainly because I didn't want to give up the width in the traces.  Is there something else off that you noticed (I'll have to take another look).
Title: Re: CNC Stepper Controller
Post by: bearmos on October 23, 2012, 02:29:01 pm
Currently, a QFN version of the A4982 is on the board.  Since this chip isn't available until mid Janurary 2013 (Allegro has packaging issues from what I hear), I'm going to use the TSSOP-24 version instead.

I threw down the new footprint and was pleasantly surprised. . . one side of the TSSOP shares the same pinouts as a side of the QFN.

Here's what the routing looks like after the offending traces have been removed (note that nothing has been re-routed or moved yet)
[attachment=1]

The output pinout also has the same ordering, so the connector's pinout won't need to change (ratsnest embellished for clarity):
[attachment=0]

This definitely makes changing packages a bit less painful than I originally thought, which is a pleasant surprise!
Title: Re: CNC Stepper Controller
Post by: bearmos on October 24, 2012, 06:03:46 am
[attachment=2]
Routing is complete for the X-Axis.  Changing packages gave me an excuse to move from 2010 power resistors to 2512 (notice they moved off to the side).

Some other support components needed to shift around a bit as well - a cap moved from the side to join it's brothers (or maybe sisters?) on the bottom left row, bulk cap is now on the right (instead of left).

There are...lots...of...vias (and a starling lack of thermal reliefs).  This is so heat from the driver and power resistors is efficiently transferred to the relatively solid layer of copper on the bottom of the board.  It's surprising how well multiple small vias work for this purpose.

Other layout considerations worth noting might be the proximity of the small ceramic caps to the Vmot pins.  This, as well as the multiple vias is to minimize the resistance between the motor supply voltage pin and the bypass cap, which is providing the short bursts of current.

As with the last iteration on the QFN, as many poly regions are used as possible in an attempt to minimize the resistance between the IC pins and connector pins.  The longest is around 150 mils (~3.8mm), which is longer than I'd like.  According to the circuit calculator (http://http://circuitcalculator.com/wordpress/2006/01/31/pcb-trace-width-calculator/) this is going to give a 60 degC temperature rise (and it'll dissipate almost 35  mW)!
[attachment=1]

Not exactly desirable, but we'll see what happens (the datasheet recommends a similar configuration).  The recommended layout appears to be around 30 mils shorter before it gets to the larger width trace:
[attachment=0]

So, now it's just a matter of reproducing this layout on the other 2 axis (this is definitely one thing I hate about eagle - no convenient way of copying identical layouts)
Title: Re: CNC Stepper Controller
Post by: matseng on October 24, 2012, 06:33:36 am
[quote author="bearmos"]There are...lots...of...vias (and a starling lack of thermal reliefs).  This is so heat from the driver and power resistors is efficiently transferred to the relatively solid layer of copper on the bottom of the board.  It's surprising how well multiple small vias work for this purpose.[/quote]

It would be interesting to know hot much the thermal resistance thru the board and vias would decrease if using 0.8mm pcb laminate instead of the regular 1.6mm.

And is there a difference of using 0.3mm (12mil) vias compared to 0.6mm for heat transfer to the bottom ground layer?
Title: Re: CNC Stepper Controller
Post by: bearmos on October 24, 2012, 06:50:42 am
you know, i never really thought about that matseng. . definitely less expensive than adding an extra two layers of ground (which also only helps with ground, which is usually what i'm trying to minimize resistance/inductance to).  I seem to remember a cree datasheet discussing something along these lines...
Title: Re: CNC Stepper Controller
Post by: bearmos on October 24, 2012, 06:54:25 am
here we go: cree thermal app note (http://http://www.cree.com/~/media/Files/Cree/LED%20Components%20and%20Modules/XLamp/XLamp%20Application%20Notes/XLamp_PCB_Thermal.pdf), check out page 11.
[attachment=0]
Title: Re: CNC Stepper Controller
Post by: bearmos on October 24, 2012, 06:56:53 am
[quote author="bearmos"]you know, i never really thought about that matseng.[/quote]

The sad part is that I *have* thought about this before. . .just forgot.  Too often, I just assume I'm limited to the constraints of whatever ordering system I'm going with.  In this case I was planning on ordering this through OSH Park, which is .062" thick PCB's only ( I think )
Title: Re: CNC Stepper Controller
Post by: matseng on October 24, 2012, 07:10:16 am
[quote author="bearmos"]here we go: cree thermal app note (http://http://www.cree.com/~/media/Files/Cree/LED%20Components%20and%20Modules/XLamp/XLamp%20Application%20Notes/XLamp_PCB_Thermal.pdf), check out page 11.][/quote]
I'd say that there are a major improvement in thermal resistance both in going to 0.8mm pcb and in doing slightly larger vias. And in addition to that hand soldering the hot parts so the vias will get properly filled with solder will make it even better....

Definitely good to know.  I'm already at 0.8 mm as my standard thickness unless I really need the extra rigidity the 1.6 provides - 1.6mm feels so "like 20 years ago" when doing smd.  I'll just have to remember to do fat vias for cooling as well, normally I just use 12 mil vias out of habit.
Title: Re: CNC Stepper Controller
Post by: bearmos on October 24, 2012, 07:19:17 am
thanks a lot for bringing this up, matseng!

[quote author="matseng"]1.6mm feels so "like 20 years ago" when doing smd[/quote]
I had a friend in college that complained that the FR4 I was getting from radioshack for DIY etching was "too thick" - with the same reasoning - it just looked too thick:)  I guess i just order the .062" stuff out of habit - in the boards I design for work, rigidity is important, aesthetics aren't ;-)
Title: Re: CNC Stepper Controller
Post by: matseng on October 24, 2012, 07:45:26 am
Boards for real life work stuff is another ballgame.  But for prototypes and for my own normal "light usage" the 0.8 is fine.  And in addition to that I in the illusion of reducing my  waste/pollution footprint a tiny bit.  And of course it saves quite a bit on shipping costs when getting a batch of boards from Seeed with DHL/Fedex since the boards are half the weight.

For DIY etching my preferred board would be the Phenolic Paper version with 0.5 oz copper.  Easy to cut and faster to etch.  Hard to find though.....
Title: Re: CNC Stepper Controller
Post by: bearmos on October 26, 2012, 09:21:45 am
TSSOP packages and 2512 resistor packages have been fully integrated now. I also added more thermals for the resistors (which also decreases the resistance/inductance - so the current reading will be more accurate):
[attachment=4]

I also added some more thermal area for the regulator (which needs to change to accommodate higher input voltages (ideally up to 35V).  Right now I'm looking at a - if anybody has any other suggestions (or if you can get me an entire buck supply for < $2 - I'd like to hear them:)
[attachment=3]
[attachment=2]

The current board (with TSSOP and 2512 resistors - and the LM1117 that won't work) is in the [url=http://svn.twilightrobotics.com/viewvc.cgi/boards/stepDriveInterface/trunk/]trunk (http://http).

Next up will probably be replacing the 5V select jumper (and component DNP's) with some diodes to add some fool-proofing:
[attachment=1]
[attachment=0]
Title: Re: CNC Stepper Controller
Post by: blarson on October 27, 2012, 06:00:26 pm
There are half a dozen buy-it-now (not auction) listings of lm2596 based buck dc-dc converters less than $2 postpaid from china.
Title: Re: CNC Stepper Controller
Post by: bearmos on October 28, 2012, 03:20:10 am
thanks blarson, I haven't looked at the simple switchers in a while.  I'm looking at possibly making more than ones of these, so I definitely wouldn't want to be relying on ebay sourced ic's for them (mainly just because availability/quality would be up in the air). 

It looks like after support components, it would probably wind up being around $5 or so.  I'll definitely look into it more deeply if the LDO winds up getting to hot, but hopefully if I keep the current driving the LED's reasonably low it won't be a huge issue (since the IC's themselves don't draw much current)
Title: Re: CNC Stepper Controller
Post by: blarson on October 28, 2012, 06:03:33 am
$2 is the whole step-down supply, with the output voltage set by a multi-turn pot.
Title: Re: CNC Stepper Controller
Post by: bearmos on October 28, 2012, 08:16:08 pm
[quote author="blarson"]$2 is the whole step-down supply, with the output voltage set by a multi-turn pot.[/quote]
impressive, but unfortunately an entire module makes for an even more difficult time ensuring that it'll be source-able.  It's definitly good to know they exist though.
Title: Re: CNC Stepper Controller
Post by: bearmos on November 06, 2012, 06:10:46 am
WRONG PITCH TSSOP - DOH!!

I was reviewing the layout before sending it out and found out that I had used a 0.5mm pitch TSSOP-24 footprint (the A4982 has a 0.65mm pitch)!

So, this is what I wound up with...at least I caught it before ordering the PCB. . .
[attachment=2]

Here's what it should have looked like originally:
[attachment=0]


The corrections were a bit more all-encompassing than before - space is pretty tight with the new 2512 power resistors.  The X and Y axis's are fixed, Z axis is in progress...

While I'm at it, I'm also "fool-proofing" the step-type jumpers.  The change just adds some space so that there's only one way to put a 2 position jumper into each. Under the original layout, it would have been possible to place a jumper in the wrong orientation.
[attachment=1]
Title: Re: CNC Stepper Controller
Post by: bearmos on November 06, 2012, 07:05:34 pm
Replaced 5V jumper selection with some diodes.  Now the board should just select whatever 5V source has the highest potential - multiple 5V sources being available at the same time will pose no risk:
[attachment=3]
[attachment=2]

Gerbers were created and I'm sending an RFQ to hackavana to see what their pricing is like.  It sounds like their lead time is better than Seeed/ITead and (from the sounds of things, they have great support).

If anyone would care to give the design a quick look, I'd appreciate it.  The absolute latest is here:


PDF of the schematic is attached, as well as PCB gerbers. (http://http)
Title: Re: CNC Stepper Controller
Post by: JuKu on November 06, 2012, 08:22:01 pm
Diode loss! Are all your chips happy with 4.3v or less?
Title: Re: CNC Stepper Controller
Post by: bearmos on November 06, 2012, 09:19:40 pm
[quote author="JuKu"]Diode loss! Are all your chips happy with 4.3v or less?[/quote]
I probably should have pointed that out - thanks for noticing!  The most picky IC's on the board should be content with 3V.
Title: Re: CNC Stepper Controller
Post by: bearmos on November 09, 2012, 02:18:18 pm
The little SOIC-8 12 series PIC has been replaced by a 16F54 (SSOP-20).  Surprisingly, they're nearly the same price.  This actually gives me enough pins to add on a proper programming header.  With the 12F629, I had to use MCLR for an IO line, so after that fuse bit was set, the chip effectively became an OTP (the circuit had to be laid out again anyway, since there was no programming header brought out).
[attachment=2]

All of the spare pins were broken out to test points (albeit very small) (labels are in yellow on the secondary side).
[attachment=1]

A slew of test points was added to the board as well, mainly getting at intermediate signals that would need testing in a production environment.  The test points are on the bottom of the board and have a silk screen around them that (if placed over each other) ensures they're at least 0.1" pitch apart, so a test fixture with pogo pins should be able to be easily developed.  The idea is to use these, along with some cup pogo pins for testing the connector-ized signals.
[attachment=0]

I've sent this board off to hackvana (http://http://www.hackvana.com/store/)(discussed here (http://http://dangerousprototypes.com/forum/viewtopic.php?f=2&t=4722)) for fab.  Right now I'm just sticking with 1oz/inch copper and green soldermask, since the first prototype won't work anyway (they never do).  Eventually, this board is intended to be 2 oz/inch with a black mask.
Title: Re: CNC Stepper Controller
Post by: dolabra on November 09, 2012, 07:11:03 pm
[quote author="bearmos"]With the 12F629, I had to use MCLR for an IO line, so after that fuse bit was set, the chip effectively became an OTP (the circuit had to be laid out again anyway, since there was no programming header brought out).
[/quote]

Moving from 12f to 16f was probably a good thing, but pics don't have that problem (since you said fuse, I'm assuming you are thinking about AVRs). You can use MCLR as an IO and still program the device in-circuit, no problem.  You do however need to think about what you are connecting to the MCLR pin as VPP will be applied to that pin during programming.  As long as what you are connecting to the pin can deal with 13V and doesn't put too much load on the pin, you're OK.  Maybe this is what you were refering to? if so, sorry.  When you said fuse I was thinking about the "high voltage vs low voltage AVR thing"
Title: Re: CNC Stepper Controller
Post by: bearmos on November 09, 2012, 07:30:46 pm
[quote author="dolabra"]but pics don't have that problem (since you said fuse, I'm assuming you are thinking about AVRs)[/quote]
I think MC might refer to this as a configuration register (it's been a while).  From what I read, there appears to be a special case were the combination of internal oscillator usage and MCLR being remapped to a GPIO makes it nearly impossible to reprogram the device.  Apparently, this isn't as much of an issue if the circuit uses an external crystal, though.  I remember running into this problem with the very first PIC I used.  Regardless it won't be an issue since MCLR is by itself now.

[quote author="dolabra"]Moving from 12f to 16f was probably a good thing[/quote]
Originally, I was going to use this as an excuse to pick up some MC assembly.  The role of the MCU is extremely simple (monitoring 3 sets of lines and setting the corresponding outputs it's been idle for more than a second).  Now, with the 16f, I'll probably just do it in C because I'm so lazy ;-)  I was also surprised to find that the 16f is actually less expensive than the 12f.  I'm guessing they're trying to phase out the 12 series.
Title: Re: CNC Stepper Controller
Post by: dolabra on November 09, 2012, 10:39:25 pm
hold the phone ---- 16f54 is cheap because it doesn't have an internal oscillator are you sure that is what you want?

regarding the 12f configuration settings -- you might be right.  I've not seen huge issues when using a pickit2. I have had problems with serial port programmers, I think it is a function of how the programmer applies VCC and VPP.  I have found the pickit2 and stand alone app pretty robust. Occasionally I find that it will fail under the conditions you say and have to restart the pickit2 app.  YMMV
Title: Re: CNC Stepper Controller
Post by: bearmos on November 09, 2012, 11:00:45 pm
[quote author="dolabra"]hold the phone ---- 16f54 is cheap because it doesn't have an internal oscillator are you sure that is what you want?
[/quote]
oops!  Apparently I take internal oscillators for granted now:  Looks like I'll need to find something pin compatible.
Title: Re: CNC Stepper Controller
Post by: dolabra on November 10, 2012, 03:48:17 am
oops.  Maybe PIC16F1826.  I think it has similar pins.  I think you need to look at the "18 pin" pics they have the power pins in the center of the chip.  It looks like most of them also come in 20pin SSOP packages with a pair of power pins.
Title: Re: CNC Stepper Controller
Post by: bearmos on November 14, 2012, 06:42:11 pm
the PIC16F1826 looks perfect dolabra, thanks again for pointing this out, it looks completely pin compatible with the 16F54
Title: Re: CNC Stepper Controller
Post by: bearmos on December 07, 2012, 11:23:31 am
Got the PCB's from hackvana last week.  I've assembled one and for the most part everything is working. 

There are plenty of silly design level mistakes:
- Home LED's turning on when an axis is *not* homed (need to use 541 buffer for syncing current on the home LED's instead of sourcing).  Looking at the SCH quickly this is glaringly obvious. . .not sure how that got missed. . .
- R49 needs to be a short, not 1k
- silk screen on the A4982 step mode setting is backwards (still need to look into this).

Two assembly issues that still needs resolved:
- The x axis Vref current setting seems to be pegged (most likely an assembly issue).
- need to buy a SOIC analog mux (sourced a TSSOP but PCB has a SOIC footprint)

The driver chips get hotter than I was hoping for.  There seems to be a decent amount of heat being transferred to the secondary side of the board, so I may try and find a way to heat sink the bottom (the original plan was to use some thermally conductive material and butt it up against the base plate of an aluminum case).
Title: Re: CNC Stepper Controller
Post by: katjap on December 07, 2012, 09:30:00 pm
WOW! it looks beautiful! Gratz bearmos! ^_^
Title: Re: CNC Stepper Controller
Post by: bearmos on December 17, 2012, 09:43:00 am
Testing has been going fairly well.  Because I went with the stock thickness PCB (1.6mm) and just 1 oz/inch copper, thermal performance certainly leaves a bit to be desired, but it's certainly useable.

There have also been a few gotcha's, like EMC's default hardware estop implementation, which assumes if it gets an ESTOP input, the ESTOP output that it generates will automatically be latched by the hardware.  Luckily LinuxCNC has a really useful HAL (hardware abstraction) language with user customizable code that runs, so after diving in an learning a bit about how the HAL is setup, the software ESTOP will keep track of it's own output signal, as well as accept input from the external ESTOP.  This means that ESTOP can now be generated by hardware or software and the software will stop executing gocde and the hardware will disable power to the stepper drivers. Details on the HAL implementation can be found here (http://http://twilightrobotics.com/wiki/CNC_Controller_LinuxCNC_Setup)

Also, here's an overview of all the changes from revA to revB: http://http://twilightrobotics.com/electronics/cnccontrollerrevb
Title: Re: CNC Stepper Controller
Post by: Sleepwalker3 on December 17, 2012, 01:02:57 pm
[quote author="matseng"] And of course it saves quite a bit on shipping costs when getting a batch of boards from Seeed with DHL/Fedex since the boards are half the weight.

For DIY etching my preferred board would be the Phenolic Paper version with 0.5 oz copper.  Easy to cut and faster to etch.  Hard to find though.....[/quote]

Unless going over the maximum satchel weight, it shouldn't make any diff to the price - of course your batch of boards may be over that weight. Why not use FR4 with 1/2 Oz copper if you specifically want quick etching? - not that there is that much diff in the etching time between the two, in that it's still pretty quick.
Title: Re: CNC Stepper Controller
Post by: Sleepwalker3 on December 17, 2012, 01:28:24 pm
[quote author="bearmos"][quote author="JuKu"]Diode loss! Are all your chips happy with 4.3v or less?[/quote]
I probably should have pointed that out - thanks for noticing!  The most picky IC's on the board should be content with 3V.[/quote]

Ever heard of Schottky's ?  Just watch the PIV.  What sort of current are you expecting to pull on the 5V line?
Title: Re: CNC Stepper Controller
Post by: bearmos on December 17, 2012, 02:11:05 pm
[quote author="Sleepwalker3"]
Ever heard of Schottky's ?  Just watch the PIV.  What sort of current are you expecting to pull on the 5V line?[/quote]
Yep and that's exactly what's spec'ed (B0520WS-7-F (http://http://www.digikey.com/scripts/DKSearch/dksus.dll?Detail&itemSeq=122510549&uq=634913231346514821) specifically;-) - which is why I wasn't all that worried about it.  I really do appreciate the concern and suggestions!  Expected draw on the 5V line is < 250mA with all 12 LED's on - if they're driven at 20mA, closer to 120mA if I go down to 10mA drive current.  In normal operating conditions, none of the LED's should be on full-time.  The diodes chosen are rated for 500mA with a max forward voltage of 430mV.

After I get the remaining parts (analog mux, ATX jumper posts), get some firmware together see if those aspects work, I'll probably offer up the remaining PCB's since everything seems to be working tolerably.

In a future rev, I'm considering looking into some sort of reverse polarity protection for the motor voltage line (up to 35V @ 6A) and possibly doing some switching for the spindle on-board (this could be anything from DC for a brushed motor to mains for a rotary tool/router).  The reason it got left off of in this round was time, space, cost, and complexity ;-)  The original thought (which is implemented on the current revB) was to simply provide an output that would drive an SSR - so then the end-user worries about what they're switching, amperage clearances, etc.  Even including a relay socket would take up a large amount of board space and bring the nasty world of high current mains onto the PCB, which I really don't want to deal with for this project.

Any thoughts?
Title: Re: CNC Stepper Controller
Post by: matseng on December 17, 2012, 05:10:56 pm
It seems like most stepper boards are using integrated solutions.  Is it very very hard to make the h-bridges with discrete fets, drivers and a microcontroller if you also want microstepping? Just wondering - I've never been fiddling with motor drivers....
Title: Re: CNC Stepper Controller
Post by: Sleepwalker3 on December 17, 2012, 05:37:20 pm
OK. Please don't take my suggestions or questions as negative, just I see a lot of people making 'simple to make' mistakes. If I'm telling you how to suck eggs, then let me know.

Re. The diodes, Lots of ways of doing it, Diodes like you have done is one way (but some disadvantages as you've mentioned), MOSFET switch, Relay, etc. Good old-fashioned Relay makes it simple and are available in 6mm wide (little board real estate). Have the Relay NC circuit from the Reg., have the coil turned on when (if) the PC supply kicks in and the C/O contacts would switch to feed Vcc from the PC supply.

Re. Spindle - Well SSR keeps it off the board (assuming you use the heatsink mountable type), but you may possibly have some problem with noise getting back to the board (though that's the case with anything if not handled right), though that's sortable. An off-board relay on a proper base is fine, so long as it's appropriately rated - the mistake people often make is thinking that the AC switching rating will be the same as the DC rating and likewise that the 'headline rating' (which is almost always the Resistive rating) will be the same as the Inductive rating - it won't and the inductive rating will be much lower.

Re. LEDs - Are you talking 20mA per LED? If you're using high efficiency LEDs (and most are these days), you can usually (depending on the application) get away quite happily with 5 or 6 mA per LED and be more than bright enough for most indicator applications (Diffused are better for indicators), in fact you can often go quite a bit lower and still have ample brightness. Your current circuit looks to be using 500R and depending on LED colour, lets say Red and 2V across the LED, so 5V-2V=3V (I'm so good at maths aren't I?    ;)  3V/500R=0.006A      i.e. 6mA      I'd suggest trying your leds out with a 1K and see if they're bright enough, I think you'll find they are.

I reckon you are really tempting fate trying to pump 24V into a little baby regulator like that, as you noted, the dissipation is going to be pretty mean. I know hobbyists try to save every cent, but would $10 be too much if you had a readily available source of switch reg that would fit in a TO220 footprint? If that sounds OK, I'll point you in the right direction.

If you haven't already, you should checkout Sparkfun's Stepper boards, as I think they used the same chips and people found they could get the full ratings out of them with the dissipation involved. Could you route the section of the board under the chip (have your fab do it later obviously!) and fit up a block of aluminium (or Aluminum if you're a yank) into the cut-out, obviously a good thermal interface medium between the two, and transfer the heat down to the chassis, where again you use a good thermal interface medium?  Essentially get rid of the vias and turn it into a block of Aluminium that connects to the chassis to give it real heatsinking. I wouldn't likely be going down that path if I was it were me, there's decent drives out there for 'reasonable' prices, though I understand the appeal of making it yourself.  I'd make my own breakout, probably, but I don't believe those chips are a good design overall - not knocking them, I just think they have put unrealistic ratings on them for decent use.


How are you working the logic on the E-Stop button, i.e. It looks like you're expecting to bridge the connection when the button is pressed in (i.e. when there is an emergency), thereby pulling E-STOP_IN high, pulls the output of the buffer high, sends a high to the PC, sends a high via D2 which eventually ends up pulling the /Enable Line on the Driver chip high, thereby Disabling it - Correct?
Title: Re: CNC Stepper Controller
Post by: bearmos on December 17, 2012, 07:39:01 pm
[quote author="matseng"]It seems like most stepper boards are using integrated solutions.[/quote]
Yep, they're inexpensive require little board space (quick also adds to the inexpensiveness) and are easy to design in.

Quote
  Is it very very hard to make the h-bridges with discrete fets, drivers and a microcontroller if you also want microstepping? Just wondering - I've never been fiddling with motor drivers....
Usually, you'll use a translator IC to take care of the chopping and microstepping and then do the discrete FET's or maybe an H-bridge IC in a large package.  It is more involved (and costs more).  I think most hobbyist applications find that they can get away with using the integrated solutions, so they do.  I'd like to get into some higher power discrete solutions in the future.

[quote author="Sleepwalker3"]OK. Please don't take my suggestions or questions as negative, just I see a lot of people making 'simple to make' mistakes. If I'm telling you how to suck eggs, then let me know. [/quote]
Not at all.  I make far more mistakes than I'd like (a lot of times when I (should) know better).  I really do appreciate all the input!  If I come off as being defensive - it's certainly not intentional :(

[quote author="Sleepwalker3"]you can usually (depending on the application) get away quite happily with 5 or 6 mA per LED and be more than bright enough for most indicator applications...I'd suggest trying your leds out with a 1K and see if they're bright enough, I think you'll find they are.[/quote]
Yeah, I'll definitely be trying out a lower current.

[quote author="Sleepwalker3"]I reckon you are really tempting fate trying to pump 24V into a little baby regulator like that, as you noted, the dissipation is going to be pretty mean. [/quote]
While driving the LED's in their existing configuration, this correct. The worst-case won't be so bad if the LED current is reduced down to 5-6mA ea (even then I'm still looking at dissipating around 2 watts worst case (.006mA * 12 LED's * 30 volt drop).  On the positive side, the regulator specified ( IFX27001) has built in thermal protection, so if things do overheat, it shouldn't cause any permanent damage.  Admittedly, I wouldn't think about using an LDO in this capacity for something I was doing in my professional life. . .

Quote
I know hobbyists try to save every cent, but would $10 be too much if you had a readily available source of switch reg that would fit in a TO220 footprint? If that sounds OK, I'll point you in the right direction.
I think in this case the $10 probably is too much, although I'm always curious to hear what other people like ( I had a bad experience with a "Simple Switcher" once :(  - I think it was due to a poor layout). 

[quote author="Sleepwalker3"]How are you working the logic on the E-Stop button, i.e. It looks like you're expecting to bridge the connection when the button is pressed in (i.e. when there is an emergency), thereby pulling E-STOP_IN high, pulls the output of the buffer high, sends a high to the PC, sends a high via D2 which eventually ends up pulling the /Enable Line on the Driver chip high, thereby Disabling it - Correct?[/quote]
Spot on.  This arrangement also allows the PC to supply an ESTOP.  Certainly not as robust as going directly into a relay that cuts power to the whole thing.  Admittedly, this is a bit indirect and doesn't even allow for a single point of failure (the buffer), but it seemed like a step in the right direction from the usual purely software-implemented ESTOP's.  Suggestions?

[quote author="Sleepwalker3"] Could you route the section of the board under the chip (have your fab do it later obviously!) and fit up a block of aluminium (or Aluminum if you're a yank) into the cut-out, obviously a good thermal interface medium between the two, and transfer the heat down to the chassis, where again you use a good thermal interface medium?[/quote]
Aluminum for the yank ;-) and you'll also find that I tend to speak in terms of mils and inches ( I fully realize I'm in the minority here, but until I can actually visualize what a mm is I'll have to live with my curse. . .)  I was really hoping that this board could be used with or without external heat sinking (not up to the max ratings without external heat sinking of course).  I like the idea of an Al block under a routed portion of the board, but this would necessitate the need for an external enclosure (which isn't a desirable requirement to impose).  I've had good luck with a 4 layer board with the same chip and a similar layout tied to a chassis sheet metal.  I need to do a bit of research and figure out if it's reasonable to expect similar performance from 2oz/inch copper and a thinner FR4 substrate (probably not) - more along the lines of 0.8mm.
Title: Re: CNC Stepper Controller
Post by: Sleepwalker3 on December 18, 2012, 08:35:26 pm
A bit to cover there and I've been working back really late, so I'll reply when I've got a moment. :)
Title: Re: CNC Stepper Controller
Post by: bearmos on December 18, 2012, 08:52:17 pm
[quote author="Sleepwalker3"]A bit to cover there and I've been working back really late, so I'll reply when I've got a moment. :)[/quote]
No worries - in summary: "Thanks!"

( ! ) Fatal error: Uncaught exception 'Elk_Exception' with message 'Please try again. If you come back to this error screen, report the error to an administrator.' in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
( ! ) Elk_Exception: Please try again. If you come back to this error screen, report the error to an administrator. in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
Call Stack
#TimeMemoryFunctionLocation
10.02082314016session_write_close ( )...(null):0
20.02112445608ElkArte\sources\subs\SessionHandler\DatabaseHandler->write( )...(null):0
30.02112446384Database_MySQL->query( ).../DatabaseHandler.php:119
40.06522585120Database_MySQL->error( ).../Db-mysql.class.php:273