Okay, here is some more detail then.... The voltage I'm looking at is the voltage gated by the triac going into a transformer. The voltage data is used for PID control of that same measured voltage (something else I have to figure out yet). Say I want 60volts to go to the transformer.... I measure the current voltage over 1/2 line cycle (8.33ms), and adjust the triac firing to try and get there on the next 1/2 cycle (repeat until it settles). The load on the transformer (off of the secondary), is extremely resistive, almost a dead short (A short nichrome heating element, attached to a "pen", which is attached to a 4 foot long 16 or 18 gauge cord, that is connected to the transformer). Nothing is rectified or filtered after the transformer (voltage goes from about 0.4vac to 2.0vac max) From what I've read, the waveform on the secondary will be 180 degrees out of phase from the primaries. At the start of this project, I was also thinking that I'd have to measure current, in order to get an idea of the true power being consumed. But multiplexing the ADC slows it down a lot, and it will also cost much more in hardware (current to voltage converter, etc...). I thought that maybe I could kind of cheat, by characterizing the transformer by measuring the RMS current at different power levels, and putting that data into a table (by looking where the triac shuts off at, I should be able to know the amount of current). The user range is only from 0 to 99, so that shouldn't be a problem. However, the actual load (the nichrome element) is user changeable, some elements draw more current at a given setting, some draw much less. Current draw is also dependant on other variables, like modular jack connections (how tight they are), cord gauge (16 or 18 gauge), solder joints, internal "pen" construction, etc.... This is how the current "analog circuit" works: Voltage is varied via user selection (potentiometer) and also depends on whatever the current line voltage happens to be. Where as the "current" drawn is determined by the particular nichrome element in use, the cord gauge, etc... (I'm really just trying to get rid of the uncertain aspect of the line voltage variation). In fact, my only core reason to look at how much "current" is being drawn, is to be able to detect a fault condition (if a short occurs near the output of that tranformer, usually in the modular jacks I'm using, stuff starts melting). BTW, maximum current output of the transformer is upwards of 16 to 20 amperes, much more if a "fault condition" exists. About the signal "risetime"/ red herring.... If a triac can turn on and bring the original signal from 0 up to 205 volts (0 to 4.096 is what I'll be looking at though) in 1us, isn't that a rise-time of 1mhz? From what I've read about the PIC's ADC (lets say an F876), the most I can hope for is around 24khz sampling rate, a little more at 8 bits on other uP's. And according to the MC's files that I've read (many), I want to keep the signal at or below 1/2 of the nyquist rate for accuracy reasons. I would assume that would also apply to frequencies within that signal. I'll be using TMR1 in compare mode to turn on the triac from CCP1 (hardware), CPP2 or B0 for zero crossing (interrupt), and TMR0 to do ADC interrupts (200 times every 8.333ms). So what happens if: The ADC sampling time is over, the conversion starts, and timer1 matches, and is just turning on the triac? Won't I miss about the first 16 to 20us of the actual signal? From what I understood from the datasheets, the sampling capacitor isn't latched back to the signal pin for a few tads "after" the conversion is finished. Loosing 20us of signal wouldn't be so bad, but that time factor can also vary, unless I were somehow able to synchronize the ADC to start sampling just as the triac was being turned on, or immediately before (would be tricky I think). I guess I don't understand what you mean by "how much of the waveform's energy is present" (what do you mean by "energy"? watts?). Would the rise time be greatly reduced because it is a transformer (inductive load)? The Triac/SCR waveforms that I seen on my buddy's scope (same inductive load conditions on an analog circuit), looked like they were going "straight up" to the top of the waveform when the triac was turned on during each half cycle. Thank you for you comments, waiting to hear more. -----Original Message----- From: Dave Dilatush To: Bob Date: Tuesday, April 24, 2001 6:26 PM Subject: Re: [EE]: RMS vs Average voltage? Bob wrote... >Okay, I've tried to read up on RMS, and I still don't understand "when" it >should be used instead of just averaging. Any suggestions on which I should be >using for this application (described below)? Depends. What are you trying to do? RMS provides, in effect, a measure of the amount of power delivered by a complex AC signal; the AC signal's "DC equivalent", as it were. If your triac-gated AC waveform is feeding a heating element, measuring the RMS value of the complex waveform will give a good indication of how much power is being delivered. You spoke of the triac output as "driving a transformer with a feedback loop", but this doesn't say enough to determine whether RMS is what you want to measure. What's the transformer load? A rectifier and filter? If so, an RMS measurement of the triac output waveform wouldn't likely do much for you. If that's the case, why not measure the DC output of the rectifier/filter and control on that measurement with a PID loop? (I'm just guessing here, I know) >And I've calculated that with triacs having something like 1us rise >times (I read that in some triac technical document somewhere), that an ADC >would have to be sampling at 2mhz in order to be at/over the correct nyquist >rate. The question of "risetime" is a red herring. What matters is how much of the waveform's energy is present at frequencies below one-half whatever sampling rate you can support. In most cases, a triac-gated 60 Hz waveform is going to deliver only a small fraction of its energy at frequencies above a few KHz, meaning you won't get much error by sampling a LOT slower than 2 MHz. That'd be gross overkill. >Gee, I wish I had gone to school for EE now, instead of programming. Yes, there are times when being an "old analog fart" comes in handy... >Any suggestions on how to go about doing this are welcomed. First step would be to describe what you're trying to do in a little more detail; then we can go from there. Hope this helps... Dave -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body