This is what I’ve been putting off for a week. It’s not even very difficult, and I don’t know why I resent the idea. Probably because I’ve been ignoring it for months. Sparky has a stepper motor driver chip with step and direction dictated by logic chips based on the position of the vertical moving part, the probe.
The probe is either a cathode or an anode. I’ve never looked it up. I just swapped the wires when I wound up electro-plating things by accident.
The probe has a high potential and is connected to a capacitor so the spark jumps from the probe to the metal thing I’m trying to cut. That ablates a bit from both, ideally. We do it under deionised water so there’s a lot of resistance around the spark and it stays very precise. It also doesn’t short out through the water. So, if the potential is and remains high, we know it’s not near to contact.
If the potential’s low, we know it’s grounded (physically, and therefore electronically). It’s touching the metal thing we want to cut, and that’s not good.
If the potential’s jumping around madly, we know it’s sparking, and that’s where we want to be. So, we need to keep track of the level of the spark probe, and decide from that what the Direction wire should be doing.
So, we have /U (pronounced U-bar, and ideally written as a U with a bar on top of it) and /D. Those mean NOT U and NOT D. We directly wire /U to DIR, the direction pin on the stepper motor. /D is used with /U in a calculation of whether to fire off the stepper at all. The ‘down’ and ‘up’ here are arbitrary, because we have two pairs of wires we can define as up or down, and we just wire them to the stepper.
We take the level coming off the spark circuit, and run it through two comparators. /D is high if level is greater than the limit we set, a bit under 5V. /U is high if LVL (the level) is lower than the limit we set, a bit over 0V. That means we can easily have a situation where the level is between the two. At that point, /U and /D are low. If the comparator chip disconnected, we will get a situation where the later 5v 10K pull-ups will make both lines high.
So, the ideal behaviour if we turn the machine on and something electronic is broken is that it will move upwards. Our default move is ‘up’. Or we can hit the /U line and say ‘not up’. The name we apply to our line, and whether it’s high or not, doesn’t matter. I’ve wired them up in orange and green, to be able to look at them. So the ‘orange’ line is high when we want to over-ride the default behaviour of going up, and send the probe down instead. If we mounted the motor sideways, the orange line would be sending the probe left and right instead.
So, without further ado, the input/results:
/U | /D | gate | DIR | result | Explanation --------------------------------------------------- 0 | 0 | 1 | 0 | U | NOT NOT UP. Up. 0 | 1 | 1 | 0 | U | NOT NOT UP. Up. 1 | 0 | 1 | 1 | D | NOT UP. Down. 1 | 1 | 0 | 1 | N | NOT UP. NOT DOWN. Gate stops.
An extra good point here is that if /U is low, it will consistently go up no matter what /D’s state. That means we can use a cut-out to force the motor to move even if the microswitches are bottomed out. I need to expand that when I write this out properly. At Project End I’ll do a full breakdown of the circuit board.
If I can output that as a small LED array, I should be able to see if something’s going wrong. Expand the testing and put it to a serial monitor with the Arduino, and I’ll be able to tell why it’s going wrong too. So, now that’s written down I can get back to staring at Sparky in sure and certain hope.