## Measuring phase angle of Voltage and Current

45 posts / 0 new
Author
Message

For a series resonant LC tank I am trying to implement a measurement of the phase angle between Voltage and current of the capacitor.

I can measure the time between zero crossing of Voltage and current but :

My main problem is I can not find a good way to decide if the current is lagging or leading the voltage.

My rough plan is:

I capture the Voltage rising edge through an isolated zero cross detector. (ICR1). Just after that I observe the following capture regiters.

ICR2 Rising edge capture register of current
ICR3 falling edge capture register of current

My state logic

Quote:

if stCheckLeadingLagging=3 then increase frequency by 60Hz /C lagging under resonance

The increment and decrement values of frequency can be adjusted according to the amount of time measured between Voltage zero crossing and current zero crossing.

Does it make sense? or is there a more effective way?

________________________________ We dream of a world where current does not need the voltage to flow.

One of the things you need to watch out for is delay in the detector(s), particularly asymmetric delay (different on rise and fall).

You can also run into problems with this if something in the resonant circuit (a core, for example) has hysteresis.

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

http://hyperphysics.phy-astr.gsu...

Quote:
When capacitors or inductors are involved in an AC circuit, the current and voltage do not peak at the same time. The fraction of a period difference between the peaks expressed in degrees is said to be the phase difference. The phase difference is <= 90 degrees. It is customary to use the angle by which the voltage leads the current. This leads to a positive phase for inductive circuits since current lags the voltage in an inductive circuit. The phase is negative for a capacitive circuit since the current leads the voltage. The useful mnemonic ELI the ICE man helps to remember the sign of the phase.

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

incal99 wrote:
For a series resonant LC tank I am trying to implement a measurement of the phase angle between Voltage and current of the capacitor.

The increment and decrement values of frequency can be adjusted according to the amount of time measured between Voltage zero crossing and current zero crossing.

A D-FlipFlop can give you rapid absolute phase, if the UC captures are not enough.

I would expect your control decisions to vary depending on above or below resonance.

Years ago, we did a series resonant power supply, and IIRC that used a monostable approach of variable Td and Ton.
There was no uC involved, and the operating point self-adjusted.
I think this operated always on one side of the resonance point.

My aim will be to keep it just a little bit over resonance (inductive region). the freewheeling diodes are better utilised in this region.
How is D-flipflop s connected after the zero cross detectors?

________________________________ We dream of a world where current does not need the voltage to flow.

Assuming we are talking about sinusoids in here..

So if u[k] and i[k] are instantaneous voltage and current ADC samples at time k:

```Real_power[k] = u[k]*i[k] //instantaneous real power
Average_real_power = integral(Real_power[k])
Average_apparent_power = rms(u[k])*rms(i[k])```

(an rms() is a sqroot of an integral of squared samples, search wikipedia for that)

And:

`angle_in_radians_in_between_two_sine_signals = arccos(Average_real_power/Average_apparent_power)`

No RSTDISBL, no fun!

Brutte:

For real power do we add absolute value of u[k] and i[k]

if so, arccos will get always +values (0..90)

So I can not get information if it is under or over resonance?

________________________________ We dream of a world where current does not need the voltage to flow.

Quote:
For real power do we add absolute value of u[k] and i[k]

With minimal effort you could put that in an excel spreadsheet to find that out.
No, instantaneous power can be positive or negative, especially when you play with a capacitor, and you should have already known that.
And the asterisk in that equation "*" means that we do not add anything but multiply: u[k] with i[k].

Quote:
if so, arccos will get always +values (0..90)

I doubt an arccos ever reaches anything close to 90. Perhaps during hurricanes :)

No RSTDISBL, no fun!

Last Edited: Mon. Jan 27, 2014 - 10:05 PM

For a 600Khz signal I assume I should take 100 samples per period in 1660ns there are 3 sum loops with 1660ns/100= 16ns steps, 2 with sqr and sqrt. And at the end an arccos . I am not sure if my DSP can do that (dspic33). I would need Tigersharc or a cortex A8.

________________________________ We dream of a world where current does not need the voltage to flow.

Do you need a fresh value of the angle calculated 600000 times per second??
Most probably not.
If you do, it is quite easy to multiply analogue signals with op-amp. Integrating a signal with an op-amp is elementary.
And of course there are dedicated chips that do just that, although I doubt that you could find anything that approaches 100*600kHz=60Msps (times two, because there is U and I).

No RSTDISBL, no fun!

Sorry, 1ms should be enough to update the values , So any Dsp can do that. thank you for the idea.I will try it. Which dedicated chips are there ?

________________________________ We dream of a world where current does not need the voltage to flow.

Quote:
Which dedicated chips are there ?

Any that can calculate power.
The fraction:

`Average_real_power/Average_apparent_power`

is commonly called power factor or sometimes "cos(phi)" and is available in most of such chips directly. And if not this value, then both Average_real_power and Average_apparent_power are available.

No RSTDISBL, no fun!

I agree that power factor ICs are available.But my problem is that even if you take samples every 2ms , measuring and evaluating a period of 1660ns is always a hammer.
Even the best lem hall effect sensor can measure upt to 120KHz bsndwith with -3db.

If I use SOI isolators (icoupler from analog devices) they seem to be the fastest and most phase true solution but they are also not enough for a 100 step measuremnt of 1660ns period.
As Brutte offered an analog frontend seems the best . But the high voltage and high current signals should be also converted to safe and isolated levels. At this stage the problems begin for me.

________________________________ We dream of a world where current does not need the voltage to flow.

In days of old, transformers were used.

Quote:
My aim will be to keep it just a little bit over resonance (inductive region). the freewheeling diodes are better utilised in this region.

So why not look how the current flow in the diodes.

Quote:
If I use SOI isolators

Instead of isolating fast analog signals, I think it is easier to put some rms chip on the high voltage side and isolate SPI digital read of cos(phi).

No RSTDISBL, no fun!

I searched all over but most rms and power factor (energy metering ICs) are for 50hz/60HZ few for a little bit higher maybe for the new 400Hz 230Vac network that will become the new standard in 12345 years.
But in my case @600Khz I couldnot find a suitable one.
My matching transformer is 10:1 so my primary is 320VDC chopped at 600khz , the secondary is 32Vac @600Khz , But as it is a resonant network
Voltage distrubution on the secondary is as follows:

+ output of ferrite transformer +32Vac
+550Vac capacitor voltage @resonance
-550Vac inductive voltage @resonance
- output of ferrite transformer 0V

even if it is low voltage, It can not be treated as low voltage because all the messpoints Ucapacitor (except I capacitor) need high voltage isolation. I am also not sure if I can treat Icapacitor as low voltage

________________________________ We dream of a world where current does not need the voltage to flow.

I really think you're making things a lot more difficult than they need to be. With what i've seen of induction heating is tou have a class c amplifier and you measure the supply current. Sweep the freq and look for a peak or dip. The sweep can be done with a 50c 4046 vco and pwm on a low end micro. No need to calc phase angles at 600kHz. Isolation can be done at relatively low voltages.

Thanks for the above tutorial , it will help alot.
I dont like 4046. I want to control it all in the MCU.

```ADC_Current_Result_Interrupt_with_rms_filter (every 2ms)
{
For (i;1:50)
{
If abs(current[new]-current[old]) > Hash (i)
{ Offset=Offset[i] }

// Hash table for increment/decrement value dependant on how the position is near to resonance frequency

}

IF Current[new] > Current[old]
{increase Freq=Freq+Offset}

IF Current[new] < Current[old]
{decrease Freq=Freq-Offset}

}

```

I think of a cyclic check and comparison with the old current value that is filtered as 2ms periods. I added a Hash table so that if I get near to the frequency the offset increments will be smaller . (a kind of simple PID )

What do you think abaout the idea of hash table increasing the increment if the leap is huge and vice versa.

________________________________ We dream of a world where current does not need the voltage to flow.

I don't think you know what a hash table is. A lookup or interpolation table perhaps.
What is so hard about implementing a PID anyway?
You really do make some really illogical statements.

I think someone has been putting tables in your shisha!

Kartmann: You have an experienced advanced enginneering knowledge. So you think that everybody you adress can reach the same level. But believe me it is not so simple for everybody to write a PID routine just like drinking water.
IMHO you should think globally. There are really more illogical statements in the world than logical statements (I guess the ratio is 1:100). But ironically we learn much when we start with illogical statements. Because this frees up preconceptions. Thats a contradiction , but at the same time a fact.
best wishes

________________________________ We dream of a world where current does not need the voltage to flow.

So this is a controller for an induction heater? Have a block diagram or some link to theory of operation? What are you going to melt, just out of curiosity?

Imagecraft compiler user

This is a different approach. I try to build a 600Khz 20KW induction heater . My aim is to melt and then evaporate wolfram. Wolfram will melt over 3600 degree celcius and If i can reach 4200 degree i will get it in liquid form. after that I will try to evaporate it passing the 5600 degree celcius. My end goal is to reach 6200 degree and evoparate wolfram (also known as tunsgten).

Notice that according to my calculations reaching to 5600 degre celcius needs frequencies over 600khz and to pass over 6200 you need 1Mhz. (this is just because of skin effect, the narrower the area that the current flows the more possibility to concentrate the heat to a higher temperature level, simply the radial convection will be forced to be not effective.

Some friends in the forum criticise my approach while they think that I try to build a classical 100khz-200Khz induction heater and they tried to help me. I thank all of them,
But just think abaout the following example why there are huge differences between (100khz-200Khz) and (600khz-1000khz)

A typical 2000Vdc/800Vac capacitor reduces its voltage blocking capacity to 600Vac @100Khz BUT at 600Khz , Polypropylene film capacitor (wima epcos etc.) will reduce it maximum voltage working point to 60V!! (sixty volts) at 1Mhz to a ridiculus 40V!!!!!

I try to build the Capacitor part from MLCC capacitors.
10nF MLCC 1812 2000V (placed on 10 seperate pcbs)

Have anyone any idea if the MLCCs better suited for frequencies above 600KHz up to 1Mhz. The main drawback is that they have higher tolerances (CGO 5 percent) against PP capacitors are 1 percent.

________________________________ We dream of a world where current does not need the voltage to flow.

Incal - i'm being a tad harsh as you seem to be guessing an awful lot. When we're talking about a control loop the first thing that comes to mind is PID - it is the classical solution with plenty of worked examples. I'd use a hash table to search strings not for a simple control loop. You seem to miss the concept that what you're building is a big rf transmitter. There's a century of knowlege behind this. You also seem to be fixated on using a hitech solution. This is fine if you have the experience. If you have NFI , start simple. You're trying to solve control loop, frequency generation and making a 20kW transmitter at once. Generating a 600kHz variable frequency source could be done with a 150 in 1 electronic kit.

Quote:
Generating a 600kHz variable frequency source could be done with a 150 in 1 electronic kit.

I have seen 7805 regulators oscillating at 1 Mhz. under the wrong operating conditions. :)

Quote:
There are really more illogical statements in the world than logical statements (I guess the ratio is 1:100).

Evidence?
Quote:
But ironically we learn much when we start with illogical statements. Because this frees up preconceptions.

Evidence?
Quote:
Thats a contradiction , but at the same time a fact.

Evidence?
Quote:
We dream of a world where current does not need the voltage to flow.

Who is we? I suspect you are on your own with that dream, so you might want to change that to "I".

Quote:
a hitech solution. This is fine if you have the experience. If you have NFI , start simple.

This should be known as Kartman's law. A corollary of KISS :lol:

Charles Darwin, Lord Kelvin & Murphy are always lurking about!
Lee -.-
Riddle me this...How did the serpent move around before the fall?

Be nice folks. I want to know why anyone anywhere would want to melt tungsten. This isn't alchemy is it?

On an entirely different subject, I know that Metcal soldering irons output 27MHz RF down the coax to the inductive heater tip. 27MHz is somewhat faster than 600 KHz. But it might squelch your CB base station.

Imagecraft compiler user

Bob, that's a big 10-4.

Nevertheless, 20kW at 600kHz sounds like needing some very expensive mosfets or a lot of cheap ones.

Hi Incal99,
if you send me your e-mail via PM, I might
send you a paper that I did with some
colleages 10 years ago. Much lower frequency,
much simpler CPU, but perhaps the approach
be of interest for you.

We estimated the resonance-frequency of the
tank-circuit and adjusted the frequency to stay
in the inductive region.

Ossi

KartMan : I use SiC Mosfets and SiCDiodes. They have near zero reverse recovery charge/time. 1200V blocking voltage and very low rdson 0.08ohm , I achieved up to 1000KHZ switching frequency @10KW @540VDC. They have a sharp price drop in the last months, 1200V 14A SiC mosfet ROHM costs 4â‚¬ @farnell

bobgardner: there are also 120MHZ inductive heaters but they have only 40W power. solder tip should also be in range of 50W. But as power increases the solution evolves to a totaly different approach than the original. The base is the same but the implementation needs unfortunatelly as a contadiction to Kartmans law a hitech solution. If we start simple we stay simply at the a order frequency of 200KHZ (I know from the experience:)

Ossi: Any implementaton will help. thank you I send you my email.

Ldevries: Hi, you were also very keen on my dreams 2-3 years ago. I remember. But do not take it serious , it is only a dream, not a fact. The definiton of th dream team WE: One member is the Prof. Adalbert Prechtl , University of technology vienna/Austria. He talks abaout a wobble movement arrangment so that current will bypass the resistance singularities. Just think a skirunner and the resistance is defined by the sticks that he goes through without colliding to them. The more he is faster , the more the possibiltiy he collides . Faster means more resistance. If you have a method to wobble automatically through an electromagnetic vectorpotential, even at faster speeds you will not face a resistance.Do not forget IBM ceo for 30 years ago told us very strong an certain: Nobody will need a harddrive more than 5MB. Only this forum topic maybe contains more than 1-2MB.

________________________________ We dream of a world where current does not need the voltage to flow.

Quote:
.Do not forget IBM ceo for 30 years ago told us very strong an certain: Nobody will need a harddrive more than 5MB. Only this forum topic maybe contains more than 1-2MB.

Or Bill Gates saying that nobody will need more than 640 KByte of RAM in a PC, (I just added 8GByte this week because 4GByte started to be slow)

Incal99,

You stated:

"For a series resonant LC tank I am trying to implement a measurement of the phase angle between Voltage and current of the capacitor."

I dream of a world in which the AC voltage across a capacitor is ANYTHING BUT 90 degrees out-of-phase with the current thru that capacitor.

There would be a small difference from 90 degrees due to resistive or leakage losses in the capacitor, but in an ideal capacitor the E-to-I relationship is 90 degrees lagging no matter whether the capacitor is in a tank circuit, an RC low pass filter, RC high pass filter, etc.

If you can find a capacitor in which you can adjust the E-to-I relationship with an SPI interface, tweaking screw, I-Phone App, etc, please let me know ASAP. I have lots of uses for it!

gyrator. use it in iphone.

________________________________ We dream of a world where current does not need the voltage to flow.

I think i'll call Apex to see if they have a 20kW op amp!

oh no, I suggested only a gyrator for chuck rowst while he wanted a capacitor that he can control over SPI. He can then adjust ANY phase angle over the SPI. But i did not understand why he needs it ASAP?!?

________________________________ We dream of a world where current does not need the voltage to flow.

The topic came to a point where power factor is nearly zero..

No RSTDISBL, no fun!

I think Chuck was taking the piss. I know i was.

sparrow2 wrote:
Quote:
.Do not forget IBM ceo for 30 years ago told us very strong an certain: Nobody will need a harddrive more than 5MB. Only this forum topic maybe contains more than 1-2MB.

Or Bill Gates saying that nobody will need more than 640 KByte of RAM in a PC, (I just added 8GByte this week because 4GByte started to be slow)

Sorry Sparrow.
Did Gates Really Say 640K is Enough For Anyone?

"I may make you feel but I can't make you think" - Jethro Tull - Thick As A Brick

"void transmigratus(void) {transmigratus();} // recursio infinitus" - larryvc

"It's much more practical to rely on the processing powers of the real debugger, i.e. the one between the keyboard and chair." - JW wek3

"When you arise in the morning think of what a privilege it is to be alive: to breathe, to think, to enjoy, to love." -  Marcus Aurelius

:) As english is my 4th language , I can not understand some phrases or misinterprete, As you said Chuck was taking the piss, What I at first glance understood was that he was taking a piss and can not participate the forum even if he needs the SPI capacitor solution ASAP.
I thought then But it is illogical , no piss can last so long and looked at wikipedia what take the piss means.
But what good is,I also learn some idiomatic through the forum.
Sorry for too much Off topic maybe Off-forum.

There was an important point abaout the capacitors. Really the high voltage PP ,polypropylene capacitors seems to have a frequency limit.
And it seems to be 150-200Khz. At 600Khz a 2000VDC/800VAc PP film capacitor reduces its voltage rating to 60V!!!

I believe I can not use these capacitors evenif thay are used in all recommended projects.

What do you think abaout using MLCCs instead of PP film capacitors.

I believe I will need a capacitance of 1uF. It can be constructed using 1000 unit cheap 2000V MLCC capacitors as a layout 100 units per PCB and all these 10 PCBS stacked on a heavy copper frame.

The problem when using MLCCs is the tolerance (best one is 5 percent). So my resonance finding algorithm should be more precise and faster.
Any ideas?

________________________________ We dream of a world where current does not need the voltage to flow.

Quote:
The problem when using MLCCs is the tolerance (best one is 5 percent). So my resonance finding algorithm should be more precise and faster.

Could you explain how the capacitor tolerance would affect your algorithm?

If you have questions about the capacitors, speak to the manufacturers - wima comes to mind. Is there a reason you don't use parallel resonant circuit? It might mean your capacitance is a lot lower and then you can use air or mica caps.

The voltage rating curve is from wima datasheet. The manufactorer have a sharp voltage rating degradation after 200KHz (this is according to datasheets of pp film capacitors from wima and epcos).

I saw some ultra high frequency induction heaters from japanese companies. I suspect they use without exception the series LC resonant circuit.Maybe the control is much simpler as the freq goeas higher. Because as i investigated paralel resonant converter needs a current fed resonant inverter rather than voltage fed inverter.

This (paralel LC) maybe a good solution for lower frequencies (espeially a must for 500Hz melting ovens). But as the freq gets higher i may have difficulties designing or controlling the CFRI.

________________________________ We dream of a world where current does not need the voltage to flow.

Capacitor tolerance: The only possibility is to use (ZrSn)TiO4 class 1 ceramic C0G. All others have a very huge temperature drift which leads to a wider sweep range for the peak searching routine.
What I wanted to ask is I see explitictly only PP capacitors for recommended projects . But the MLCC C0G fits much better for the job. I mean do i miss some sideeffect that i may face with MLCC banks.

________________________________ We dream of a world where current does not need the voltage to flow.

Incal99,

My apologies, I didn't realize you are multi-lingual and may have some English language and grammar limitations.

The way you original question was stated it read like you were trying to measure the phase difference between a capacitor's current and the voltage across that same capacitor. This is, of course, always a 90 degree phase relationship.

What you probably meant to ask pertained to relationship of the tank circuit's DRIVE VOLTAGE (i.e. the voltage across the series combination of the L & C) and the current flowing thru the capacitor. That relationship will definitely vary as the drive frequency changes.

On the topic of appropriate capacitors. You must consider the AC current level the capacitor must handle. It sounds like it could be multiple amps in you application. Most signal level capacitors are not meant for high current levels, and will exhibit various problems when subjected to such current levels. I definitely would not recomend COG MLCC's or any of the other common ceramics materials they are available in. My first choice would be mica's for this reason alone. Plus, micas have better temperature performance than COGs.