Doing some flying capacitor voltage measurement, need switching advice. many thanks

Status
Not open for further replies.

Tomek

Well-known member
edit: You might have noticed this thread in the wrong section. I just realized project guidance is probably more appropriate for it.

So I originally started a quest on another thread a year ago:
http://forum.pjrc.com/threads/21682-Teensy-3-0-looking-for-ADC-absolute-measurement-tips-)

The scope of my challenge changed a little, and my leading plan of action has shifted. I realize that my question is no longer about precision voltage measurement on the ADC, because I'm not scaling the signal as much with resistors. Instead I am now trying to use a capacitor to measure my voltages, then switches to float the gnd of the capacitor and then connect it to gnd of the teensy, then connect the + of the capacitor to the ADC.

Originally that felt like mystique logic, but actually it kind of seems sensible now that I think more about what a capacitor is.

To quickly lay out the application I'm trying to make:

I have a 36V voltage running through an integrated H-bridge controlled by the Teensy. This voltage is applied through 9 peltier modules, which you can think of as resistors- sort of. Critically, I have to apply the voltage in two directions for the peltier module, first 0--36V, then 36V---0. I want to be able to measure the voltage across an individual peltier module, so that I can determine the rough DC resistance of that module and in turn its power consumption (since I know the current going through the total series circuit.) I intend on using a capacitor system to measure these voltages, to deal with the fact they vary as high as 36V above teensy-ground, even while the individual relative voltages are much less (about 4V max each).

But what I don't have enough experience with, is transistor logic. I have used both N and P-channel mosfets before, and NPN transistors. I think in this application because I am making a directional change in my voltages with 0----stuff to measure---36v then 36----stuff to measure---0v, I am dealing with negative voltages, and also moments when the relative voltage to ground of something is 33v, then later 3v. This totally messes up my limited understanding of how transistors functionally work.

I think the only solution I have is to use a lower-cost small SSR type chip like http://datasheet.octopart.com/G3VM-61H1-Omron-datasheet-9718722.pdf. I don't know if it will work as I intend, because I am in over my head by a little bit with transistor logic.

Presumably I can't just use mosfets because direction of the voltage will change, but perhaps I actually could still use a P-channel mosfet to switch the lines and another transistor to allow the teensy to switch the p-side. I will however struggle with getting the right Vgs voltage, since the circuit changes directions.

As draw in the attached circuit I've just show switch symbols, which does kind of point out that I could use a wonky series of low power relays if I'm desperate.
BasicSchematic.jpg

Thanks for any suggestions or input. At this point I'm mainly looking at two things
(1) Is this flying capacitor solution feasible? Am I missing something major?
(2) What can I use for the 'switches' in my circuit? So that I can control these things from the teensy.
View attachment 2605
 
Yes, a flying capacitor is feasible, although preserving accuracy may be a challenge. There are a number of sources of error --
1) dielectric relaxation -- basically when you charge (or discharge) a capacitor, some charge remains 'stuck' in the dielectric and doesn't appear instantaneously. For example, if you charge a capacitor to 10 V, discharge it (short the terminals) -- the voltage should become 0. However, if you now measure the terminal voltages on a meter, you may see 100's of mV. Some dielectrics are better than others (electrolytic, ceramics are bad) -- polypropylene are best (but physically much larger).
2) leakage -- from your switches, and the ADC input. You have about 10 switches connected to each capacitor terminal. Specified leakage (not worst case) is 0.001 uA per switch, so you could have leakages of 0.01 uA. This will discharge a 0.1 uF by 1 mV in 10 ms. The highest resolution ADC might not convert that fast. Best to use 1 uF if you can.
3) parastic capacitances -- probably not a high issue in this application, but coupling between the capacitor's terminals and other wires will slightly change the V on the capacitor.

For experiments, you might find it easier to use a ~ 100 uF capacitor (you can then put a DVM across it and not discharge too fast). Put 10 Ω in series with the 100 uF to limit current spikes.

Using discrete transistors will become large an cumbersome because you will also need back-back FETs for most switches and level shifters and VGS protection to drive them. The SSRs might be the simplest to use.
 
Thank you! That is some really awesome advice for me. There are some things there that I would have *no* idea about, because I don't have a specifically electrical background (and even if I did, perhaps simply because it is coming from a better amount of electrical knowledge.)

(1) I had never heard of dielectric relaxation, but I looked it up now and find that interesting. It sounds like for my application the relevance is more in the potential for my capacitor to discharge, than the measurement of the capacitor. Is that correct? Since the measurement should not draw much current, I reason that it should not be affected as much by dielectric relaxation. But I take away that I should still use a polypropylene capacitor, and otherwise I would have just used a ceramic cap, and I appreciate the guiding direction.

(2) leakage. oi! Yeah, I figured leakage would probably affect what sort of cap I need. There are a ton of switches in the circuit and I don't really know anything about circuit simulation. I can definitely use a 1uF as a capacitor. I plan on using the teensy ADC and will try to be mindful of how long I supersample the measurement, since as you point out the measurement might vary as a consequence of measuring over a longer time (at which point, why supersample?)

(3) I guess I should keep larger traces and lines short to avoid parasitic capacitance? Also, I suppose, since you've suggested towards a 1uF cap instead of a 0.1uF cap, the relative effect of parasitic capacitance should be less.

(A) About the ~100uF capacitor, I was not certain why you suggested it. Were you thinking that it would help because I wouldn't have to worry about switch leakage and parasitic capacitance? I suppose that is a good reason. But then at 100uF i don't know how long it would take to charge. At 100uF, it makes me think that I might want to have one extra way to slowly charge the capacitor up to my ~2.6V measurement point, then I can probably afterwords connect directly to my measurements. Because at that point the measurements are only varying by 0.1X voltage. Having a separate slow-charge would cost me an extra two switches with resistors inline, representing a connection to the two lowest in the chain modules on each side (so 0-first module, for one direction, then the other side of the line 0-last module, for voltage running through the h-bridge in the other direction.)

(B) I'm really glad you suggest the SSRs might work. I guess it sounds like running the discrete transistors (back to back fets) would be not unlike making my own SSRs in a way, at least insofar as my limited understanding thinks of an SSR as an optocoupler+back to back fets. I think they're something more than just that. And if I tried to finangle my own system, I think the cost would be even higher and less reliable.


Again, thank you for your help! It's a lifesaver to have some advice and feedback from someone who knows more about what I'm doing. On friday I was thinking that whatever the next thing I do is with my projects, I should work on something with a more mechanical basis. I think I dipped too deep into electrical stuff and I respect the world and like it, but it was looking a little overwhelming to not know if what I was doing made any sense. thanks again.
 
So, as for the dielectric relaxation topic:

I have basically made my PCB board, and foolishly didn't take enough note of how you said those polyethylene caps are bigger. They are much bigger, yah! I made my board with room for 1206 or 1210 caps (3 1uF ones) and it looks like there aren't any polyethylene caps that small.

I have however found one thin-film polymer type that does fit, with "acrylic" as the dialectric. The wikipedia section on dialectric absorption/relaxation does not have a category for acrylic capacitors. And, I can't find any chart elsewhere online indicating their relaxation error. Would they be better than a ceramic capacitor?


I have to go direct to PCB board because this project is impossible to hand wire....some 3 meters of traces according to KiCad and many connections :p. At least for me this is a first, most of my boards have been simpler. yay OSH park.
 
I don't know how well the acrylic caps will work.

If you have a DVM, do this manually: connect one up to a voltage source for a few seconds. Then remove it and briefly (<< 1 s) short the terminals, then leave them open circuit. Then measure the voltage on the terminals. Note that if you leave the DVM connected, it will continue to discharge the capacitor. That will give an indication of what effects you might observe.

If you short again, or for a longer time, you'll see the voltage reduce.

What this basically means that when you connect the caps to various voltages in your system, it will take some time to settle reliably to the new voltage for measurement. The worst cases will be when you significantly change the voltage across the capacitor (or reverse the polarity).
 
Status
Not open for further replies.
Back
Top