Where is the output to the welder?
PedalIN, PedalVCC, and PedalGND.
Also, I didn't really wanted to use an encoder switch, like the Jattus design in the video I linked earlier. That means you have tot kinda scroll through a menu system to select the different pulses, etc. of the torch.
No, I meant that the pots would control the pulse rate (pulses per second), duty cycle (pecentage), and off current (percentage); and the encoder switch only when changing the rarer settings, like if you wanted the pedal to also affect the pulse rate. (Say, you might want 1 pulse per 2 seconds normally, reach full current at pedal halfway, with half to maximum changing just the pulse rate; with pedal in the floor giving you 1 pulse per 1 second, or something like that.)
I'm new to the coding of the Arduino, I mean really knew.
I already have a couple of microcontroller projects I'm helping with; otherwise I'd get some MCP4912s and wire it up and write the code.
I'm pretty sure it would be easy to make the Arduino software so that after wiring it up, you could upload a test firmware, and measure the output with a DMM (between WelderIN and WelderGND, comparing to normal pedal), and read the pot ranges from the debug output; then fill those numbers into the proper firmware sources, and upload it, and use it.
Like I said: just right now I don't have the time. Also, before I'd wire it up, I'd like a real engineer to look at the current amplifier/push-pull stage, to see if it makes sense. (I haven't yet built anything that incorporates such, because I mostly play with sensors that use very little current, so I don't know for sure if it works.)
I do like to use Hammond die-cast aluminium enclosures. The circuit does not include the ferrite beads you'd need for the pedal (3) and welder (3) wires.
If you use a big enough box, the powerbank fits in, and you can use modeling clay to put the OLED outside the enclosure, with just four tiny wires poking through, and short and tiny enough to probably not need ferrites.
It seems like it would eliminate the problem with the LED on the out pin of the 74HC4051 I was trying to do?
For sure. The idea is that the three potentiometers, and the welder pedal, are wired to the Pro Micro, and only to the Pro Micro microcontroller.
The Pro Micro is programmed and powered via the USB connector. For welding, you'd use a small USB powerbank. (Using a powerbank also means we can use the welder ground, without risking any kind of ground loops or such.)
The "pedal state", or the voltage the welder sees at its pedal input, is completely controlled by the microcontroller, via the MCP4912 digital-to-analog converter and the push-pull output stage. (The DAC can only output something like 10-20 mA. The push-pull output stage is a current amplifier, keeping the voltage the same (up to WelderVCC) as the output from the DAC.)
The microcontroller controls the DAC by sending it the new voltage level (0-5V) via SPI. (Currently, I have the LDAC pin tied to ground, which means it should change the output voltage as soon as the transmission completes, but it might have to be wired to an I/O pin instead, if there is signal noise which makes that unreliable.) This particular one is 10 bit, referenced to the microcontroller voltage, so a value of 0 causes 0V to be output, 1023 gives 5V, and 512 gives 2.5V. Even for 3.3V welders, it should have enough resolution to play with.
The LED is controlled via PWM. In the Arduino code, whenever a value is sent to the DAC, the duty cycle of the LED is set at the same time, with a fixed linear correction. (So that if DAC output of say 423 on this particular machine gives full current, that value gives 100% duty cycle for the led also; at 0, both are completely off.)
The 'Pedal In' wire would have to be spliced (that is the wiper of the Potentiometer) and then one end into the circuit (from Pedal), and the other end out to the machine from some output of the Arduino?
Well, no; I was thinking of having two of those connectors your welder uses for the pedal. One to connect to the welder (connected to the WelderIN, WelderVCC, and WelderGND on the other end), and the other to connect the pedal to (which would be connected as a potentiometer).
Each potentiometer acts like a voltage divider, so they don't need to be linear 10k. Anything between 1k and 100k should work equally well, except for noise and such. (A 1k linear potentiometer will consume 5mA whenever connected, producing 25mW of heat. A 10k, half a milliamp and 2.5mW, respectively.)
So, what about mixed voltage in? My machine is 3.3v out to the pedal.
Welder voltage and ground go to WelderVCC and WelderGND. The microcontroller gets a steady 5V from a rechargeable USB power bank.
Because the pedal is almost certainly a voltage divider configuration, the welder voltage might not be very stable at all. If its own circuitry is such that it measures the pedal input voltage
with respect to the output voltage, then any fluctuation in it would not matter at all to the welder -- but it would to the microcontroller.
If that is the case, then my circuit can be amended *and isolated* by having the right side (MCP4912 and the output stage) connected to WelderVCC, and the SDI, CS, and SCK signals (all outputs from the microcontroller, inputs to MCP4912) use optoisolators or a digital isolator. Then, it'd be pretty universal, because the MCP4912 output (0 to 1023) would be relative to the welder's pedal voltage.
There does not seem to be a lower limit to the SPI data rate, and each setting is just 16 bits, so at 10000 baud (using dirt cheap ILD213T optoisolators) it would incur a delay of less than 2 ms, which is well below human detection threshold, and also fixed, so no problem there.
If we could get one of the actual EE's to review the design, I could whip up a board design in EasyEDA ($2 for 5 boards). Also needs checking if there is a DAC with a wider input voltage range (MCP4912 is only 2.5 to 5.5 VDC), whose reference is/can be tied to its input voltage, that is easily available.