OP...My method would have a constant current supply ,and a very slow controllable feed mechanism whose speed depended on the average voltage across the gap. The bigger the volts, the faster the feed. Hence you'd get a constant gap as the hole was formed.You can buy tungsten carbide drills down to about 300 micron - used for PCB manufacture. But very brittle.Allan
,You circuit won't work.I presume the 'right hand' switch is a connection, and the 'left hand ' one the gap.To measure the average voltage across the gap:1/ Connect one end of the 2M2 to the gap.2/ Other end to the 220k , and to arduino analog in.3/ 220k to this point, other end to ground.4/ I'd add a capacitor eg 10uF between the gap and ground as well to smooth out the pwm and get a steady reading.And even so this only tells you the PWM ratio of the drive ( which you know already) , nothing about the current flowing, which is the important thing. I think my idea of a constant current feed and a variable speed drive is much better.I'll hash out a circuit.
Ok. Do you understand what I'm saying about the divider when the mosfet is turned off? It really needs reconfigured, or better yet moved off that 12V supply. The noise from the arc will play havoc with any digital signal, and with R values that high it will be messy. What is the goal of the divider circuit? Just indication?
The mosfet should be heatsunk as it might dissipate 20 watts. IRF 540? The pot adjusts between 0 and 1A => plenty. I'd start with 100mA.The 24v psu MUST be completely isolated from ground - note that ground is on the electrode.The arduino measures the gap volts - choose eg 2, and use it to drive the stepper to hold it near there.As I remember a typical spark erosion system only uses a few volts - < 10 - so your +24 is probably well over the top and just adds dissipation. Try 12.
Obviously you haven't looked at my circuit yet.But some basics.There are 6.023 E23 atoms/ molecules in a mole.( Avagadro's number) So that many atoms in 56 grams of iron( it's atomic mass )To remove each atom takes 2 electrons - it comes off as Fe++.Each electron has a charge of 1.6E-19 coulombs. ie ampere-seconds.So to remove 56 grams of iron takes 6.023E23 x 1.6E-19 x 2 or about 193,000 coulombs (ampere-seconds).Suppose your hole requires removing 0.1 grams of iron. That's 344 coulombs, or 1A for 344 seconds. Or 0.1A for 3440 secondsLet's continue? Allan
Might be easier for you to test and see. Disconnect the Uno altogether, it's not needed, or at least the pin we are looking at. With the mosfet OFF, measure the voltage anywhere on that resistor divider. All points will read 12VDC. Turn the mosfet ON. You should read 12V, 1.2V, and 0V. What is the max input level for the Uno? IIRC it's VCC +.5VDC, so roughly 5.5VDC, but it also might just be .3VDC. I don't recall as I try to keep inputs <= VCC. What you are trying to do is doable, but it's going to be a bit more complex than what you have. Using an adjustable constant current supply would make things a little less complicated.
The ground path for your divider (as shown) is through the mosfet. With the mosfet OFF, you have no ground, and all points of the circuit will reach max potential--12VDC. Try and see. It's the easiest way to learn.