Critique my homebrew solar pv router

Been busy designing a distributed solar pv router. I say distributed because my aim is to measure the flow of energy to and from the grid in the meter box and cater for any number of load switches on a priority basis anywhere in the house and outbuildings. To do this I have used an ESP32 to measure the AC voltage and current with a CT. This unit then signals the status of the Joule buffer using MQTT and also imposes an X10 style 120kHz signal to ‘tag’ AC cycles available for consumption. This has sufficiently low latency to allow larger loads (e.g. 3kW immersion) to remain in control as the capacity of the Joule buffer in the meter is only around 1 second at this power level. I found MQTT alone to be too slow and SRD860 radio too finicky for the building layout and materials.

To start with I made maximum use of having the ESP32 accessible on the LAN. OTA firmware updates mean the electronics can be referenced directly to the AC meaning no distortion from a voltage sense transformer and the ability to capacitively couple the 120kHz signal without a pulse transformer. As this makes probing around with a scope a little tricky, I put in lots of debug over MQTT and included a webserver for graphical interfacing such as a snapshot display of voltage and current:

I have also incorporated a pzem-004t module to compare my measurements and flag-up any significant deviations.

The first power switch I’ve constructed is also ESP32 based but is isolated from the AC

Everything has been made of stuff I had laying around so the Triac box & heatsink is way OTT but it doesn’t matter as there’s plenty of space for it next to the HWC

I would add an animation of the MQTT dash display showing the Joule buffer emptying but can’t seem to upload an mp4. Here’s a link to the animation and other images I posted on the buildhub forums where I spend most of my time,

as critique - i would use surface mount triac. easier fixing when it fail at some point and better heat dissipation. just use push on connectors instead of soldering them on


Will bear FASTPAK in mind. Was actually quite restricted in choice for Alternistor types (AKA snubberless). Settled on Littelfuse Q6040J7TP this time although I could easily of picked a lower spec.

So I’m wondering what other people have come up with in the way of power routing? Most roads seem to lead to @calypso_rae and I’ve had an enjoyable time watching the Youtubes especially the one demoing the demo kit!

Obviously there’s a big attraction to a well designed and documented bit of kit like the Mk2 PV Router but I’m sure there’s still scope to take homebrewed router design a bit further. One thing I keep reading is that burst control is playing with ‘dirty power’ as is phase angle control. Some commercial offerings seem to make a virtue out of their patented sine wave modulation techniques - ‘lid off’ photos often reveal large toroidal power inductors which make me suspicious of phase angle control being filtered to remove harmonics but equally it could be AC Buck regulation.

I’m currently using burst mode and it’s fairly slow but totally adjustable. Currently my excess PV is very modest so the Joule bucket typically creeps up slowly and empties fast. I’ve yet to test it with higher export amounts and faster modulation. If it turns out to warrant more refined power control I’m ready to contemplate AC Buck topologies - I have plenty of experience with DC but synchronous flyback with 240VAC sounds like a big challenge!

That is where the problem lies. Quite heavy-duty filtering is required on both input and output, and that introduces huge difficulties for the switching devices.

To explain, think about a relay operating at d.c. The energy stored in the inductor (the relay) means the current must continue to circulate in the load to dissipate that energy when the switching transistor is turned off. A flywheel (or flyback) diode across the transistor provides a path for the current.
If you now translate that to an a.c. supply, the polarity reverses every half-cycle, and you have a very hard problem to solve.

One way (in concept) is to have a pair of switching transistors in inverse parallel providing the main current path, and a pair of flyback diodes to circulate the stored energy. But of course this won’t work, because the diode for one polarity of mains shorts out the transistor for the other polarity. Therefore, for each polarity, you need two active devices that must switch with perfect timing to smoothly transfer the current between the main path and the flywheel path. If the timing is wrong, there are either damaging voltage spikes or a short across the mains supply. One well-known make uses this scheme, and I’ve seen the result of what must have been a timing error in the switching.

Indeed it is.

Yep. Mosfet gate driving is definitely a non-trivial exercise. However, there are plenty of good gate driver IC’s around so it’s not out of the question for a DIY project. But it does demand good board design with attention to stray inductance and capacitance. Certainly not a stripboard project :smile:

I was just wondering about Shokley breakover for this kind of application - an inverse pair of SCR’s or Triac? I guess it’s the recovery times for repetetive switching or dv/dt behaviour. Must be something like that otherwise it’d be a go-to solution.

This is what the output of the one I looked at was like:

Fet Output

The FETs are chopping up the mains with a variable mark-space ratio to vary that average power, whilst the filters preserve the sinusoidal waveform, albeit at variable amplitude. Depending on mains polarity, you turn on one of Q1 or Q2 to supply the output (and the internal diode in the other one passes the current), and when you turn it off, you must turn on one of Q3 and Q4 to circulate the current in the load.

If you have nothing on and there’s circulating current, it’s bad news in the voltage breakdown department due to the stored energy in the filter. If you have one transistor in both series pairs on, it’s bad news in the over-current department (a short across the mains). Your problem is getting the timing exactly right to transfer the current between the series leg and the shunt leg every time you switch the transistors. And that’s before you think of interference that might turn one of the transistors on when you don’t want it on.

Perhaps a bit higher level than soldering components together but I still think this is “Home Brew” I am using one of these:
You can also drive it opto isolated via PWM signal from e.g. Arduino with one of these:

I experimented with it on my washing machine, Typically I might have a 1kW spare solar on a sunny morning but the element is a fixed 2kW so I annoyingly end up importing 1kW I would be happy if the washing took longer.

I had to replace the drive belt so while machine was open I tried the M028 module on the heating element it works fine, but there’s a snag - the logic in the washing machine has a timer, if the water has not reached temperature after 20 minutes it goes into an error state.

I have also experimented with it on a kettle - no idea how it works but the plug in socket meter I have shows the power factor ot the load changing considerably from 0.98 at 100% down to 0.2 at 10%

The page at CPC says “This power control module can control resistive inductive loads such as motors, heaters (if they are phase controllable).”, so there you have it - phase angle control. And that’s why the power factor changes: when it’s firing at 100%, the block of current is synchronous with the voltage (if it’s a resistive load). As the firing angle changes, the width of the current pulse changes, and its centre drifts away from the centre of the voltage pulse, so (if you smoothed the current out into a sine wave again) it looks like the phase has shifted, hence the power factor change.

Yes, although ‘shoot-through’ is evidently a problem solved in high power motor drivers where 100kW is the name of the game! :hot_face:

Currently looking around for gate driver IC’s designed for AC bridges but nothing doing. The other approach is full wave rectification and standard mosfet topology for synchronous buck. This would simplify the gate driving but the bridge would dissipate around 30W unless it too was derived from synchronous mosfet switches - but then back to square one.