Author Topic: Prema BK7 derived meter  (Read 14696 times)

0 Members and 3 Guests are viewing this topic.

Online Kleinstein

  • Super Contributor
  • ***
  • Posts: 14889
  • Country: de
Re: Prema BK7 derived meter
« Reply #25 on: November 04, 2023, 08:01:07 pm »
The control for going from a negative ref (integrator output goingup) to a positive ref. is still a bit chaotic. For a good result an low noise one would want a rather stable waveform, as the integration time and all possible raw data points used fron inbetween are effected by the scattering.

Using only a limited part of the range (like 20 V of a theroretical 70 V) can help with stability of the feedback. How the the upper switching triggered ?
 

Offline dietert1Topic starter

  • Super Contributor
  • ***
  • Posts: 2429
  • Country: br
    • CADT Homepage
Re: Prema BK7 derived meter
« Reply #26 on: November 04, 2023, 09:07:19 pm »
Yes, it can't stay like that. When the integrator runs into the upper limit or only into the nonlinearity the measurement will be lost. For this test the rundown starts at a fixed time in the 10 msec cycle (middle + 1msec). Input integration is continuous like in the Prema. During rundown it integrates the difference between input and reference current.
Maybe i should add an upper comparator, something simple just to keep the integration cycle in order.

Regards, Dieter
 

Offline dietert1Topic starter

  • Super Contributor
  • ***
  • Posts: 2429
  • Country: br
    • CADT Homepage
Re: Prema BK7 derived meter
« Reply #27 on: November 07, 2023, 12:53:41 pm »
Meanwhile i wrote a simulator for the Prema integrator, assuming the simple control mentioned above and an upper integrator saturation voltage of 17 V. In my build the integration cap is 220 nF, so it reaches higher voltages. The diagram shows the simulator plot in a run of 0.5 seconds. The run starts with Integrator = 0 and with I unknown / I ref = 0.3. At 0.1 0.2 and 0.3 seconds into the run the input current gets raised to 0.4, 0.5 and 0.75. While at low input current the integrator is well behaved and settles for a regular cycle, the first integrator saturation happens at 0.4. At 0.5 and above it gets wild, with the last setting similar to the scope dump i posted above.
The PREMA 6048 runs below 0.3 (21 V / 70 V).

Regards, Dieter


« Last Edit: November 07, 2023, 05:33:12 pm by dietert1 »
 

Online Kleinstein

  • Super Contributor
  • ***
  • Posts: 14889
  • Country: de
Re: Prema BK7 derived meter
« Reply #28 on: November 07, 2023, 01:59:22 pm »
It is some time since I looked at the feedback and I faitly remember that there is kind of too much FB gain to make it stable. The solatron meters use the extra forcing signal added to the integrator. This is equivalent to having time dependent switching points, e.g. adding the negative of the forcing signal to an integrator for the other side of the comparator. With enough slope in the time dependent limit one should get a reduced gain and a stable feedback loop. The positive thing of applying the forcing signal to a separate part (e.g. some integrator or maybe a passive low pass) is that any error would not add to the integrator and the swing of the integrator is not reduced. One may also have more freedom (e.g. maybe use more than a simple square wave to start with, a 2nd capacitor for more rounding) approximating the ideal limit curve. It does not have to be perfect, just close enough to keeping the loop stable / well dampened.

Another possiblity would be to add some delay to the feedback: so switch the reference at least at one end with a delay after a level is reached. With the rather slow modulation there should be time to do the math to get a stable waveform.
 

Offline dietert1Topic starter

  • Super Contributor
  • ***
  • Posts: 2429
  • Country: br
    • CADT Homepage
Re: Prema BK7 derived meter
« Reply #29 on: November 07, 2023, 07:07:43 pm »
Yes, the force method appears to be a trick. Using only 0.3 of the available input range isn't that convincing either.
Rather i will try a more PWM like compensation method where one looks at more than one cycle before changing the PWM ratio. Maybe it is enough to make the PWM pulses symmetric within the time frame.
Certainly one needs a simple upper comparator to protect the integrator from saturating. Input voltage change or AC will then disturb the timing but valid measurements are guaranteed.
Anyway with continuous integration the integrator zero events won't exactly match the requested integration time. So the final result calculation needs interpolation at the start and at the end of each requested integration period.

Regards, Dieter
 

Online iMo

  • Super Contributor
  • ***
  • Posts: 5284
  • Country: ag
Re: Prema BK7 derived meter
« Reply #30 on: November 07, 2023, 08:24:15 pm »
Could you point me to a schematics of that ADC? I'll try to sim it in LTspice (as I did years back with the Multislope)..
Readers discretion is advised..
 

Offline dietert1Topic starter

  • Super Contributor
  • ***
  • Posts: 2429
  • Country: br
    • CADT Homepage
Re: Prema BK7 derived meter
« Reply #31 on: November 08, 2023, 08:44:48 am »
Schematics of the Prema 6048 can be found inside the PDF user manual that is online, Fig. 11.8. They are using a proprietary control chip "BK7". It implements a mains PLL and a pretty simple integrator control method described in the user manual, paragraph 1.2. The P6048 front-end converts input voltage to input current using a buffer and a set of range resistors. Then the idea is continuous integration of input current compensated by a switched reference current source of opposite polarity (a PWM DAC). They implement a 10 msec cycle derived from the mains PLL. At a certain time in the cycle they turn on the reference current (begin of run-down) and count the time until a comparator signals integrator = 0 V (end of run-down). Summing up those time measurements they arrive at a high resolution measurement of input current.
My circuit is similar, though it uses a 14.2 V reference with two LTZ1000 and the reference current source is implemented following the Advantest R6581 design. Also i added some mods from a nonlinearity study in the Prema 6048 teardown thread. In my case integrator control is implemented in a Spartan 6 FPGA, with flexibility to change/improve the rules and calculations.
After that integrator saturation/instability problem i wrote a little simulator to understand what is going on and to test different control methods meant to solve that.

Regards, Dieter
« Last Edit: November 08, 2023, 11:30:34 am by dietert1 »
 
The following users thanked this post: iMo

Offline dietert1Topic starter

  • Super Contributor
  • ***
  • Posts: 2429
  • Country: br
    • CADT Homepage
Re: Prema BK7 derived meter
« Reply #32 on: November 13, 2023, 09:26:59 am »
Meanwhile i found a better solution for continuous integration, using an upper comparator to avoid integrator overflow/nonlinearity. The integrator cycles independent of the rigid timing scheme the Prema 6048 uses. But timing can still be locked to mains in the sense of a PLL. This happens by the adjustment of the PWM ratio as seen in the simulation. x-axis of diagram is time in seconds. The 15 V upper comparator triggers twice during simulation. The maximum integrator voltage reached at I input/I reference = 0.5 is 14.67 V.
Next step is to implement this in the FPGA using fixed-point arithmetics.

Regards, Dieter
« Last Edit: November 13, 2023, 09:31:33 am by dietert1 »
 

Online Kleinstein

  • Super Contributor
  • ***
  • Posts: 14889
  • Country: de
Re: Prema BK7 derived meter
« Reply #33 on: November 13, 2023, 09:49:22 am »
I don't see how a comparator at 15 V would help if the level is essentially never reached. A comparator at a low level, like 30-50% could help, by using the timing as additional information to get a first estimate and from that calculate the time when to best switch from sising to falling.  To simplify the math and make it less sensitive to noise, 2 comparator levels (e.g. 50% and 10%)  for different ranges could be an option. The cost for an extra comparator is relative moderate.
 

Offline dietert1Topic starter

  • Super Contributor
  • ***
  • Posts: 2429
  • Country: br
    • CADT Homepage
Re: Prema BK7 derived meter
« Reply #34 on: November 13, 2023, 10:50:12 am »
The upper comparator avoids invalid measurements when allowing I input/I reference > 0.5. The solution i am showing is almost as simple as the Prema 6048 yet makes better use of the hardware. At full range input the boards i made will run at a PWM ratio of 0.93.
The exceptionally long integration after stepping to 0.95 yields a valid measurement equivalent to several "normal" cycles.
Of course one can always dream up something more and you are invited to present your ideas in a more formal way. Maybe i will later look at it - once the DSP got implemented inside the FPGA and i can see how everything works out. The PWM calculation needs to complete during run-up, that is within 500 usec at a PWM ratio of 0.95.

Regards, Dieter
« Last Edit: November 13, 2023, 11:07:52 am by dietert1 »
 

Online Kleinstein

  • Super Contributor
  • ***
  • Posts: 14889
  • Country: de
Re: Prema BK7 derived meter
« Reply #35 on: November 13, 2023, 11:43:07 am »
The C code indeed looks relatively simple and may be FPGA compatible. So the 15 V comparator is only there to avoid the overflow with large steps. Chances are the system may have problems with higher levels of hum. This may already be an issue with the old prema system.
 

Offline dietert1Topic starter

  • Super Contributor
  • ***
  • Posts: 2429
  • Country: br
    • CADT Homepage
Re: Prema BK7 derived meter
« Reply #36 on: March 28, 2024, 10:30:20 pm »
Currently i am making the TEC oven for the second prototype. Image roughly shows thermal scheme. The copper heat conductor gets glued to the TEC and screwed to the heatsink. PU foam isolation near the flat cables is in two 2 cm layers.

Regards, Dieter
 

Online Kleinstein

  • Super Contributor
  • ***
  • Posts: 14889
  • Country: de
Re: Prema BK7 derived meter
« Reply #37 on: March 29, 2024, 08:07:41 am »
The copper part may add some thermal resistance that could be relevant in comparison to the size of the heat sink.
It may still be OK as the peltier element is likely used with relatively low power, well below it't nominal rated current / power.
One may want a temperature sensor also on the outer side of the peltier element to make sure not to run into a thermal runaway when the heat sink a blocked. In this case the regulation could run away to a state with high current, trying too cool and overheat the heatsink. The outside sensor would also improve the regulation speed, as variations in the hot side temperature are likely the main path to get thermal coupling from the outside. In minimal solution would be to limit the peltier current to a safe limit, that could be something like half the nominal current.
 

Offline branadic

  • Super Contributor
  • ***
  • Posts: 2451
  • Country: de
  • Sounds like noise
Re: Prema BK7 derived meter
« Reply #38 on: March 29, 2024, 08:55:45 am »
Maybe I've overlooked it, but why did you choose temperature stabilization of the circuit with a TEG instead of temperature compensation in software?

-branadic-
Computers exist to solve problems that we wouldn't have without them. AI exists to answer questions, we wouldn't ask without it.
 

Offline dietert1Topic starter

  • Super Contributor
  • ***
  • Posts: 2429
  • Country: br
    • CADT Homepage
Re: Prema BK7 derived meter
« Reply #39 on: March 29, 2024, 10:00:46 am »
One disadvantage of a TEC oven is the thermal link to the outside, while a resistive heater oven can be made with much better thermal isolation, limited only by power consumption inside the oven.
The double TEC element was selected as it has less cooling power and higher heat resistance. So it can reach the same temperature difference with less electrical input. The copper bar also adds some heat resistance. It is made from ETP copper with about 400 W/(m K) heat conductivity, has a cross section of 4 cm² and an effective length of about 8 cm. That gives a heat resistance of 0.5   K/W. The Fischer SK 42/100 SA heatsink is specified at 1.65 K/W. Maximum electrical power into the TEC is about 5 W, so the device is safe.
Yes, a second NTC sensor on the heatsink can help yet requires digital control. I have a working implementation of that for our 19" temperature chamber. For the time being i implemented the meter oven with analog control, and it is good for about +/- 0.1 K. That already helps in comparison with the usual ambient temperature variations other meters are exposed to. The thermal mass of copper bar and aluminum enclosure slows down ambient temperature changes.

This is a study. There is a good chance it performs better than a meter with temperature compensation. A meter is made of many parts and there will be different delays for temperature changes. Calculating the correction requires the determination of the kernel of a convolution. And then there are nonlinear temperature drifts. In the end it may be cheaper to put the meter into an oven than to install a professional air conditioning system for the lab.

Regards, Dieter
 

Offline branadic

  • Super Contributor
  • ***
  • Posts: 2451
  • Country: de
  • Sounds like noise
Re: Prema BK7 derived meter
« Reply #40 on: March 31, 2024, 07:27:24 am »
Next question, did you copy the functionallity of the BK7 chip completely? Does that mean you have the very same slow integration cycles as in Prema 6048? I'd like to learn more about your work.

-branadic-
Computers exist to solve problems that we wouldn't have without them. AI exists to answer questions, we wouldn't ask without it.
 

Offline dietert1Topic starter

  • Super Contributor
  • ***
  • Posts: 2429
  • Country: br
    • CADT Homepage
Re: Prema BK7 derived meter
« Reply #41 on: March 31, 2024, 09:37:41 am »
A voltnut easter egg:

The BK7 contains certain elements i did not replicate for my meter study. E.g. it has a built in switched voltage reference to implement the integrating meter with just one additional opamp. The temperature measurement on the Prema 6048 processor board demonstrates this.

I kept the idea of polarity switching at the meter input, so the ADC handles one polarity only - with some overlap at zero. I added a third relay for rapid nulling of the meter. The Prema 6048 requires manual insertion of a low thermal EMF short. That procedure takes several minutes.
I also kept the idea that the front-end should be as simple as possible, essentially just a buffer amplifier with a resistor for voltage to integrator current conversion. As in the Prema 6048 this is implemented in a four wire scheme to eliminate influence of the range switches.
For my study i implemented the switched current source of the Advantest 6581 with SD215 switches, except i used a double LTZ1000 reference to have 14.2 V (+17 V in the 6581, U209). This change was motivated by the reference switching problems of the Prema 6048 which affect its LTZ1000 reference (linearity issue at low input).
I kept the idea of uninterrupted integration with a 10 msec cycle time. As we know the Prema 6048 ADC could measure about 70 V in its 20 V range, except above 25 or 30 V the integrator cycle becomes unstable and overflows can occur. I found an improved integrator scheme with a second comparator that avoids a 3.5x headroom (see above).
Another improvement over the BK7 is supplementing the precision comparator by a high resolution fast SAR ADC in order to perform noise filtering in the digital domain. This method can produce similar results as a multi-slope scheme. Multi-slope is incompatible with continuous integration.
With nowadays parts it's easy to count at 50 or 100 MHz instead of 3.8 MHz, so the meter has better resolution - roughly 1 ppm per cycle or 10 ** -8 in one second. Locking the measurement cycle to mains frequency can be all digital now, so the RC-oscillator time base of the Prema 6048 got replaced by a crystal oscillator (lower phase noise).
I want a voltmeter that runs at about 1 or 2 W of power, more than those integrated delta-sigma converters have available. So one can work at higher analog signal levels. 1 or 2 W is little enough to run the board inside a TEC oven. Hope one can get sub ppm precision without custom made resistor arrays, nor the hermetic precision resistors of the Prema 6048, nor a sophisticated temperature drift compensation scheme.

What i don't like about the Prema 6048: Nobody knows what is their temperature compensation scheme and we cannot check their method nor recalibrate that. Whatever hardware mod you apply can destroy the temperature compensation. Therefore i pulled the temperature measurement BK7 from our Prema 6048 and instead inserted a SHT35 sensor into the meter. I calculate the compensation offline.

Regards, Dieter
 

Offline branadic

  • Super Contributor
  • ***
  • Posts: 2451
  • Country: de
  • Sounds like noise
Re: Prema BK7 derived meter
« Reply #42 on: September 02, 2024, 07:04:19 pm »
I wonder if you made any progress. So far I've read the progress with huge interest.

-branadic-
Computers exist to solve problems that we wouldn't have without them. AI exists to answer questions, we wouldn't ask without it.
 

Offline dietert1Topic starter

  • Super Contributor
  • ***
  • Posts: 2429
  • Country: br
    • CADT Homepage
Re: Prema BK7 derived meter
« Reply #43 on: September 03, 2024, 05:57:38 am »
Yes, there is progress yet slow. Currently i am protoyping controller hardware and firmware. I took my time to study two ethernet solutions: A STM32H743 with fiber and a W5500 alternative (copper). Both are working well, and i am implementing javascript/AJAX based dynamic web pages for setup and monitoring of the device, along the lines given in W5500 ioLibrary_Driver. Recently i implemented an interrupt based driver for the W5500 with http and telnet servers on top. It requires arbitrary amounts of time to tidy up open source software.
Also more oven setups are running, trying to demonstrate a constant humidity oven. The screen dump shows the monitoring page of the K41 oven i made recently. Logs are recorded over a telnet connection.
It runs at 37.4 °C with a bag of desiccant and the sensors inside. Its cover is still loose so it can breath with ambient pressure changes and the desiccant will adapt to average ambient humidity level, but already at working temperature. After a month or two the cover can be tightened to make it hermetic.
The other image shows the STM32H743 fiber ethernet prototype. It got a GPIB interface, sensor I2C, power supply and realtime clock. The ADS1256 module can provide low noise temperature measurement, similar to the relay scanner with K2182A controller i showed elsewhere.

Regards, Dieter
« Last Edit: September 03, 2024, 06:15:57 am by dietert1 »
 
The following users thanked this post: ch_scr

Offline EC8010

  • Regular Contributor
  • *
  • Posts: 181
  • Country: gb
Re: Prema BK7 derived meter
« Reply #44 on: September 03, 2024, 07:22:36 am »
The transformer has a shield between primary and secondaries. If we connect the shield to guard, then the secondary will inject hum current between the DC supplies and guard. The trim cap supports compensation down to levels of about 20 nA. It works for a certain orientation of the mains plug.
This is with 220 V 50 Hz L and N mains. I tried to find a scheme that allows reversal of the mains plug without readjustment but gave up on that.

As you say, connecting the shield to guard causes injection. But I'm not at all sure it should connect to guard. Without a shield, a mains transformer has capacitance between primary and seondary (Cps). Adding the shield breaks that single capacitance in two. Earthing the shield makes a potential divider out of the capacitance from primary to shield and the shield's impedance to earth. The effect is to greatly reduce the apparent Cps. You can go further and wrap the primary in earthed copper foil (avoiding a shorted turn) and do the same for the secondary. That gives you two potential dividers and allows you to bring the apparent Cps down to single digit fF. To be effective, those shields need a low impedance path to earth, and that usually means directly to chassis.

Now to my point. I don't believe the shield should connect to guard. By and large, guards are for preventing surface currents on PCBs etc and guard drivers are low bandwidth - not suitable for cancelling RF. I think you'll be better off using the shield connected to chassis. If you really want to attenuate common-mode interference from the mains, 10n from each end of the transformer secondary directly to chassis will help. The other thing you could consider is that it's amazing how much coupling you get from unshielded mains wiring. I never thought mains filters did much until I started fitting a shield with no apertures whatsoever between their input and output. That usually means folded tin plate screens with self-adhesive copper tape over all gaps. Even a 0.1mm gap will let RF crawl through.
 

Offline dietert1Topic starter

  • Super Contributor
  • ***
  • Posts: 2429
  • Country: br
    • CADT Homepage
Re: Prema BK7 derived meter
« Reply #45 on: September 03, 2024, 05:32:19 pm »
Yes, that mains input section looks a bit unusual. To start with the mains cable is one without protective earth and i tried to avoid the usual prefabricated mains input filter with switch and fuse, as it is for 3-prong cables and will connect chassis to PE. The transformer shield is connected to chassis. It's a low voltage device, all inside one common shield, at least for the time being.
Certainly i can try a separate, shielded compartment for the mains input wiring.
The meter board inside the oven has some guard traces, most of them connected to ADC Gnd, and some driven by the input buffer. The biggest meter input voltage range is +/- 24 V.

Regards, Dieter
« Last Edit: September 03, 2024, 05:34:42 pm by dietert1 »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf