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
asdf32
May 15, 2010

I lust for childrens' deaths. Ask me about how I don't care if my kids die.

Aurium posted:

Sorry, it was a segue into exploring a hypothetical. You wouldn't actually do it for this load. Hence the answer 41, don't filter earlier posts.

What I meant was for circuit topology Delta-Wye suggested, filtered PWM to control a transistor, you'd putting said transistor into its linear region. Hence Delta-Wye is correct.

There is another layout that I think would be a better way of implementing a filtered pwm signal, as it wouldn't put it the operating transistor into it's linear region. It would come with some other costs though.

I don't think you can actually do low side switching with this topology. A high side P channel vs N channel with some additional circuitry was an implementation detail that I didn't really deal with because it was a hypothetical. If you actually did this, it's absolutely something to consider.

I chose an RL because the inductor would look like a short to the dc component, and the resistor would wouldn't be in the load current's path. You could use a traditional RC filter here instead, but it seems to me that if you need an external transistor to drive the load current, you probably wouldn't want a resistor in series with the load. You could replace the resistor in the RL filter with a capacitor and get it out of parallel with the load too.

I've attached a picture of the circuit. You'll see similar layouts in class D amps where they drive the transistors with PWM signals, but the output of the amp needs to be continuous and clean, but also high current. (they typically do swap the resistor for a capacitor)

Hopefully this post is a lot clearer than the original.



A class D amp has a much different goal which is to out put a high current variable voltage. In this case the voltage doesn't need to varry, it simply needs to shut on and off, which is why the filter is unneeded.

The class D amp uses an LC filter because it's a strong filter and because the L stores energy instead of dissipating it. In some ways it approximates a high frequency variable DC to DC converter, which it sort of is.

Specifically in this case, as you show it, that inductor is going limit current, which isn't really needed, but then cause overshoot. Note that the resource deliberately stressed that the voltage needs to remain under the maximum. A better way to eliminate noise in this circuit is to put a small filter on the MOSFET gate such that its turn on time is 1/100th or so of the PWM period. That limits rapid voltage/current spikes without any ill effects (marginal heat increase in the fet).

What's your reason for suggesting low side switching won't work? Even your example above could easily be flipped upside down with no ill effects.

asdf32 fucked around with this message at 14:25 on Mar 22, 2013

Adbot
ADBOT LOVES YOU

evensevenone
May 12, 2001
Glass is a solid.
Just PWM at a high frequency, 120hz would be easy with the Arduino. If you're using the "analog" output I think it's just PWM at 500hz.

Or add hysteresis and a wide enough band that it only switches every few seconds. You're dealing with a thermal system, it responds very slowly, so you don't really need much to get good regulation.

Slanderer
May 6, 2007

evensevenone posted:

Just PWM at a high frequency, 120hz would be easy with the Arduino. If you're using the "analog" output I think it's just PWM at 500hz.

Or add hysteresis and a wide enough band that it only switches every few seconds. You're dealing with a thermal system, it responds very slowly, so you don't really need much to get good regulation.

Don't do the latter, because that's still thermostat control (which will have hysteresis in the mechanical design), which is not good for the peltier

evensevenone
May 12, 2001
Glass is a solid.
If it's well coupled to the thermal mass, and the thermal mass is large, I can't really see the Peltier changing temperature that much. Is the problem the temperature changes, or the cycling itself?

Looking back someone was talking about high-power laser diodes but that would be a different situation. A Peltier should be tightly sandwiched between the mass and the heatsink and you'd really want to maximize conductivity on both interfaces. So the cold side shouldn't be very much colder than the mass, and the hot side shouldn't be much hotter than ambient, and there shouldn't be huge variations between off and on.

Slanderer
May 6, 2007

evensevenone posted:

If it's well coupled to the thermal mass, and the thermal mass is large, I can't really see the Peltier changing temperature that much. Is the problem the temperature changes, or the cycling itself?

Looking back someone was talking about high-power laser diodes but that would be a different situation. A Peltier should be tightly sandwiched between the mass and the heatsink and you'd really want to maximize conductivity on both interfaces. So the cold side shouldn't be very much colder than the mass, and the hot side shouldn't be much hotter than ambient, and there shouldn't be huge variations between off and on.

I'm honestly not really sure what the real issue is, since I didn't read into it further, but it seems to be recommended against:

quote:

44. Can I cycle the device on and off for temperature control?

Thermostatic operation (on-off) is one of the more affordable modes of control and is a tempting option (although a pulsed steady-state control can often be done as cheaply). With this approach, cooling (or heating) power is turned on at one temperature and off at another. This means that the system will continually bounce back and forth between two temperature limits; as a result, it is not a good alternative if steady-state performance is desired. An additional issue here is cycle time. Moderately slow cycle times can be more thermally stressful to the modules than using other types of control. If thermostatic control is to be employed, therefore, it is probably best to keep the cycle time in the range of tens of minutes or more.

Aurium
Oct 10, 2010

asdf32 posted:

A class D amp has a much different goal which is to out put a high current variable voltage. In this case the voltage doesn't need to varry, it simply needs to shut on and off, which is why the filter is unneeded.

The class D amp uses an LC filter because it's a strong filter and because the L stores energy instead of dissipating it. In some ways it approximates a high frequency variable DC to DC converter, which it sort of is.

Specifically in this case, as you show it, that inductor is going limit current, which isn't really needed, but then cause overshoot. Note that the resource deliberately stressed that the voltage needs to remain under the maximum. A better way to eliminate noise in this circuit is to put a small filter on the MOSFET gate such that its turn on time is 1/100th or so of the PWM period. That limits rapid voltage/current spikes without any ill effects (marginal heat increase in the fet).

What's your reason for suggesting low side switching won't work? Even your example above could easily be flipped upside down with no ill effects.

1. I'm still not talking about driving a peltier. A filter is unneeded. I said that 3 posts ago. I thought it was implied in the second post but wasn't explicitly said, so I've taken to explicitly saying it now.

2. I am interested in discussing this circuit, as unsuitable for peltier applications as it is, though.

So, lets say I actually wanted to make this circuit, either to make a high current variable dc power supply, or a class D (but not to drive a peltier). How would I deal with the overshoot? It seems to me that it's just a question of modifying the PWM signal in. The circuits in general do not seem to have these transistor filters. Many of them use a dedicated chip and the only external components are some gate resistors, I suppose the actual filter could be internal, but the block diagrams don't seem to have them either. Of course, it could easily be an implementation detail.

Regarding low side switching. Obviously filter -> load -> switch won't work. You'll clean up the power supply, but the same current would flow though the load as the switch. I've honestly never considered load -> filter -> switch, probably because I've never seen it in the wild either. I suppose that it could work. Is its rarity because the applications it would find use in are so limited, or does it just have a flaw?

makomk
Jul 16, 2011

evensevenone posted:

Just PWM at a high frequency, 120hz would be easy with the Arduino. If you're using the "analog" output I think it's just PWM at 500hz.
~500 Hz or ~1000 Hz depending on which pins you use, apparently. It's possible to change the PWM frequency but it involves modifying the timer registers directly and will break other functionality which uses the same timer. Read the fine print carefully if you want to try it!

e: PWM on Gumstix boards, on the other hand, apparently involves the modern equivalent of PEEK and POKE commands. Seriously, I didn't know you could do this stuff these days.

makomk fucked around with this message at 23:32 on Mar 22, 2013

Delta-Wye
Sep 29, 2005

makomk posted:

e: PWM on Gumstix boards, on the other hand, apparently involves the modern equivalent of PEEK and POKE commands. Seriously, I didn't know you could do this stuff these days.

That is a pretty ghetto way to do it. Ideally, you'd wrap all of that garbage up in a kernel module that just exposes a simple interface via /sys or something.

EDIT: VV Yeah, I thought the previous poster was referring to the direct memory access crap.

Delta-Wye fucked around with this message at 00:07 on Mar 23, 2013

Slanderer
May 6, 2007

Delta-Wye posted:

That is a pretty ghetto way to do it. Ideally, you'd wrap all of that garbage up in a kernel module that just exposes a simple interface via /sys or something.

Hmm? A kernel module is the first examples listed there. All the other shenanigans for doing it manually are below it.

HATE TROLL TIM
Dec 14, 2006
I'm looking at Xbee Pro 900MHz to do some remote processing from a small free ranging robot. Essentially the bot will have the sensors and IMU onboard and I'll have a RPi at a base station doing on the heavy lifting. What sort of a non-line of site range can I expect out of a system like this? I'm looking for ideally 3 miles.

evensevenone
May 12, 2001
Glass is a solid.

makomk posted:



e: PWM on Gumstix boards, on the other hand, apparently involves the modern equivalent of PEEK and POKE commands. Seriously, I didn't know you could do this stuff these days.
You're really doing the same thing when you set registers, they're just compiler macros for set memory addresses.

asdf32
May 15, 2010

I lust for childrens' deaths. Ask me about how I don't care if my kids die.

Aurium posted:

1. I'm still not talking about driving a peltier. A filter is unneeded. I said that 3 posts ago. I thought it was implied in the second post but wasn't explicitly said, so I've taken to explicitly saying it now.

2. I am interested in discussing this circuit, as unsuitable for peltier applications as it is, though.

So, lets say I actually wanted to make this circuit, either to make a high current variable dc power supply, or a class D (but not to drive a peltier). How would I deal with the overshoot? It seems to me that it's just a question of modifying the PWM signal in. The circuits in general do not seem to have these transistor filters. Many of them use a dedicated chip and the only external components are some gate resistors, I suppose the actual filter could be internal, but the block diagrams don't seem to have them either. Of course, it could easily be an implementation detail.

Regarding low side switching. Obviously filter -> load -> switch won't work. You'll clean up the power supply, but the same current would flow though the load as the switch. I've honestly never considered load -> filter -> switch, probably because I've never seen it in the wild either. I suppose that it could work. Is its rarity because the applications it would find use in are so limited, or does it just have a flaw?

What do you mean by "transistor filters", or dedicated chip with only external gate resistors. Which class of chip are you talking about?

When it comes to a DC-DC for example, to control it you're talking about control loop design and loop compensation. That's a massive subject unto itself. With proper design you get no overshoot. Many chips, including regulators, most op-amps, and DC-DC controllers take care of aspects of this for you (some don't, like DC-DC's with external compensation or op-amps that arne't stable at unity gain).

As for low side switching it's quite common, especially for things like LED's and relay coils. There is nothing special about ground compared to Vcc. It just happens to be convienient to have a rock solid ground connection between boards/modules to try to eliminate at least one side of your power supply challenges. If you don't really need that, then it can be more convenient to leave the + side always connected and switch the ground side (one reason being the ~2.5X better performance of N versus P devices). If you search for "low side switch" you'll see a whole range of various devices designed for this.

asdf32 fucked around with this message at 16:20 on Mar 24, 2013

Aurium
Oct 10, 2010

asdf32 posted:

What do you mean by "transistor filters", or dedicated chip with only external gate resistors. Which class of chip are you talking about?

When I was talking about transistor filters, I was referring to when you said:

quote:

A better way to eliminate noise in this circuit is to put a small filter on the MOSFET gate such that its turn on time is 1/100th or so of the PWM period. That limits rapid voltage/current spikes without any ill effects (marginal heat increase in the fet).

As far as what class of chip, basically anything on a GIS for class D amp connects the chip to the mosfet using only a resistor.

Lets use one in particular as an example though, the LM4651. Chosen because it is simply the first class d amplifier chip on my search. I've never seen one before. It's also marked obsolete. If you take a look at the datasheet, you'll see that there is no apparent filter on the gate of the driving mosfet. There is a component block for both the high-side and low-side drivers though. Can I presume that such a gate filter is internal to that block, or do they simply use a different technique? Is using a filter for reducing a turn on time common for this class of problems?

quote:

As for low side switching it's quite common, especially for things like LED's and relay coils. There is nothing special about ground compared to Vcc. It just happens to be convienient to have a rock solid ground connection between boards/modules to try to eliminate at least one side of your power supply challenges. If you don't really need that, then it can be more convenient to leave the + side always connected and switch the ground side (one reason being the ~2.5X better performance of N versus P devices). If you search for "low side switch" you'll see a whole range of various devices designed for this.
Plain low side switching is quite common. I've just never seen low side switching with a low side filter. When I've seen filters, they've always been high side, simply because they're filtering something that is already a source. At this point I don't doubt that you could do a low side filter, but it would be nice to have see one implemented else where.

quote:

When it comes to a DC-DC for example, to control it you're talking about control loop design and loop compensation. That's a massive subject unto itself. With proper design you get no overshoot. Many chips, including regulators, most op-amps, and DC-DC controllers take care of aspects of this for you (some don't, like DC-DC's with external compensation or op-amps that arne't stable at unity gain).

I guess this is probably the core of it. I'll come back later with a better set of questions.

ANIME AKBAR
Jan 25, 2007

afu~

HATE TROLL TIM posted:

I'm looking at Xbee Pro 900MHz to do some remote processing from a small free ranging robot. Essentially the bot will have the sensors and IMU onboard and I'll have a RPi at a base station doing on the heavy lifting. What sort of a non-line of site range can I expect out of a system like this? I'm looking for ideally 3 miles.

3 miles might be possible, if you have very good, highly directional antennas on both sides (we're talking at least +10dBi). A good set of patch antennas might work, though they can be pretty big.

Kasan
Dec 24, 2006
I don't know if this is a better question for the industrial wiring thread or not, but here goes. Disclaimer: Math

I've been hand winding a made from scratch transformer and I've hit a couple hurdles in the math department and I need some assistance before I plug this into mains and set fire to something.


The core is mild steel (.8 flux density, and yes I'm aware eddy currents could be an issue but in theory I shouldn't ever draw more than 500 mA off this thing) The primary winding has a .33mm diameter, and the usable core length is 53.89mm and has a post polish diameter of 12.36mm (started life as 1/2inch cold roll). Roughly, I should have around 163 turns per layer give or take 10% (I hand wound this thing and lost count somewhere around 90 turns). There are 8 layers of wire for an estimated total turns of 1,304. So far so good.

The secondary has me nearly tearing my scalp off. I decided to go with a center tap configuration with a single secondary. I had trouble with my googlefu and only found a couple videos of how I think the winding should work. What I ended up doing was just separating out about 15ft of magnet wire off my 1000ft spool and just wound them together. The wire diameter for the secondary is .75mm.

Now here is where I'm having all my woes. I have 2 layers of the secondary. at .75mm diameter I should have (I think) 72~ turns per layer. Since I'm using 2 conductors that will be joined at the center tap I'm slightly confused on if it matters how I calculate turns or not.

Questions I haven't been able to answer:
Turns per volt for Pri/Sec: (assume 120 rms/60hz input on the primary)
VA of the transformer: I'm hoping less than 1 amp or if my load can control that value.
Will it catch fire if I plug it in: Every layer is separated with a layer made up of masking tape > wax paper >masking tape. The layer between primary and secondary also has a layer of teflon tape.

Notes of import: I haven't actually cut the secondary yet so I can pile on more layers of it if I need.
Output voltage should be anything less than 50 (ideally around 30rms~ under load). I can regulate anything under than to my needed voltages with the parts I have available.



Semi scatterbrained post, haven't slept all weekend from a new puppy. I'll monitor the thread for a couple hours and answer questions if I've forgotten something.

Edit: Not sure if relevant, but resistance on the primary is 17.3 ohms

Kasan fucked around with this message at 01:56 on Mar 25, 2013

HATE TROLL TIM
Dec 14, 2006

ANIME AKBAR posted:

3 miles might be possible, if you have very good, highly directional antennas on both sides (we're talking at least +10dBi). A good set of patch antennas might work, though they can be pretty big.

Thanks! I found some sites that had range calculators on them and 10dBi is about what I came up with as well. I might just opt for a GSM module.

So here's what may be a dumb question... With an adjustable LM2577 boost converter, is the output voltage tied to the input voltage? What I mean is, let's say I've got 3.5v coming in and it's set to an output of 5v... What happens if the input voltage changes and goes higher? Does the output voltage linearly scale up or does it stay where it's at? Basically, I need a wide ranging input voltage (from 3 to 30v) to be converted to a steady 5v. I'm wondering if just an LM2577 will do that, or if I'll need to add a buck converter as well.

Rescue Toaster
Mar 13, 2003
Any thoughts on correcting a normal opto-isolator (transistor output) duty cycle? Using a normal pullup resistor and the opto as an open collector driver, it ends up distorting the duty cycle by about 2-3% on average with a 100 ohm pullup (which does not give a lot of swing), and by 5-6% with a 470 ohm pullup (which gives pretty much full output swing). This is with PWM frequencies in the 5-20khz range.

I'm guessing the answer is just 'deal with it'. The only 'solution' I could think of was some sort of logic structure that would have the opposite rise/fall skew, but I can't think of a cheap/easy way to do that.

Slanderer
May 6, 2007

HATE TROLL TIM posted:

Thanks! I found some sites that had range calculators on them and 10dBi is about what I came up with as well. I might just opt for a GSM module.

So here's what may be a dumb question... With an adjustable LM2577 boost converter, is the output voltage tied to the input voltage? What I mean is, let's say I've got 3.5v coming in and it's set to an output of 5v... What happens if the input voltage changes and goes higher? Does the output voltage linearly scale up or does it stay where it's at? Basically, I need a wide ranging input voltage (from 3 to 30v) to be converted to a steady 5v. I'm wondering if just an LM2577 will do that, or if I'll need to add a buck converter as well.

I don't think it'll do that, although I only briefly glanced at the datasheet. It looks like the standard design would basically just pass the input through to the output (via a diode) if the input was too high.

You'll definitely need a different design. Depending on the current required, you could use a linear regulator for higher voltage sources and setup a comparator and power switches to select for the two, or use a buck-boost converter or a SEPIC converter or whatever. This really isn't my area of expertise, so maybe someone who still does this stuff can chime in.

Slanderer
May 6, 2007

Rescue Toaster posted:

Any thoughts on correcting a normal opto-isolator (transistor output) duty cycle? Using a normal pullup resistor and the opto as an open collector driver, it ends up distorting the duty cycle by about 2-3% on average with a 100 ohm pullup (which does not give a lot of swing), and by 5-6% with a 470 ohm pullup (which gives pretty much full output swing). This is with PWM frequencies in the 5-20khz range.

I'm guessing the answer is just 'deal with it'. The only 'solution' I could think of was some sort of logic structure that would have the opposite rise/fall skew, but I can't think of a cheap/easy way to do that.

I've never had this issue before. Can you show exactly what your schematic looks like, and what opto you're using is? You could always use something with Schmitt trigger outputs, but that is probably just a bandaid solution for whatever is loving with your rise times.

evensevenone
May 12, 2001
Glass is a solid.

HATE TROLL TIM posted:

Thanks! I found some sites that had range calculators on them and 10dBi is about what I came up with as well. I might just opt for a GSM module.

So here's what may be a dumb question... With an adjustable LM2577 boost converter, is the output voltage tied to the input voltage? What I mean is, let's say I've got 3.5v coming in and it's set to an output of 5v... What happens if the input voltage changes and goes higher? Does the output voltage linearly scale up or does it stay where it's at? Basically, I need a wide ranging input voltage (from 3 to 30v) to be converted to a steady 5v. I'm wondering if just an LM2577 will do that, or if I'll need to add a buck converter as well.

As long as the input voltage doesn't get close to the output voltage, the output voltage will be regulated to the correct voltage. On the datasheet, they give a number for deltaVout/deltaVin of 20mV/V. SoI think that means if Vin goes up 1V, Vout goes up 20mV, which isn't bad.

But a boost converter can only increase the voltage (i.e Vout > Vin). If you have an input range from 3 to 30V, you would need a buck-boost converter, which do exist and should have similar properties.

HATE TROLL TIM
Dec 14, 2006
Thanks guys, that's what I thought, but had read some confusing Engrish on a few eBay listings for boost converter PCBs. Thanks for the information about the delta, Slanderer. I was thinking that's what it meant as well, but wasn't 100% sure.

Basically I need the highest efficiency power supply I can get that will give me a steady 5v/2a (max) from 2.7v (super cap), 3.7v (lipo or limn cell) and 5v (usb).

catbread.jpg
Feb 22, 2007

Rescue Toaster posted:

Any thoughts on correcting a normal opto-isolator (transistor output) duty cycle? Using a normal pullup resistor and the opto as an open collector driver, it ends up distorting the duty cycle by about 2-3% on average with a 100 ohm pullup (which does not give a lot of swing), and by 5-6% with a 470 ohm pullup (which gives pretty much full output swing). This is with PWM frequencies in the 5-20khz range.

I'm guessing the answer is just 'deal with it'. The only 'solution' I could think of was some sort of logic structure that would have the opposite rise/fall skew, but I can't think of a cheap/easy way to do that.

yeah, assuming it's due to a consistent turnoff skew, take your PWM signal x, invert it to give y, put both through separate optocouplers, and use the rising edges (any number of ways to do edge detection) to trigger the S and R inputs of an SR latch or what have you.

or, ya know, deal with it. what is it for?

Blotto Skorzany
Nov 7, 2008

He's a PSoC, loose and runnin'
came the whisper from each lip
And he's here to do some business with
the bad ADC on his chip
bad ADC on his chiiiiip
So today I found out that my ADC's internal buffer, when enabled, increases the INL from about .003% to about .15%. gently caress my life. TJ Rogers is the reincarnation of Hitler.

insta
Jan 28, 2009

HATE TROLL TIM posted:

Thanks guys, that's what I thought, but had read some confusing Engrish on a few eBay listings for boost converter PCBs. Thanks for the information about the delta, Slanderer. I was thinking that's what it meant as well, but wasn't 100% sure.

Basically I need the highest efficiency power supply I can get that will give me a steady 5v/2a (max) from 2.7v (super cap), 3.7v (lipo or limn cell) and 5v (usb).

:catstare: 2.7V supercap and 5v/2a?

You'll get less than 1 second of runtime per Farad rating of your capacitor.

Slanderer
May 6, 2007

Otto Skorzeny posted:

So today I found out that my ADC's internal buffer, when enabled, increases the INL from about .003% to about .15%. gently caress my life. TJ Rogers is the reincarnation of Hitler.

Even before I looked up TJ Rogers, I just knew this had to be about a PSOC

HATE TROLL TIM
Dec 14, 2006

insta posted:

:catstare: 2.7V supercap and 5v/2a?

You'll get less than 1 second of runtime per Farad rating of your capacitor.

2A will be maximum possible output, average current usage will be >500mA under most conditions. I plan on using a 10 Farad super capacitor. I only need around 10 seconds of runtime on the capacitor. It's essentially there to keep power while switching batteries out. I'll most likely end up using a 3000~4000mAh protected 18650 battery since they're cheap, plentiful and can be easily swapped out. (In case you're wondering, I'm building a battery/power add-on board for the Raspberry Pi. Trying to fix some of the power flaws by supplying clean, consistent power. Adding a RTC and some other useful stuff to it as well.)

Arcsech
Aug 5, 2008

Otto Skorzeny posted:

So today I found out that my ADC's internal buffer, when enabled, increases the INL from about .003% to about .15%. gently caress my life. TJ Rogers is the reincarnation of Hitler.

Yeah even on the PSoC 3 the internal ADC buffer is poo poo.

The PSoC is sort of a jack-of-all-trades-master-of-none type device. If you need something really flexible but don't need it to do any one thing particularly well it's about what you need.

insta
Jan 28, 2009

HATE TROLL TIM posted:

2A will be maximum possible output, average current usage will be >500mA under most conditions. I plan on using a 10 Farad super capacitor. I only need around 10 seconds of runtime on the capacitor. It's essentially there to keep power while switching batteries out. I'll most likely end up using a 3000~4000mAh protected 18650 battery since they're cheap, plentiful and can be easily swapped out. (In case you're wondering, I'm building a battery/power add-on board for the Raspberry Pi. Trying to fix some of the power flaws by supplying clean, consistent power. Adding a RTC and some other useful stuff to it as well.)

I'd highly suggest utilizing sleep modes to help push your cap further...

HATE TROLL TIM
Dec 14, 2006
For sure! This board will talk to the RPi over I2C and I planned on implementing power management. I've got a battery fuel gauge chip sample coming from Maxim. Basically I planned on having an ATmega-somthing on the power board that will handle all the heavy lifting (fuel gauge, current sensor, voltage monitoring, charge control) and then talk to the Pi over I2C. I can integrate that with Linux's power management through software. (I haven't gotten that far in the planning yet.)

Delta-Wye
Sep 29, 2005

HATE TROLL TIM posted:

For sure! This board will talk to the RPi over I2C and I planned on implementing power management. I've got a battery fuel gauge chip sample coming from Maxim. Basically I planned on having an ATmega-somthing on the power board that will handle all the heavy lifting (fuel gauge, current sensor, voltage monitoring, charge control) and then talk to the Pi over I2C. I can integrate that with Linux's power management through software. (I haven't gotten that far in the planning yet.)

Linux can talk to some of these sensors via already made kernel patches. If you use supported chips and you can wire them directly to the pi, seems like you'd be silly not to take advantage of it.

http://lxr.linux.no/linux+v3.8.4/drivers/power/bq27x00_battery.c

Rescue Toaster
Mar 13, 2003

Slanderer posted:

I've never had this issue before. Can you show exactly what your schematic looks like, and what opto you're using is? You could always use something with Schmitt trigger outputs, but that is probably just a bandaid solution for whatever is loving with your rise times.

Basically I was using the cheapest opto imaginable (LTV-847) and using a pretty normal ~10mA drive current and tried various pullup/down resistors on the output (for inverting or non-inverting operation, I tried both ways).

The problems I had were two-fold, if the pullup/down resistor was too large (>220 ohms) I'd get lots of swing but the thing took forever to switch off when the input switched off. (And that's only driving a single 74ac04 input) Also, if the driving current was too high, it took forever to turn off, I'm guessing because the phototransistor was completely saturated? But when I turned down the driving current, the switch transitions had really bad rise/fall times, which made the duty cycle even less accurate.

If I slowed the PWM way down (in the 4khz range) the error was only about 1%, but then I had to hear that annoying shriek from the motor/fan.

Regardless, any solution involving 2x the channels or any other extra chips will end up making the thing more expensive than just using a SI8440, so I'm just going to do that. It has a duty cycle error in the tens of nanoseconds instead of the tens of microseconds.

HATE TROLL TIM
Dec 14, 2006

Delta-Wye posted:

Linux can talk to some of these sensors via already made kernel patches. If you use supported chips and you can wire them directly to the pi, seems like you'd be silly not to take advantage of it.

http://lxr.linux.no/linux+v3.8.4/drivers/power/bq27x00_battery.c

Yeah, that was the plan (to find a chip with existing linux drivers). There is a driver for the Maxim chip I've got coming, but that TI chip looks really nice as well, so I ordered a sample of that too!

asdf32
May 15, 2010

I lust for childrens' deaths. Ask me about how I don't care if my kids die.

HATE TROLL TIM posted:

Thanks guys, that's what I thought, but had read some confusing Engrish on a few eBay listings for boost converter PCBs. Thanks for the information about the delta, Slanderer. I was thinking that's what it meant as well, but wasn't 100% sure.

Basically I need the highest efficiency power supply I can get that will give me a steady 5v/2a (max) from 2.7v (super cap), 3.7v (lipo or limn cell) and 5v (usb).

Yep, buck-boost is what you want. Note that the standard buck boost topology is invertering. This should be of little consequence with the battery (just flip it upside down) but would add complications if you're using USB for communication in addition to power.

If that's a problem consider boosting to ~6v (whatever is the lowest you can get from the boost at ~5.5v in) and using a linear to go back down a steady 5.

Slanderer
May 6, 2007

HATE TROLL TIM posted:

Yeah, that was the plan (to find a chip with existing linux drivers). There is a driver for the Maxim chip I've got coming, but that TI chip looks really nice as well, so I ordered a sample of that too!

TI gas gauges are the poo poo. About 15% of my time at work is spent working with battery backs that use their SBS 1.1 gas gauges (it's a mostly-standardized battery spec used by a lot of laptop batteries).

The good thing about the gas gauges is that they are wonderfully accurate most of the time, and properly account for temperature, discharge current, cell chemistry, and all this stuff. Their "Impedance Track" tech sounds like marketing, but the algorithm is rather effective. They basically get programmed with a "known" chemistry for a particular cell (or a generic cell of a specific construction) and that gives the gas gauge information about the cell impedance and open circuit voltage over the entire range of charge (essentially, it stores these as big tables in the gas gauge). The resistance tables are updated over the life of the battery to properly reflect the variation in the cell's impedance curve over lifetime. Pretty good poo poo.

I've never used any of their system-side stuff, but it's probably pretty good too. Keep in mind that this kind of gas gauge still expects your battery pack to have basic protection circuitry built in (probably overcharge protection, and likely overcurrent as well, with FETs to disable charge/discharge and possibly a fuse-type element), and a thermistor built into the pack. You really don't want to neglect these safety elements. A lot of the batteries from like Sparkfun or Adafruit or wherever have a cheapo protection PCA inside the pack, but that's only for flat prismatic packs. Using a bare 18650-sized cell is a bad idea, especially if you're drawing a lot of current from it.

A really, really bad idea.

darkhand
Jan 18, 2010

This beard just won't do!
Is there any kind of component that can produce a "Click" or "Clunk" sound? Or a self setting mechanical switch that produces a clunky sound? Although that sounds kinda complex/expensive. Maybe a really loud relay?

darkhand fucked around with this message at 18:44 on Mar 26, 2013

taqueso
Mar 8, 2004


:911:
:wookie: :thermidor: :wookie:
:dehumanize:

:pirate::hf::tinfoil:

darkhand posted:

Is there any kind of component that can produce a "Click" or "Clunk" sound? Or a self setting mechanical switch that produces a clunky sound? Although that sounds kinda complex/expensive. Maybe a really loud relay?

A solenoid or big relay will clunk. Big three-phase contactors make a really great thump, but they are expensive.

taqueso fucked around with this message at 18:59 on Mar 26, 2013

peepsalot
Apr 24, 2007

        PEEP THIS...
           BITCH!

Use a solenoid made for a pinball machine

HATE TROLL TIM
Dec 14, 2006

Slanderer posted:

TI gas gauges are the poo poo. About 15% of my time at work is spent working with battery backs that use their SBS 1.1 gas gauges (it's a mostly-standardized battery spec used by a lot of laptop batteries).

The good thing about the gas gauges is that they are wonderfully accurate most of the time, and properly account for temperature, discharge current, cell chemistry, and all this stuff. Their "Impedance Track" tech sounds like marketing, but the algorithm is rather effective. They basically get programmed with a "known" chemistry for a particular cell (or a generic cell of a specific construction) and that gives the gas gauge information about the cell impedance and open circuit voltage over the entire range of charge (essentially, it stores these as big tables in the gas gauge). The resistance tables are updated over the life of the battery to properly reflect the variation in the cell's impedance curve over lifetime. Pretty good poo poo.

I've never used any of their system-side stuff, but it's probably pretty good too. Keep in mind that this kind of gas gauge still expects your battery pack to have basic protection circuitry built in (probably overcharge protection, and likely overcurrent as well, with FETs to disable charge/discharge and possibly a fuse-type element), and a thermistor built into the pack. You really don't want to neglect these safety elements. A lot of the batteries from like Sparkfun or Adafruit or wherever have a cheapo protection PCA inside the pack, but that's only for flat prismatic packs. Using a bare 18650-sized cell is a bad idea, especially if you're drawing a lot of current from it.

A really, really bad idea.

Obviously I'll have a chip onboard to handle the lithium ion charging and low voltage protection. The batteries will be protected 18650 cells, which as I understand it have onboard circuits to limit current coming out of the battery (2.5 to 3 amps in most cases). The circuit should never pull over 2 amps, so that should be enough current. Though, to be safe I had planned on adding a separate current limiting circuit in case an end user puts a bare 18650 cell on there.

Another option is to use 18650 LiMn cells, which can handle absurd amounts of current without risk of explosion. They won't explode, instead just simply melt down, making it a lot safer.

I've got some experience working with lithium cells from selling and modding electronic cigarettes.

movax
Aug 30, 2008

http://aaron-sherwood.com/blog/?p=712

What is this guy's username? It would probably cost less to you know, talk to his wife or hire someone to take a picture of her and his best friend going at it.

Adbot
ADBOT LOVES YOU

Slanderer
May 6, 2007

HATE TROLL TIM posted:

Obviously I'll have a chip onboard to handle the lithium ion charging and low voltage protection. The batteries will be protected 18650 cells, which as I understand it have onboard circuits to limit current coming out of the battery (2.5 to 3 amps in most cases). The circuit should never pull over 2 amps, so that should be enough current. Though, to be safe I had planned on adding a separate current limiting circuit in case an end user puts a bare 18650 cell on there.

Another option is to use 18650 LiMn cells, which can handle absurd amounts of current without risk of explosion. They won't explode, instead just simply melt down, making it a lot safer.

I've got some experience working with lithium cells from selling and modding electronic cigarettes.

I was about to say, "protected 18650? BULLSHIT!" until I decided not to be an rear end and what do you know:

http://www.batteryjunction.com/ultrafire-xsl-2600-18650.html

That looks good, with over- and under-voltage protection. It also has an integrated PTC, so that will handle overcurrent stuff pretty well (not perfectly, though--I can't remember if those are bad for short circuits, or high constant loads, or what).

But I guess I learned something today. And you know what you're doing, so full speed ahead.

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