This system uses a 250W 24V halogen lamp. We're using an autotransformer to deliver about 30VAC open circuit, then phase controlling that down to 24V (actually, the RMS voltage to the lamp can be varied by a control voltage that is generated by another PIC generating a PWM signal and handling user interface). The autotransformer also has an isolated secondary that powers the PICs (three of them in this product, the 16c716 in the power supply, a 16f628 in the control panel, and a 16f627 as a remote display driver/pushbutton interface that communicates with the control panel over three wires: +5V, data, ground). The isolated secondary has its center tap grounded. One pair of rectifiers drives a capacitor and a 7805 to provide the 5V supply. Another pair of rectifiers drives a current limit resistor into RB0 to generate an interrupt just prior to zero cross. This resets the timer that the compare register uses to figure out when to turn on the triac. The same diode pair driving RB0 also drives a voltage divider into an analog input. This is where the instantaneous voltages during the half cycle are measured. Note that these samples are the full half cycle, not just the part when the triac is on. But, since the PIC is turning on the triac, we know when it's on. So, we just add zero instead of the A/D reading when the triac is not on. Ideally, we'd measure the actual output driving the lamp, but that'd require another isolation barrier to get the phase controlled AC back to the PIC. I figured that the isolated secondary voltage is pretty close to being proportional to the nonisolated secondary (the portion of the primary between the bottom and the 30V tap). There'd be two errors: First would be a lack of tracking as the load varies. The second would be lack of tracing as the line varies. Since we are always driving the same load, the first factor (which is probably the larger one) can be ignored. I suspect the second factor is pretty small (the secondary voltage is pretty proportional to the line voltage). So, it worked out pretty well. I was able to avoid another coupling across the isolation barrier... Harold On Sat, 17 Mar 2001 15:55:35 +1100 Roman Black writes: > Harold M Hallikainen wrote: > > > > Yep, the PIC16c716 is a nice chip. We've designed it into > a phase > > controlled voltage regulator. It measures the instantaneous > voltage 200 > > times every half cycle, accumulating the square of the voltage, > then > > dividing by the actual count (which may vary some depending on PIC > and > > line frequency), then taking the square root to get the RMS > voltage. The > > compare register is then adjusted in the appropriate direction to > trigger > > the triac at the right time so the RMS voltage remains constant > > (relatively). > > We've shipped our first 500 and are about to start a run > of 1,000. > > > > Harold > > > Nice system Harold! Are you using a transformer > too or does it just correct for over-power > conditions? > -Roman > > -- > http://www.piclist.com#nomail Going offline? Don't AutoReply us! > email listserv@mitvma.mit.edu with SET PICList DIGEST in the body > > ________________________________________________________________ GET INTERNET ACCESS FROM JUNO! Juno offers FREE or PREMIUM Internet access for less! Join Juno today! For your FREE software, visit: http://dl.www.juno.com/get/tagj. -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu