Programming Arduino Pro Mini, TIG Pulse Add-On, missing some code - Page 1
Forum section: electronics / general

author: Falcon69
author_rank: Super Contributor
timestamp: November 26, 2018, 02:27:53 am
content: So, here's the lowdown.I bought a Lincoln MP210 Welder which is a multi-function Welder, MIG, TIG, And Stick. It MIG's just fine, but I totally suck at TIG. So awhile ago I was at a friend's house, and he had an Everlast TIG Welder that had a pulse feature on it, and because of this, his welds came out really nice, and mine came out decent using his machine.So, I did some searching online to figure out how i can add this feature to my machine.I found this on YouTube.So, after buying all the necessary components, reading alittle on Arduino and how to upload the code to the Arduino, I was ready for this project, so I thought.It seems the code that was posted on the video is missing some.Here is the code:Code://Varsint PWM_DutyCycle=0;int PWM_DutyCycle_Pin=A0;int PWM_Period=512; //period in msint PWM_Period_Pin=A1;//Scale the time of the period or duty by N*1024 milliseconds.//e.g. PWM_PeriodScale=5 will allow a maximum PWM period of 5120 milliseconds, or ~.195 Hzint PWM_PeriodScale = 4;int PWM_DutyScale = 4;int PWM_Out_Pin = 9; //31250 base frequency (Timer1)bool SimpleMode = 1; //NOTE - Other mode is not implemented!int ADC1Vals[] = {0,0,0};int ADC2Vals[] = {0,0,0};unsigned long HighTime=1;unsigned long LowTime=0;void setup() {//Set up PWM outputpinMode(PWM_Out_Pin, OUTPUT);}void loop() {ReadPots();HighTime = PWM_DutyCycle*PWM_DutyScale;LowTime = PWM_Period*PWM_PeriodScale;//turn on the out pindigitalWrite(PWM_Out_Pin,HIGH);delay(HighTime);ReadPots();HighTime = PWM_DutyCycle*PWM_DutyScale;LowTime = PWM_Period*PWM_PeriodScale;//turn pin offdigitalWrite(PWM_Out_Pin,LOW);delay(LowTime);}void ReadPots()And here is the schematic to how it is wired.So, as you can see, there is missing code. no more code after line void ReadPots(). you can clearly see in the video, that the scroll bar can go down further, but he does not show it.I tried hooking this up to the machine. The pots do nothing, but I still have full Pedal Control. But, it just works as normal, no pulsing. It's like the Pots aren't even working (I tried adjusting them as well, to no avail).So, Anyone have any ideas? What am I doing wrong? How do I tell the Arduino to get the values for the Potentiometers? I'm guessing there was another file library, like ReadPots.h ?Thanks in Advance for all your help.

author: Falcon69
author_rank: Super Contributor
timestamp: November 26, 2018, 02:39:43 am
content: I thought maybe after the line void ReadPots()I could putCode:{PWM_DutyCycle = anologRead(PWM_DutyCycle_Pin);PWM_Period = analogRead(PWM_Period_Pin);}But, that doesn't make sense I guess. I'm not sure what to do here.

author: rstofer
author_rank: Super Contributor
timestamp: November 26, 2018, 02:47:23 am
content: When I watched the video on YouATube, there are posts below asking about the code. I can't get to the reply because I don't have a Google account. There may be something in the Replies.It seems kind of silly to post a project like this without the source code.Or, spend some time thinking about what is actually happening, learn more about the Arduino analog inputs and other gadgets then reverse engineer it and write your own code. What it does is pretty trivial so it should be pretty easy to describe the flow. After that, it's just details.

author: Falcon69
author_rank: Super Contributor
timestamp: November 26, 2018, 02:50:51 am
content: Ya, I checked all the replies. They OP talks about posting the code and a write-up, but never has done it. no communication from him in over a year. All the other posts are thanking him for the video, and asking for the code and write-up.As far as learning to reverse engineer it, I'm trying, but my little brain just can't seem to get it. I'm not sure I understand what all these commands do.Everything I've been reading on an Arduino reading a potentiometer, seems to be in the code already that is there.

author: Falcon69
author_rank: Super Contributor
timestamp: November 26, 2018, 03:04:32 am
content: HmmLooks like I need to convert the signal from the pot to PWM?Something like this then for the void ReadPots() ?Code:void ReadPots() {PWM_DutyCycle = analogRead(PWM_DutyCycle_Pin);PWM_DutyCycle = map(PWM_DutyCycle_Pin,0,1023,0,255);PWM_Period = analogRead(PWM_Period_Pin);PWM_Period = map(PWM_Period_Pin,0,1023,0,255);}

author: Falcon69
author_rank: Super Contributor
timestamp: November 26, 2018, 03:19:53 am
content: That doesn't work. I have a feeling it's got something to do with the ADC1Vals[] and ADC2Vals[]

author: rstofer
author_rank: Super Contributor
timestamp: November 26, 2018, 03:34:03 am
content: That little purple board on the left is an 8 input analog multiplexer of which only 2 channels are used. The TIG pedal and the leftmost pot 'Background' are in series such that the pedal controls the current some of the time and the pedal plus the pot controls the current the rest of the time. The time slot is chosen by the wire connected to S0 and is driven to select one or the other analog input based on the timing created in the Arduino by the settings of the background and main pots.So, read the pots, scale the values and then set/clear the pin accordingly - that code exists. You do not need to create a voltage with PWM, just control the frequency and pulse width in the loop.There is an AnalogInput example under the Examples->Analog folder if you are unclear about reading the pot values.I don't know of a better way to write this but once you realize that the Arduino only drives the input selection on the analog multiplexer, you are on your way. The Arduino could be replaced by a 555 timer with a little effort but, of course, the Arduino is a lot more flexible.

author: rstofer
author_rank: Super Contributor
timestamp: November 26, 2018, 03:46:34 am
content: Just guessing but the pedal provides high heat and the pedal plus the pot set the background heat. So, the background heat will always be less than pedal heat.I don't think you need that map() stuff (but maybe you do). You will get values of 0..1023 from the ADC and they will be scaled up by the scale amount - nominally 0..4096 or a little over 4 seconds. You surely want to use times much less than this for the maximum heat and probably for the interval. But the way I see the code, you just return the 10 bit value and handle the issue with the scaling variables (if necessary) which are currently setting at '4'.

author: Falcon69
author_rank: Super Contributor
timestamp: November 26, 2018, 03:59:18 am
content: thank you rstoferI addedCode:void ReadPots(){PWM_DutyCycle = analogRead(PWM_DutyCycle_Pin);PWM_Period = analogRead(PWM_Period_Pin);}while Arduino does not give an error now, I am unsure if this will work, or if it was what I needed to do

author: Falcon69
author_rank: Super Contributor
timestamp: November 26, 2018, 04:28:57 am
content: I just looked over the OP original coding.He mentions this codeCode:int ADC1Vals[] = {0,0,0};int ADC2Vals[] = {0,0,0};but does not mention it anywhere else. He says in video chat that it is a couple of arrays to hold the values of the potentiometers.So my guess is, that has something to do with the missing code under void ReadPots()I don't know where to go from here.

author: rstofer
author_rank: Super Contributor
timestamp: November 26, 2018, 03:01:35 pm
content: Quote from: Falcon69 on November 26, 2018, 03:59:18 amSend the output to the LED (Pin 13?) and watch the change between high and low heat selection. LED_BUILTIN is the name of the pin (apparently, I haven't tried it) if you want to use the macro. I would expect the LED to blink at a human visible rate if we're trying to make nickels. That also makes sense because the scale values are getting up into seconds, not milliseconds.https://www.arduino.cc/en/Tutorial/BlinkWork the controls and see how the on time and total time (frequency) change.I have a feeling that the array of values is used to create a running average to reduce the effect of noise in the readings.ADC1Vals = ADC1Vals;ADC1Vals = ADC1Vals;ADC1Vals = AnalogRead(ADC1);PWMDutyCycle = (ADC1Vals+ADC1Vals+ADC1Vals)/3;ADC2Vals = ADC2Vals;ADC2Vals = ADC2Vals;ADC2Vals = AnalogRead(ADC2);PWMPeriod = (ADC2Vals+ADC2Vals+ADC2Vals)/3;Something like that... I may have the PWMDutyCycle and PWMPeriod reversed or whatever.Low heat will occur when the output is high and this will be when the LED is on.High heat will occur when the output is low and this will be when the LED is off.Kind of backwards for viewing. So...Leave the code as is with respect to the existing output to the multiplexer such that the code matches the schematic. Then, when you turn ON the output, turn OFF the LED and vice versa. Then the LED will be on during high heat. That seems more useful.Now the LED should resemble what you would get at the torch from the settings of the two pots. Play around and see if it is reasonable.Unimportant but...Code:int PWM_Out_Pin = 9; //31250 base frequency (Timer1) <= Comment is misleading, the timer isn't usedbool SimpleMode = 1; //NOTE - Other mode is not implemented! <= SimpleMode isn't used at all

author: Falcon69
author_rank: Super Contributor
timestamp: November 26, 2018, 09:26:26 pm
content: I don't know why that simplemode is on either, makes no sense.I got it working. Your code was almost right, thank you for that.I still have to play around with that divide value you had at 3, but, I think 8 seems to work. 16 was just too fast, and anything above that just made it faster. 3 was just way too slow.I have not tried this yet on the machine. I think I am going to wait until I get some boards made. At least it works flashing the LED, and I think that's all it needs to do. If the LED is flashing correctly, I don't see why it wouldn't send the same signal to the machine.I did find some problems, I think I had a short in the wires to the pots somewhere that was creating some problem. But the code seems to work now. thank you rstofer.Your idea about changing output from pin 9 to 13 did not work. I couldn't read the pedal and the background current potentiometers. Those two were hooked to the multiplexer. So I had to leave the output on 9 and hook an external led to pin Z of the multiplexer (Pin 3).Here is the code now, that seems to work.Code://Varsint PWM_DutyCycle = 0;int PWM_DutyCycle_Pin = A0;int PWM_Period = 512; //period in msint PWM_Period_Pin = A1;//Scale the time of the period or duty by N*1024 milliseconds.//e.g. PWM_PeriodScale=5 will allow a maximum PWM period of 5120 milliseconds, or ~.195 Hzint PWM_PeriodScale = 4;int PWM_DutyScale = 4;int PWM_Out_Pin = 9;bool SimpleMode = 1; //NOTE - Other mode is not implemented!int ADC1Vals[] = {0, 0, 0};int ADC2Vals[] = {0, 0, 0};unsigned long HighTime = 1;unsigned long LowTime = 0;void setup() {//Set up PWM outputpinMode(PWM_Out_Pin, OUTPUT);}void loop() {ReadPots();HighTime = PWM_DutyCycle * PWM_DutyScale;LowTime = PWM_Period * PWM_PeriodScale;//turn on the out pindigitalWrite(PWM_Out_Pin, HIGH);delay(HighTime);ReadPots();HighTime = PWM_DutyCycle * PWM_DutyScale;LowTime = PWM_Period * PWM_PeriodScale;//turn pin offdigitalWrite(PWM_Out_Pin, LOW);delay(LowTime);}void ReadPots(){ADC1Vals = ADC1Vals;ADC1Vals = ADC1Vals;ADC1Vals = analogRead(PWM_Period_Pin);PWM_Period = (ADC1Vals + ADC1Vals + ADC1Vals) / 8;ADC2Vals = ADC2Vals;ADC2Vals = ADC2Vals;ADC2Vals = analogRead(PWM_DutyCycle_Pin);PWM_DutyCycle = (ADC2Vals + ADC2Vals + ADC2Vals) / 8;}I may just do this same thing to the MIG welder too, that should be the same principal. Just splice the circuit in between the trigger wires.

author: rstofer
author_rank: Super Contributor
timestamp: November 26, 2018, 10:21:59 pm
content: Quote from: Falcon69 on November 26, 2018, 09:26:26 pmYou can also fix that by changing the scale factors earlier in the code. Either way...QuoteThat seems wrong because Z shouldn't pulse. It should be a solid voltage between 0 and 5V depending on which source is selected and the setting of the background pot. It will APPEAR to pulse if the background is set low but if the background is at 100%, there won't be a difference between pedal output voltage and background output voltage. The LED will just light up to the pedal output and that's it. It won't even do that if the pedal voltage is less than a couple of volts (perhaps 50%).All you should have to do in the code is a DigitalWrite(LED_BUILTIN,High) everywhere you do a DigitalWrite(PWM_Out_Pin,Low) and vice versa. Of course, you also need to set LED_BUILTIN to output. Or you can just use the pin number (13).

author: Falcon69
author_rank: Super Contributor
timestamp: November 26, 2018, 11:26:37 pm
content: I don't know, it seems to work.If you look at the schematic, the output to the LED (or to the pedal input of the machine later), clearly is connected to the Z-Output of the Multiplexer, and it does pulse.Everything is working as it should. With the foot pedal down, I get full current, and if the background turned all the way up, i get full current, the other two pots seem to do nothing at that point, unless I let off on the Background current, then they start to pulse the LED.Adjusting the Background Pot seems to extend the time between the OFF position of the LED. While the Main Time POT seems to be extending the time the LED is ON. All at the same time, still supplying current (to keep the TIG Torch ON) to the LED while adjusting the BackGround Current Pot (one that is tied to the pot inside the foot pedal).I went ahead and ordered the parts, and I'll start designing the board and get it made. I need to make one of these for myself, and for 2 friends.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: November 27, 2018, 04:15:29 am
content: A welder is a very noisy environment. Make sure you have heavy filtering on any wire more than, like, a few inches away from the board.Tim

author: Falcon69
author_rank: Super Contributor
timestamp: November 27, 2018, 04:26:58 am
content: What do you mean Tim? like a 0.01uf Cap on each wire? or a Ferrite core wrapped around it?

author: T3sl4co1l
author_rank: Super Contributor
timestamp: November 27, 2018, 08:20:05 am
content: Ferrite beads on wires, sure, or resistors where current flow isn't needed (e.g. digital and analog voltage inputs, some logic outputs too). Since, a resistor can have many times the peak impedance of a ferrite bead but at all frequencies, not just high frequencies (so, this is a net win for filtering when the resistor can be >= 1kohm say).Then, 0.01uF from wire to ground is a good general purpose "don't care" value, sure. Obviously anything you need to move faster, needs to be better filtered (better in the sense of not "don't care"-ing -- 0.01uF with 1kohm has a roll-off at 16kHz), or common mode filtered or shielded or isolated or whatever.An example would be a serial port, which might be best with optoisolators just so you don't have to deal with filtering or conducted noise or ground loops.Tim

author: Falcon69
author_rank: Super Contributor
timestamp: November 27, 2018, 07:56:32 pm
content: Thanks Tim, I understand.Other than the Arduino Pro Mini, which is housed inside an aluminum enclosure, there is nothing else other then a 74HC4051 and 3 Potentiometers.However, I will be putting in a 1.3" OLED display so I can visually see the percentage of the value of the Potentiometers. That has 4 pins. But, again, inside the aluminum enclosure project box. Being in the box (which I heard metal creates kinda like a Faraday Cage, you still think I would need to put a filter circuit on it? If I put resistors/capacitor filter on the Potentiometers, it will change my values, but I guess I can just adjust that with the multiplier i have in the program to compensate. There really isn't much going on with this circuit, and the guy in the video did not add anything to his circuit, and it was working very well for him. I want to do it right, but if it isn't needed, no sense to.

author: rstofer
author_rank: Super Contributor
timestamp: November 27, 2018, 09:15:59 pm
content: Have you tested the control over all heat combinations on the welder itself? If so and everything works, skip the following...The 74HC4051 datasheet on page 5 talks about ISWof +- 25 mA but NOWHERE do they characterize the device at anywhere near that current. On page 8, they characterize the chip in terms of 1000 uA (1 mA). I don't think they intend to switch anywhere near several multiples of 1 mA.I don't know how much current it takes at the foot pedal input of the welder. It could vary all over the map. Adding the LED to the Z output doesn't help if we want to be anywhere near 1 mA. That LED really does need to be the one on Pin 13 or some other digital output. You could put it on Pin 9 but the sense of the LED is backwards. One other way to resolve this is to connect the LED resistor between Vcc and the LED anode, connect the cathode to the pin. When the pin goes low, the LED goes on and this would correspond to foot pedal current. The LED would be off during background heat. This doesn't even require a code change!It could well turn out that you need to add a voltage follower op amp (probably single voltage rail-to-rail) if the welder input current is much over 1 mA. Make sure the op amp can get very near 0V and 5V outputs. "Rail-To-Rail" is a marketing term, not an engineering fact.Or, maybe the circuit works just fine.

author: Falcon69
author_rank: Super Contributor
timestamp: November 27, 2018, 09:44:19 pm
content: not sure about that.It seems to work for the guy in the video. I'm thinking the input into the welder is relying on the voltage input, and not the current. Being that this is an inverter machine, and from what I'm reading, the output on the pedal to the machine (the wiper of the potentiometer), feeds the voltage into the machine, which in turns controls some transistors which control the on and off and current of the TIG.Damn, I was hoping to put an LED on to show the pulsing on and off as you use it. But putting it on Pin 13 will not work, as the operation of the foot pedal potentiometer and the background current potentiometer is not even hooked to the arduino. I guess it would still work. It would show the 'ON' current, but will show the flashing on and off. What I mean by on current, as you turn up the potentiometer on the background current, the LED, brightens and stays that brightness, even during the pulsing of the tig, this shows the current still being applied, to keep the metal molten.I will try and test the circuit on the board, but I've had to take it all apart (i had it in a aluminum project box, but since been trying to fix it to get code to work so there's no protection on it, and it's touchy.

author: rstofer
author_rank: Super Contributor
timestamp: November 27, 2018, 10:42:01 pm
content: Quote from: Falcon69 on November 27, 2018, 09:44:19 pmYou can put a DMM set to measure current in series with the pedal input to the welder. Then you would know. I'm a retired engineer so I like to do things with numbers and measurements.In the extreme, the input impedance might be quite low, say 1 Ohm, and it would take 5 Amps of current to get the input up to 5V. It won't really be this bad but I have no numbers in front of me that say how much less it might be. It is absolutely something. Hopefully the impedance is low enough to provide a certain amount of noise immunity but high enough to drive it with the multiplexer.QuoteFair enough, use an op amp to drive the LED - organize it as a unity gain inverting amplifier and connect the LED cathode to the Op amp output and connect the ballast resistor between Vcc and the LED anode. As the input voltage to the op amp increases, the output decreases making the LED turn on brighter. Rail to Rail isn't terribly important because the LED won't even turn on until the signal is at least 1.65V (see below) and brightness is subjective. Play with the background control with the existing LED and a DMM. Note the voltage on the background adjustment that gets the LED to just turn on. Or, turn the background to zero and measure the LED voltage while working the pedal. I think you will see the LED doesn't do much until you are 1/3 throttle. More or less...Bottom of page for inverting unity gain op amp circuit:http://hyperphysics.phy-astr.gsu.edu/hbase/Electronic/buffer.htmlHere is a datasheet (random) for a red LED. Note that Vf, the voltage at which the LED starts to turn on, is typically 1.65V or about 1/3 throttle.https://www.alliedelec.com/m/d/6355b8aba0b01578df0bb7b871ceefd7.pdfWith some dinking around with resistors, it is possible to add 1.65V to the op amp input (summing junction) so that the LED turns on with just the least amount of throttle. I'd have to breadboard that idea... Maybe just a pot so the minimum, no current, brightness could be adjusted. Set it until the LED just turns off.

author: rstofer
author_rank: Super Contributor
timestamp: November 27, 2018, 10:43:37 pm
content: When you measure the pedal input current, if it gets much over 1 mA, consider using a dual op amp - 1 for the LED and 1 to buffer the signal to the welder. It would add an 8 pin DIP and some resistors.

author: Falcon69
author_rank: Super Contributor
timestamp: November 27, 2018, 11:01:05 pm
content: I don't have it set-up to the machine.Just on my desk.The DMM connected between the cathode and ground (LED that's connect to the output 'Z' pin of the 74HC4051 and goes to the pedal input of the machine), is reading at max 2.92mA. That's WITH the LED. Well below the output of 25mA the 74HC4051 can output.I don't know if it will be any different when connected to the machine. This was just connect via USB Plug from Computer, to FTDI Board, to Arduino Mini Pro. I know the voltage output (vcc) from the machine is about 4.7V, I measured it a few days ago.

author: Falcon69
author_rank: Super Contributor
timestamp: November 27, 2018, 11:10:59 pm
content: the pedal input current I'm not sure on, if you mean the current coming from the machine, into the potentiometer within the pedal (without the board connected)I'd have to head over to the machine with my soldering iron, unsolder a wire, and place the DMM in between to get that read out. I'll try and do that later. Right now I'm expecting a shipment and can't do anything that requires time, while I watch for it.If that current is well below the 25mA (with pedal pushed all the way down and TIG welding) Then is it safe to say that the 74HC will not be a problem for this application?

author: rstofer
author_rank: Super Contributor
timestamp: November 28, 2018, 02:04:11 am
content: In a perfect world, the LED would come on as soon as the pedal voltage moves above 0V. But this requires an LED voltage around 1.67V. So, the pedal varies between 0V and 5V while the LED voltage (to the resistor) varies between 1.67V and 5V. I have no idea if this works in practice but I thought I would gin up an op amp circuit with 1 op amp and 4 resistors to do the offset and gain. TI has a publication about this: SLOA097I have attached the LTspice model which uses values from the attached MATLAB script using the equations from the TI publication. The way I see it, 'm' and 'b' are both positive so we use the method on pages 2-3http://www.ti.com/lit/an/sloa097/sloa097.pdfThe other way to create the reference voltage is to use a pot. This might be preferred because I really don't know what the Vref voltage should be.I didn't pick out any particular op amp. Any single rail op amp that runs on 5V should be fine. Rail-to-rail gets extra credit. The output should be capable of sinking a few mA given that R10 and R11 are so high. These may need to be reduced for brightness, just make sure they are approximately identical. Unless you use the pot, in that case the value of the output LED resistor can be whatever seems right as long as the current is within the capability of the op amp to drive.This was done as an exercise and I don't really expect any particular outcome. I like playing with MATLAB and LTspice.

author: rstofer
author_rank: Super Contributor
timestamp: November 28, 2018, 02:20:28 am
content: Quote from: Falcon69 on November 27, 2018, 11:10:59 pmI had hoped, given the state of the project, that this would be easier to do externally. Alas, it's not going to be that simple.QuoteI don't see it that way. All of the examples in the datasheet max out at Isw= 1 mA. The maximum values are just numbers that somebody thinks will cause the chip to melt down. I'm not sure that the region between 1 mA and meltdown is well understood. But the author made it work so, try it! See if the chip gets hot!BTW, is the author still supporting the project? I see he never posted the source code and I was wondering if his hardware has melted and he just moved on to a different version. Yes, I am a cynic by nature. So little trust...All you need is yet another op amp set up as a non-inverting amplifier with a gain of 1. If you do the offset/scale thing for the LED, you might as well use a dual op amp and use the second op amp for this buffer.The reason I am bringing this stuff up, including full scale testing, is that you seem about ready to order PCBs. Were it my project, I would be spending more time on the breadboard to see if these side issues can be solved and what impact they make on the PCB. My PCBs tend to cost a lot of money (ExpressPCB doesn't use China pricing) so I try to stay on the breadboard until I am absolutely convinced.I might even do a bunch of welding with the circuit still on the breadboard. Among other things, I would know more about the EMI issues. Yes, an aluminum box will help for radiated disturbances but not a bit for conducted disturbances (down the wires between the gadget and welder).

author: Falcon69
author_rank: Super Contributor
timestamp: November 28, 2018, 02:25:34 am
content: nah, the board isn't even close to be designed. so far, I just have the components placed and rat lines, on a board to see if i can get everything fit inside my project boxes i planned for.I guess I need to go test this thing tomorrow and see. I can't TIG worth crap, but maybe I can run a few beads and see if that chip gets hot. I can just forget about the LED, and just put it on Pin 13, then we don't have to worry about that at all.I'll try testing it tomorrow when I get time.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: November 28, 2018, 06:30:10 am
content: Quote from: Falcon69 on November 27, 2018, 07:56:32 pmYes, the metal enclosure helps a lot. Consider a closed, continuous (welded, say) box, with one hole for one wire to come through. Nothing's getting through the box, the only place noise can enter is along the wire, along with whatever signal/power is on it. Filter this signal with respect to ground (which is the enclosure), where the wire passes through it, and you have clean signals inside.Now consider if we open up a hole in the box. If no wires go through it, then it's only radio signals that can pass, and high frequencies at that (corresponding to the size of the hole). Still fairly good shielding, even if it's looking like Swiss cheese, and as long as we've got signals filtered with respect to ground.Now consider more wires going into the box. If we filter each one with respect to ground (the box), they're all treated the same, and everything stays clean on the inside.Now for practicalities. Suppose we route the wires onto a PCB, because that's easier to do than filtering right on the enclosure itself. Now we're asking the PCB to act as part of the enclosure, but it has to be mounted somewhere inside the enclosure, not actually as the enclosure itself*.We need the next best ground then, which is going to be some screws and standoffs mounting the board inside the enclosure, and providing a ground connection that way. Say we put two ground screws on one edge of the board, and the connectors and filters are all placed on the board on that same side. That keeps the noise off to that side of the board, and the internal signals are surrounded by ground (ground plane and enclosure) and relatively free from interference.*Well, you could actually arrange it that way, and it would be pretty good if you can work out the electrical details -- I mean, install the PCB over a hole in the enclosure, one side exposed to the world, one side facing in, and with a ground plane which carries the same ground as the enclosure, so the connectors can be filtered directly to ground as such.I think it's best to think about shielding in terms of the ideal case (full shield), made worse by certain geometric transformations -- opening holes in the walls, terminating or filtering potentially-noisy wires with respect to the walls, or if not the walls directly, then the next closest thing, without opening up loops between the wires and the walls. (Example, a board that's grounded on the opposite end of where the connectors are, would carry noise through the board, making a huge loop under the board. That's not so great.)You can also continue this stripping process, all the way down to a bare board. Then you have only the ground plane for ground-as-such, and traces and components are fairly open and exposed to noise, but that's still not necessarily a terrible thing as long as the signals (with respect to local ground plane) are clean enough for purpose. Noise is not so much one wire with respect to an ideal, absolute ground, as one wire with respect to all the others; but as it happens, this doesn't force a change in topology, as we can at least contain those (noise) currents to one side of the board, and have all the active circuitry off to one side, away from all the connectors (which are grouped on the other side).For your case, building with dev boards, you're probably going to add a "glue" board, on which you can place connectors and filters and stuff, and which gets grounded to the enclosure. Short cables or headers then connect to the dev boards, which therefore stay clean, away from the noisy outside world. If you need very little "glue" (basically just the filters, no, like, I/O transceivers or voltage regulators or whatever), you may get away with using the main dev board in this way, minding to tie ground to the enclosure in an opportune spot (don't be afraid to scratch away soldermask and make your own ground pads if needed -- it's your board, you can modify it however you like!).Or if using the dev boards just for circuit reference, and basically copying all that onto a single main board proper -- same idea, connectors and grounds to one side, everything else on the other side.Tim

author: Falcon69
author_rank: Super Contributor
timestamp: November 28, 2018, 11:28:26 am
content: gotcha.So make some ground points where the wires connect to the boards, and then solder or screw that (with wire of course soldered to board), to the wall of the enclosure.Might be alittle difficult to screw the wire to the box, but, i think maybe I can screw it to the end caps. The end caps get screwed on with 4 screws, so That may be good enough.I have managed to place almost the entire circuit on the top plane, and all the grounds connecting on the bottom plane on a Copper Pour. I then placed a copper pour up top, and also connected that to ground, and placed in some more vias just to help.I've left alittle more room between the signal traces and the Power Traces and since I poured, there's ground between them as well.Really, the only signal wires are the 2 for the OLED Display, and the 1 going to the 74HC4051 (Pin 9) from the Arduino.

author: rstofer
author_rank: Super Contributor
timestamp: November 28, 2018, 05:38:11 pm
content: Quote from: Falcon69 on November 28, 2018, 02:25:34 amBy putting the LED output on pin 13, you use the onboard LED or, worse yet, you put another LED in parallel and pin current increases. Furthermore, the onboard LED is probably not visible in the enclosure. You also need to add a couple of lines of code plus define the pin as output.If you put the LED on pin 9 (the output to the MUX), with the resistor between Vcc and the LED anode and the LED cathode connected to the pin, you will pull the LED cathode to ground when the mux is selecting the pedal current. Just what you want! And no code to write... Try it on a breadboard, it should work right out of the box.I prefer pulling LEDs down to ground rather than pulling them up to Vcc like the onboard LED. It probably doesn't matter as much these days but some time back logic could sink more current than it could source. In any event, you can now put the LED in the enclosure cover and get some sense of the pulse ratio while turning the knobs.Note that the LED is driven from the Arduino so it will flash whether there is pedal input or not. Maybe ok... Even pin 13 would do the same thing. The Arduino just doesn't know when the pedal is pressed, with this design.I like my analog design because the LED brightness is somehow proportional to current. I clevered up the Vref and it may not work well that way. It's true that Vf is 1.67 volts for some LEDs but what we need is to output some starting level of brightness when the pedal is minimum (but on) and the background is minimum. We need to find the 'bottom' of the illumination scale and then recalculate the resistors - hence spending a few minutes with MATLAB; rework is easy. We also need some measurements, both eyeball for brightness and DMM for Vf, to calibrate the LED.Either way works and the analog bit is really overkill. The pin 9 approach doesn't given any indication of heat but it does show the pulse rate and width. Still very useful with no analog involved. I'm not sure which way I would go but, being lazy, probably pin 9. <=== this is the easy way!

author: Falcon69
author_rank: Super Contributor
timestamp: November 28, 2018, 09:06:25 pm
content: Okay, but putting an LED on the Z output of the 74HC4051 or on the Output (pin 9) of the arduino and having it sink to ground, would mean that the LED only goes on when the Pulse is off?

author: TheDirty
author_rank: Frequent Contributor
timestamp: November 28, 2018, 09:32:21 pm
content: I'm not a EE and just a hobbyist that normally plays with digital electronics, my original plan was to make a remote button replace the peddle in a TIG welder, but adjustable pulse looks like a great idea to add as well.I'm asking because my plan was to use a digital pot to control the welder control input. Anybody see anything wrong with this? Analog electronics isn't my thing and don't want to go the wrong direction. 5v signal and 5v microcontroller should work fine with a basic digital pot and I could control much more than just high/low, cycle, and duration.

author: Falcon69
author_rank: Super Contributor
timestamp: November 28, 2018, 09:39:09 pm
content: Do You mean a Rotary Encoder?This guy made one and is selling his units, but IMO wants way too much for them.So yes, it's possible to do it with that. I found code searching arduino programs for the Encoders, seems simple enough. But, I wanted the quickness and ease of adjusting on the fly, without having to use a push button to scroll through a menu to adjust the settings. With the potentiometers, and a digital read out display, I can adjust on the fly. So I chose this route instead.

author: rstofer
author_rank: Super Contributor
timestamp: November 28, 2018, 09:54:16 pm
content: Quote from: Falcon69 on November 28, 2018, 09:06:25 pmLet's not talk about pin Z, I think that is a really bad idea. Try it if you like...Pin 9 goes low to select the pedal input and it goes high to select the pedal plus background input. So, if the LED is pulled to ground, it will be bright when pedal input is selected (high current) and off when background current is selected.The resistor goes from Vcc to the anode of the LED and the cathode of the LED goes to pin 9. No code changes required. No overcurrent problems either as long as the LED current is reasonable. Maybe 10 mA or so...R = (Vcc - Vf) / 0.01 should get you close. You should try to find out what Vf is. Just hook up the LED and measure it. I don't know what Vcc is either. Some Arduinos are 5V and some are 3.3V.

author: TheDirty
author_rank: Frequent Contributor
timestamp: November 28, 2018, 09:55:03 pm
content: A rotory encoder would be for the interface, that's not what I'm talking about.In the video's design a analog switch is used to switch between the levels of the different pots. Instead of using the analog switch and the pots, just using a single digital pot to control the input. I'm assuming that's what the last video there is using as it's showing different pulse forms as well other than just square. So replace all the pots with and the switcher with a single digital pot, the interface then can be whatever you want.EDIT: Or it's possibly using a DAC I guess.

author: Falcon69
author_rank: Super Contributor
timestamp: November 28, 2018, 10:00:30 pm
content: rstoferI will just be using a standard flat top 3mm Red LED. So vF should be about 3.3vThe Arduino I'm using is the 5v Pro mini. I am using 5v, because i have 5volt output from the Machine, so no need to add a Voltage Regulator then.

author: Falcon69
author_rank: Super Contributor
timestamp: November 28, 2018, 10:15:47 pm
content: okay, I took the LED and soldered the anode to vcc(with resistor in between of course), and the cathode to PIN 9. The LED turns on when pin 9 goes low, as i thought it would, but when a DMM is put on the Z pin of the multiplexor, it appears the LED turns on when that PIN goes high. I'm confused. Is the multiplexor switching the high low from the arduino?But, when the LED is on pin 9, I don't see the current though that will be on, as background current, i only see the on/off of the torch pulse. I could live with this I guess, but would be nice to see the LED go low to bright as the pedal, or the background current, is turned up or pedal pushed down.

author: rstofer
author_rank: Super Contributor
timestamp: November 28, 2018, 10:55:56 pm
content: Quote from: Falcon69 on November 28, 2018, 10:15:47 pmPin Z is not a digital pin, it is the output of the multiplexer selecting 1 of 8 analog inputs. It is a voltage level, not digital at all.When pin S0 goes low, the multiplexer selects channel Y0 as input (which is the pedal voltage) and delivers whatever it is (0, 1.4, 4.555, <whatever>) to Z.When pin S0 goes high, the multiplexer selects channel Y1 as input (which is the pedal voltage reduced by the pot setting) and delivers that to Z.Since you have parts laying around, you can set up two pots as inputs Y0 and Y1, play with S0 (logic 0 or logic 1) and watch Z on a DMM.

author: Falcon69
author_rank: Super Contributor
timestamp: November 28, 2018, 11:09:57 pm
content: hmm, sounds like we can eliminate the 74HC4051 and put in a relay or solid state relay in it's place. that would...wait,t hat won't work, there would be no back ground current, while pin 9 goes low. Thus, turning off the torch, not good, hmmm

author: rstofer
author_rank: Super Contributor
timestamp: November 28, 2018, 11:20:54 pm
content: Quote from: Falcon69 on November 28, 2018, 10:15:47 pmI gave you an analog solution, one op amp and 4 resistors. Once the minimum brightness and equivalent Vf are established, I can compute the appropriate resistor values. 3+ volts, Vf, for a conventional red LED seems way too high! At least I have never seen anything like that. I'm more familiar with about 2.2V and the datasheet I linked earlier shows 1.67V (IIRC). Try measuring it with a 220 Ohm resistor in series...Linear LED intensity just doesn't work. The op amp solution is elegant but it probably won't really work well. The human eye just isn't linear!The easiest way to get this done takes one extra pin - probably not pin 13 - and a diode (1N914 or 1N4148). Connect the LED anode directly to Vcc. Connect the cathode to one end of a 220 Ohm resistor. Connect the other end of the resistor to the anode of the diode. Connect the cathode of the diode to the IO pin. The diode prevents interaction with what follows. Connect the cathode of the LED to ground through another but higher value resistor (say 1K). Now, toggle this new pin exactly the same as pin 9. When the output is low (pedal voltage selected), the LED will be bright (through the 220 Ohm resistor and diode) and when the output is high (background level) the LED will be dim (through the 1k resistor). Pick resistor values that work for you. Try to keep the LED current at or below 10 mA for full brightness. Yes, the uC can handle 20 mA per pin but, oddly, you don't see much brightness change between 10 and 20 mA. You will have to play with resistor values to get the brightness levels the way you want them.

author: rstofer
author_rank: Super Contributor
timestamp: November 28, 2018, 11:22:43 pm
content: Quote from: Falcon69 on November 28, 2018, 11:09:57 pmThe 4051 is working exactly like a SPDT relay except that it switches in less than 500 nS. Relays aren't anywhere near fast enough unless you get one with overlapping contacts. That would actually work. But you would have an annoying buzz.

author: rstofer
author_rank: Super Contributor
timestamp: November 29, 2018, 12:44:50 am
content: Quote from: TheDirty on November 28, 2018, 09:32:21 pmUnless you add an op amp buffer between your controller and the input to the welder, I don't think this ends well. You still don't have the input current and, trust me, it's not zero. It might not be much or it could be a lot, relative to what a digital pot can handle. You still need numbers - and measurements.Remember, we were talking about the MUX and its nominal usage at 1 mA, not 20 mA like in the MAX table in the datasheet.

author: TheDirty
author_rank: Frequent Contributor
timestamp: November 29, 2018, 01:13:29 am
content: Quote from: rstofer on November 29, 2018, 12:44:50 amThanks. I'll measure the current on my pedal and see what it's actually pulling on the sense line. A buffer might be a good idea anyway and I don't think it's that hard to implement.

author: Falcon69
author_rank: Super Contributor
timestamp: November 29, 2018, 01:16:41 am
content: hmm, just went and measured the voltage out of the machine. It seems the voltage going to the Potentiometer is 3.3v, while the voltage to the switch in the pedal is 5v.Right now, the circuit was working off that voltage going to the potentiometer in the pedal. Oddly enough, the circuit works with that, and a 5V arduino. weird.Should I just leave it? and order some 3.3v Arduino when I actually order and make the boards? Or keep the 5v arduino? I don't think it would be wise to pull the power from the switch, I have no idea what the circuitry of the machine is before and past that switch.

author: Falcon69
author_rank: Super Contributor
timestamp: November 29, 2018, 01:28:53 am
content: Okay, so I measured the foot pedal amerage.Here's what I got. I disconnected the wiper part of the Potentiometer, and put my DMM in between that and the machine. It was reading 0.3uA when pedal pushed to the floor. 0 when pedal not pushed.Moved the leads to the positive and negative output of that potentiometer. 1.937mA when pedal pushed to the floor, and 0 when not pushed.The internal potentiometer in the footpedal is 10K, and the machine is putting out 3.3v.Did I measure correctly? Doesn't seem like a lotWas I suppose to put my DMM between the positive coming out of the machine, and then the positive terminal of the potentiometer?

author: Falcon69
author_rank: Super Contributor
timestamp: November 29, 2018, 01:37:46 am
content: okay, now it makes more sense, because of that 10k potentiometer.The output of the machine to the pedal is 3.3v at 296mA when pedal pushed to the floor. 0 ma and 3.3v when not pushed to the floor.The output of the wiper on the potentiometer is 0.32uA when pedal pushed to the floor.So it looks like, with just the pedal (no circuit), it is drawing 295mA from the machine, but only putting out 0.32uA back to the machine through the wiper on the potentiometer in the pedal.Does all that make any sense? So, if that's all the output is, then an LED on the output of Z of the 74HC4051 should be fine.

author: rstofer
author_rank: Super Contributor
timestamp: November 29, 2018, 02:06:48 am
content: Quote from: Falcon69 on November 29, 2018, 01:37:46 amI don't think so but you can try it. If the MUX is spec'd with a 1 mA output (ignoring MAX values) then the LED won't even begin to light up. Normally, I set up red LEDs for 10 mA but 20 mA is usually a limit for continuous operation (not pulsed).Then there is the voltage problem. Suppose Vf actually IS 3.3V. You just barely have that much voltage when the foot pedal is fully depressed. Yes, the Z output will track properly but there won't be enough voltage to get to Vf. That it worked at all is testment to the idea that Vf is a good deal less than 3.3V.If, as I suspect, Vf is around 2.2V (or maybe as low as 1.67V) then the LED won't turn on until somewhere between 1/3 and 1/2 throttle depending on Vf.If the foot pedal pot is 10k and the machine delivers 3.3V then the current should be 330 uA not 290+ mA. Any chance something went wrong with the measurements?

author: Falcon69
author_rank: Super Contributor
timestamp: November 29, 2018, 02:16:04 am
content: nope. when measure from voltage out of the machine, through DMM, then to positive input of the Potentiometer in the foot pedal, it reads 296mAWhen dmm between footpedal potentiometer wiper, and machine input, it reads 0.3 uA when pedal pushed down.

author: Falcon69
author_rank: Super Contributor
timestamp: November 29, 2018, 02:17:07 am
content: maybe the position of my leads are in the wrong place. I thought you had to splice a wire and put the leads between them.

author: rstofer
author_rank: Super Contributor
timestamp: November 29, 2018, 03:02:26 am
content: Another way to get the LED to respond to current level: Run the Z output into an Arduino analog input and do an AnalogRead(the_int) and use that value to set a PWM output on one of the digital pins. You can do some kind of calculation (quickly, the metal's hot...) based on the input to make the LED do what you want.Like this but with the Z output going to the analog input instead of a potentiometer.http://www.toptechboy.com/arduino/lesson-11-arduino-circuit-to-dim-led-with-potentiometer/Note the 255./1023. in the conversion function. That division needs to be done in setup() and carried in a variable. The value of the division is loop invariant and shouldn't be calculated every cycle through main(). Especially when it is a floating point calculation.

author: Falcon69
author_rank: Super Contributor
timestamp: November 29, 2018, 05:47:17 am
content: hmm, that sounds good.I am headed over to a friend's tomorrow night. he's much better at TIG then I am. I'm bringing this circuit and my machine to test for an hour or so.The thing I'm worried about is that the Arduino I bought is a 5v one, and the machine outputs 3.3V. From what I read, the Arduino will still work But may have problems as it is running out of spec.Now on the bread board, switching the FTDI module to output 3.3v, the circuit still works as intended, just, the LED's are not as bright as they are with the 5 volt.What I may try is to steel the power from the switch (the one that is in the foot pedal and sends signal back to machine to tell it that the foot pedal is activated), and see if I can use that. I think I may be able to. But will try it and see if it works.Does the Arduino 3.3v, also work if the Power Supply is 5volts?

author: rstofer
author_rank: Super Contributor
timestamp: November 29, 2018, 06:49:22 am
content: The "Arduino Pro Mini 3.3V" from Sparkfun is a 3.3V CPU with a regulator on board. You can power the board from 5 to 12V using the onboard regulator or you can disconnect the regulator and power the board with 3.3Vhttps://learn.sparkfun.com/tutorials/using-the-arduino-pro-mini-33v#powering

author: Falcon69
author_rank: Super Contributor
timestamp: November 29, 2018, 07:08:15 am
content: okay, so that solves the problem with my friend's machines, if their output is 5volts and I have the 3.3v Pro mini on the circuit board. But, right now in my case, I made this circuit to test, with a 5V Pro Mini, but my machine only puts out 3.3V. The only thing so far that I read, is that the crystal doesn't like the low voltage. So It may work, but not like it will, since the Pro Mini will be operating out of it's spec.Regardless, I think if it can work on this, it should work fine once I get the 3.3v in (I ordered some, but you know China, takes a month-2 months to get anything from there.)I can then put a selectable jumper on the Raw pin and the VCC In, so if they have 5v or even 12v, they can select the RAW pin and connect to it.I know, china has fake Arduino, but they are really cheap. I may just order the real ones, after this is done. Depends on if I can get my friends to shell out the extra cash for those parts or not. But, they are cheap, like me.Thanks for that Info RSTofer

author: Nominal Animal
author_rank: Super Contributor
timestamp: November 29, 2018, 10:37:27 pm
content: Call me an idiot (because I'm talking out of turn here, and am a hobbyist myself), but why not a circuit something like the following?The idea is to use the four potentiometers (one of them the actual pedal) as inputs to the microcontroller (I like the Pro Micros more than the Minis), and use a DAC and a push-pull output stage to control the voltage the welder sees.That way you could do some really interesting stuff, like allow adjusting the duty cycle as well as the maximum current with the foot pedal. The microcontroller is in full control of the "pedal state" the welder sees. I'm not certain if my output buffer is correct, but the idea is to use a current amplifier stage to ensure the welder gets enough current at low voltages.I would use an additional rotary encoder with a switch for the mode control. The DAC is a cheap MCP4912, and the wiring is for an I2C OLED (since MCP4912 uses SPI) for displaying the values. RXO, TXI, 4, 5, 6, 8, 9, 10 (LED), and MISO are available for the rotary encoder (two digital I/O pins, plus one for the push switch) and other uses. You could use pin 5, 6, 9, or 10 (which has the LED already) to control the intensity of an indicator LED via PWM (which is much more linear than trying to control it via voltage or current). You only need a current-limiting resistor (to limit the LED current to about 15mA maximum).The pro micro would be powered from an USB power bank. (I like them more than the minis, because they have native USB interfaces, rather than a USB-to-serial chip.)

author: rstofer
author_rank: Super Contributor
timestamp: November 30, 2018, 12:25:46 am
content: Quote from: Nominal Animal on November 29, 2018, 10:37:27 pmYour solution is far more elegant, no question!In the beginning there was an Internet project, suspected to work, with some missing code. Then the current related LED intensity came along and, pretty soon, you get to 'feature creep' and the starting point is inadequate. The variation in supply voltages can be an issue and I'm still curious about the foot pedal current - it seems far too high for a 10k pot. Nevertheless, here we are...Your solution could support an OLED display, some kind of quadrature encoder menuing screen and a host of features. Even digital readout of the settings which would be really nice when it came time to replicate a weld.It assumes capabilities in construction and coding. And a lot of work!More feature creep: Use a bargraph for the heat level display. That would provide far better feedback than a single LED. Then the question becomes: Do you want the display to 'jump' between the high and low bars or do you want it to scroll smoothly? Technically, the torch is 'jumping' but, actually, the puddle is forming more smoothly. Is jumping the best answer for the torch if the goal is nickels? Never thought about it!

author: Falcon69
author_rank: Super Contributor
timestamp: November 30, 2018, 03:27:18 am
content: Nice Nominal Animal.Where is the output to the welder? D9? Like I have it now?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. I want to be able to adjust quickly, on the fly.I like your circuit idea much better, and can understand most of it. but I'm new to the coding of the Arduino, I mean really knew. Hard for me to understand much, as I'm mostly a visual person and need to actually see and understand it as it is drawn up on paper, or assembled in real life. To just read abouot something, I have trouble with.So, tonight I went over to a friends to test it. I don't understand what is going on. The wire that was reading 3.3v to the pedal input of the 10k Pot inside the potentiometer, was only reading 1.96 volts with the circuit hooked up, and therefore was not even powering up the Arduino. Nothing was working. I have a 5V Arduino, and was hoping it would work. It works on the breadboard with 3.3v supplied to it (I used the 3.3v jumper on the FTDI board and had that plugged into the computer USB), but, not in real life I guess. I don't understand why the voltage was only reading 1.96v when I put the DMM across the positive and negative of the breadboard, which was hooked to pin 1 and 3 of the Potentiometer, with pin 2 being the wiper going into the Arduino. Pin 1 being the power and Pin 3 being ground.I just can't understand why the machine was only reading 1.96volts then, when last night with just the pedal hooked up, it was reading the 3.3V. *shrug*I like your circuit Nominal, but I'd need some help with it to implement it, and some help to fully understand it. It seems like it would eliminate the problem with the LED on the out pin of the 74HC4051 I was trying to do?the LED wouldn't even be seen when you have your helmet on and face down in the weld watching it. It's just there for visual effect. Nothing more, just as a guide to see as you press the pedal and turn the knobs, before you start welding.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?oh! Wait, I think I understand now......In the Diagram, my machine would be on the right side. The R4 would be connected to the potentiometer in the Pedal itself, actually, R4 WILL BE that potentiometer.Okay, this makes sense. So the LED for visual effect would come off one of the free Digital Pins off the Micro, and then using code, scale it down from the 1024 to the 255 for PWM.So, what about mixed voltage in? My machine is 3.3v out to the pedal. I'm not sure what my friend's are, I need to go over there and measure it (Not the friend from tonight, he has a nice Everlast TIG welder, already has Pulse built in). What voltage range in does this circuit accept? Is it still dependant on the Arduino? rstofer was saying the Adafruit one will do 3.3v to 12v in.

author: Falcon69
author_rank: Super Contributor
timestamp: November 30, 2018, 03:53:16 am
content: Just looked on Arduino site. The Micros they have, say they need 7-12 volts to work. I guess if I have to, I can use a 9volt battery, but, what about the power from the machine and feeding into the potentiometer pedal? Maybe that Pedal Pot has to be larger than 10K? If the welder puts out 3.3V, and has a 10K pot on the pedal, then having 5volts supplied (The Arduino Micro has onboard regulator), may be too much for the machine to operate the pulse current correctly?Now, searching on eBay, they have Chinese PRO Micros, that do 3.3V, and operate up to 12vdc input.

author: Falcon69
author_rank: Super Contributor
timestamp: November 30, 2018, 03:55:26 am
content: Quote from: rstofer on November 29, 2018, 06:49:22 amya, was looking at that too the other night when you posted that. Nominal said to look into the Micros, because of the on board USB, no need for the FTDI. but I guess it doesn't matter, since I already have that FTDI to Serial board to program with. How do you disconnect the regulator? Just unsolder it?EDIT: Nevermind, I'm an idiot. Voltages larger than 3.3v, use the RAW pin instead of the VCC IN pin.

author: rstofer
author_rank: Super Contributor
timestamp: November 30, 2018, 04:55:00 am
content: Why not save some grief and use a wall wart to provide power. If you're going to use the 3.3V Mini, why not use a 5V wall wart for all applications. Use the onboard regulator to get the 3.3V. Don't even bother trying to get power from the welder because all welders will be different.The new schematic, with the totem pole output, can use the 3 footpedal leads with only the GND common to the electronics; that's nice! What's not clear to me is what happens if the footpedal is 5V and the DAC output is only 3.3V. Or, what if the footpedal is 48V and the DAC output is 5V. I'm almost of the opinion that an opto-isolator would be a way to get complete autonomy from pedal voltage. But I would have to think on it...That's the problem with trying to come up with the "general solution", the design gets out of hand pretty quick.

author: Falcon69
author_rank: Super Contributor
timestamp: November 30, 2018, 05:12:16 am
content: Ya, gets confusing, at least to me.The problem with the walwart is that the machine is 220V and I would have to run another extension cord to use the walwart. It would be easier to probably run a 9 volt battery and just replace it every now and then. But, I could just run a walwart as well, and forget about the regulator and 9 volt battery, i guess that would be simpler.SO I redrew it, but I may totally be wrong here... Since I won't be using an encoder to switch the modes. Is this correct? The totem pole output coming off of the machines pedal input, probably needs to be an analog pin and not a digital pin?And yes, that has me concerned as well, if the pedal is 42 volts (I know some machines are), then is there another resistor inside the machine to drop the voltage so it reads it differently, then my machine? I don't know. How would an optoisolator work though, with the back ground current on? I know ON/OFF isn't a problem..

author: Falcon69
author_rank: Super Contributor
timestamp: November 30, 2018, 05:35:23 am
content: Okay, nevermind about that circuit. I reread what Nominal wrote. You need that DAC for this circuit. The Encoder can be added if so be, using the MISO Pin and 2 digital pins.I'm guessing the coding would be similar to what is already written. Except, now we ad a 4th ADCVals3[] but do we average that in with all of them? ADCVals2 is a percentage of the foot pedal's (which will be ADCVals3) voltage. Which is the background current.I'm guessing there will need to be code for the DAC? Or is it just like before, where the Arduino just sends the signals to an output Pin, which is then connected to the DAC?

author: Falcon69
author_rank: Super Contributor
timestamp: November 30, 2018, 05:47:34 am
content: Sorry, just trying to understand what is happening here.So there will need to be code for the DAC as well, SPI.I like the idea you were thinking of rstofer of using this circuit, but completely isolate the machines Pedal input from it, yet, still send the correct ininfo to the machines Pedal Input.That would completely solve the problem with different machines voltages. One friend owns a Miller machine, another owns another older Lincoln like mine that has MIG and TIG. Another one owns an older Lincoln TIG only, but no pulse feature.Pulse features are available nowadays on most dedicated TIG welders, but they aren't cheap for those. My friend tonight told me that one of the guys he works with, just bought a Miller Dynasty with the chiller, and cost him $4200.

author: rstofer
author_rank: Super Contributor
timestamp: November 30, 2018, 06:39:47 am
content: When I think about TIG welding I go back to my youth. I worked in a machine shop that did a lot of work for NASA and, among other things, a lot of precision welding. The welders worked in air conditioned workspaces, sitting on comfortable work chairs with parts mounted in positioning tools. They even had wrist supports. These guys were the artists of precision welding. The machines were 400A AC/DC Millers.The point is, they weren't very far from a wall outlet.Not true for MIG and stick arc. That kind of welding might very well be somewhere awkward.

author: Falcon69
author_rank: Super Contributor
timestamp: November 30, 2018, 06:46:21 am
content: yes, but, sometimes I have to take my welder outside and work on truck, 50 feet away (I have a 60ft 220volt extension).So it would be nice to have to not string another 110V extension cord, but, it would make things simpler, using a walwart, instead of a battery. I could try and impliment a rechargeable battery inside the case, that can be taken inside after a hard day of welding and thrown on a charger. Just unplug the unit from the elder, and the footpedal, and off we go to the charging station.Ya, I seen some of the stuff NASA does. It's crazy what their standards are, yet, didn't a valve fail, because they went cheap, and exploded the challenger? I may have that wrong. I was just a kid in 7th grade watching it happen in school. The teacher brought in the TV, and we watched it live. :/They don't do that anymore for the kids.

author: Nominal Animal
author_rank: Super Contributor
timestamp: November 30, 2018, 09:47:22 pm
content: Quote from: Falcon69 on November 30, 2018, 03:27:18 amPedalIN, PedalVCC, and PedalGND.Quote from: Falcon69 on November 30, 2018, 03:27:18 amNo, 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.)Quote from: Falcon69 on November 30, 2018, 03:27:18 amI 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.Quote from: Falcon69 on November 30, 2018, 03:27:18 amFor 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.)Quote from: Falcon69 on November 30, 2018, 03:27:18 amWell, 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.)Quote from: Falcon69 on November 30, 2018, 03:27:18 amWelder 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 voltagewith 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.

author: Nominal Animal
author_rank: Super Contributor
timestamp: November 30, 2018, 09:52:02 pm
content: Quote from: Falcon69 on November 30, 2018, 06:46:21 amIt was arubber O ring that failed. They knew there was a problem, but it was deemed an acceptable risk.

author: rstofer
author_rank: Super Contributor
timestamp: November 30, 2018, 10:35:42 pm
content: Quote from: Nominal Animal on November 30, 2018, 09:52:02 pmPage 99 here:https://www.gpo.gov/fdsys/pkg/GPO-CRPT-99hrpt1016/pdf/GPO-CRPT-99hrpt1016.pdfThis was an institutional problem. Just because the o-ring had never failed before was accepted as an answer to whether it would fail the next time. Near failures had been observed on previous flights.

author: Falcon69
author_rank: Super Contributor
timestamp: December 01, 2018, 09:49:13 pm
content: Thank You Nominal.Yes, the idea would be to have the input from pedal to the machine completely isolated. That would make it easier for different voltage machines. Wouldn't have to worry about designing (and possible re-coding the processor) a completely new board with voltage regulators installed. However, would be nice that if the batteries for the Arduino/DAC chip die, that the machine would revert back to normal pedal input if it happens.I don't mind running a battery or a rechargeable battery bank. If it's a rechargeable battery bank, I could see it lasting for months before having to recharge it.I really do appreciate your guys help in this. I can't afford to go out and buy a $4000+ machine that has the feature built in.Nominal, if you do buy boards to make test on, or whatever, please let me know, I can PayPal the cash to you for that. I could draw the boards up and have them made too. I'm pretty good with DipTrace, and I'm a perfectionist, so it will be pristine looking too.The encoder switch, controlling the pedal position to change pulse rate, that's just too fancy for me. Keep it simple works for me. It's a cool idea, maybe figure out how to design it, with a switch or something that can select that feature to be off? Then when I get better at TIG, I could switch it on and learn it. Mostly, for now while learning, I'll probably just smash the pedal to the floor, and adjust knobs for pulse rate and background current.You talked about the potentiometer being a voltage divider and that's how the machine changes the current in the TIG Torch. I'd have to agree with this. So far, both the miller and the older Lincoln welders my friends and I have, the pedals are almost identical. Switch inside for on/off, and a single potentiometer. The only difference I saw is at the PIN. Some machines have 7 pins, only 6 are utilized, and one pin coming off the potentiometer in the pedal, is connected to another PIN, at the connector to the Welder (Not in the pedal, pedals are almost identical). So, for those I need to try and figure out why they jumpered the wire at the connector, but for this application, since the pedals are identical (5 pins - 2 for switch, 3 for potentiometer), I don't think it matters?Just so I try to understand, to isolate the welder inputs, because of pssible voltage differences, the SDI, CS, and SCK signals can work off an optocoupler/optoisolator? What about the steady on background current? Doesn't optocouplers/optoisolators basically work off an on/off state? Or do they also measure the LED light input as well, and turn the transistor (or mosFET) on partially, allowing current to go through during the on/off cycle?I just did a search on Mouser. I did not see any serial SPI DAC chips that had more than 6.5v max supply voltage. Most of them were all 1.8v-2.5v to 5.5v - 6.5v. There is a parallel -5.5v - 16.5v, 8bit with an external reference. This was the ONLY one. Everything else seems to be max voltage of 6.5v.https://www.mouser.com/ProductDetail/Maxim-Integrated/MX7224KCWN%2b?qs=%2fha2pyFaduggQWm%2fHwmWYqavbQTXwpz%2fWuZ3oQTpSmI%3dhttps://www.mouser.com/datasheet/2/256/MX7224-111350.pdfThat ILD213T chip is 70v collector emitter breakdown voltage. That should be more than enough. but what amount the current going through that transistor? Remember, I measure 296mA, when only the pedal connected to my machine (there may have been something wrong with my DMM also).I wasn't planning on using modeling clay for the display. I was going to take my dremel tool to the enclosure, and cut out a square, and use double stick tape (I have some of that tape that is used on cellphones to attach the screen and digipad to the case left over from repairing the broken screens of my niece's phones) and stick the display to it from the inside of the enclosure. Make it a complete unit, with the board, display, and the potentiometers. Only have a wire coming out one side with a connector, and another out the other side with a connector. That way, no cutting of the pedal wires. Just plug and play. Then I can return it back to stock (Just pedal and machine), easily.Again, thank you all for your help. It is much appreciated.

author: Nominal Animal
author_rank: Super Contributor
timestamp: December 02, 2018, 05:19:57 am
content: Quote from: Falcon69 on December 01, 2018, 09:49:13 pmTrue.Perhaps something even simpler might work. Say, two high-speed optoisolators, two transistors (logic level MOSFET, say a FQP30N06L) to PWM the welder voltage at say 25 kHz, followed by a simple RC filter to smooth it? (No DAC. The other one of the pair would be for the "foot switch"; I forgot about that in my above schematic.)Quote from: Falcon69 on December 01, 2018, 09:49:13 pmThe DAC is an intelligent device. When CS is pulled low, it starts listening on SCK and SDI lines. On each rising edge (low to high transition of SCK), it looks at the SDI state. If it is low, it received a zero bit; if high, an one bit. Sixteen bits form one command. Each command can set the output voltage of one of its outputs. (If LDAC is tied low, then the voltage changes immediately when the 16th bit has been received; otherwise the next time LDAC goes low.)Thus, if you send the DAC 16 bits telling it to set the first output to 511 (50% of reference voltage, since this is a 10-bit DAC), it keeps the output voltage at that for as long as it is supplied power. Essentially, the DAC replaces the foot pedal the welder sees. (And the actual foot pedal and its switch are just inputs to the microcontroller.)Quote from: Falcon69 on December 01, 2018, 09:49:13 pmYour foot pedal is Lincoln K870, I believe. As it happens,Arc-Zone HotFoot PDFshows its configuration, which is basically a microswitch, 2 watt 10kOhm linear potentiometer, and two 3kV 4700µF (I think) capacitors connected between the wiper and the ends of the potentiometer (to filter out any spikes and noise). It does not say what the actual voltage is, though; probably because it does not matter that much for a microswitch and a potentiometer voltage divider.If the voltage is 5 V, then the current must be less than 400mA, to not exceed the potentiometer rating.Anyway, considering those capacitors, I think the optocouplers-PWM-MOSFETs would work just fine, with even smaller filter capacitors. I'm not sure which optoisolator would be best, though; I was thinking of 6n137s, but as its output side is powered from the welder, I'm not sure if they work with 3.3V pedal voltage. (It really is just an optocoupler controlling a MOSFET, with the optocoupler output and MOSFET using the welder VCC. The IR LED side of the optocoupler is driven at 5V, max. about 15mA current, preferably 5mA or so; with 25 kHz pulse rate but preferably higher bandwidth.)That means you'd need the Pro Micro, the potentiometers, the welder and pedal connectors, two optocouplers (or a dual one), two current-limiting resistors for the optocouplers, two MOSFETs, two pull-down resistors, and two beefy high-voltage capacitors (for filtering the VCC from the welder, and the output from the PWM'ing MOSFET; the other is the "switch", so it does not need filtering).Anyway, if that was sorted out and works, the next step would be to write a minimal Arduino firmware, that just duplicates the pedal and switch state to the welder. That should be relatively easy and quick to write. Then, when that works, the firmware is enhanced to actually implement the pulsing, according to the potentiometers' settings (frequency, duty cycle, and off current). Anyone interested in those odder control modes, could easily go on from that. The OLED display control stuff is trivial; the hardest part is choosing which font to use, how large, and where on the screen.

author: rstofer
author_rank: Super Contributor
timestamp: December 02, 2018, 03:06:19 pm
content: Quote from: Nominal Animal on December 02, 2018, 05:19:57 am2W seems like a very big pot. P = E2/R so E2= 20,000 or E = 141V. It takes a pretty high voltage across the pot to get anywhere near 2W.To get nearly 300 mA through a 10k pot: E = I * R = 3,000V I can believe 300 uA, equivalent to 3V, but I have a bit of a problem with 300 mA.I can see overdesigning the potentiometer but I'll be darned if I see how there can be nearly 300 mA flowing through it! If the measurements are right, something else is going on. Or there is something wrong with the measurements!From the beginning, I have wondered about those current readings.

author: rstofer
author_rank: Super Contributor
timestamp: December 02, 2018, 04:59:02 pm
content: If the current is300 uA, I wonder how a digital potentiometer would play into this. There is some degree of isolation between the digital and the potentiometer making it somewhat immune to pedal voltage (within some limits) and it replaces the DAC and the totem pole structure. It also doesn't limit pedal voltage to somewhere around logic voltage as the totem pole does.ETA: I haven't found a digital pot where the upper end of the pot isn't somehow related to logic voltage. Unless such a device can be found, there's no point in pursuing this. OTOH, I only looked at one...There are some that will handle 15V on the pot side:https://www.intersil.com/content/dam/Intersil/documents/an11/an1158.pdfThe one I was looking at used step pulses to increase or decrease the setting. Not the most useful interface but not truly awful either.

author: Nominal Animal
author_rank: Super Contributor
timestamp: December 02, 2018, 08:28:23 pm
content: Quote from: rstofer on December 02, 2018, 03:06:19 pmYou're right: me neither, thinking about it. Perhaps the huge caps connected to the pot are buggering the measurements?I think the pot is designed to handle DC voltages up to 120 V or so. This is becauseP=VI=V2/R, and withR= 10 kOhm, that yieldsV≃ 141 V, as you already noted.141 V over 10 kOhm yields 14 mA, so I think we can safely assume the DC current is less than 15 mA or so, or the potentiometer rating would be exceeded. Because of the capacitors (being that high capacity must be polarized), I think we can also safely assume DC is used.At 5 V, the current over the pot is half a milliamp, (I=V/R); and at 3.3 V, a third of a milliamp.Still, I like the filtered PWM via an optoisolator and a MOSFET idea better. Actually, I think there are some optoisolators with MOSFET (totem-pole) output, so it would be something like the following:The capacitors above are a pure guess, so their values are bogus. I just stuffed some in, to emphasize that this needs some caps for filtering.

author: Falcon69
author_rank: Super Contributor
timestamp: December 02, 2018, 10:02:01 pm
content: Nominal,That's exactly the pedal I have, the K870.And yes, there are two caps on them, One leg of each connected to the Wiper, and the other legs connected to the Poistive and negative, respectively.I will redo my measurements. but I'm not moving my dryer again to plug in the 220V. I'll just use the 110v. But, I don't think that matters for this.I will take measurements again, with and without the capacitors. I think you guys are on to something, and they are contributing to a false reading on the DMMSo the new circuit you drew completely isolates the welder inputs. I like that idea much better.I will be back in a few. I'll go test those measurements.

author: Falcon69
author_rank: Super Contributor
timestamp: December 02, 2018, 10:38:06 pm
content: I retook the measurements with the DMM.I must have been reading it wrong last time.Now, it is reading voltage of 3.295v on the VCC pin output of the welder that goes to the potentiometer pin of the pedal (Blue wire or 'A' of the k870 Pedal Schematic)Amperage does NOT change with or without the Caps. I actually unsoldered them from the pedal to check.The Amperage I am reading now on the DMM is 296.3µA on the VCC output pin of the welder (again, the blue wire or 'A' on the pedal schematic) This reads this amount, whether the pedal is pushed to the floor or not, capacitors connected or not.The Amperage I am reading now on the DMM on the Wiper of the potentiometer going back to the welder (or Brown wire or 'B' on the pedal schematic) reads 0.3-0.4µA. My DMM won't drop down anymore to get an accurate measurement. It reads 0 when pedal is NOT pushed at all. My DMM isn't that good, but I did see the number slowly going up from 0.0 to 0.4 when pedal pressed down slowly.Here is a pic of that footpedal schematicSO, not very much amperage draw at all.Do these numbers sound more correct now? I must have been looking at the DMM wrong when reading before, it is in fact NOT milli-Amps, but Micro-Amps instead.EDIT: Oh, I think the capacitors are high voltage ceramic disc capacitors. They read 472, 3kV on them and are blue. So you they are not 4700µF like you were thinking, but rather they are 4700pF 3kV High Voltage Capacitors.

author: Falcon69
author_rank: Super Contributor
timestamp: December 02, 2018, 11:16:35 pm
content: Oh, another friend has an AHP welder. His foot pedal is 7 pins. But, still, has same number of wires going to the pedal itself. It's just that pin 6 and 7 are connected together. He bought a pedal like mine (he broke his and had trouble getting a replacement), and we tried to make it work per this schematic, but couldn't get it working. I wonder, now that i think about it, if the capacitors were wrong size for his welder.

author: Falcon69
author_rank: Super Contributor
timestamp: December 02, 2018, 11:28:42 pm
content: Nominal,The wires going to the optoisolator for the switch. I'm not sure of the circuitry inside the welder as to what exactly that switch is doing. So Wouldn't it be a better idea to just have a separate ground for that? Not tied at all together with the welder pedal inputs. I understand why you have it on an optoisolator though and then connected to the Arduino. It's to shutdown and turn on the Arduino to save battery power.

author: rstofer
author_rank: Super Contributor
timestamp: December 02, 2018, 11:48:31 pm
content: So, we would like the pedal and all of the adjustment pots to be isolated from the welder and not even share a common ground. Total isolation...Part I: Use a relay as the switch input to the welder and trigger it with the pedal. Get an accurate measure of switch current and then decide on a relay. Something with a 5V coil might work well.Part II: Isolate the current inputs to the welder... Here's a completely off-the-wall approach that I really like! Have the Arduino drive a stepping motor and connect a pot to the shaft. Total isolation! In the end, the pot can handle any voltage from any welder or be replaced with one that can. Universal!There is a wee bit of an issue and that's the fact that we don't know where 0 is on the pot so, somehow, we need to have some way of backing down from any position to absoute zero when the Arduino starts up.As part of the coupling between the motor shaft and the pot, add a metal disk with a small hole. Use a sensor like:https://www.jameco.com/z/HOA1882-011-Honeywell-Infrared-Transmissive-Sensor_1861380.htmlThe hole needs to be fairly small because the startup process will back the pot down until it sees the hole and perhaps step it forward until it doesn't see the hole. That will be the minimum current. The code will guarantee that the motor is never reversed beyond this point by keeping track of steps. Obviously, we need to know how many steps until we get to the other end and, usually 1.2 degrees per step. A 270 degree pot would take 225 steps and I might knock a few off just to prevent mechanical damage.Maybe the stepper noise will be a concern... It wouldn't need to be a very big stepper...

author: Falcon69
author_rank: Super Contributor
timestamp: December 03, 2018, 12:08:42 am
content: The problem with the stepper, would require busting open the pedals to connect to the pot inside?Nominal's recent schematic seems like it will work. Just not connect the switch and pedal grounds together. It's probably fine, but I don't know where those wires are going inside the machine.I noticed that zero thing you were talking about when I was testing circuit on breadboard. I noticed if i backed off just alittle from the end rotation of the pot, the pulsing seemed fine, but the second i turned it ALL the way to the end, the LED was erratic in behavior. It was acting strange.Couldn't there be programming that would account for this? Like the Arduino would know to only accept 3%-97% of the output of the potentiometers or something? That way if it goes past, then it doesn't matter. The Arduino wouldn't read the input, or rather kept the input the same as it were at 3% or 97%. Like the Arduino would be programmed to only output or read the voltage from the potentiometer if it was only between .005v to 3.295v. anything less or more than that, arduino would only put out 0.005v or the 3.295v. I'm still new to the Arduino and it's programming, but I remember seeing some coding that is 'IF'. 'I'F voltage < 0.0005 then output 0.0005. 'IF' voltage > 3.295V, then output 3.295V. Something like that.

author: rstofer
author_rank: Super Contributor
timestamp: December 03, 2018, 01:46:19 am
content: Quote from: Falcon69 on December 03, 2018, 12:08:42 amIn my imagination, there would be a jack on the electronics box where the unmodified pedal would plug in and there would be a cord with plug to connect the electronics to the welder. Or the cord could have connectors as well - just get the sex right. The input from the pedal would probably be female (like the welder) and the output to the cord would be male. In effect, the cord is really an extension cord and could be used that way.I'm not seriously suggesting this approach, I just wanted to come up with a scheme where the pedal voltage and current could be anything and the electronics would just deal with it while not smoking the Arduino. I could pick ANY potentiometer, for any welder, match the power and resistance ratings and be done with it. Nothing in the electronics would change at all.QuoteTo do this properly, you need to know everything. Further, you have to rationalize what you know against reality. I knew from the start there was no way 300 mA was going through that 10k pot. Now, there could have been something else in the pedal but from Ohm's Law, I knew that that much current wasn't going through a 10k pot. I am often reminded: Ohm's Law is a LAW, not a suggestion. You can't treat it like a speed limit.QuoteYes, code is intended to fix up anomalies. We already know there is going to be some kind of math involved with converting the ADC reading to something we can use to create an output. If we really look at that, there might be something where the value goes astray.

author: Nominal Animal
author_rank: Super Contributor
timestamp: December 03, 2018, 02:07:46 am
content: Quote from: Falcon69 on December 02, 2018, 11:28:42 pmSure, makes sense.Quote from: Falcon69 on December 02, 2018, 11:28:42 pmOh no, it doesn't do that.The pedal has two separate functions: one is the potentiometer (voltage divider), and one is a switch (microswitch). If we want to use a microcontroller to pretend to be a pedal, we need to provide both.If we do use a DAC (MCP4911's seem to be more easily available), an TLP240A as the optoisolated switch, and two TLP2168(TP,F) optoisolator pairs to isolate the four signals to the DAC (just to make sure the DAC can be properly controlled), and some resistors and capacitors, the control circuit would look like this, I think:R10 and R11 are purely optional, just there to stop the I/O pins from burning out if the pins were to be programmed as outputs. Lower right side goes to the welder. You connect the pedal to upper left. Four control pots are drawn in the circuit. I added a tactile button (SW1) just in case; could add a couple more using RX/TX pins (with current-limiting resistors in case they are set as outputs). Pro Micro has selectable internal pullups.

author: Falcon69
author_rank: Super Contributor
timestamp: December 03, 2018, 04:29:58 am
content: Quote from: rstofer on December 03, 2018, 01:46:19 amYes, that's how I planned to do it. So the pedal is unmodified, and the cable for it is not cut.Quote from: rstofer on December 03, 2018, 01:46:19 amYes, that is the idea.I can understand this.Quote from: rstofer on December 03, 2018, 01:46:19 amYes, I was off on my original measurement, you guys were right. I should have done the calculation for ohm's law, I just was not thinking.Nominal,So SW1 would be used to turn the Circuit on/off, since it has it's own power source, the battery bank?I just looked, the TLP2168 is not available from any of the big suppliers (Arrow, Mouser, Digikey). It is factory pre-order, and therefore may require a HUGE quantity to buy. There are a few on eBay, but I don't like buying IC Chips off eBay.EDIT: Looks like FindChips has located some from Verical, chip1stop, and Arrow, but it is unsure if that is in America or not.

author: Falcon69
author_rank: Super Contributor
timestamp: December 03, 2018, 04:36:16 am
content: Nominal,I looked at data sheet, and am curious, though, it's probably not that big of a deal since the values can be adjust (or multiplier) in the code to make it work. But I have to ask...The Vf of that tlp2168 for the LED inside is 1.4-1.8volts. Does that mean that the LED inside will not turn on until 1.4 volts? If that's the case, how is the machine going to see the back ground current then? If that isn't on during pulsing, the molten metal pool will cool too quickly during pulses.

author: Falcon69
author_rank: Super Contributor
timestamp: December 03, 2018, 04:40:06 am
content: oh, wait...You mentioned earlier that the DAC is 16bit, and if i understand correctly, that works like a highly advanced shift register. Meaning it reads all the bits (zeros and ones) before it executes the string of bits. Meaning, it can receive the flashes of light from the LED in the optocoupler (on/off state), and then it calculates the voltage from that and adjusts the output.Did I understand that right? I have never worked with DAC's before.

author: Nominal Animal
author_rank: Super Contributor
timestamp: December 03, 2018, 06:47:51 am
content: Quote from: Falcon69 on December 03, 2018, 04:29:58 amNo, just in case a button is needed for the UI. It can be used to put the microcontroller to deep sleep (and wake up from it), but it'd be better to just disconnect the power bank when not in use.For a real on/off switch, I'd just take an USB micro B cable, cut it in half, and put a 2xon-off toggle switch in between. (Pin 1 is VCC, and you want to disconnect that when off. Only pin 1 and pin 5, GND, need to be connected for a pure charging cable.)Quote from: Falcon69 on December 03, 2018, 04:29:58 amThere are other drop-in equivalents, like TLP2161, TLP2662, and so on.Quote from: Falcon69 on December 03, 2018, 04:40:06 am10-bit, with 16-bit commands, yes. Think of it as a serial-to-parallel latch, followed by a resistor ladder.If we look at the DAC end: Normally, CS and LDAC are high. To send data, CS is pulled low. Then, on each rising SCK edge, the SDI line determines each bit. If we send 0011xxxxxxxxxx00, and finally pull LDAC low and CS high, the output of the DAC will be xxxxxxxxxx2/ 1024 of the maximum voltage within 5 microseconds, and stay there. (00000000002= 0, 10000000002= 512, 11111111112= 1023, and so on.)(If LDAC is tied to the ground, then rising edge of CS will cause the data to latch. That probably makes sense, and would free pin 7 on the Pro Micro.)The signal inversion due to optoisolators do mean that we must use SPI mode 1,1 instead of mode 0,0; but fortunately that is not a problem on the Pro Micro/ATmega32u4.Pin 10 is internally connected to the LED, and can be connected to an external LED (with a suitable current-limiting resistor), and PWM'd to control its intensity.

author: rstofer
author_rank: Super Contributor
timestamp: December 03, 2018, 02:45:45 pm
content: The MCP4911 DAC will operate at Vdd=2.7V..5.0V which is nice since it includes both 3.3V and 5.0V logic and the isolation in the schematic should work fine.However, should there be a welder whose pedal voltage is outside this range, the DAC is not going to work/survive. I don't know if there are welders using, say, 12V for pedal voltage.

author: Falcon69
author_rank: Super Contributor
timestamp: December 04, 2018, 01:24:30 am
content: there is this one, excepts up to 36v but only puts out max 11v. So, probably won't work.http://www.ti.com/lit/ds/symlink/dac8760.pdfI know some machines are 12 volt and another that operate on 42 volts. I'm not sure which machines those are. I just remember reading about it when I was looking to buy compatible foot pedals for friends machine. So, I'm not sure yet, what the voltage is coming out of my friends' machines.It looks like however, that all of them that drop down low enough (3.3v min), for supply voltage, have max input of 5.5v. For my machine, that would work just fine, but for my friends' machines, if their's is more then the 5v, maybe have to design the circuit board to except either of the DAC's. Maybe can find one with same foot print and same pin out, would make it easy. Still, it doesn't seem like it can be universal.

author: Nominal Animal
author_rank: Super Contributor
timestamp: December 04, 2018, 03:27:43 am
content: Quote from: rstofer on December 03, 2018, 02:45:45 pmQuite true, but since we don't have any specs for the pedal voltage, I do like the PWM option better. Plus it should be simpler to do; fewer things that could go wrong. I finessed it a bit:The idea is that the two switches and five potentiometers form a 3×7 pin block, with the VCC pins omitted from the two switches. This allows different configuration in software, with up to seven switches, or up to five potentiometers, as long as their total number is at most seven. In my opinion, three buttons for the OLED UI and four pots sounds best, but what do I know? Not much.I'm thinking the capacitors and connections to the welder would be on a separate board, connected with 5 wires to the Pro Micro carrier board (which would not need to be much larger than the Pro Micro; just enough additional room for the connectors). It looks like 450 V tolerant electrolytics should be easy to find; hopefully that'd be enough. If not, they'll go bang, but should not harm either the Pro Micro or the welder (since they'll just go either short or open).For a power switch, I'd just cannibalize an USB cable, and splice in an 1xON-OFF or 2xON-OFF switch (see e.g. the Wikipedia article onUSB connectorsfor details). Since the current needed is well under 500mA, you can use any old cable, even the el-cheapo thin ones.rstofer, do you see any issues with this one?Because I do have a Pro Micro at hand, at least one 10k potentiometer, and a collection of random capacitors, I think I could write an example firmware during the holidays. Make it CC0-1.0, so anyone could build on top of it, too. (Because the inputs do not have current-limiting resistors, one does need to be careful which pins are set as outputs, but that's about it. Having one of the input pins configured as output and high yields a short, which usually burns that pin out. Then again, the Pro Micro clones seem to work just as well as the originals (except they use the Arduino Leonardo bootloader), and cost $5 or so, so it's not that big of a loss, as long as one is aware of the issue.)

author: Falcon69
author_rank: Super Contributor
timestamp: December 04, 2018, 03:40:25 am
content: Thank you Nominal,Okay, those DAC's are readily available. Mouser shows over 1800 in stock, bit pricey at over $3 each, but I don't care of cost too much, if this works. It's still alot less then spending $4000 on a new machine.So, I'm not really understanding what R5 and the switches do. I guess the switch is to select different code saved into the Arduino, in case the DAC needs to be switched out for a 12v version for other welders? R4 is still the potentiometer inside the pedal? Or does that correspond now to the Pedal_A, B, and C inputs now, leaving two potentiometers on the board for something else? R1 and R2 are still for Background Time and Main Time.I'm guessing the resistor still needs to be on Pedal_B P3 and on the switches as well, like in previous schematic. (see, I'm learning)So the capacitor bank for machine input, those are electrolytic, or all 1uF and below ceramic?What If when I design the board, It's all one board, but I separate them with a slit routed in it, to separate the welder inputs from rest of circuit, and have the TLP5701 straddle over the slit? I think I've seen that done before on old Television Boards to isolate power.

author: Falcon69
author_rank: Super Contributor
timestamp: December 04, 2018, 03:48:17 am
content: Nominal,I was planning on using a TP4056 tied to a 18650 3.7v battery, with a step-up converter to get to 5v for the arduino (or just use the tp4056, battery, and step down module to 3.3v arduino), then just have the USB connector sticking out of the project box for recharging the battery. That battery should last months on a single charge on this simple circuit, i would think.

author: Nominal Animal
author_rank: Super Contributor
timestamp: December 04, 2018, 04:15:51 am
content: Quote from: Falcon69 on December 04, 2018, 03:40:25 amYou do not *need* to use them; they're just there to make sure that if you do need them, they're available.The first firmware I'd write would use R1, R2, and R3 potentiometers (and the pedal). R1 would control the pulse rate (between say 0.2 and 2 seconds), R2 the duty cycle (between say 10% and 90%), and R3 the off-time current (as a percentage of maximum).However, if you find that you want to add those other modes, or add a three-button menu interface (up, down, and select), you need those three buttons. And you still have one potentiometer free. You might want to use it for decay rate (so that when you release the pedal, the welder always sees a smooth easing at that rate).It is horrible to find out you created a board that you cannot use, and must redesign. I like to have a bit of future-proofing.Quote from: Falcon69 on December 04, 2018, 03:40:25 amThe pedal potentiometer is connected to Pedal_A, Pedal_B, and Pedal_C, and the pedal switch to Pedal_D and Pedal_E. There are up to five control potentiometers (knobs) you can connect to the Pro Micro in addition to the pedal.Quote from: Falcon69 on December 04, 2018, 03:40:25 amThe Pro Micro does have internal programmable pullups, so they're not really needed. You can use standard pullup wiring (switch between ground and a 10k resistor to VCC, and input connected to the point the switch connects to the resistor), which protects against programming bugs. Debouncing capacitors can be used in series with the switches (because at microsecond scales, the switch does not change states cleanly, but bounces a few times between open and closed), but that too can be done in software.Quote from: Falcon69 on December 04, 2018, 03:40:25 amI am not certain; I'm not even certain on how much capacitance is needed to get comfortable results. Remember, the existing pedals use capacitors with very high voltage ratings. I do not know if that is for compatibility, or actually necessary with all machines. I would personally do a compromise, and find capacitors rated at say 450 V.As an RC filter, the break frequency when using the capacitors shown, would be around 15 Hz. At 50% duty cycle, the peak-to-peak ripple would be around 0.1%. Is that enough? Is that overkill? I do not have enough practical experience to know; as I said, I mostly use digital sensors myself.Quote from: Falcon69 on December 04, 2018, 03:40:25 amThat helps with isolation, sure. I was thinking of using a separate board more for ease of putting into an enclosure (you could put the capacitors on both sides of the board. I like Hammond diecast enclosures, and you could put a conductive separator (plate, or just circuit board material) to help with the EM noise. I don't know if that matters, but that's what I'd do.Quote from: Falcon69 on December 04, 2018, 03:48:17 amOLED and Pro Micro do consume quite a bit of power. Haven't measured it, but if it was say 150 mA on average, I would not be surprised. A 2000 mAh USB power bank (a single 18650 cell, from a reputable local seller) costs about 5€ here, so would provide about a day of continuous running. I think it would be easier if you had a short USB cable with a male connector sticking out from the enclosure, and a couple of those cheapo power banks, and simply switch them when they run out; keeping the other in a charger.That way you could have a power switch on the enclosure, too between the two ends of the USB cable; one end sticking out, the other end inside connected to the Pro Micro. Ferrite bead or a choke where it exits the enclosure. KISS.

author: Falcon69
author_rank: Super Contributor
timestamp: December 04, 2018, 04:29:59 am
content: ya, good idea on the Battery Bank and switching them out on the fly.The capacitors in the pedal with high voltage rating, i'm guessing that is to eat up the voltage spikes that could happen with the plugging and unplugging of the cable maybe?Ya, I'm down for that, adding extra switches/potentiometers for later features, if they ever get implemented.Okay, so the internal pull-ups and stuff you are talking about is what you meant by being careful on how you program and pin selection in previous posts. That makes sense. Otherwise, we would have to put in resistors so we don't fry the pin outputs/inputs.ya, I'm well familiar with the debounce thing. I had that problem with another circuit I was working on for Hall Effects Sensors. Is a pain to experience that, and then have to redesign and make the boards for it.Looking at alot of boards just now on google images that have optoisolators, it looks like the majority of them just stop the copper pour underneath the optoisolators, in a line that goes across the whole board. So what I was seeing before on old TV Boards, must have been for something else? Because they actually had a slit routed across the board.

author: Nominal Animal
author_rank: Super Contributor
timestamp: December 04, 2018, 10:18:24 am
content: Quote from: Falcon69 on December 04, 2018, 04:29:59 amAnything that sparks tends to generate all sorts of EM, that could get coupled to the long wires.Quote from: Falcon69 on December 04, 2018, 04:29:59 amYes, exactly. If the firmware accidentally makes one of those pot or switch pins outputs, and sets them high, the next time the user presses the button or turns the pot all the way, will cause a short that is likely to burn out the pin. It is a common thing to happen when playing with microcontrollers in the Arduino environment.If one wants to, one can solder the pull-up resistors to the push buttons; no need to have them on the board at all. 1k or above will work fine; I like 10k. (At 5V, each 10k pull-up consumes 0.5 mA. I think the internal ones are equivalent to 33k or so.)I really like the idea of having each button or potentiometer connected to a 3-pin header; keeps it neat but modular.Quote from: Falcon69 on December 04, 2018, 04:29:59 amIn software, I like the approach where you act on the change in state as soon as it is detected, but ignore further changes for a "debounce duration", say 20ms (0.020 seconds) or so.In the welder case, the most common software debounce (like implemented in several Arduino libraries) that only accepts a change in state after the new state has been observed for long enough, might work better: it ignores spurious spikes (say caused by radiated EM).Quote from: Falcon69 on December 04, 2018, 04:29:59 amIt is for isolation. If you consider a high voltage spike, a routed slot is better than a bare board, and a plastic or mica baffle inserted into the slot is even better than an empty slot.I really like how Big Clive describes these things. Inthis video, he tears down an UK USB power supply that has a baffle inside a routed slot for better isolation (it's quite a dense little thing), and later on even does a high-voltage test on it.With respect to the welder and pedals, I do believe the spikes, if any, would be caused by radiated EM due to sparking. Don't forget: the very first radio waves were generated with spark gaps, and relatively long wires close by will act as antennas.

author: rstofer
author_rank: Super Contributor
timestamp: December 04, 2018, 11:31:33 pm
content: It's a TIG welder, we know there will be high frequency and high voltage generated to start the arc. We can also suspect that the torch cable will be laying somewhere near the pedal cable.

author: Falcon69
author_rank: Super Contributor
timestamp: December 06, 2018, 04:51:57 am
content: Sorry all, I been sick the last couple days. I did receive those 3.3v Arduino Mini's. I'll test those when I feel better.rstofer.Yes, most TIG machines have high frequency start, however, mine is a DC machine. All in one, does TIG, Stick, and MIG. It does not do HF (I wish it did though), it does Lift Arc. I wish it was HF, cause then I could TIG Aluminum. As it is, I have to buy a spool gun to be able to MIG aluminum. The machine is a Lincoln MP 210

author: Falcon69
author_rank: Super Contributor
timestamp: December 09, 2018, 04:29:22 am
content: I'm still ill. Sorry no updates.As soon as I feel better (think I have the flu), I'll be hooking up this 3.3v Arduino and seeing if I can get the machine to fire this time. I think the 5volt arduino just didn't see enough voltage from the machine to fire it up.Hopefully I'll be feeling better next few days and can get this done.

author: Pm31416
author_rank: Newbie
timestamp: December 15, 2018, 02:50:17 am
content: Keep us update, i would like to build this for my Everlast St140. Did you follow the initial wiring diagram from the Youtube video ?

author: Falcon69
author_rank: Super Contributor
timestamp: December 15, 2018, 10:36:20 pm
content: yes, I will try. I've been pretty ill the last week and a half. I'll keep ya posted though when I can.

author: Pm31416
author_rank: Newbie
timestamp: January 16, 2019, 02:02:22 am
content: Did you finally tried it ? Wonder if it's working well !

author: Falcon69
author_rank: Super Contributor
timestamp: January 16, 2019, 07:13:07 am
content: Sorry, I've been ill, and with the holidays and everything I haven't had time to try it yet. I did get the 3v arduino's in, so I can try when I have time. I'll update this once I get it figured out.

author: Mackn918
author_rank: Newbie
timestamp: October 29, 2019, 07:45:22 pm
content: I have been trying to bud this for a year. Did you get it working? Can you help others now?

author: Mackn918
author_rank: Newbie
timestamp: October 29, 2019, 08:09:21 pm
content: How about this code with the schematics TOT showed"Hi everyone. I bit-banged out some code. This seems to be working for me. Note, I changed the scale values for my own purposes. I am running this on my Syncrowave 250. My welder is using ~9 volts. So I was able to use the multiplexer listed in his video. I tied my grounds together and only ran the TIG Vref though the multiplexer used a separate 5V power supply to power the Arduino. Never allow more than 5V into the Arduino. Here's the sketch I am using:"//varsint PWM_DutyCycle = 0;int PWM_DutyCycle_Pin = A0;int PWM_Period = 512; //period in msint PWM_Period_Pin = A1;//Scale the time of the period or duty by N*1024 milliseconds.//e.g. PWM_PeriodScale=5 will allow a maximum PWM period of 5120 ms or ~0.195Hzint PWM_PeriodScale = 3.5;int PWM_DutyScale = 3.5;int PWM_Out_Pin = 9; //31250 base freq. (Timer1)unsigned long HighTime=1;unsigned long LowTime=0;//Setup PWM Outputvoid setup() {pinMode (PWM_Out_Pin, OUTPUT);pinMode (PWM_DutyCycle_Pin, INPUT);pinMode (PWM_Period_Pin, INPUT);}void loop(){PWM_DutyCycle= analogRead(PWM_DutyCycle_Pin);HighTime = PWM_DutyCycle*PWM_DutyScale;LowTime = PWM_Period*PWM_PeriodScale;//turn on the out pindigitalWrite(PWM_Out_Pin,HIGH);delay(HighTime);//turn pin offdigitalWrite(PWM_Out_Pin,LOW);delay(LowTime);}

author: DennisCA
author_rank: Contributor
timestamp: October 31, 2019, 01:04:05 pm
content: I'm no electronics expert, but doesn't this seem relevant:https://www.ebay.com/itm/Adjustable-PWM-Pulse-Frequency-Duty-Cycle-Square-Wave-Signal-Generator-Module/401426669311?hash=item5d76e4deff:m:mnaul_Ap9qbVjPLk0sK6StwSeems to me you could just use this thing here and not bother with arduino or anything else, it alsoworks on a large range of voltages. I built my own pedal for my Kemppi TIG welder and replicated (with help from others) the circuit Kemppi used to set a lower and upper max value on their factory pedals. I think I could integrate a circuit like this into that setup (been on a bread board for 2 years now), all it really needs is to hook up between the pedal and welder.EDIT; And this one looks even more polished and under 10 bucks:https://www.ebay.com/itm/Square-Signal-Generator-1-150KHz-PWM-Pulse-Frequency-Cycle-Duty-Adjustable-Meter/312690277939?hash=item48cdcafe33:m:mDN4M2CcoqxdWPGwhTdYxFw

author: DennisCA
author_rank: Contributor
timestamp: October 31, 2019, 05:34:07 pm
content: I went and took a closer look now that I am home and I think my initial excitement was overstated. Frequency and duty cycle can be set, but the reduction of the value seems to be fixed, maybe it drops it completely. If so it does not look suitable for this purpose.

author: DennisCA
author_rank: Contributor
timestamp: November 01, 2019, 09:39:33 am
content: I believe the PWM module can still be used to drive the multiplexer howver.I went out and measured the voltage of my pedal and it varies from 1.4 volts (max) to 10.4 volts (min) so I would have to power the PWR separately, that is doable I guess, but can the multiplexer handle voltages like this, I've searched and I believe it cannot.Anyone know an alternative if so?

author: Nominal Animal
author_rank: Super Contributor
timestamp: November 01, 2019, 12:42:34 pm
content: My idea was to use a microcontroller with a small OLED display, so that you could control the TIG pulse frequency, duty cycle/balance, and pulse high and low levels. To do this, the microcontroller uses a high-frequency PWM to chop the voltage the inverter provides using a totem-pole MOSFET pair (so that even the polarity does not matter), with a simple LC or RC filter so that the inverter really just sees 0% to 100% of its supply voltage, depending on the PWM duty cycle. The microcontroller modulates that PWM to produce the actual TIG pulse train. A second totem-pole MOSFET pair handles the inverter trigger.The physical pedals are usually just 10kOhm potentiometers. The pedal would be connected to the microcontroller, not to the inverter at all. (It also means that the pedal is not directly tied to anything, so one could experiment with having it adjust other properties of the TIG pulse frequency as well.)The microcontroller would be powered using an USB power bank. On/off would be spliced into an USB (power) cable. I like the Pro Micro clones (ATmega32u4); they work at 5V logic levels, are easy to program (either in Arduino environment, or on bare metal using avr-gcc and avr-libc). As they have a native USB interface, no drivers are necessary; and the default bootloader (usually Arduino Leonardo on the clones) works with avrdude. No programmers etc. needed.I was thinking the microcontroller would have some three-pin inputs (VCC, Analog In, GND) for the pedal and 10kOhm potentiometers (anything between 1k and 47k should work) for controlling the TIG pulse properties (say, five of them); some two-pin inputs (GND, Digital In) for buttons (and the TIG trigger); four-pin I2C connector for the OLED display, and a four-pin output connector for the TIG interface (VCC, GND, Trigger, PWM).Depending on the voltage levels the TIG uses, the components on the four-pin interface vary. It could be as simple as two MOSFETs, two resistors, and some capacitors (and maybe some ferrites to filter out spikes). Or, it could be a couple of optoisolators with totem-pole outputs, two resistors, and some caps. For inverters using very high voltages (say 40-60 V), you could use optoisolated outputs, and a second battery or USB power bank to drive some really beefy MOSFETs via transistors.In all cases the Trigger is the simple trigger signal output, and the duty cycle of the PWM the "pedal state" the TIG sees. The output stage only depends on the voltage levels (and possibly amount of noise in the TIG voltage), but its purpose is always to modulate the voltage provided by the TIG, to produce the "pedal" and "trigger" voltages the TIG sees.The microcontroller, OLED, and its input controls are very easy to implement, and the parts cost from eBay is under 10 USD. Unfortunately, I don't have a welder, and I don't have any experience in using MOSFETs to PWM and then filter an external voltage, to generate a fractional voltage of that external voltage.

author: Mackn918
author_rank: Newbie
timestamp: April 10, 2023, 11:21:53 pm
content: just going to leave this here. i made it using Chat-GPT.//Here is an Arduino sketch that allows you to add an adjustable pulse welding feature to your TIG welder.//This sketch requires an Arduino Nano V3 board and three potentiometers connected to the analog input pins A0, A1, and A2 for adjusting the background current, background time, and main time respectively.Code:// Adjustable Pulse Welding for TIG Welder using Arduino Nano V3int backgroundCurrentPin = A0; // analog input pin for background current adjustmentint backgroundTimePin = A1; // analog input pin for background time adjustmentint mainTimePin = A2; // analog input pin for main time adjustmentint tigTorchPin = 9; // output pin for TIG torchint backgroundCurrent = 0; // variable to store background current percentageint backgroundTime = 0; // variable to store background time in millisecondsint mainTime = 0; // variable to store main time in millisecondsvoid setup() {pinMode(tigTorchPin, OUTPUT);Serial.begin(9600);}void loop() {// read the potentiometer values and map them to appropriate valuesbackgroundCurrent = map(analogRead(backgroundCurrentPin), 0, 1023, 0, 100);backgroundTime = map(analogRead(backgroundTimePin), 0, 1023, 0, 1000);mainTime = map(analogRead(mainTimePin), 0, 1023, 0, 1000);// turn on the TIG torch and set background currentdigitalWrite(tigTorchPin, HIGH);delay(backgroundTime * (1 - backgroundCurrent / 100));// pulse welding loopwhile (true) {// main current phasedelay(mainTime);// background current phasedelay(backgroundTime * (backgroundCurrent / 100));}}//In this sketch, we first define the analog input pins for the potentiometers and the output pin for the TIG torch. We also define variables to store the current and time values adjusted by the potentiometers.//In the setup() function, we set the output pin for the TIG torch as an output pin and start the serial communication for debugging purposes.//In the loop() function, we read the potentiometer values and map them to appropriate values for background current, background time, and main time.//We then turn on the TIG torch and set the background current by delaying the program for a certain amount of time based on the background time and background current percentage.//Finally, we enter into a pulse welding loop where the main and background currents alternate based on the main time and background time values.//The main current phase is set by delaying the program for the main time value.//The background current phase is set by delaying the program for a certain amount of time based on the background time and background current percentage.//This loop repeats indefinitely until the Arduino is reset or turned off.//Note: This sketch is provided as an example only and should be tested and modified as needed to fit your specific TIG welder and welding needs.//It is also important to ensure proper safety precautions are taken when working with electricity and welding.

author: Mackn918
author_rank: Newbie
timestamp: April 10, 2023, 11:30:51 pm
content: better yet.Code:#include <Multiplexer.h>// Define the pins for the multiplexer#define S0 2#define S1 3#define S2 4#define S3 5#define SIG A0// Define the pins for the potentiometers#define POT1 A1#define POT2 A2#define POT3 A3// Define the pins for the tig welder and tig torch#define WELDER_PIN 6#define TORCH_PIN 7// Define the variables for the pulse parametersint backgroundCurrent = 50;int backgroundTime = 100;int mainTime = 10;// Create a Multiplexer objectMultiplexer mux(S0, S1, S2, S3);void setup() {// Set the pins for the tig welder and tig torch as output pinspinMode(WELDER_PIN, OUTPUT);pinMode(TORCH_PIN, OUTPUT);// Set the signal pin for the multiplexer as an input pinpinMode(SIG, INPUT);// Set the pins for the potentiometers as input pinspinMode(POT1, INPUT);pinMode(POT2, INPUT);pinMode(POT3, INPUT);}void loop() {// Read the values of the potentiometersint pot1Val = analogRead(POT1);int pot2Val = analogRead(POT2);int pot3Val = analogRead(POT3);// Map the values of the potentiometers to the pulse parametersbackgroundCurrent = map(pot1Val, 0, 1023, 0, 100);backgroundTime = map(pot2Val, 0, 1023, 0, 1000);mainTime = map(pot3Val, 0, 1023, 0, 100);// Set the multiplexer channel to read the signal from the tig weldermux.setChannel(0);// Read the signal from the tig welderint welderSignal = analogRead(SIG);// Set the multiplexer channel to read the signal from the tig torchmux.setChannel(1);// Read the signal from the tig torchint torchSignal = analogRead(SIG);// If the signal from the tig welder is high and the signal from the tig torch is low, start the pulseif (welderSignal > 512 && torchSignal < 512) {// Set the output pins for the tig welder and tig torch to highdigitalWrite(WELDER_PIN, HIGH);digitalWrite(TORCH_PIN, HIGH);// Wait for the background timedelay(backgroundTime);// Set the output pin for the tig torch to lowdigitalWrite(TORCH_PIN, LOW);// Wait for the main timedelay(mainTime);// Set the output pin for the tig welder and tig torch to lowdigitalWrite(WELDER_PIN, LOW);digitalWrite(TORCH_PIN, LOW);// Wait for the background timedelay(backgroundTime);} else {// Set the output pin for the tig welder and tig torch to lowdigitalWrite(WELDER_PIN, LOW);digitalWrite(TORCH_PIN, LOW);}}```To wire everything together, you will need the following parts:- Arduino nano v3- Multiplexer (e.g. CD4051)- Three potentiometers (e.g. 10k ohm)- Tig welder- Tig torch- Jumper wiresHere are the steps to wire everything together:1. Connect the VCC pin of the multiplexer to the 5V pin of the Arduino.2. Connect the GND pin of the multiplexer to the GND pin of the Arduino.3. Connect the SIG pin of the multiplexer to the A0 pin of the Arduino.4. Connect the S0, S1, S2, and S3 pins of the multiplexer to the 2, 3, 4, and 5 pins of the Arduino, respectively.5. Connect the middle pin of each potentiometer to the A1, A2, and A3 pins of the Arduino, respectively.6. Connect one leg of each potentiometer to the GND pin of the Arduino.7. Connect the other leg of each potentiometer to the 5V pin of the Arduino.8. Connect the tig welder to the WELDER_PIN (e.g. pin 6) of the Arduino.9. Connect the tig torch to the TORCH_PIN (e.g. pin 7) of the Arduino.10. Connect the power supply to the Arduino.Once everything is wired together, upload the above sketch to the Arduino nano v3 and you should be able to use the three potentiometers to control the pulse parameters and add pulse functionality to your tig200 ac/dc!Protecting the Arduino and other electronic components from high-frequency noise generated by the tig welder is important to prevent damage and ensure proper operation. Here are some ways you can protect the device from high frequency noise:1. Use a shielded cable between the tig welder and the Arduino: A shielded cable has a conductive layer that helps to block high-frequency noise from entering the cable. It is important to ensure that the shield is properly grounded to prevent noise from entering the system.2. Use a ferrite bead: A ferrite bead is a passive device that can be placed on the cable to attenuate high-frequency noise. It works by dissipating the noise energy in the form of heat, reducing the amplitude of the noise signal.3. Use a low-pass filter: A low-pass filter can be used to attenuate high-frequency noise in the signal. This can be achieved by using a combination of resistors and capacitors to create a filter circuit that allows low-frequency signals to pass through while blocking high-frequency signals.4. Use opto-isolation: Opto-isolation is a technique that uses a light-emitting diode (LED) and a phototransistor to isolate the Arduino from the tig welder. The LED is driven by the Arduino and emits light that is detected by the phototransistor. This provides electrical isolation between the two circuits, preventing high-frequency noise from entering the Arduino.5. Use a metal enclosure: A metal enclosure can be used to shield the Arduino from high-frequency noise. The enclosure should be grounded to prevent noise from entering the system.Using one or more of these techniques can help to protect the Arduino and other electronic components from high-frequency noise generated by the tig welder.