Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Slanderer
May 6, 2007

orange sky posted:

I don't know if this warrants its own thread, so here goes:

I want to build a gift for my SO, whose voice is pretty high pitched. My own voice is much lower, thus I think I can separate the frequencies and choose those that only she achieves. I have plenty of programming skills and I'm willing to spend some money on this.

The main idea is building a transparent object with a LED inside that lights up whenever she's speaking. Now, I have a basic idea of how to program this, but I don't know what's available in terms of hardware that I can use. I think buying an FPGA is overkill (and too big for my purposes). Anything else I can use? Is an Arduino capable of doing something like this?

I was thinking of building a MatLab script that analyses the sound input and outputs 0 or 1 wether the sounds it picks up are in a certain frequency and power. Now what I don't know is how to pick up the sounds and translate them into samples. All I've ever used are waveform generators, programmed for a certain wave.

Any tips on what I should look into? Just some guidelines would be cool, I'll then buy the gear and put it all together myself.

Thanks in advance!

This definitely isn't a simple thing you want to do.

http://en.wikipedia.org/wiki/Speaker_recognition

Without reading any research or anything technical, the simplest algorithm possible (for your simple scenario) would be looking at the differences in the spectral profile of your speech versus hers. Most likely by comparing the relative amplitudes of certain frequency bands. Or possibly by looking for specific overtones present in each voice. Whatever you do, it's really not that simple.

You mentioned matlab, but I'm not sure what you're getting at? Do you want to have something continuously running in matlab to do processing? If so, that simplifies things, since you could steal a demo some grad student made. Or are you looking to develop and simulate an algorithm in matlab by building a model from existing data (and then possibly have matlab output c code for you)?

Adbot
ADBOT LOVES YOU

Delta-Wye
Sep 29, 2005
If you're comfortable in Matlab, I would start by getting some recordings of both your and her voices, and start analyzing them. You're probably going to either use a high-pass filter with a cutoff between the range your voice is in and hers, or do a FFT and look at the spectral contents of the recorded audio. I suspect that the frequency ranges your voices occupy are a lot closer together then you realize, making a simple filter difficult to use. An FFT may give you a bit more information and make it all come together. Using matlab makes it much simpler to try out ideas and you shouldn't be CPU bound.

Once you figure out a set of filters that provide the information you need, you can get a guesstimate for the sort of processing you need. An Arduino wouldn't be capable of anything beyond the simplest of filters, and even then I think you'd have trouble getting enough samples. I would guess a DSP may work, and I think Matlab can even dump out an equivalent FPGA design that performs the same set of filters as the Matlab program.

Another approach may be an all-analog design. Use an active filter with opamps to separate out the frequencies of interest and then amplify them. If the cutoff frequency and gain is right, the correct amount of power input in the range of interest could drive the LED directly. For googling, look for Color Organs; you're basically looking for a one channel color organ that is looking at frequency contents in her range of speaking but outside of yours. I realize you have 'plenty of programming skills' and are looking to toss software at the problem until it is solved, but sometimes the easiest solution is an old-school analog design. :corsair:

An interesting project, at least.

EDIT: Beaten like the family dog. If you have matlab and are comfortable in it, get some recordings and do some FFTs so you know what the spectral content of the signals are - they are going to be VERY similar, but at least then you can make some decisions on what to do next based on actual data and not just postulations.

Slanderer
May 6, 2007

Parallel Paraplegic posted:

You can't just do some kind of band-pass filtering to filter out low frequencies and only accept high frequencies, then feed that to an amplifier and some kind of logic that would only trigger on sufficiently "strong" signals? I mean if you want this to be really accurate and only respond to specifically her voice that would take some fancy programming, but if you just want it to respond to a certain range of frequencies and not others that's somewhat easy to do even without a microcontroller, I believe.

The problem is that even a lower pitched voice will have higher pitched overtones stuffed in there. That, combined with general ambient noise, means that a single bandpass filter isn't really enough.

Maybe some guys with big glasses and pocket protectors in the 50's did this kind of thing in labs, with big filters made using tube op amps and other crazy poo poo, but the golden age of analog has long since passed. We have forgotten their works, and will never again achieve their glory.

Shame Boy
Mar 2, 2010

Slanderer posted:

The problem is that even a lower pitched voice will have higher pitched overtones stuffed in there. That, combined with general ambient noise, means that a single bandpass filter isn't really enough.

Maybe some guys with big glasses and pocket protectors in the 50's did this kind of thing in labs, with big filters made using tube op amps and other crazy poo poo, but the golden age of analog has long since passed. We have forgotten their works, and will never again achieve their glory.

Yeah, I was thinking find a frequency that is very strong in her voice but not as strong in his voice, and then make it so that in normal conversational volume it would trigger for her but not for him. I'm also assuming that this is just some kind of novelty "I built this 'correctness' detector honey, it's specifically tuned for our marriage!" thing, and not something that would need to reliably trigger on her voice but not his in all conditions. Of course I'm still probably underestimating the complexity of the human voice.

orange sky
May 7, 2007

Parallel Paraplegic posted:

You can't just do some kind of band-pass filtering to filter out low frequencies and only accept high frequencies, then feed that to an amplifier and some kind of logic that would only trigger on sufficiently "strong" signals? I mean if you want this to be really accurate and only respond to specifically her voice that would take some fancy programming, but if you just want it to respond to a certain range of frequencies and not others that's somewhat easy to do even without a microcontroller, I believe.

Thing is, I don't know if I have access to the kind of stuff needed to build/test a band pass filter. I'll try to talk to the electronics guys at my university. And yes, it's just a band pass filter that I need, not something fancy only for her voice.

Slanderer posted:

This definitely isn't a simple thing you want to do.

http://en.wikipedia.org/wiki/Speaker_recognition

Without reading any research or anything technical, the simplest algorithm possible (for your simple scenario) would be looking at the differences in the spectral profile of your speech versus hers. Most likely by comparing the relative amplitudes of certain frequency bands. Or possibly by looking for specific overtones present in each voice. Whatever you do, it's really not that simple.

You mentioned matlab, but I'm not sure what you're getting at? Do you want to have something continuously running in matlab to do processing? If so, that simplifies things, since you could steal a demo some grad student made. Or are you looking to develop and simulate an algorithm in matlab by building a model from existing data (and then possibly have matlab output c code for you)?

What I meant would be building a matlab script that compares running samples (from audio), collects x samples and draws a conclusion from it (simply by frequency range position). I'd then work out a way to output it to C, yes, in order to run it in a basic processor. Thing is, Parallel Paraplegic is totally right, I only need a filter since I don't want to get into speaker recognition or anything, I want it as simple as possible.

I only looked into a higher level solution than electronics because electronics isn't really my area, I'm used to working with other stuff, so I wanted to stay confortable. It would probably turn out much more expensive though. I'll look into the electronics and the way I could make it small, I don't want a breadboard in it.

I'll talk to the electronics guys at my uni, they'll probably be able to tell me what I need to make it simple and small if I'm going to do it that way.

Slanderer
May 6, 2007

Delta-Wye posted:

If you're comfortable in Matlab, I would start by getting some recordings of both your and her voices, and start analyzing them. You're probably going to either use a high-pass filter with a cutoff between the range your voice is in and hers, or do a FFT and look at the spectral contents of the recorded audio. I suspect that the frequency ranges your voices occupy are a lot closer together then you realize, making a simple filter difficult to use. An FFT may give you a bit more information and make it all come together. Using matlab makes it much simpler to try out ideas and you shouldn't be CPU bound.

Once you figure out a set of filters that provide the information you need, you can get a guesstimate for the sort of processing you need. An Arduino wouldn't be capable of anything beyond the simplest of filters, and even then I think you'd have trouble getting enough samples. I would guess a DSP may work, and I think Matlab can even dump out an equivalent FPGA design that performs the same set of filters as the Matlab program.

Another approach may be an all-analog design. Use an active filter with opamps to separate out the frequencies of interest and then amplify them. If the cutoff frequency and gain is right, the correct amount of power input in the range of interest could drive the LED directly. For googling, look for Color Organs; you're basically looking for a one channel color organ that is looking at frequency contents in her range of speaking but outside of yours. I realize you have 'plenty of programming skills' and are looking to toss software at the problem until it is solved, but sometimes the easiest solution is an old-school analog design. :corsair:

An interesting project, at least.

EDIT: Beaten like the family dog. If you have matlab and are comfortable in it, get some recordings and do some FFTs so you know what the spectral content of the signals are - they are going to be VERY similar, but at least then you can make some decisions on what to do next based on actual data and not just postulations.

I think DSPs and FPGAs are both essentially impenetrable to anyone who isn't an electrical/computer engineer, or has the equivalent education. I figure some grad student has done something exactly like this entirely on an FPGA, but that's a pretty tall order.

An arduino probably can't natively do an FFT, do to some of the software overhead. Doing it in assembly in possible, but still really limited (compared to anything in matlab). A raspberry pi (or anything else with a solid ARM core) could manage it, but with the hardware abstraction on the RPI, you'd probably have an easier time with a USB microphone than with hooking up an analog one (in fact, that's really the only viable option). It's a shame, since you could do a lot of good stuff on an RPI (since you got linux running out of the box), so long as it was designed in matlab with the limited memory in mind.

Shame Boy
Mar 2, 2010

orange sky posted:

Thing is, I don't know if I have access to the kind of stuff needed to build/test a band pass filter. I'll try to talk to the electronics guys at my university. And yes, it's just a band pass filter that I need, not something fancy only for her voice.


What I meant would be building a matlab script that compares running samples (from audio), collects x samples and draws a conclusion from it. I'd then work out a way to output it to C, yes, in order to run it in a basic processor. Thing is, Parallel Paraplegic is totally right, I only need a filter since I don't want to get into speaker recognition or anything, I want it as simple as possible.

I only looked into a higher level solution than electronics because electronics isn't really my area, I'm used to working with other stuff, so I wanted to stay confortable. It would probably turn out much more expensive though. I'll look into the electronics and the way I could make it small, I don't want a breadboard in it.

I'll talk to the electronics guys at my uni, they'll probably be able to tell me what I need to make it simple and small if I'm going to do it that way.

Well don't put too much stock in my answer, I got shot down by everyone who has actual training here so I'm actually doubting the feasibility of it myself now :shobon: However talking to your electronics buddies would probably be a great place to start, assuming there is a simple solution to this.

Slanderer
May 6, 2007

orange sky posted:

What I meant would be building a matlab script that compares running samples (from audio), collects x samples and draws a conclusion from it (simply by frequency range position). I'd then work out a way to output it to C, yes, in order to run it in a basic processor. Thing is, Parallel Paraplegic is totally right, I only need a filter since I don't want to get into speaker recognition or anything, I want it as simple as possible.

I only looked into a higher level solution than electronics because electronics isn't really my area, I'm used to working with other stuff, so I wanted to stay confortable. It would probably turn out much more expensive though. I'll look into the electronics and the way I could make it small, I don't want a breadboard in it.

I'll talk to the electronics guys at my uni, they'll probably be able to tell me what I need to make it simple and small if I'm going to do it that way.

You still have the problem of separating out background noise. Maybe this is just a one-time gimmick, but if you want this to work with any reliability, it needs to be able to first separate out a "voice" from random sounds, and then determine which of two voices it is.

If you select for a single bandpass, your voice will trigger it too, if you speak slightly more loudly. In fact, many background noises will have the correct spectral noises to trigger it as well.

EDIT: Take the similar problem of the first cordless remote control (or maybe not the first, whatever). It had a bunch of metal tuning forks inside, which were slightly above the range of human hearing. The TV had (I assume) an amplified microphone bandpass filters corresponding to these frequencies (or, if they were even more clever, a matched set of tuning forks, with inductance coils next to each to see if they are vibrating). This worked well until random noises in the background also contained those same ultrasonic frequencies (ie, keys dropping, glass, etc), and would trigger the remote. Hell, this sort of thing is one of the reasons why phones used 2 mixed frequencies for each button tone--signaling was done in-band, so in order to separate out control information (ie, the button tones as well as communication tones for long distance calling and maintenance and wahtever) from voice data, they used multiple frequencies for all control codes.

Slanderer fucked around with this message at 02:49 on Dec 31, 2012

orange sky
May 7, 2007

Delta-Wye posted:



Another approach may be an all-analog design. Use an active filter with opamps to separate out the frequencies of interest and then amplify them. If the cutoff frequency and gain is right, the correct amount of power input in the range of interest could drive the LED directly. For googling, look for Color Organs; you're basically looking for a one channel color organ that is looking at frequency contents in her range of speaking but outside of yours. I realize you have 'plenty of programming skills' and are looking to toss software at the problem until it is solved, but sometimes the easiest solution is an old-school analog design. :corsair:

An interesting project, at least.

EDIT: Beaten like the family dog. If you have matlab and are comfortable in it, get some recordings and do some FFTs so you know what the spectral content of the signals are - they are going to be VERY similar, but at least then you can make some decisions on what to do next based on actual data and not just postulations.

Yes, I'm going to start by doing this. Not going to be easy getting a clean recording (trying to do this as a surprise) but I happen to have a pretty good recorder lying around that belongs to a friend.

I do realise that it's going to be pretty hard separating our voices from one another, but it's a challenge, and I like challenges. I'll check out the analog feasibility with some good components, see if there's anything with the performance I need available (all I've used are lovely components).


Slanderer posted:

I think DSPs and FPGAs are both essentially impenetrable to anyone who isn't an electrical/computer engineer, or has the equivalent education. I figure some grad student has done something exactly like this entirely on an FPGA, but that's a pretty tall order.

An arduino probably can't natively do an FFT, do to some of the software overhead. Doing it in assembly in possible, but still really limited (compared to anything in matlab). A raspberry pi (or anything else with a solid ARM core) could manage it, but with the hardware abstraction on the RPI, you'd probably have an easier time with a USB microphone than with hooking up an analog one (in fact, that's really the only viable option). It's a shame, since you could do a lot of good stuff on an RPI (since you got linux running out of the box), so long as it was designed in matlab with the limited memory in mind.

I'm kind of ashamed to say that even though I posted this I'm actually in EE. It's been some time since I got my hands on anything this practical, though. I'm currently actually working on a USRP, designing Sofware Defined Radio, but I've never interacted directly with only a DSP. I've worked on FPGAs, that's why I mentioned them in my initial post. It's the more practical aspects that I had doubts in (audio input, electric output) and what would be capable of handling this.


Slanderer posted:

You still have the problem of separating out background noise. Maybe this is just a one-time gimmick, but if you want this to work with any reliability, it needs to be able to first separate out a "voice" from random sounds, and then determine which of two voices it is.

If you select for a single bandpass, your voice will trigger it too, if you speak slightly more loudly. In fact, many background noises will have the correct spectral noises to trigger it as well.

EDIT: Take the similar problem of the first cordless remote control (or maybe not the first, whatever). It had a bunch of metal tuning forks inside, which were slightly above the range of human hearing. The TV had (I assume) an amplified microphone bandpass filters corresponding to these frequencies (or, if they were even more clever, a matched set of tuning forks, with inductance coils next to each to see if they are vibrating). This worked well until random noises in the background also contained those same ultrasonic frequencies (ie, keys dropping, glass, etc), and would trigger the remote. Hell, this sort of thing is one of the reasons why phones used 2 mixed frequencies for each button tone--signaling was done in-band, so in order to separate out control information (ie, the button tones as well as communication tones for long distance calling and maintenance and wahtever) from voice data, they used multiple frequencies for all control codes.



I'll need to look into more complex algorithms for speaker recognition then, I reckon. I remember in my intro to signals building a program to identify vowels with basis on a collected sample. It was a complex algorithm, with FFT and lots of correlations, that's why I didn't want to go there (and stay at frequency ranges). I don't even know what I could use to run that script.


In case I do it (well-built or not) I'll certainly post my conclusions here though. Thanks for the help so far.

peepsalot
Apr 24, 2007

        PEEP THIS...
           BITCH!

You might be interested in this guy's code:
http://elm-chan.org/works/akilcd/report_e.html

He made FFT library in assembly for atmega (chips used in arduino). It looks very responsive. I haven't tried implementing it myself, but it looks like he's done most of the hard work. Once you have the FFT of incoming audio I think you could compare it to her known profile without too much trouble.

orange sky
May 7, 2007

peepsalot posted:

You might be interested in this guy's code:
http://elm-chan.org/works/akilcd/report_e.html

He made FFT library in assembly for atmega (chips used in arduino). It looks very responsive. I haven't tried implementing it myself, but it looks like he's done most of the hard work. Once you have the FFT of incoming audio I think you could compare it to her known profile without too much trouble.

Well that's a pretty clean output. I'll look into this, thanks!

PDP-1
Oct 12, 2004

It's a beautiful day in the neighborhood.
I'd definitely second Delta-Wye's suggestion that you work in MatLab exclusively at first. Programming on a microcontroller is a whole different ballgame than programming on a PC - the toolchains tend to suck, RAM and CPU cycles come at a premium, fancy-pants things like 'floating point numbers' may not even exist, and debugging often boils down to watching an onboard LED flicker on and off. In short, you don't want to develop a complex algorithm on a microcontroller if you can avoid it. Figure out what to do on a PC and then work on the port after the algorithms are nailed down. Plus, once you know what you have to do you can choose appropriate hardware much more accurately.

That said, here's a spitball idea for how you might go about identifying voices: Get a long-ish recording (say one minute) of you and your wife talking with a quiet background. Do an FFT in MatLab of the two samples of you and your wife's voices to get a spectral envelope of each of your voices and save that data to a pair of normalized reference tables. Next, get some shorter samples of the two voices and of some random background noise and make a set of FFTs of those also. The analysis technique would then involve multiplying each normalized voice envelope FFT by the sample sound FFT to determine what fraction of the total sample noise power is contained in each voice envelope. If 80% of the sample noise power is contained within your voice envelope, it's probably you talking. If 80% of the sample noise power is in your wife's voice envelope it's probably her talking. If less than 80% of the sample noise power is contained in either voice envelope it's likely that nobody is talking or the neighbor's dog is barking or whatever.

Idea #2: You might be able to get away with a relatively low-power microcontroller in this case if you collect real-time sample data for, say, 0.2 seconds and then analyze that for however long it takes to determine a 'wife is talking' result. If three of the last five 'wife is talking' results came out as true then light up the LED. Basically, you don't really need continuous real-time processing for this task.

Shame Boy
Mar 2, 2010

peepsalot posted:

You might be interested in this guy's code:
http://elm-chan.org/works/akilcd/report_e.html

He made FFT library in assembly for atmega (chips used in arduino). It looks very responsive. I haven't tried implementing it myself, but it looks like he's done most of the hard work. Once you have the FFT of incoming audio I think you could compare it to her known profile without too much trouble.

There's actually a tutorial about doing FFT in arduino's native C-ish language too. It even has some information on finding specific frequency peaks and doing some basic DSP.

ANIME AKBAR
Jan 25, 2007

afu~
One issue with voice recognition is that the full range of speech covers a very wide bandwidth (like 200Hz to 3000Hz minimum), but at any given instant you'll only be using a few bits of that bandwidth at any given time. Things are easy if you're speaking a specific word or phrase, but if it's just random words then you'll end up with random bits of the full spectrum being filled in, and the results will be far more correlated with the words being said than the overall pitch of the person's voice.

So the dumb solution is to sample very large quantities of speech, such that you are guaranteed to see most of a person's bandwidth used. Then you can use some dumb algorithm to look at the whole thing and make a call. We're talking seconds worth of speech, and megabytes of data. Not something a simple microcontroller can handle.

Base Emitter
Apr 1, 2012

?

Slanderer posted:

Maybe some guys with big glasses and pocket protectors in the 50's did this kind of thing in labs, with big filters made using tube op amps and other crazy poo poo, but the golden age of analog has long since passed. We have forgotten their works, and will never again achieve their glory.

I have to admit, an analog channel vocoder is on my list of cool-if-impractical-someday projects. Solid-state, though.

I think you can do some basic DSP type stuff on ARM processors, I've implemented a basic string simulation on an mbed (which is another nice option if you are comfortable with C++).

The IIR biquad filter is the digital equivalent of the basic two-pole filter stage in the analog domain. If you just want to build up some filters, and you'd prefer to implement it digitally, look that up and use it as a building block.

Delta-Wye
Sep 29, 2005
We're overlooking the easy solution: assume that any voice you're picking up is the woman's voice, you'll be right most of the time :v:

orange sky
May 7, 2007

I'll start by analyzing our speech FFT's and draw a conclusion from there (if it's feasible by frequency division alone or not). Thing is, I don't really care if it lights up when something high pitched reaches the power threshold needed, as I don't think there's much that will do that. With the exception of the TV, of course, but I'll turn the thing off when the TV is on. When I decide something, I'll come back here.

drat, never thought I'd get so much feedback. Thank you all guys.

Delta-Wye posted:

We're overlooking the easy solution: assume that any voice you're picking up is the woman's voice, you'll be right most of the time :v:


Definitely true. That's a message she will get if I get this done. drat, I'm the most passive-agressive rear end in a top hat on earth. :)

Bad Munki
Nov 4, 2008

We're all mad here.


Delta-Wye posted:

We're overlooking the easy solution: assume that any voice you're picking up is the woman's voice, you'll be right most of the time :v:

Embed a wireless mic in one of her teeth, duh.

peepsalot
Apr 24, 2007

        PEEP THIS...
           BITCH!

ANIME AKBAR posted:

So the dumb solution is to sample very large quantities of speech, such that you are guaranteed to see most of a person's bandwidth used. Then you can use some dumb algorithm to look at the whole thing and make a call. We're talking seconds worth of speech, and megabytes of data. Not something a simple microcontroller can handle.

Yeah, but that's the dumb solution. A smarter one would be to FFT sufficiently small chunks that the microcontroller can handle, and combine the results over time to get a moving average.

FSMC
Apr 27, 2003
I love to live this lie
I'm designing some boost and buck converters and am struggling a bit on the PCB layout. I initially designed the pcb layout so there is a solid ground plane, and all other traces were on the component layer. But now I've started looking at some PCB layout guides for switching power supplies and it seems like my ground plane idea is bad. In general ground plane adds capacitance which is bad, and you don't want the discontinuous ground currents on the ground plane. So before I start again I want to check I have some of the basics down.
Short switching current paths.
Switching ground currents on the component layer.
Large traces/polygon fills.
I'll have to use 2 layers to route the other auxiliary stuff(FB,COMP,etc)
Do I keep some kind of ground polygon on the bottom layer or get rid of it completely?

Edit: I get more confused every time I read something on this topic.

FSMC fucked around with this message at 16:09 on Dec 31, 2012

ANIME AKBAR
Jan 25, 2007

afu~

FSMC posted:

I'm designing some boost and buck converters and am struggling a bit on the PCB layout. I initially designed the pcb layout so there is a solid ground plane, and all other traces were on the component layer. But now I've started looking at some PCB layout guides for switching power supplies and it seems like my ground plane idea is bad. In general ground plane adds capacitance which is bad, and you don't want the discontinuous ground currents on the ground plane. So before I start again I want to check I have some of the basics down.
Short switching current paths.
Switching ground currents on the component layer.
Large traces/polygon fills.
I'll have to use 2 layers to route the other auxiliary stuff(FB,COMP,etc)
Do I keep some kind of ground polygon on the bottom layer or get rid of it completely?

Edit: I get more confused every time I read something on this topic.

In reality, the various ideal qualities of an ideal layout end up contradicting each other. For example, like you said, having a solid ground plane is nice for lowering the impedance of high frequency loops, but also allows those high frequency signals to possibly interfere with other circuits that share the ground plane. Partitioning the ground plane or using some sort of star ground approach sounds great in theory but becomes impractical if you have multiple subsystems connected directly to each other on the board. Real designs will always involve compromises, and if you try to uphold every rule of thumb at once you will be tearing your hair out.

In my experience, the most important thing is to keep the high di/dt loops small, and use a solid ground plane underneath. The capacitance added by a ground plane should be negligible, so long as all the currents through that "capacitance" flow directly back to the common ground of the SMPS, rather than to other traces or planes. When possible, try to locate the supply towards an edge of the board, and avoid having it placed between sensitive circuits.

movax
Aug 30, 2008

FSMC posted:

I'm designing some boost and buck converters and am struggling a bit on the PCB layout. I initially designed the pcb layout so there is a solid ground plane, and all other traces were on the component layer. But now I've started looking at some PCB layout guides for switching power supplies and it seems like my ground plane idea is bad. In general ground plane adds capacitance which is bad, and you don't want the discontinuous ground currents on the ground plane. So before I start again I want to check I have some of the basics down.
Short switching current paths.
Switching ground currents on the component layer.
Large traces/polygon fills.
I'll have to use 2 layers to route the other auxiliary stuff(FB,COMP,etc)
Do I keep some kind of ground polygon on the bottom layer or get rid of it completely?

Edit: I get more confused every time I read something on this topic.

Switchers are tricky; sometimes the reference board will not have a good layout, and you cannot trust it. Same with their advice...it's probably all good, but you'd have to poke a FAE to be sure. I know Linear FAEs have advised us the opposite of what their docs say.

That said, you definitely want a ground plane. Minimize your high-current loop size, filter/connect the small-signal and power grounds properly. If you have external FETs throw 0 ohm resistors on the gate pins and tune the value to remove any output ringing. Usually top-gate will end up somewhere between 1 and 10; bottom is usually fine.

some kinda jackal
Feb 25, 2003

 
 
Putting the cart before the horse, I collected way too much surplus electronics gear for my skill level and I'm basically drowning in parts and test equipment and stuff. Total first-world-problem but the disorganization is kind of making me want to not work on electronics when every time I whip out a multimeter probe cable it gets tangled on like 5 other cables. I don't really know why I posted this since this isn't livejournal, but it's just an observation that cleanliness and organization is important in everything :q:

Shame Boy
Mar 2, 2010

Martytoof posted:

Putting the cart before the horse, I collected way too much surplus electronics gear for my skill level and I'm basically drowning in parts and test equipment and stuff. Total first-world-problem but the disorganization is kind of making me want to not work on electronics when every time I whip out a multimeter probe cable it gets tangled on like 5 other cables. I don't really know why I posted this since this isn't livejournal, but it's just an observation that cleanliness and organization is important in everything :q:

Sell some of it.

To me.

For a very low price.

ANIME AKBAR
Jan 25, 2007

afu~

movax posted:

Same with their advice...it's probably all good, but you'd have to poke a FAE to be sure. I know Linear FAEs have advised us the opposite of what their docs say.

Ugh tell me about it. Last trade show I went through the LT engineers basically spent half their time browsing through their datasheet pointing out things that were wrong, misleading, etc. Great presentation, but didn't make me really excited about using their stuff...

Favorite part, while presenting a slide showing a SMPS with a current sense resistor: "This is called the telephone resistor, because it makes our telephone ring. Don't use one sense resistor like the diagram shows, use two separate ones here and here. That way your circuit works properly and our telephones don't ring so much."

ANIME AKBAR fucked around with this message at 14:21 on Jan 2, 2013

rotor
Jun 11, 2001

classic case of pineapple derangement syndrome
Hello Electronics Thread,

Ok so I'm putting together a little benchtop cnc machine and the motor controller has serial ports. I had assumed I'd just buy 3 serial cables, chop one end off and hook up the appropriate wires and could be done with it.

BUT: PROBLEMS!!!

the controller people say that no, i shouldnt do that and should instead build my own loving cables and solder dsub pins like a goddamn caveman because most serial cables wont tolerate 5A of current. Is this true? And if so, how do I tell if mine will or won't? And if they wont, how the hell should I build my own cables? I have the dsub parts, but like, what gauge wire and what should I use as a sheath? left to my own stupid devices, I'd just use paracord sheathing, but I feel confident that my house would burn down quickly enough after that.

peepsalot
Apr 24, 2007

        PEEP THIS...
           BITCH!

You mean the power wires that drive the motors directly are attached with dsubs? How many wire motors are you using(are they unipolar, bipolar, 4,5,6,8 pins?)? Does it use redundant pins for higher current carrying?

Jonny 290
May 5, 2005



[ASK] me about OS/2 Warp

rotor posted:

Hello Electronics Thread,

Ok so I'm putting together a little benchtop cnc machine and the motor controller has serial ports. I had assumed I'd just buy 3 serial cables, chop one end off and hook up the appropriate wires and could be done with it.

BUT: PROBLEMS!!!

the controller people say that no, i shouldnt do that and should instead build my own loving cables and solder dsub pins like a goddamn caveman because most serial cables wont tolerate 5A of current. Is this true? And if so, how do I tell if mine will or won't? And if they wont, how the hell should I build my own cables? I have the dsub parts, but like, what gauge wire and what should I use as a sheath? left to my own stupid devices, I'd just use paracord sheathing, but I feel confident that my house would burn down quickly enough after that.

Wait wait wait wait. This sounds vicious. Are you drat sure these are RS-232 serial ports? Toss us some pinouts or something to ponder. This should be a trivial part of the setup.

Slanderer
May 6, 2007

rotor posted:

Hello Electronics Thread,

Ok so I'm putting together a little benchtop cnc machine and the motor controller has serial ports. I had assumed I'd just buy 3 serial cables, chop one end off and hook up the appropriate wires and could be done with it.

BUT: PROBLEMS!!!

the controller people say that no, i shouldnt do that and should instead build my own loving cables and solder dsub pins like a goddamn caveman because most serial cables wont tolerate 5A of current. Is this true? And if so, how do I tell if mine will or won't? And if they wont, how the hell should I build my own cables? I have the dsub parts, but like, what gauge wire and what should I use as a sheath? left to my own stupid devices, I'd just use paracord sheathing, but I feel confident that my house would burn down quickly enough after that.

This sounds dumb and I refuse to believe it's real.

rotor
Jun 11, 2001

classic case of pineapple derangement syndrome

peepsalot posted:

You mean the power wires that drive the motors directly are attached with dsubs?

female db9 connector on the controller, bare wires on the motors.

quote:

How many wire motors are you using(are they unipolar, bipolar, 4,5,6,8 pins?)? Does it use redundant pins for higher current carrying?

3 motors. 4 wires each, so i think that means unipolar. no.


Jonny 290 posted:

Wait wait wait wait. This sounds vicious. Are you drat sure these are RS-232 serial ports? Toss us some pinouts or something to ponder. This should be a trivial part of the setup.

they just use db9 ports as connectors. pins 6-9 are the hot ones, the others are unused.

rotor
Jun 11, 2001

classic case of pineapple derangement syndrome

Slanderer posted:

This sounds dumb and I refuse to believe it's real.

this:



connects to 3 bare-wire motors.

oh yeah and there's a resistor across pins 1 and 5

Slanderer
May 6, 2007

rotor posted:

this:



connects to 3 bare-wire motors.

oh yeah and there's a resistor across pins 1 and 5

Oh, that makes more sense. I thought there was power on the data cable--but there's a terminal block for that.

For the motors, it's just using DB9 as a convenient plug. Get some DB9 connectors on sparkfun (either crimp pin or solder type), making sure you get the full housing that lets you do strain relief. Then make or buy some multi-cable assemblies online, and solder/crimp that poo poo

peepsalot
Apr 24, 2007

        PEEP THIS...
           BITCH!

Get some pre made 4 conductor cable like this maybe http://www.amazon.com/MonoPrice-18A...+conductor+wire

Use one of these style connectors that clamps together http://www.amazon.com/StarTech-com-...+male+connector

You should be able to wire the resistor directly to the port pins w/ no separate wire.

I think 18awg should be ok for 5A.

Oh and 4 conductor stepper motors/drivers are bipolar.

rotor
Jun 11, 2001

classic case of pineapple derangement syndrome

Slanderer posted:

Oh, that makes more sense. I thought there was power on the data cable--but there's a terminal block for that.

For the motors, it's just using DB9 as a convenient plug. Get some DB9 connectors on sparkfun (either crimp pin or solder type), making sure you get the full housing that lets you do strain relief. Then make or buy some multi-cable assemblies online, and solder/crimp that poo poo

:raise:

well, yeah, the power to the motors goes through the cable, hence the dude's 5 amp comment. I have the db9 connectors. What multi-cable assemblies am I looking for? Alternately, what do I make them from?

rotor
Jun 11, 2001

classic case of pineapple derangement syndrome

peepsalot posted:

Get some pre made 4 conductor cable like this maybe http://www.amazon.com/MonoPrice-18A...+conductor+wire

Use one of these style connectors that clamps together http://www.amazon.com/StarTech-com-...+male+connector

You should be able to wire the resistor directly to the port pins w/ no separate wire.

I think 18awg should be ok for 5A.

yay ok thanks. wish i'd known this earlier. who wants to buy these three 10' serial cables?

Slanderer
May 6, 2007

peepsalot posted:

Get some pre made 4 conductor cable like this maybe http://www.amazon.com/MonoPrice-18A...+conductor+wire

Use one of these style connectors that clamps together http://www.amazon.com/StarTech-com-...+male+connector

You should be able to wire the resistor directly to the port pins w/ no separate wire.

I think 18awg should be ok for 5A.

Oh and 4 conductor stepper motors/drivers are bipolar.

Or this
http://www.ebay.com/itm/Shielded-Cable-Wire-4-x-18Ga-Stepper-Motor-CNC-Router-/160632659191?pt=LH_DefaultDomain_0&hash=item256673dcf7

EDIT: You'll probably want to add a connector between the motor and the cable as well, since it'll make a lot of poo poo easier.

Slanderer fucked around with this message at 01:15 on Jan 3, 2013

rotor
Jun 11, 2001

classic case of pineapple derangement syndrome

Slanderer posted:

Or this
http://www.ebay.com/itm/Shielded-Cable-Wire-4-x-18Ga-Stepper-Motor-CNC-Router-/160632659191?pt=LH_DefaultDomain_0&hash=item256673dcf7

EDIT: You'll probably want to add a connector between the motor and the cable as well, since it'll make a lot of poo poo easier.

i like this cable better, and i think that's good advise re: connectors

peepsalot
Apr 24, 2007

        PEEP THIS...
           BITCH!

Actually, thinking about it, 18AWG is probably overkill. 18AWG home wiring is rated like 14A. I'm not really expert on wire sizing, but I think you could get away with 22AWG at 5A.
http://www.powerstream.com/Wire_Size.htm

A second opinion wouldn't hurt though.

Jonny 290
May 5, 2005



[ASK] me about OS/2 Warp
I'd go at least 18 gauge. One suggestion is to holler at a local HVAC place; they carry multi-conductor wire for thermostats and some of them should be heavy enough gauge that it should work. Not cheaper than waiting a day off Amazon, but instant gratification.

The use of DB9 connectors for such an application angers me, as an aside.

Adbot
ADBOT LOVES YOU

ante
Apr 9, 2005

SUNSHINE AND RAINBOWS

Jonny 290 posted:

I'd go at least 18 gauge. One suggestion is to holler at a local HVAC place; they carry multi-conductor wire for thermostats and some of them should be heavy enough gauge that it should work. Not cheaper than waiting a day off Amazon, but instant gratification.

The use of DB9 connectors for such an application angers me, as an aside.

What would you do for connectors, out of curiosity?

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply