Pulse Generator Design
The Waveform
I've had some email correspondance with Jaako Fagerlund (who is one of the few people who has made his own desktop EDM) and he had a really nice explanation of how the waveform should work:
The waveform is quite simplified in that picture, but it explains the basics very well. Looking at the upper graph you see gap voltage versus time. As the voltage is switched on, the voltage in the gap is the same as the generators output. If the gap is small enough, the dielectric breaks down and a spark is ignited. This plasma channel is of course lower resistance, so now current (lower graph) starts to flow. The gap voltage drops to basically what the plasma channels resistance times current is. In the graph this area is the lower voltage after full (open) voltage. Then after the on time pulse length is achieved, the generator switches of, the current flow stops and the gap voltage is zero until the generator once again applies a new pulse.
Based on this, this is the basic circuit schematic that I'm after:

With a few more details filled in:

My understanding of the waveform:

References:
Parts:
-
Hearty N-Type MOSFETs: IRFP460A FDB20N50F SDB45N40 (least R_dson)
-
High-side gate drivers: LM5107 UCC27200A
- I could get away with just using one of these (and using a low-side mosfet to do the discharge control). The problem with this is that then the workpiece and worktable are at high voltages whenever the machine is on. So I suspect I'll go with two...
-
Capacitor: 6.8uF conductive polymer
-
window comparator
Timing Calculations
from: https://www.vishay.com/docs/73217/an608a.pdf
Effective Resistance seen by the gate driver: $ R_G = R_g + R_{gext} $
Effective capacitance seen by the gate driver: C_{iss} = C_{gs} + C_{gd}
switching time: $ t = R_G C_{iss} \times \ln{\frac{1}{1-V_{gs}/V_{GS}}} $
Design Decisions
I decided to focus the first revision of this board around the idea of doing as much as possible in firmware on a microcontroller rather than as a static implementation in hardware.
After much flipping back and forth between datasheets, digikey tables, and eagle libraries, I eventually ended up at this board:

I've more-or-less tried to keep the board layout pretty divided based on function. This will hopefully help with debugging and I believe is also good design practice when dealing with mixed signals (both digital/analog and high-power/low-power).
All of the high-current/high-voltage things are on the right side of the board. This includes the two power MOSFETs (SDB45N40), two banks of low ESR capacitors (6.8uF conductive polymer), as well as the high-side gate drivers (LM5107). 100V DC power comes in at the top of the board, which will likely just be supplied by a bench top 100V supply initially (although, ultimately I may take mains power in and use a bridge rectifier to get that voltage).
On the opposite side of the board are all of the small-signal computing and communication peripherals. I decided to use an xmega128a4u as the main processor. I chose this over other options (including the NRF52, ATSAMD21, ATSAMD51, ATmega32u4) for it's speed and ease of timing. After talking with Sam and Jake, the ATSAM architectures just seemed a little unnecessarily complex for this dedicated controller. Some of the notable features of this XMega include a 2 Msps analag to digital converter (which may just be fast enough to directly sample my ~50KHz pulses), two built-in analog comparators, and all of the necessary PWM/timing peripherals. Because I had space, I included both USB and FTDI communication channels (since I've never tried getting USB going on an XMega before). I also broke out a few extra GPIO/ADC pins… just in case...
Connecting those two regions, is the sensing and control circuitry. This region needs to be able to sense the voltage levels of the spark and filter capacitors relay information to the microcontroller to decide whether to turn on or off the high-power MOSFETs. I'm using a 4-channel comparator wired as a dual window-comparator. This will let me set desired voltage windows (across the spark capacitors) that I can then modulate the MOSFETs to achieve. I plan to produce the variable voltages by low-pass filtering PWM signals from the microcontroller. This is just one idea I have for implementing this kind of control and I intentionally left my options open for experimenting.
Errata
- need to tie unused low input pins of the gate drivers to ground (should be easy to bridge)
- need to jumper between HS pin of the gate driver and MOSFET source (bottom of mosfet)
- should use switch instead of solder jumper to switch between 5V and 12V (or better yet, have it automatically switch to the higher voltage source… I can probably do this with properly rated shottky diodes)
- I don't have the overhad to use a normal 0.7V diode with the 5V supply.
Something called an ideal diode works for this though.But this doesn't work above a 6V reverse voltage. - This one would likely scrape by for the 5V side (0.5V drop at 500mA). (actually this one would work, but I think the BAT54S 200mA schottky diode in the fablab inventory would work was well. It has a higher 800mV drop at 100mA but the MCP switching regulator should be okay down to 4V)
- Here's a diode for the 12V side, which I may not even need.
- I don't have the overhad to use a normal 0.7V diode with the 5V supply.
- should have pull downs on both inputs to gate drivers and inputs to mosfets (for safety)
- unclear if I need higher powe-rated resistors for the gate drive resistor. They'll be undergoing high momentary currents but their average power dissipation is well below their 1/4W rating.