On Wed, 2 May 2001, Bob wrote: > > And that gets me thinking back to looking at the incoming (non SCR) sine wave, > and doing open loop compensation instead of PID control compensation (I don't > have a clue on how to do open loop). The raw math for doing that is > "transendental" (extremely compute intensive), so that option is out. A few > people told me that I could just use a couple of tables to do this method of > control, but I can only figure out how I'd use a table to linearize the output. > Anyone have a prime example of how this is done (in pseudo code or basic > please)? Hmm, this method would have one or two drawbacks, as the output would > not be linear (and possibly not accurate) if someone plugs the device into a > non-sinusoidal AC voltage (especially a sawtooth waveform). I don't have code or examples. But here's an explanation that may simplify the concept. Separate for the moment, the incoming peak sinusoidal voltage and the SCR firing angle. Imagine you had a look up table that took as its input the SCR firing angle and produced at its output the RMS voltage for a 1 volt sine wave. This is easy to produce. If you wanted to scale it up to higher voltage then the only "computation" required is multiplication. rms_voltage = Vline * table[firing_angle] Inverting this table is where the transcendental math enters. You could create the inverse table (i.e. input to the table is the line voltage and the output is firing angle), but it doesn't scale linearly with changes in line voltage. However, it's straight forward to servo the firing angle to achieve the desired voltage. Presumably you have a desired RMS output. A simple PID controller could monitor the incoming RMS voltage, calculate the outgoing SCR RMS voltage (based on the current firing angle), and vary the firing angle on a cycle-by-cycle basis based on how much the calculated output differs from the desired (and how long it's been that way if you want the "integrator" portion of PID). I'm tacitly assuming that the input IS sinusoidal. If it's not, then this method will not work. (Also, after re-reading your message, I think I have the input and outputs reversed... But whether you're measuring firing angle or generating it, the same approach applies [and so does the same assumption about the SCR chopping a sinusoidal wave form]) Scott -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads