Author Topic: Programming Arduino Pro Mini, TIG Pulse Add-On, missing some code  (Read 24820 times)

0 Members and 1 Guest are viewing this topic.

Offline Falcon69Topic starter

  • Super Contributor
  • ***
  • Posts: 1482
  • Country: us
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: [Select]
//Vars

int PWM_DutyCycle=0;
int PWM_DutyCycle_Pin=A0;

int PWM_Period=512;  //period in ms
int 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 Hz
int 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 output
pinMode(PWM_Out_Pin, OUTPUT);
}

void loop() {

  ReadPots();
  HighTime = PWM_DutyCycle*PWM_DutyScale;
  LowTime = PWM_Period*PWM_PeriodScale;

  //turn on the out pin
  digitalWrite(PWM_Out_Pin,HIGH);
  delay(HighTime);

  ReadPots();
  HighTime = PWM_DutyCycle*PWM_DutyScale;
  LowTime = PWM_Period*PWM_PeriodScale;

//turn pin off
digitalWrite(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.
« Last Edit: November 26, 2018, 02:52:58 am by Falcon69 »
 

Offline Falcon69Topic starter

  • Super Contributor
  • ***
  • Posts: 1482
  • Country: us
Re: Programming Arduino Pro Mini, missing some code
« Reply #1 on: November 26, 2018, 02:39:43 am »
I thought maybe after the line void ReadPots()

I could put

Code: [Select]
{

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.
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9890
  • Country: us
Re: Programming Arduino Pro Mini, missing some code
« Reply #2 on: November 26, 2018, 02:47:23 am »
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.
 

Offline Falcon69Topic starter

  • Super Contributor
  • ***
  • Posts: 1482
  • Country: us
Re: Programming Arduino Pro Mini, missing some code
« Reply #3 on: November 26, 2018, 02:50:51 am »
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.
 

Offline Falcon69Topic starter

  • Super Contributor
  • ***
  • Posts: 1482
  • Country: us
Re: Programming Arduino Pro Mini, TIG Pulse Add-On, missing some code
« Reply #4 on: November 26, 2018, 03:04:32 am »
Hmm

Looks like I need to convert the signal from the pot to PWM?

Something like this then for the void ReadPots() ?

Code: [Select]
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);
}
 

Offline Falcon69Topic starter

  • Super Contributor
  • ***
  • Posts: 1482
  • Country: us
Re: Programming Arduino Pro Mini, TIG Pulse Add-On, missing some code
« Reply #5 on: November 26, 2018, 03:19:53 am »
That doesn't work. I have a feeling it's got something to do with the ADC1Vals[] and ADC2Vals[]
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9890
  • Country: us
Re: Programming Arduino Pro Mini, TIG Pulse Add-On, missing some code
« Reply #6 on: November 26, 2018, 03:34:03 am »
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.
« Last Edit: November 26, 2018, 03:36:23 am by rstofer »
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9890
  • Country: us
Re: Programming Arduino Pro Mini, TIG Pulse Add-On, missing some code
« Reply #7 on: November 26, 2018, 03:46:34 am »
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'.
 

Offline Falcon69Topic starter

  • Super Contributor
  • ***
  • Posts: 1482
  • Country: us
Re: Programming Arduino Pro Mini, TIG Pulse Add-On, missing some code
« Reply #8 on: November 26, 2018, 03:59:18 am »
thank you rstofer

I added
Code: [Select]

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
 

Offline Falcon69Topic starter

  • Super Contributor
  • ***
  • Posts: 1482
  • Country: us
Re: Programming Arduino Pro Mini, TIG Pulse Add-On, missing some code
« Reply #9 on: November 26, 2018, 04:28:57 am »
I just looked over the OP original coding.

He mentions this code

Code: [Select]
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.
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9890
  • Country: us
Re: Programming Arduino Pro Mini, TIG Pulse Add-On, missing some code
« Reply #10 on: November 26, 2018, 03:01:35 pm »
thank you rstofer

I added
Code: [Select]

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

Send 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/Blink

Work 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[0]    = ADC1Vals[1];
ADC1Vals[1]    = ADC1Vals[2];
ADC1Vals[2]    = AnalogRead(ADC1);
PWMDutyCycle = (ADC1Vals[0]+ADC1Vals[1]+ADC1Vals[2])/3;

ADC2Vals[0] = ADC2Vals[1];
ADC2Vals[1] = ADC2Vals[2];
ADC2Vals[2] = AnalogRead(ADC2);
PWMPeriod   = (ADC2Vals[0]+ADC2Vals[1]+ADC2Vals[2])/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: [Select]
int PWM_Out_Pin = 9;     //31250 base frequency (Timer1)   <= Comment is misleading, the timer isn't used
bool SimpleMode = 1;     //NOTE - Other mode is not implemented!  <= SimpleMode isn't used at all
« Last Edit: November 26, 2018, 03:32:13 pm by rstofer »
 

Offline Falcon69Topic starter

  • Super Contributor
  • ***
  • Posts: 1482
  • Country: us
Re: Programming Arduino Pro Mini, TIG Pulse Add-On, missing some code
« Reply #11 on: November 26, 2018, 09:26:26 pm »
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: [Select]
//Vars

int PWM_DutyCycle = 0;
int PWM_DutyCycle_Pin = A0;

int PWM_Period = 512; //period in ms
int 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 Hz
int 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 output
  pinMode(PWM_Out_Pin, OUTPUT);
}

void loop() {

  ReadPots();
  HighTime = PWM_DutyCycle * PWM_DutyScale;
  LowTime = PWM_Period * PWM_PeriodScale;

  //turn on the out pin
  digitalWrite(PWM_Out_Pin, HIGH);
  delay(HighTime);


  ReadPots();
  HighTime = PWM_DutyCycle * PWM_DutyScale;
  LowTime = PWM_Period * PWM_PeriodScale;

  //turn pin off
  digitalWrite(PWM_Out_Pin, LOW);
  delay(LowTime);
}

void ReadPots()
{
  ADC1Vals[0] = ADC1Vals[1];
  ADC1Vals[1] = ADC1Vals[2];
  ADC1Vals[2] = analogRead(PWM_Period_Pin);
  PWM_Period = (ADC1Vals[0] + ADC1Vals[1] + ADC1Vals[2]) / 8;

  ADC2Vals[0] = ADC2Vals[1];
  ADC2Vals[1] = ADC2Vals[2];
  ADC2Vals[2] = analogRead(PWM_DutyCycle_Pin);
  PWM_DutyCycle = (ADC2Vals[0] + ADC2Vals[1] + ADC2Vals[2]) / 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.
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9890
  • Country: us
Re: Programming Arduino Pro Mini, TIG Pulse Add-On, missing some code
« Reply #12 on: November 26, 2018, 10:21:59 pm »
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.
You can also fix that by changing the scale factors earlier in the code.  Either way...
Quote

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.

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).


That 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).
 

Offline Falcon69Topic starter

  • Super Contributor
  • ***
  • Posts: 1482
  • Country: us
Re: Programming Arduino Pro Mini, TIG Pulse Add-On, missing some code
« Reply #13 on: November 26, 2018, 11:26:37 pm »
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.

 

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 21674
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Programming Arduino Pro Mini, TIG Pulse Add-On, missing some code
« Reply #14 on: November 27, 2018, 04:15:29 am »
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
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline Falcon69Topic starter

  • Super Contributor
  • ***
  • Posts: 1482
  • Country: us
Re: Programming Arduino Pro Mini, TIG Pulse Add-On, missing some code
« Reply #15 on: November 27, 2018, 04:26:58 am »
What do you mean Tim? like a 0.01uf Cap on each wire? or a Ferrite core wrapped around it?
 

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 21674
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Programming Arduino Pro Mini, TIG Pulse Add-On, missing some code
« Reply #16 on: November 27, 2018, 08:20:05 am »
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
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline Falcon69Topic starter

  • Super Contributor
  • ***
  • Posts: 1482
  • Country: us
Re: Programming Arduino Pro Mini, TIG Pulse Add-On, missing some code
« Reply #17 on: November 27, 2018, 07:56:32 pm »
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.
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9890
  • Country: us
Re: Programming Arduino Pro Mini, TIG Pulse Add-On, missing some code
« Reply #18 on: November 27, 2018, 09:15:59 pm »
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 ISW of +- 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.
 

Offline Falcon69Topic starter

  • Super Contributor
  • ***
  • Posts: 1482
  • Country: us
Re: Programming Arduino Pro Mini, TIG Pulse Add-On, missing some code
« Reply #19 on: November 27, 2018, 09:44:19 pm »
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.
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9890
  • Country: us
Re: Programming Arduino Pro Mini, TIG Pulse Add-On, missing some code
« Reply #20 on: November 27, 2018, 10:42:01 pm »
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.

You 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.

Quote
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.

Fair 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.html

Here 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.pdf

With 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.

 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9890
  • Country: us
Re: Programming Arduino Pro Mini, TIG Pulse Add-On, missing some code
« Reply #21 on: November 27, 2018, 10:43:37 pm »
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.

 

Offline Falcon69Topic starter

  • Super Contributor
  • ***
  • Posts: 1482
  • Country: us
Re: Programming Arduino Pro Mini, TIG Pulse Add-On, missing some code
« Reply #22 on: November 27, 2018, 11:01:05 pm »
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.
 

Offline Falcon69Topic starter

  • Super Contributor
  • ***
  • Posts: 1482
  • Country: us
Re: Programming Arduino Pro Mini, TIG Pulse Add-On, missing some code
« Reply #23 on: November 27, 2018, 11:10:59 pm »
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?
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9890
  • Country: us
Re: Programming Arduino Pro Mini, TIG Pulse Add-On, missing some code
« Reply #24 on: November 28, 2018, 02:04:11 am »
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:  SLOA097

I 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-3

http://www.ti.com/lit/an/sloa097/sloa097.pdf

The 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.
« Last Edit: November 28, 2018, 02:09:05 am by rstofer »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf