Feature

Safe 3-Phase Generator

Building a Low Voltage 3-Phase Synthesiser

Tishampati Dhar

Issue 2, August 2017

Building a 3-phase power monitor isn’t your average DIY project, but when Tisham discovered he didn’t have a 3-phase power source to test it with... the low voltage 3-phase synthesiser was born!

Three-phase is something that many of us will never actually deal with in our tinkering. It’s not in your average house or back shed and requires special precautions to safely work around. All that aside, for those using 3-phase (industrial workshops, fast food restaurants, and much more), power monitoring is as necessary as for anyone else (perhaps even more so since their power usage may be much higher than average). It takes some special skills and a different approach to single-phase AC. Tisham’s 3-phase AC simulator provides a safe, low-voltage source for developing 3-phase testing equipment.

Before we get into the AC simulator itself, tell us what spawned the need for this project?

It started with a competition run by SeeedStudio, which involved building something with the NodeMCU. I built an energy monitor with an I2C ADC (analogue to digital converter). It wasn’t very accurate though, so I started a project to make the ATM90E26, which is a utility-grade metering IC. It’s easy to DIY, with devkits costing around AUD800. After I published the Arduino code online for the single phase ATM90E26, I started receiving requests to support and debug ATM90E36 code, which other people were writing. The ATM90E36 is a 3-phase energy monitor chip, and in order to test the code I made a devkit for this chip as well. The code reads the values from the 3-phase chip fine, and I managed to test each phase individually using my existing single phase test rig; however, to test all at once I had to book the hackerspace in Tonsley (in South Australia) for a variac and isolation transformer. This was helpful, but the test only lasted a couple of minutes since I foolishly plugged in a low resistance (1-5ohm) load bank to the 12VAC without considering power ratings of the resistors. The load bank went up in smoke and interrupted the test. So rather than waste all the travel time and resources living dangerously at high voltages, I decided to build a safe, low-voltage synthetic 3-phase rig.

Oh we’ve all let the smoke out a few times. So the idea for a simulator was born to allow you to test thoroughly and consistently - what a great idea! Can you roughly explain how you’re creating the 3-phase output?

The 3-phase output is created by sending a digitised sine wave array to an I2C DAC at around 3.2MHz (the highest supported clock I could get out of an Adafruit Teensy 3.2). The sine wave array has 165 points and each other phase is generated by circular shifting the array by one-third of its length. I have made the code for the Teensy available via github (see resources). The output of the DAC has a DC component and is stepped (has harmonics). So I pass it through an RC low-pass filter and an opamp to bring it to +/- 12V peak to peak AC, which my energy monitor devkit is designed to handle.

Sounds like a reasonable approach, and it obviously works! Is monitoring 3-phase more difficult than standard mains power?

Monitoring 3-phase has to deal with higher voltages between phases. It also requires more ADCs (around 6 for 3-voltages, 3-currents), whereas single-phase can make do with 1, 2 if you want to capture the power factor.

A mix of development boards make it work.
A mix of development boards make it work.

What voltage does your simulator output?

The DAC outputs 0-3.3V, which gets AC-filtered then passed through a TL084 JFET opamp. The opamp is powered from 23A 12V cells, so without saturation output is +/- 12V rail-to-rail.

Nice and safe compared to actual 3-phase - good one! How can you load-test the low-voltage unit (since you can’t simply connect the actual load)?

The plan is to use small current-sensing transformers (CTs) at 5A max range (see resources) and high power load resistors, such as 10W wire-wound (see resources). This stage is not built yet and the simulator only outputs 3-phase voltages at the moment. Three-phase current inputs are being tested by passing the voltage through a small divider.

Maybe you can use the old “pull apart the kettle” trick, if you get stuck for a dummy load? It sounds like you’ll have PCBs produced, do you anticipate any challenges moving from prototype to PCB?

That’s right, the PCBs for the 3-phase synthesiser are not yet produced. It is currently made of discrete components, and devkits from manufacturers, plugged and taped onto breadboard. I have produced PCBs for other prototypes - specifically, the ADS1115-based single-phase energy monitor. For this I had to learn EAGLE, scope out PCB manufacturers, and learn cost/capability matrices. Then wait for weeks/months to get prototypes, since there is no SeeedStudio or OSHPark equivalent here in Australia.

Sounds like “living down under” is the only major hurdle here. Other than the voltage, are there any notable differences between grid 3-phase and your simulated 3-phase?

My simulated 3-phase probably has higher harmonics due to being generated from stepped DAC output, I have my scope ready to perform harmonic analysis. I will have to go to the 3-phase lab to do the same for the mains 3-phase. The timing is also critical to maintain the angle between the phases; mine may vary a bit, whereas the grid is pretty stable.

Tisham's workbench complete with working prototype.
Tisham's workbench complete with working prototype.

Timing is definitely a challenge with 3-phase simulation; single-phase AC is so simple by comparison. What unexpected challenges did you face with this project?

There are no breadboard-ready breakouts for 3-4 output DACs, which makes it difficult to prototype. The demo PCB for Microchip MCP4728 that I’m using, is also unexpectedly large. The Arduino library for it had fallen out of date as well, and so I had to update it (see resources for a link to the updated version that I put on GitHub).Of course, getting 3-phase to test my energy monitor was the initial challenge, which lead me down this rabbit hole in the first place!

Those boards do appear rather large, but not the most difficult thing to overcome (even if your prototype ends up three times the size it needs to be). If you had your time over, or were creating a v2.0 of this project, is there anything you would change?

One of the suggestions from hackerspace for building a 3-phase 50Hz simulator was a constant speed drive, which spins one of the BLDC motors commonly used in quadcopters. I would like to build an electro-mechanical rig to do this. It might end up being simpler, with less harmonics than the DAC-based approach that I’m currently using.

That’s definitely an interesting idea. Constant motor speed isn’t terribly difficult to achieve, and it could produce better grid-like consistency; perhaps they’re onto something! How much testing have you done so far, with the 3-phase monitor itself?

When connected to the simulated input, the ATM90E36 successfully detected the 3-phases with correct angles. The load testing needs to be finalised still, as well as power-factor/phase-shift testing.

It sounds like you’re well prepared for that stage. Since we all love having multiple projects on the go, what else are you working on now?

I am currently working on building a 3-phase 6-CT energy monitor in M2 DIN Rail format to monitor grid and solar systems - very similar to WattWatchers - but running on the ESP8266/ESP32. It is going to be fully open-source. It is a multi-board design, so requires a fair bit of to-ing and fro-ing from MCAD to ECAD (FreeCAD and KiCAD are my tools of choice). I would be interested in hearing from anyone who is interested in collaborating or contributing to this project.

Sounds amazing. With a little luck, one of our DIYODE readers will see this and get in touch! Thanks for taking us through your Three-Phase Synthesiser Tisham, we look forward to seeing what’s next!