Unoffical empeg BBS

Quick Links: Empeg FAQ | RioCar.Org | Hijack | BigDisk Builder | jEmplode | emphatic
Repairs: Repairs

Page 2 of 2 < 1 2
Topic Options
#308240 - 15/03/2008 02:12 Re: Electronics help- H-Bridge is annoying me [Re: mlord]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14478
Loc: Canada
Originally Posted By: mlord
Mmmm... so long as I use a totally independent power supply for the motor side of the house, it works flawlessly now.
...
It's good enough now, but I really don't want another wall wart in that room. Powering the motor side directly from the 5V line of the ATX PSU in the box can still glitch it. So I may try a 12V line instead, and use a 7805 to step that down to 5V on the motor board.


Well, heh.. that was interesting.

I created an onboard 5V PSU with a 7805 connected to the 12V ATX supply from the MythTV box. No difference from just using the 5V directly from the ATX box: still glitchy. Despite placing the recommended ceramics (from the 7805 datasheet) right next to the regulator.

Oh well, yet another wall wart does seem to be in the works now..

Cheers

Top
#308241 - 15/03/2008 02:14 Re: Electronics help- H-Bridge is annoying me [Re: gbeer]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14478
Loc: Canada
Originally Posted By: mlord
Yeah, I really need a storage scope here, to find out what's actually happening.

Originally Posted By: gbeer
Ok! So break out the Altoids tin already. smile


Yeah, baby.. oh yeah! smile

(just gotta find one that I like, at a reasonable price..).

Cheers

Top
#308243 - 15/03/2008 04:44 Digital Storage Scopes.. cheap! [Re: mlord]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14478
Loc: Canada
Originally Posted By: mlord
Originally Posted By: mlord
Yeah, I really need a storage scope here, to find out what's actually happening.

Originally Posted By: gbeer
Ok! So break out the Altoids tin already. smile


Yeah, baby.. oh yeah! smile

(just gotta find one that I like, at a reasonable price..).


Well, well..

Tough choice.. smile

The price on the second one seems to vary week by week, from $585 to $799. Currently $674.

Top
#308244 - 15/03/2008 05:51 Re: Electronics help- H-Bridge is annoying me [Re: mlord]
Ross Wellington
enthusiast

Registered: 21/02/2006
Posts: 325
Hi,

Shonky is correct about layout problems causing EMI/EMC susceptibility.

A couple of thing to consider when you transfer the design to Printed Wiring Board (PWB).

1) The controller device is CMOS and even though the output of the chip is controlling very slow events, the rise and fall time is usually very fast. I noticed that the design does not include any termination for the lines that drive the motor controller. It is often a good idea to series terminate the lines at the driver side. The termination resistor can be roughly estimated by:
a) Estimate the output impedance of the driver (RO)
R(Out) = V(OL) / I(OL)
Example: The datasheet specifies Normal Drive Output Low
Voltage V(OL) as 0.3V and Low Output Current I(OL) as 2mA.

R(out) = 0.3V / 2mA = 0.3 / 0.002 = 150 Ohm

The wiring you have in your circuit is around 100 Ohms, this
exceeds the 150 Ohm and no series termination should be
required. The worst it will do is degrade the rise and fall
time a little which in your case is negligible.

The output drive strength is programmable. The datasheet also
specifies that it has a high-drive capability of 8 mA at
VCC=3.3V. If it is progammed for high drive (to drive your
opto-isolators), the value of R(Out) is calculated as:

R(Out) = V(OL) / I(OL)
The datasheet specifies Normal Drive Output Low
Voltage V(OL) as 0.3V and Low Output Current I(OL) as 8mA.

R(out) = 0.3V / 8mA = 0.3 / 0.008 = 37.5 Ohm

b) To terminate the line properly (to eliminate reflections that
may cause Overshoot - which may over-Voltage the output driver
power ESD clamps)for the high-drive case, you need to use the
following calculation:

R(Series) = Zo - R(Out) Where:
R(Series) is the series termination resistance value
Zo is the target impedance of the transmission line
(The target impedance of the circuit board - like 50 Ohms)
R(Out) is the output resistance you just calculated above

R(Series) = 100 Ohms (your wire impedance of your breadboard)
R(Out) = 37.5 Ohms (calculated above)

R(series) = 100 Ohms (-) 37.5 Ohms = 62.5 Ohms (use a 68 Ohm)

If you don't need the extra drive for the Opto-isolators,
just program it out.

For your new board layout use the target impedance of board
(preferred 50 Ohm Characteristic Impedance) for Zo in the
formula above.


PWB Board & Routing Recommendations:
------------------------------------

1) Use a 4 layer PWB. You can use a similar stack-up like this:

Layer 1 - Signal Layer 1
Layer 2 - Solid Ground and Routed Power within Ground
Layer 3 - Signal Layer 2
Layer 4 - Ground

If you have to use a 2 layer (increases susceptibility and
emissions), use the following stack-up:

Layer 1 - Signal Layer
Layer 2 - Ground and Routed power within Ground

On Layer 1, use a ground fill with around 10 mil spacing
around the traces. Make sure that the ground fill vias into
the Ground on Layer 2 (don't leave unconnected Ground Islands
on Layer 1. Sometimes it works to drill a hole and solder a
wire from the Ground Island to layer 2 Ground Plane - Vias
work better though. Make sure you don't drill through traces
on Layer 2 though <grin>.

2) Place your sensitive lines in Layer 3 like Reset,
CBUS lines and UART Lines if you use them, & USB Lines. Route
non-sensitive lines on Layer 1 of the 4 Layer Stack-up.

3) Do not route any lines across or adjacent to the Routed Power
Traces or to Reset

4) Route 8 mil traces with 4X the line width space from edge to
edge ie... If your trace width is 8 mils the next trace
adjacent to it is 32 mils away edge-to-edge. This is
conservative, but you don't have a lot of traces, so use the
space. This prevents crosstalk, but if the board is small,
with short traces, you can go down to 2X with no problem.

5) Don't route any of the motor outputs or motor power traces
near the digital traces.

6) Consider a plane split bridged by a Zero Ohm resistor between
the Motor circuitry and the Digital Circuitry to partition
the noise. It is easier to add or remove it. The Opto-
Isolator can easilly cross the boundary, but if you need a
common ground, the Zero Ohm Resistor is easy to install.
Since you have Opto-isolators, no digital return currents
have to cross the boundary and you should be okay.

7) Make the power traces wide (20 mils). As Shonky mentioned,
The decoupling capacitors should be close to the chip. Place
them with the smallest value closer (a 100nF capacitor is
placed closer to the chip than a 10uF capacitor is), to the
chip VCC and via directly into the ground plane(s). The 10 uF
can be placed further away.

8) Place any series resistors at the driver side of the net.

9) Route the motor traces as a Differential Pair as much as
possible if they are long. They do not have to be matched.

10) Route the USB Bus as a Differential Pair on the inside
layer for the 4 layer PWB. If your board is 40 mils or
62 mils thick, space the dielectric layers 8 to each other.
Use 10 mil traces and space them 15 mils away edge to edge
from each other (45 Ohm Characteristic, 90 Ohms
Differential Impedance). Route any Ground around them spaced
12 mils away from the trace pair (for Co-Planar Differential
Striplines).

11) Make sure all of the unused lines are either pulled high or
low unless they affect functionality. One trick if you are
experiencing Ground Bounce issues is to have all of the
unused drivers driving low. This works well with FPGAs with
lots of I/O or I/O banks.

12) If you do use a 7805 off of +12V, place a 10uF capacitor
near the input and another near the output - it needs to see
low ESR on both sides - most linear regulators need this. A
Tantalum Capacitor works best, always select the working
voltage of a Tantalum (you can get by with less with an
electrolytic cap), by multiplying the applied voltage by 2.
ie... 25V cap on the input (2 X 12V), and (2 X 5V) = 10V or
16V on the output.

13) Is there a reason why you didn't connect VCC to VCCIO?
Most design examples have these connected.

14) Make sure you filter the Motor Driver Supply with a Pi
filter of some sort. Like a 0.1uF connected to the +12V
power input, then a Ferrite Bead, then a 0.1uF cap to the
Motor Driver Chip. Remember the Bulk Low Frequency Capacitor
on the Motor Driver Chip side of the Ferrite Bead.

15) Be sure to decouple the power from the USB with a 0.1uF and
10uF to clean it up. This returns your generated noise to
your card and filters off any noise coming to you from the
USB Host.


Ross
_________________________
In SI, a little termination and attention to layout goes a long way. In EMC, without SI, you'll spend 80% of the effort on the last 3dB.

Top
#308249 - 15/03/2008 12:50 Re: Digital Storage Scopes.. cheap! [Re: mlord]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14478
Loc: Canada
Originally Posted By: mlord
Well, well..

Tough choice.. smile


Okay, I've ordered the German/UK 200MHz DSO (second link above) -- the specs are really unbeatable at that price, with probes included.

Should be here by mid/late next week, I expect.
EDIT: looks more like about 2-weeks for delivery now. /EDIT

Woo-hoo!

(gotta go update the New Toy thread with this info now).


Edited by mlord (15/03/2008 17:39)

Top
#308271 - 16/03/2008 01:28 Re: Electronics help- H-Bridge is annoying me [Re: Ross Wellington]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14478
Loc: Canada
Thanks, Ross. I'm still digesting your latest brain dump, but do please keep them coming. I'm sure everyone else here also enjoys them!

Meanwhile, I decided that the only way to improve the layout of my circuit was to scrap the preassembled L293D boards. They are fun to play with, and have blinken lights for debugging and all, but they also lack any attempt at EMI suppression. Not a single cap on board either of them.

My last order from Digikey included a couple of raw L293D chips, so I just plopped them down on the breadboard, and started routing signals again.

This time I was careful to keep the logic and motor power buses completely separate, as well as maintaining the full isolation to the USB sub-assembly.

I applied a generous spinkling of little through-hole ferrite beads, and some little blue capacitors labeled "693M", as well as my limited stock of 0.1uF ceramic discs.

Woo-hoo, it works!

I can power the motor & electronics from the same ATX supply that the PC and USB end use, and have not managed to trip up the USB at all, despite furious attempts to do so.

Here are some photos of the latest layout.






Attachments
1.gif

Description: The complete breadboard. USB isolated at the left by the "shiny" quad optoisolator chip.

2.gif

Description: The motor side of the house. Left chip is a 3:8 decoder to provide fan-out from my limited number of GPIO pins. Lots of ferrite beads and pretty blue capacitors, too! The middle H-Bridge is not fully wired up yet; I've only been testing with the rightmost



Top
#308336 - 17/03/2008 20:05 Re: Electronics help- H-Bridge is annoying me [Re: mlord]
sn00p
addict

Registered: 24/07/2002
Posts: 618
Loc: South London
We've now switched to isolation routing for in house prototypes, veroboard was taking too much time and effort:



Top
#308337 - 17/03/2008 20:19 Re: Digital Storage Scopes.. cheap! [Re: mlord]
pca
old hand

Registered: 20/07/1999
Posts: 1102
Loc: UK
Speaking from personal experience, those breadboard blocks you're using are a sod for crosstalk. I've long since given up using them, as every circuit I was inerested in building on them simply wouldn't work because of the parasitic capacitance or inductance of the things.

Also, stop finding useful toys and posting the links! I've just finally completely paid off my credit card, and you go and tempt me with a decent scope at a good price wink

pca
_________________________
Experience is what you get just after it would have helped...

Top
#308338 - 17/03/2008 21:34 Re: Digital Storage Scopes.. cheap! [Re: pca]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14478
Loc: Canada
Originally Posted By: pca
Speaking from personal experience, those breadboard blocks you're using are a sod for crosstalk. I've long since given up using them, as every circuit I was inerested in building on them simply wouldn't work because of the parasitic capacitance or inductance of the things.

Yeah. It's particularly bad with those H-bridge chips.. the signal pins are sandwiched between power pins and output driver pins. And most of the signals are paired across the chip (opposite pins tied together, like the cute yellow jumpers above).

I can hardly wait to view the carnage once the new scope arrives.

Originally Posted By: pca
Also, stop finding useful toys and posting the links!

Ya takes yer chances when reading these postings, Patrick! smile
We'll see if that new rig is any good or not once it arrives here.

-ml


Edited by mlord (18/03/2008 01:15)

Top
#308339 - 17/03/2008 21:40 Re: Electronics help- H-Bridge is annoying me [Re: sn00p]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14478
Loc: Canada
Originally Posted By: sn00p
We've now switched to isolation routing for in house prototypes, veroboard was taking too much time and effort

Wow! That looks totally extreme! Like for RF or something.

Thanks for posting it!

Cheers

Top
#308340 - 17/03/2008 22:02 Re: Electronics help- H-Bridge is annoying me [Re: mlord]
sn00p
addict

Registered: 24/07/2002
Posts: 618
Loc: South London
Cool. Glad you liked. smile

That board is totally non exciting though! It's just a uart (TTL level) to 20ma converter (vending machine interface). I knew it'd take ages to do on veroboard, then check and double check...only to find that it didn't work.

<tangent>

We had a CNC machine made for us, we had a couple of differing requirements. It had to be large enough so we can use it for mechanical prototyping (i.e faceplates and such like) but with also with enough fine resolution to mill pcb's.

The machine itself can do pretty large bits and pieces, wouldn't have trouble doing 19inch rack mount panels. But once I'd done all the setting up in mach3 it was a nervous time waiting to see what the accuracy would be like on small things...Thankfully it turned out to be very good.

I added isolation routing to our software so that we could directly export a 2 layer design into NC and straight into mach3.

</tangent>

I was quite pleased that I managed to route the entire board without the need for a single jump wire, single layer as well! Not only was I impressed, but my boss was too.

We did another board a few weeks earlier which was an RFID interface, that also worked straight off without any problems.

The great thing about this method is that because you're laying out from a schematic you can be certain that the final output will be correct. Just have to put the right components in the right holes.

That board (from memory) had 56 odd drill holes that were 0.6mm, 0.7mm, 0.8mm and 1mm in diameter. I think it took me a couple of hours start to finish (design to routing to populating to working!).

For small test circuits it's a revolution!

We reckon we could do large QFP's without much problem too.


Top
#308344 - 18/03/2008 00:22 Re: Electronics help- H-Bridge is annoying me [Re: sn00p]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14478
Loc: Canada
Originally Posted By: sn00p
Cool. Glad you liked. smile

That board is totally non exciting though! It's just a uart (TTL level) to 20ma converter (vending machine interface).


Oh, you mean like this circuit, from whence I "liberated" a couple of optoisolators for an early prototype of my Frankenswitch V2 circuit:



Attachments
1.jpg

Description: Volker-Craig C-104: RS232C to 20mA current loop adapter, using a pair of IL5 optoisolators.

1.gif

Description: Description that accompanied the cable/connector assembly. I got this for free at a factory "junk" closeout in 1983.



Top
#308345 - 18/03/2008 00:37 Re: Electronics help- H-Bridge is annoying me [Re: sn00p]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14478
Loc: Canada
Quote:
I added isolation routing to our software so that we could directly export a 2 layer design into NC and straight into mach3.


Totally cool, that. I was wondering how the layout ended up as an "etched" PCB.. trivial stuff with a CNC machine, once the software exists.. smile

EDIT: Oh, and did I mention that I think you have a rather cool job? cool


Edited by mlord (18/03/2008 00:40)

Top
#308356 - 18/03/2008 11:44 Re: Electronics help- H-Bridge is annoying me [Re: mlord]
Folsom
member

Registered: 12/08/2001
Posts: 175
Loc: Atlanta
We have a Quick Circuit at work that does a good job. Only problem is that you can't put vias under parts since our vias are just eyelets smashed into the vias. Also, we have all the through hole connections on the back to ensure we can solder to the pins.

The software came with the milling machine, and it takes gerber files and isolates the traces with a specified gap. I believe the system was pretty expensive, about $15k.

Top
#308370 - 18/03/2008 17:22 Re: Electronics help- H-Bridge is annoying me [Re: Folsom]
sn00p
addict

Registered: 24/07/2002
Posts: 618
Loc: South London
Originally Posted By: mlord


Oh, you mean like this circuit, from whence I "liberated" a couple of optoisolators for an early prototype of my Frankenswitch V2 circuit:



Yeah, that'll be the same thing!

Originally Posted By: mlord

Totally cool, that. I was wondering how the layout ended up as an "etched" PCB.. trivial stuff with a CNC machine, once the software exists..

EDIT: Oh, and did I mention that I think you have a rather cool job?


Yeah. I'm fortunate that I get to do a lot of different stuff! Originally I just did our pcb software but I also done a lot of embedded stuff for quite a few years now.

Originally Posted By: folsom
The software came with the milling machine, and it takes gerber files and isolates the traces with a specified gap. I believe the system was pretty expensive, about $15k.


Ouch! It's a pretty trivial exercise when you figure out how to do it. Took me about a day I think to get the software producing the isolation traces. Our software outputs direct to NC and doesn't require external software to import gerber.

Top
#308372 - 18/03/2008 19:40 Re: Electronics help- H-Bridge is annoying me [Re: sn00p]
Folsom
member

Registered: 12/08/2001
Posts: 175
Loc: Atlanta
The software that came with the machine is nice; you specify different isolation widths and it will remove all the ones that overlap. The same software that imports the gerbers also runs the milling machine, so it is all in one suite.

The milling machine is nice, but it sounds like they are changing from milling to laser. The one we have is very loud, and you have to keep changing bits if you want different isolations or hole routing.

Top
#308392 - 19/03/2008 15:15 Re: Electronics help- H-Bridge is annoying me [Re: mlord]
canuckInOR
carpal tunnel

Registered: 13/02/2002
Posts: 3212
Loc: Portland, OR
Originally Posted By: mlord
I'm sure everyone else here also enjoys them!

I'd enjoy them a lot more, if I understood what everyone was talking about. crazy

Ah, well. when I get the opportunity, I'll go through the relevant electrical engineering MIT open courses, and then come back and re-read all these posts.

Top
#308393 - 19/03/2008 15:35 Re: Electronics help- H-Bridge is annoying me [Re: canuckInOR]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14478
Loc: Canada
Originally Posted By: canuckInOR
Originally Posted By: mlord
I'm sure everyone else here also enjoys them!

I'd enjoy them a lot more, if I understood what everyone was talking about. crazy

Ah, well. when I get the opportunity, I'll go through the relevant electrical engineering MIT open courses, and then come back and re-read all these posts.


Heh.. smile

I'm still a dedicated software/firmware geek, with electronics as a high-school hobby from the very distant past. So I think I understand perhaps half of what's said.

I'm going to use the new scope to help me understand the rest.

Things like this are a lot easier when one can actually see what's happening, and see the effects of changes to the circuit. Then the theory begins to make more sense.

Cheers!

Top
#308395 - 19/03/2008 18:01 Re: Electronics help- H-Bridge is annoying me [Re: mlord]
andym
carpal tunnel

Registered: 17/01/2002
Posts: 3995
Loc: Manchester UK
Me too, the insides of PIC's and microcontrollers make sense. Interfacing them to other things is where I have to end up googling.

I would love to have done A-Level electronics but my school didn't offer it. I'd love to do an evening class or part-time course in it, but there doesn't seem to be anything in the area and there doesn't appear to be 'one' place on the web to search for it.
_________________________
Cheers,

Andy M

Top
#308397 - 19/03/2008 18:14 Re: Electronics help- H-Bridge is annoying me [Re: andym]
wfaulk
carpal tunnel

Registered: 25/12/2000
Posts: 16706
Loc: Raleigh, NC US
As was implied earlier, how can you go wrong with free MIT coursework?
_________________________
Bitt Faulk

Top
#308398 - 19/03/2008 18:20 Re: Electronics help- H-Bridge is annoying me [Re: andym]
lectric
pooh-bah

Registered: 20/01/2002
Posts: 2085
Loc: New Orleans, LA
I was able to take 1st and third year electronics in high school. I had to skip year 2 since it was only offered the exact same time as gifted english, which they wouldn't let me out of. The unfortunate bit is that it was really more of a vo-tech class so I was in class with quite a few people that weren't nearly as interested as I was, to put it nicely. One of the guys at my work station missed 3 months of school because he quite literally blew 3 of his fingers off trying to make a homemade grenade in the back yard. The really unfortunate bit for me is that this was all 15 years ago, and I've forgotten 95% of what I learned. Oh well.

Top
#308400 - 19/03/2008 20:19 Re: Electronics help- H-Bridge is annoying me [Re: wfaulk]
andym
carpal tunnel

Registered: 17/01/2002
Posts: 3995
Loc: Manchester UK
Originally Posted By: wfaulk
As was implied earlier, how can you go wrong with free MIT coursework?


I could also re-read all the books I've collected over the years. IMO nothing compares to sitting in a properly equipped classroom listening to someone who knows what they're talking about.
_________________________
Cheers,

Andy M

Top
#308403 - 19/03/2008 22:29 Re: Electronics help- H-Bridge is annoying me [Re: andym]
sn00p
addict

Registered: 24/07/2002
Posts: 618
Loc: South London
Originally Posted By: andym
Me too, the insides of PIC's and microcontrollers make sense. Interfacing them to other things is where I have to end up googling.


I'm usually pretty harsh on PIC microcontrollers. But the other week I actually found myself choosing a PIC for a project, I couldn't believe what I was doing.

Thing is, Microchip have got the number of available USB endpoints correct in their "18F" family. We almost exclusively use ARM based processors, but my favoured ARM flavoured chip only has 4 fricking endpoints, which basically means that it can't be used as a composite device. On the other hand, the PIC has 32 endpoints, which is more than enough for the application which we require it for. Fortunately this application requires no processing, just shifting of data in and out - so the PIC will do fine for this.

And as a side rant, why exactly does a CDC serial port under windows require a inf file to install? Is this just to extort money from hardware vendors if they don't want security warnings popping up? OS X and Linux handle them quite happily.

Top
Page 2 of 2 < 1 2