| |
Page 3 of 3 |
| Author |
Message |
johansen Newbie
 Joined: 01/08/2014 Location: United StatesPosts: 13 |
| Posted: 12:21am 16 Oct 2026 |
Copy link to clipboard |
 Print this post |
|
I did some measurements today with a APC smart ups rated for 700watts/1000va but i have the larger transformer from the 1000w/1400va ups in it.
Both the yellow and purple traces are 2000:1 current sensors into an 11 ohm resistor, into a 1x o scope probe. Yellow is a current transformer, purple is an LEM closed loop sensor rated for 300 amps.
This particular ups is much better than a few others i have played with, some are so bad on the dc current into the primary that the output voltage waveform is clipped flat on the side that's saturated.
As for the pwm frequency on these UPS's, it varies depending on how much inductance you insert into the primary or secondary. by default there is none, i have a rather large inductance inserted
The last photo in the imgur link is the current flowing with a 60 watt soldering iron for a load, which is controlled by a triac.
I measured a filtered, 14mv dc offset peak today, which corresponds to 2.5 amps of dc flowing, which is enough to come close to saturating the transformer in my opinion. again, this ups is better than average.
https://imgur.com/a/transformer-offset-currents-5onZNmD
EDIT: i have added two more images. I wrapped the transformer secondary through the lem sensor 7 times which almost perfectly cancels out the ac current. its not a fixed dc current, i'm able to manipulate it buy turning a load on or off.
So anyhow as for how long it takes to saturate the transformer from a given voltage, that is going to highly depend on what flux density you run and the permeability of the core, with toroidal inductors being very high.
I measured 400mh inductance for the 240 winding on this 65 pound transformer: https://imgur.com/a/6kva-isolation-transformer-mqGhHAy
my inductor design spreadsheet is suggesting to get 400mh from 164 turns on that core, requires a permeability somewhere around 2500 with a 0.05mm air gap. or a permeability of 2000, with zero air gap. This results in a flux density of 1T with a current of just 1.2 amps (200 amp turns)
so when we try to calculate how much time we have before 1 amp flows, well if the voltage potential is 400mv, then the current rises at 1 amp per second. 400mv corresponds to basically 0.1% of a 400volt peak to peak system.
Decreasing the inductance by inserting an air gap allows for more dc current to flow, but the current rise time will be inversely faster for the same voltage offset. Edited 2026-10-16 11:30 by johansen |
| |
poida
 Guru
 Joined: 02/02/2017 Location: AustraliaPosts: 1497 |
| Posted: 12:51am 17 Oct 2026 |
Copy link to clipboard |
 Print this post |
|
how quickly does the toroid go into partial saturation after I switch the diode in circuit?
using the standard test conditions (200W load) we can see here:

it takes about 9 50 Hz cycles to be stable in it's new running state. This is an interesting experiment to do, in my view.
Dark Blue is AC volts (about 240V AC RMS) Purple is primary current Light Blue is secondary current Past tests have shown DC input voltage is quite stable so no need to probe that any more.
here is one cycle with the diode in circuit using the new probe locations. I was wondering what the secondary current would look like and so here it is. Zero crossing of AC output is at one division in from both the left and right side of the capture. Both current signals are now AC coupled, this must be kept in mind.
 wronger than a phone book full of wrong phone numbers |
| |
poida
 Guru
 Joined: 02/02/2017 Location: AustraliaPosts: 1497 |
| Posted: 03:23am 17 Oct 2026 |
Copy link to clipboard |
 Print this post |
|
I am not have much luck with current sensing right now.
But the idea of using an asymmetric waveform to reduce the problem does work as shown below:
Dark Blue is AC volts on secondary Light Blue is AC current on secondary Purple is primary winding current
this is normal, i.e. no diode in circuit it runs quiet too
 next is with diode in circuit. a solid hum from the toroid.

And this is with 3.5% less amplitude on the 1/2 wave where the diode does not conduct (and zero AC current, zero AC voltage)

This is a result. The toroid is back to being very quiet too. There was no closed loop control with the waveform symmetry just a fixed value.
Now, on to getting a solid signal from the current sensor.. wronger than a phone book full of wrong phone numbers |
| |
poida
 Guru
 Joined: 02/02/2017 Location: AustraliaPosts: 1497 |
| Posted: 06:04am 17 Oct 2026 |
Copy link to clipboard |
 Print this post |
|
And I now have a closed loop control running. it is not PID, only "bang bang" but it works.
see https://youtube.com/shorts/BYY4eldyFOA?feature=share
I have the closed loop control already running with no load. it is stable. then I twice switch in the 200W load with series diode. You can see it stablise under this load and then stablise with no load.
I then disable the closed loop control via an external switch. And then twice switch the load to show what no control results in.
The current sensor output is rather noisy so I use a 100Hz at -3db RC low pass filter, (0.1uF and 15K resistor). This delays the signal about 24 PWM clocks.
I am running code that looks only at the primary current at both zero crossings and altering one or the other 1/2 wave to suit. wronger than a phone book full of wrong phone numbers |
| |
wiseguy
 Guru
 Joined: 21/06/2018 Location: AustraliaPosts: 1329 |
| Posted: 02:10pm 17 Oct 2026 |
Copy link to clipboard |
 Print this post |
|
The results are sounding promising. It appears you are monitoring the output AC voltage after the diode you insert ?? If it's intentional, I don't understand why it is being monitored there - the AC waveform shape helps us to see saturation distortion level etc ? Maybe there is a point here I'm failing to see... If at first you dont succeed, I suggest you avoid sky diving.... Cheers Mike |
| |
analog8484 Senior Member
 Joined: 11/11/2021 Location: United StatesPosts: 242 |
| Posted: 06:04pm 17 Oct 2026 |
Copy link to clipboard |
 Print this post |
|
Kudos on the results so far. The video certainly looks like encouraging results but the AC voltage does look like it's from after the diode. Just assuming it's for clear demo purposes and the Vfb is still coming from the inverter output cap before loads.
I like the new control loop changes. In particular, the 2 separate control loops and the imbalance loop only reduces the unloaded/under-loaded half wave based on current imbalance without dependencies on waveform attributes (e.g. peaks). This should be more robust under real-world load conditions where potentially multiple loads are running that could make waveform attribute comparisons across the half waves less accurate for imbalance indication.
Look forward seeing more results for different test cases. Perhaps including the no load hum scenario? Edited 2026-10-18 04:08 by analog8484 |
| |
poida
 Guru
 Joined: 02/02/2017 Location: AustraliaPosts: 1497 |
| Posted: 11:29am 18 Oct 2026 |
Copy link to clipboard |
 Print this post |
|
I found the delay introduced in the primary current signal, resulting from the low pass filter was causing some oscillations and also preventing the code from getting the saturation current bump to reduce to near zero.
After I removed the RC filter, and changed the time when I sample the current to close to zero crossing, I now have near perfect reduction of the effects of putting a DC load on the AC output of the inverter.
It still uses bang bang control but it works and works well.
I have a switch that controls when this feature of the code will run or not and it's like waving a magic wand over it and saying "begone you DC imbalance!" and it is gone. I hit the switch and 2 seconds later there is no noise from the toroid.
It's also stable with or without load, with or without DC load and changing from AC to DC load.
I modified the code to display on the LCD the amplitude of both half waves and was very instructive for me during this experimentation.
for instance: no load: V1 is 444, V2 is 444 200W AC: V1 is 457, V2 is 457 200W DC: V1 is 450, v2 is 450 but with the saturation current spike and noise 200W DC with balance code: V1 is 441, V2 is 457 and no noise and no current spike. no load with balance code: V1 is 441, V2 is 441
We can see the code modifies the waveform with a reduction in V1 amplitude from 457 down to 441. This is 3.5% reduction from 457. (where did we read this value? hint: a couple of posts above here.)
400W DC with balance code: (maybe we need 2x the adjustment?) V1 is 441, V2 is 468 And no noise and no significant primary current spikes from saturation. balance is now 5.8% less for one half cycle. not 2x from 2x the AC load. a bit less.
From these results and testing I am confident we can control the problem of unbalanced AC loads creating saturation by using the scheme I have outlined above.
The extra hardware is a LEM current sensor, that gives 2.5V for zero current and can handle about +100 Amps down to -100 Amps. Use the Nano's 5V regulated supply for the LEM sensor. feed this signal into one of the Nano's ADC inputs. run my modified code. get the polarity of the current sensor correct via some experimentation. and it's done. Edited 2026-10-18 21:29 by poida wronger than a phone book full of wrong phone numbers |
| |
nickskethisniks Guru
 Joined: 17/10/2017 Location: BelgiumPosts: 499 |
| Posted: 08:19pm 18 Oct 2026 |
Copy link to clipboard |
 Print this post |
|
Thanks Peter, great testing!
I'm dying to test this out, I hope I can before wednesday otherwise it will need to wait for 4 weeks because of paint and finishing works in the house, so much things to do...
Does your transformer makes noise from time to time during no load, I'm curious if the LEM catches this also, I think it would. But maybe limited by the 10 bit adc and resolution when the inverter is build for higher power. |
| |
poida
 Guru
 Joined: 02/02/2017 Location: AustraliaPosts: 1497 |
| Posted: 10:11pm 18 Oct 2026 |
Copy link to clipboard |
 Print this post |
|
all of my inverters make a small noise during soft start. Once at the setpoint they go quiet (maybe a tiny hum but it's a transformer after all)
2 more videos! testing at 400W I do not have a hair drier (probably because I have lost all my hair) that puts a diode in series with the heating element at 1/2 power.
Now it is using PID closed loop control. checkout how well it works as I switch the diode in and out of circuit. You will see the AC waveform in Dark Blue and primary current in Purple.
https://youtube.com/shorts/4eRzdZejl6E
the other video is the same but with the DC bias control disabled that is, how a normal inverter behaves with this sort of load.
https://youtube.com/shorts/WRFKjYIglrw wronger than a phone book full of wrong phone numbers |
| |
phil99
 Guru
 Joined: 11/02/2018 Location: AustraliaPosts: 3415 |
| Posted: 12:12am 19 Oct 2026 |
Copy link to clipboard |
 Print this post |
|
Your idea of sampling the primary current at (or near) the voltage zero crossings is clearly a winner. The fast response is something integrating the difference between primary and secondary amp-turns could never achieve.
It would be interesting to see if the saturation peak shifts left or right when there is also a reactive load** at the same time as the diode in series with a load.
If any shift of the saturation peak still includes the zero crossing within it, it probably won't matter. If the shift is more than that maybe some method of finding the timing of the peak first would help. The amplitude of the current at the peak could then be compared with the amplitude 1/2 cycle later.
** Induction motor for lagging PF or loaded DC power supply with large filter capacitor for leading PF. Edited 2026-10-19 13:01 by phil99 |
| |
poida
 Guru
 Joined: 02/02/2017 Location: AustraliaPosts: 1497 |
| Posted: 04:23am 19 Oct 2026 |
Copy link to clipboard |
 Print this post |
|
I doubt it will work as well with large reactive loads in place.
I looked at sorting out one thing only, being the saturation peak due to DC bias. In the test cases I use, it's a pure resistive load since I could repeat the tests exactly.
The peak currents resulting from saturation are of the order of 70 Amps and likely more in larger inverter systems. These peaks might end up occurring a bit earlier or later than zero crossing, when reactive loads are present.
What would be a good example device I could plug in that will give me a reactive load? It needs to be about 400W, maybe up to 600W.
Or could I fake one with 400W incandescent lights with a large capacitor or something? wronger than a phone book full of wrong phone numbers |
| |
Bryan1
 Guru
 Joined: 22/02/2006 Location: AustraliaPosts: 2297 |
| Posted: 05:12am 19 Oct 2026 |
Copy link to clipboard |
 Print this post |
|
Peter I use those portable element stove tops which I have had for decades so when I was testing my inverter the single 1500W element ramped upto max nicely then with my twin element 3000W getting each one ramped up until all 3 were max'd and the inverter did work fine.
Another option is an old hot water supply as they too use a resistive element.
Regards Bryan |
| |
analog8484 Senior Member
 Joined: 11/11/2021 Location: United StatesPosts: 242 |
| Posted: 04:43pm 19 Oct 2026 |
Copy link to clipboard |
 Print this post |
|
If the test inverter is big enough then a non-inverter washing machine could be a realistic reactive load for testing. Edited 2026-10-20 02:45 by analog8484 |
| |
wiseguy
 Guru
 Joined: 21/06/2018 Location: AustraliaPosts: 1329 |
| Posted: 10:34am 22 Oct 2026 |
Copy link to clipboard |
 Print this post |
|
Its gone quiet here so time to make some noise....
I am not a software writer/coder but if I were, the following outlined scheme is what I would really like to try, those who can code are welcome to chime in and illuminate the problems I might face in trying to get the Nano to operate to my thinking. The Magnetising currents in a Toroid must be equally matched to ensure that the flux does not tend to wander towards saturation. As we have observed in our inverters a slight variation in hum is observed as the flux seems to randomly wander towards very mild saturation and usually eventually wanders the other way. When non symmetrical half wave loads are applied, system losses for the more heavily loaded 180° part can cause heavy saturation in the unloaded wave portion after a few cycles, this is due to unequal magnetization (due to system losses on the loaded portion). It can be referred to as DC in the primary but it is essentially asymmetric excitation, which does in effect resemble a DC offset. For a half wave Power reduction setting, on a hair-dryer or heat-gun etc, the toroidal transformer quickly enters saturation, but it occurs on the unloaded 180° waveform. This is due to all the combined losses of the loaded 180° of the inverter Power stage & Toroid. However please note, I believe measurement of the loaded 180° half sine-wave is the key to solving the issue. The 180° unloaded portion has essentially no losses due to no load so it will have a higher measurement.
It follows that the primary magnetizing flux for the loaded 180° will be less compared to the unloaded 180° due to the system resistive losses of the reflected load for the 180° loaded portion.
There are two methods that could be explored, one is using the RMS value of the 180° loaded waveform, this method will often have an inherent delay which I suspect could be undesirable, the second method is to take the peak value of the sine, which has the benefit of time to “do stuff” if required before the following unloaded 180° half cycle SPWM table is loaded.
The peak value of the loaded half cycle will have drooped by a percentage due to the applied load as the SPWM value in use was already set before the load was applied. What is needed now is to ensure the SPWM for the unloaded 180° has its peak value reduced by the same percentage that the previous 180° loaded half cycle was. The only result we are after is to keep the primary exciting magnetizing voltages matched and therefore magnetizing currents as equal as possible.
The Toroid mains winding resistive losses for the loaded 180° will exacerbate the droop error of the measured mains value compared to no resistive losses on the unloaded half cycle. For this reason a separate sense winding would be preferred to remove all mains winding resistive losses when comparing the 2 x 180° peak values.
I advocated in my first Nano controller (~2019) to use a 180° peak hold scheme for the feedback voltage. I always considered the smoothing capacitor after the AC rectified voltage feedback would be giving incorrect information for many cycles after a load change. This was mostly due to gut feeling of what was required, but as I believe I now have a much better picture of what the electronics and magnetics are doing I am convinced that it is a very valid approach. I also incorrectly initially said mains drive should be symmetrical for a complete 360 degrees – which turns out to be only good for resistive loads.
The scheme is, measure the loaded peak value and compare it to the previous peak value and if lower then we have 90° or 5mSecs to load the next 180° table with a corresponding reduction in drive. The net effect is we have less P-P & RMS mains than before. So, as we now know the reduction % for the loaded half cycle. What if we now boost the next loaded half cycle by that % to restore the loaded peak value and then remove the reduction we had applied to the unloaded half cycle.
In effect we (hopefully) avoided or minimized saturation and the droop in mains voltage was ~ 1 full 360° cycle before being restored back to normal. The only undesirable feature is that any mains droop due to the mains winding inherent resistance is now not directly corrected for, however there is still a solution for this.
By characterizing the inverters droop for 1kW 2.5kW & 5kW loads we can measure the DC input current and create a droop correction table for the loaded error.
Another similar possible scheme is to have two loops one monitoring the primary peak voltage per 180° and keeping their peak value in balance for the fast loop, the slower loop still uses the P-P or RMS of the mains winding and adjusting loop gain for regulation of the output level?
Lastly, primary current sensing for a sudden large rate of change on the primary with little or no increase on the secondary current could form another level of a saturation mitigation scheme, similar to what Poida recently tried.
So who is up to the task to attempt to write some cool code….??
I will not be posting anything further about this scheme or my thoughts on saturation unless requested, as I consider I have essentially presented it and done it to death! If at first you dont succeed, I suggest you avoid sky diving.... Cheers Mike |
| |
phil99
 Guru
 Joined: 11/02/2018 Location: AustraliaPosts: 3415 |
| Posted: 12:21pm 22 Oct 2026 |
Copy link to clipboard |
 Print this post |
|
Hardware to accomplish comparing the peak voltages of both half-cycles is in the diagram I posted on the previous page. An extra winding on the toroid feeds + and - peak-hold circuits (fast attack, slow decay) with a voltage divider to provide an error signal when they are unequal.
Implementing it in software might give finer control. Edited 2026-10-22 22:24 by phil99 |
| |
wiseguy
 Guru
 Joined: 21/06/2018 Location: AustraliaPosts: 1329 |
| Posted: 01:04pm 22 Oct 2026 |
Copy link to clipboard |
 Print this post |
|
Phil, I did not recognise or quite understand what you had drawn, the RC time constants felt a bit problematic in my mind and I rightly or wrongly just rejected the method. I agree when I reread your text though, it is in line with my thoughts on equal magnetisation. I think either a hardware fast sample and hold or a software timed peak read value would give the best results. I also agree that the difference of each 180° read may need amplification to work more effectively.
I know there is a school of thought on looking at currents to solve the problem but in my mind the first driven half cycle voltage droop, holds the key to maybe the best possible cure, before the onset of higher saturation currents. That is why I wanted to present a discussion of how I see what is happening, why and some possible mitigation/correction schemes. If at first you dont succeed, I suggest you avoid sky diving.... Cheers Mike |
| |
wiseguy
 Guru
 Joined: 21/06/2018 Location: AustraliaPosts: 1329 |
| Posted: 01:21pm 23 Oct 2026 |
Copy link to clipboard |
 Print this post |
|
There is a big hole in my thinking that everyone here was too polite to point out.
We can't look at the first 180° dip and assume the second 180° will be unloaded. This is a case of knowing the result and then finding a test that fits that one example.
Before any change in PWM is made, we would need to see if it is really a half wave load or a balanced load. That means measuring for a minimum of 360° before any type of correction/mitigation is done, if it is unbalanced there will be a recurring dip/peak happening, so the soonest we can make a change is more like 360° to 540° before any correction is attempted.
There are other possible holes, please don't hold back! Edited 2026-10-23 23:22 by wiseguy If at first you dont succeed, I suggest you avoid sky diving.... Cheers Mike |
| |
| |
Page 3 of 3 |