• Have you tried out dark mode?! Scroll to the bottom of any page to find a sun or moon icon to turn dark mode on or off!

diy solar

diy solar

PWM solar water heater controller

AntronX

DC Powered
Joined
Oct 24, 2021
Messages
2,664
Location
South FL
Here I present very simple PWM controller to keep solar panels at constant voltage for driving water heating element. LM393 comparator generates mosfet on/off switching at 0 - 100Hz for 99.6% efficient PWM switching with only 0.012w switching loss due to low frequency operation. PV voltage ripple is 3V which is still well within Vmp range. UCC37321P is way overkill of a driver (9A capable) but it's what I had and I exploited its built in hysteresis on its enable pin for very stable jitter-free mosfet switching. It's also way too fast for this operation - driving the mosfet to 1.8MHz during oscillation mishap that immediately fried the RC snubber resistor! Oscilations and jitter were eliminated by adding 220pF cap across 2Mohm positive feedback resistor for LM393 hysterisis. I spent all day trying to figure this out.

I only had inverted input version of this driver so using enable pin worked out perfect for LM393 active low pulldown output. I used large choke to slow down voltage rise (200ns!!) across the heating element to eliminate massive RFI generated by this circuit. I can place portable AM radio on top of solar panel and hear no RFI. Diode is added to catch inductive spikes at turn off but it needs correct snubber calculated for itself. Without the diode or crude snubber I have in there the turn off spike without the choke inductor was 60V spike at only 10V PV supply due to inherent 13uH inductance in water heating element and wire. With the choke in line and without diode that poor mosfet would get destroyed!

Here is schematic and quick video of its operation. I looped 1 turn of speaker wire through the inductor to get audible PWM sound for demonstration. The circuit works very well to keep panels at preset 60V and you will see when I bypass the PWM the voltage drops to 33V while current remains the same = 50% loss of power without PWM. Edit: Updated schematic here.

pwm_controller1.png

 
Last edited:
Made some improvements. Cleaned up the layout on the power board. Changed gate resistor from 40 to 2k ohms to slow down the mosfet to reduce RFI. Switching time went from 0.2us to 5us which eliminated all RFI above 1Mhz including diode ringing at 25Mhz. Efficiency is still very good - heatsink stays barely warm at 5A switching current. I tried smaller inductor made on same type 26 powdered iron core material and with only 7 turns I noticed dramatic RFI reduction on 1Mhz compared to that other giant core from the video. I wound 20 turns on this smaller T157-26 core but RFI got worse and it became acoustically noisy. It appears that 12 turns is ideal for completely eliminating RFI above 300 kHz and more inductance makes things worse. I suspect more inductance makes it start behaving like a buck converter driving significant current through the diode. I will investigave this effect more.
pwm_v1.01.jpg

Updated schematic with some new parts values.
pwm_controller_v1.01c.png
 
Last edited:
Question to @Warpspeed why am I getting a dip on drain-source voltage at turn off? Inductive spike from the choke? Higher inductance make the dip larger. Could it be reverse transfer capacitance partially turning mosfet on due to 2k gate resistor not providing enough gate current to ground after turn off?
TEK0014a.png

Gate voltage at turn off. I wonder if miller plateu is causing that dip. Note the time scale is 25us vs. 2.5us above.
TEK0018a.png
 
Last edited:
This effect is quite common in mosfet circuits.

Its a ringing resonance created by the combination of series parasitic inductance in the drain circuit, and the various combined parasitic capacitances around the drain circuit.
When the conducted mosfet current abruptly turns off, the voltage at the drain does not just rise to the full open circuit voltage, it tries, but the stored energy in the series inductance can create ringing.
D1 prevents a massive positive inductive spike at turn off, but there is additional inductance between D1 and the drain.

Usual cure is to place a ferrite bead directly on the drain pin. The size and material of the ferrite bead needs to be found experimentally.

Even one inch of wire length between L1/D1 and the drain can ring at a multi Mhz rate.
A "suitably lossy" ferrite bead placed over the drain pin will usually damp out most or all of the ringing.

If you don't really need the turn off speed, slowing down turn off can also improve matters.
The 2K gate resistor will have already slowed things down considerably in your case, so probably not much more you can do with that.

Try placing a big fat EMC bead on the drain and see what happens.
You are not the first person to be plagued by this problem :)
https://www.thebackshed.com/forum/ViewTopic.php?TID=11276&PID=132900#132900
 
Thanks, but this thing looks different from simple ringing. Notice abrupt transition to straight line at 5us right of center line. Ringing looks different for example at 33sec mark in my video in 1st post. I will do some more investigation tomorrow. Also it takes 4us for that dip to complete which suggests 125kHz frequency. Ringing in this circuit happened at 25Mhz when i had 40 ohm gate resistor and 200ns turn off time. Maybe i can try big and slow IGBT instead. Funny how the goal is to get slow turn on/off when everyone else want it faster.
 
Vgs plateau half way down of course likely due to capacitive coupling from drain rising.
Yeah, "Miller"

25us vs. 2.5us, gate close to threshold and output rises suddenly.
Of course you want the transition quick enough to minimize dissipation. Don't be too slow.

But you're asking about Vds dipping momentarily after it reached 60V.

Some things like light bulbs are 1/10th the resistance cold. Heating elements seem to have much lower TCR.
Timeframe here of a couple microseconds, likely no cooling going on, so that's probably a red herring.
 
Difficult to know for sure, there can be all kinds of spurious effects, ground bounce on your probe for example.
You can never be absolutely certain things you can see are actually there.
Could be a combination of several different effects.
Agree with Hedges that the hesitation on the gate waveform is most likely from gate drain Miller capacitance while passing through the linear region.

Highly likely that a slight change in physical layout will also change the waveform even with the exact same components.
 
Last edited:
Found the problem. It was 0.22uF cap across heater element. Replacing with 0.1uF removes the dip. Still not sure exactly how that dip was developing. But it had no effect on RFI. Changed gate resistor to 500 ohms to better show the dip forming 1us after transistor turned off.

0.22uF
TEK0051.png

0.1uF
TEK0052.png

Probe placement
pwm_controller_v1.01_probes1.png
 
Last edited:
Why have a cap across heating element?
I would expect that to cause inrush current.

I expect a cap across PV (you have a large one).
And maybe RC across FET switch, snubber for any inductive spikes.
 
Why have a cap across heating element? I would expect that to cause inrush current.
It's physically located on power board connected across heater output. It's needed for RFI reduction and has >30dB effect. Together with the choke it forms a low pass filter. The inductor supposed to limit the inrush but I have not verified it because I don't have current shunt inserted. I should install it between source and ground and measure current there.
And maybe RC across FET switch, snubber for any inductive spikes.
The diode is way superior to a snubber for catching inductive kick back.
 
OK, inductor prevents FET from shorting two capacitors together.

0.22 uF, 14 uH, 90 kHz LPF feeding resistor.
Should reduce EMI, which we test about 150 kHz to 80 MHz for FCC conducted.

Your Vds 5 us rise time is similar. Possibly not by coincidence.

I would think transistor losses could be reduced (if needed to keep cool with rapid switching) by enough inductance that it saturates before current ramps up.

Should snubber perhaps be across FET, which is what could be damaged? Protects from parasitic inductance in wires if nothing else.

(Just thoughts, I haven't studied your circuit closely.)
 
Switching at 50Hz (or less) is entirely practical for something like this.
The switching losses are going to be extremely low regardless of what the waveforms looks like.
EMC is another matter entirely. Rise times can be controlled without slowing down the mosfet gate drive.

The series inductor (and diode across the load) that you already have make an excellent turn on snubber limiting rate of current rise at turn on.

Rate of voltage rise at turn off could also be limited by the usual turn off snubber consisting of a capacitor and diode in series between drain and ground, and a resistor to discharge the capacitor while the mosfet is turned on.

All fascinating stuff :)
 
0.22 uF, 14 uH, 90 kHz LPF feeding resistor.
I just realized something. With inherent 13uH heater inductance and 12 ohm resistance, this output filter network essentially forms a 3rd order series-first Chebushev low pass filter tuned for 140 kHz and 90dB/decade roll off rate. Makes sense why 220nF cap was causing issues and too much inductance as well. I got lucky picking 100nF cap and 14uH inductor!
140khz_chebushev_3rd_order.PNG

140khz_chebushev_3rd_order_plot.PNG
 
Last edited:
Rate of voltage rise at turn off could also be limited by the usual turn off snubber consisting of a capacitor and diode in series between drain and ground, and a resistor to discharge the capacitor while the mosfet is turned on.
Interesting! Will try.
 
The usual arrangement to slow down rate of voltage rise at turn off.

Turn off switching losses move from within the mosfet into the resistor.
The reduced EMC from a slower dV/dT is a bonus.
 

Attachments

  • RCD.jpg
    RCD.jpg
    8.6 KB · Views: 5
Last edited:
The reduced EMC from a slower dV/dT is a bonus.
Yes that's the goal. I am actually using PV wire connected to solar panels outside (and this PWM circuit on other end next to water heater) as my AM radio antenna for EMC testing. This is as worst as it gets for RFI.
 
Last edited:
Updated schematic. Removed unnecessary resistor from mosfet driver input pin. Updated part values. Working really well now. Very low RFI, practically undetectable (Edit: undetectable above 500kHz, detectable around 50 - 300kHz with very sensitive mini-whip E field antenna 10' from panels). Efficiency is very good as well. Ran it with 2 heaters in parallel switching 11 amps. Heatsink barely gets warm without a fan. When mosfet is fully on (no PWM) the efficiency is 99.8%. Circuit runs quietly and does not buzz. Only very faint buzz from the water heater element. I might mess with turn off RCD snubber later.
pwm_controller_v1.02c.png
 
Last edited:
Here I present very simple PWM controller to keep solar panels at constant voltage for driving water heating element.

Meaning that, in the absence of shade, pretty close to maximum power point for some panel temperature?

Voltage setpoint from 477k & 20k divider, compared to 2.5V
Now time to add MPPT algorithm? Like periodic sweep of that "2.5V" reference, saving highest power point (highest LPF voltage coming from heating element). Any way to do that analog?
 
Meaning that, in the absence of shade, pretty close to maximum power point for some panel temperature?
Yes. I have panels wired in 2s3p. Vmp is 62V most of the day. There is 3 volts of ripple due to charging/discharging 8mF capacitor which sets the switching frequency together with comparator hysteresis.
Now time to add MPPT algorithm? ... Any way to do that analog?
Should be possible but I'm no Jim Williams level of analog wizard. I'd use ATtiny13A.
 
Updated schematic. Removed unnecessary resistor from mosfet driver input pin. Updated part values. Working really well now. Very low RFI, practically undetectable (Edit: undetectable above 500kHz, detectable around 50 - 300kHz with very sensitive mini-whip E field antenna 10' from panels). Efficiency is very good as well. Ran it with 2 heaters in parallel switching 11 amps. Heatsink barely gets warm without a fan. When mosfet is fully on (no PWM) the efficiency is 99.8%. Circuit runs quietly and does not buzz. Only very faint buzz from the water heater element. I might mess with turn off RCD snubber later.
View attachment 254713
I'm a little confused, am I right in understanding you have pv 60v input but your running a heating element which is 240v?
 
And you can still operate 80M (3.5 MHz) on your radio with this running?

I need to add this to my Cement Pond Dummy Load :)
 

diy solar

diy solar
Back
Top