Mike R.
Email: admineverlast@everlastwelders.com
www.everlastgenerators.com
www.everlastwelders.com
877-755-9353 x203
M-F 12 - 7PM PST
FYI: PP50, PP80, IMIG-200, IMIG-250P, 210EXT and 255EXT.
Don't just add LEDs for buttons, it's important to have an LED or display to give you feedback it's working
I do a lot of projects with small micro controllers (you can't beat the price). I always have one LED letting me know where I am at (in the code). Throw it in the main loop or turn on interrupts and blink it. Worth it for me anyway, you can track down bugs faster when you can see. Simulators and emulators are nice, but that little LED can work magic.
Mike R.
Email: admineverlast@everlastwelders.com
www.everlastgenerators.com
www.everlastwelders.com
877-755-9353 x203
M-F 12 - 7PM PST
FYI: PP50, PP80, IMIG-200, IMIG-250P, 210EXT and 255EXT.
The Arduino includes a serial-to-USB interface--one of those layers of fluffy padding--so all of my debugging is done with prints to serial. Eventually, the project may get a screen, in which case that can show state without having to hook up to a computer. I am kind of hoping that I can get away without adding a screen, and just rely on dial position, but it is really nice to see the actual numerical value that the pot is mapping to in real-time.
Mike R.
Email: admineverlast@everlastwelders.com
www.everlastgenerators.com
www.everlastwelders.com
877-755-9353 x203
M-F 12 - 7PM PST
FYI: PP50, PP80, IMIG-200, IMIG-250P, 210EXT and 255EXT.
Nothing to show, but a small update anyway. I have integrated the analog mux chip into the code. It was actually shockingly easy, because there is a library out there for the chip that means you can use the exact same function call that you use to read from the Arduino's in-built pins. Instead of typing, "analogRead(pinNum)", you type "analogMux.analogRead(pinNum)", where analogMux is an object from the library that you have instantiated. Anyway, the upshot is that all I had to do was search-and-replace "analogRead" with "analogMux.analogRead" in the appropriate places, and I was good to go. Took like five minutes. It took longer to wire up the chip than it did to change the code.
BTW, speaking of wiring up the chip. This was my opportunity to learn what the difference between Vcc and Vee is. Both were labeled as "power supply" in the data sheet, so I hooked them both up to 5v. Whoops. Sorry. Vee is supposed to be ground in a 0-5v system, which meant I created a dead short between +5v and ground. The chips got hot, but I noticed that something wasn't right (bus voltage dropped from +5v to around +4v) and unplugged things before anything fried. Fortunately, I was feeding the chip straight off the Arduino's power rail, instead of off of a data pin. The power rail can supply up to, I think it is, 250 mA, while the individual data pins can only provide 40 mA. I blew the fuse in my multimeter measuring the current draw, so it was over 250 mA, but it wasn't enough to fry the Arduino, for which I'm glad.
I have been working on debugging the pulse algorithm, which, as you might expect, is taking some effort. Not extraordinary effort, but just figuring out all the places where things aren't working like I'm expecting them to. Now that I have the analog mux chip integrated, I can hook up all of the input pots and actually use them to twiddle with the parameters for the box, which is nice. Pretty soon, it will be time to start putting things on a board, in a box, and actually hooking up the real pedal and torch, instead of using a bread-board pot and switch.
One main thing outstanding is to test the feasibility of using a transistor to modulate a parallel resistor to simulate a digital pot. I bought some BJT transistors and am working out the wiring, but it's not as straightforward as I would have hoped. Someone suggested that a FET would be a better choice for my purposes, and as long as I was ordering more things, I ordered a couple analog switch ICs and some solid-state relay ICs too. I think the solid-state relay ICs will have too slow a switch time to use with the Arduino's PWM output (I think it's about 490 Hz on all but the Arduino Mega), but the FET and analog switch IC should have more than enough bandwidth to handle it. Meanwhile, I continue to poke at the BJT just on the principle of experimentation and learning.
You might think this is funny: I soldered the common leads of the pots to a bus connector and put pins on it, to make a jury-rigged connector that I could plug into a header on the board. This will allow me to take the faceplate of the box off if I need to get at the internals. When I soldered up the potentiometer leads, I accidentally wired all the pots up backwards, so that increasing output is counter-clockwise and decreasing output is clockwise. At this point, I have zero interest in rewiring them, and this is a protoype anyway, right, so who cares? Right?! Anyway, it's pretty amusing.
Here are a couple photos of the project as it currently stands.
The reason that there is a "pedal" button, in addition to 2T and 4T, is that I want to be able to leave the pedal plugged into the box and select welding mode purely through the box. The way the welder detects the pedal is that pins 6 and 7 in the connector are shorted together. This tells the welder that it should take its output from the pedal pot instead of the panel pot. So what I can do is put a relay or transistor between those pins and, if the box is powered up, I can connect those pins and the welder will take its output from the box. If the box is powered down, the pins open up and the welder works as if the pedal/box were not attached at all. Through the buttons on the box, I can choose between fixed-output 2T (2T button), pedal-controlled 2T (pedal button), and 4T (4T button--duh) operation without having to un-plug anything. I have considered putting two remote receptacles on the box and plugging in both the torch and the pedal at the same time, so that I never have to un-plug anything at all, but for now, I'm keeping things simple. Having both the torch and pedal plugged in at the same time would add some complexity to the code, and I don't think the benefit of not having to un-plug the pedal and plug in the torch, or vice versa, is worth it.
So if I want to stick weld, for example, I don't need to unplug the pedal or the box, I just power down the box and the welder registers the pedal as disconnected. Or if I am TIG welding and I want to do fixed-output 2T mode--for example, for tacking up or something, where I don't want to move the pedal around every time I move to do another tack--I don't have to unplug the pedal to give control back to the welder panel dial. I just hit "2T" mode and BAM it's done.
Last edited by joshuab; 09-04-2013 at 04:06 AM.
Sounds like it's coming along. No pictures, though. Don't forget to include the original intent of being able to have the pedal only give a limited current, with full travel.
Long arc, short arc, heliarc and in-the-dark!
Photos fixed. No worries on the max output setting. It's already implemented and working perfectly.
I'm pleased to report that the pulse algorithm appears to be working. I'm sure I'll discover more bugs as I continue with the testing, and especially as the pulse frequency is increased, but for now, it seems sound. I've attached a marked-up screen shot of my debug output, for you to ogle, if that's your thing.
The pulse parameters in the screen shot are pulse length = 2 seconds, pulse ratio = 50%, pulse balance = 75%. I chose a long pulse length so that I could easily watch the pulse algorithm play out in real time. The program is set to a max-output of 50%, so the foreground pulse is 50%, and the background pulse is 50% of that, or 25%. Since the pulse length is 2 seconds, a 75% balance results in 0.5 second foreground and 0.75 seconds background. I realize that may be backwards from how you expect it, but it would be trivial to reverse it.
For simplicity and speed in determining whether we should be in foreground or background pulse at any given time, I've made the pulse "windows" start on an integer multiple of the pulse length. So if the pulse length is 2 seconds, or 2000 milliseconds (or "millis" in Arduino parlance), the foreground pulse will always start at 2000, 4000, 6000, and so on. The background pulse will then start proportionally within that window. In this case, the balance is 75%, so the background pulse starts at 2500, 4500, 6500, and so on. In actuality, you'll see that the background pulse starts at 506 millis, not 500, because I didn't go to the trouble of dialing in exactly 500 millis on the potentiometer. You will also see that the "move" operations from foreground to background output and back again don't start exactly on the 2000, 4000, etc... milli boundary. That's because there is some code in between the beginning of the "swap" and the actual beginning of the moveOutput command, but are about 60-70 milliseconds late. The time it takes to run that code is the delay you see. Also, the program stopping to output debug information to the terminal creates a lot of delay that won't be there in the final program.
I'm really thrilled!
Last edited by joshuab; 09-04-2013 at 07:04 AM.
Another small update. Technique of using a digital switch fed by a PWM signal to cycle a parallel resistor in and out of circuit, thereby simulating a digital pot appears to work. Very good news. We are now at the point where there's no avoiding actually hooking the darn thing up to the welder and doing further testing. But I have to get it all transferred to perfboard and wire up the plugs for the pedal and the power switch and all that stuff. Soldering iron time!
How complex is the board?
I can fire up a schematic capture and PCB layout program and send you the files (eagle cad is great, free for non-commercial use). You can toner transfer from that (you would need a small drill bit .032" range, and some ferric chloride, and an iron; maybe do the perf board ). I did 2 boards today that way. More that a couple parts it is the only way to go.
Mike R.
Email: admineverlast@everlastwelders.com
www.everlastgenerators.com
www.everlastwelders.com
877-755-9353 x203
M-F 12 - 7PM PST
FYI: PP50, PP80, IMIG-200, IMIG-250P, 210EXT and 255EXT.
It's not that complicated, but I'm not confident enough that the design is final to do a PCB yet.
Everlast 200DX
Everlast PT185
Shoptask 3-in-1 (not currently in my garage, but I own it...)
Any day on a motorcycle like this that ends just needing parts and labor is a good day.
4.82, 158.67mph 1/8th mile 7.350, 200.35mph 1/4 mile
I like the pictures of that capture and such. Any more pictures from documenting along the way?
Jason
Everlast 255EXT - Perfection
Everlast PowerPro 256 - UPS Demolished
Everlast MTS200s
12 Ton Shop Press
DeWalt Hand Tools/ChopSaw
Mike R.
Email: admineverlast@everlastwelders.com
www.everlastgenerators.com
www.everlastwelders.com
877-755-9353 x203
M-F 12 - 7PM PST
FYI: PP50, PP80, IMIG-200, IMIG-250P, 210EXT and 255EXT.
Mike R.
Email: admineverlast@everlastwelders.com
www.everlastgenerators.com
www.everlastwelders.com
877-755-9353 x203
M-F 12 - 7PM PST
FYI: PP50, PP80, IMIG-200, IMIG-250P, 210EXT and 255EXT.
The main thing is get the hardware solid, so the amps swings all the way, good resolution, etc. Software can be flashed to fix bugs OR add features later.
Our new 255EXT has an Infineon MCU and can be flashed. Internal use only at this point. So having the MCU is a cool thing
Which Arduino did you use? I might go look at them if less than $20. My favorite toy right now is the Raspberry Pi, never did get a Beagle Bone Black.
Mike R.
Email: admineverlast@everlastwelders.com
www.everlastgenerators.com
www.everlastwelders.com
877-755-9353 x203
M-F 12 - 7PM PST
FYI: PP50, PP80, IMIG-200, IMIG-250P, 210EXT and 255EXT.
Currently, I'm working off the Uno R3, but that's just because it's the one that's recommended for first-time purchasers. Going forward, I intend to look closely at something like the DC Boarduino from Adafruit or the Arduino Pro Mini from Sparkfun. Both of these are really tiny, minimalistic units, that are more appropriate for integrated application vs. prototyping.
The Boarduino design uses a through-hole 328 chip, and is sold as a you-solder-it kit with a PCB. The interesting thing about it, to me, is that you could take the Eagle file (available from Adafruit) and incorporate it into your own PCB, then order the kit and solder the parts directly to your PCB. So your Arduino is 100% integrated into your PCB, vs. floating on top of it, plugged into headers. On the other hand, if one had the level of familiarity with electronics that you have, one could certainly design their own PCB around the base 328 chip. Take the 328 chip, pull out the inputs and outputs to solder pads, lay out a regulated power supply, and that's more or less it. But for only $20, it might be nice to have somebody else do the work for you and just ship you all the parts. If you bought a 328 chip with an Arduino bootloader, you could still take advantage of the Arduino development environment, such as being able to upload and download code via USB or FTDI without having to have a programmer (although, knowing you, you've already got a programmer!).
The Pro Mini, on the other hand, uses all surface-mount components, and is not sold as a kit, so it would have to be installed on headers. On the other hand, it's only $10, so kind of hard to go wrong there. I'm a little torn between them. The Pro Mini is nearly half the cost of the Boarduino, but the layout of its PCB is a little weird--they stuck three of the analog input solder pads like, right in the middle of the board. It's a silly thing to care about, but it bugs me.
For prototyping, the Boarduino is perfect, because it's designed to slot into a breadboard. Because of the Pro Mini's odd location of some of its analog inputs, you wouldn't have access to them if it was slotted into a breadboard. Maybe no big deal if you're comfortable with DACs and shift registers and muxes, oh my.
I have gotten tired of lugging around a breadboard and having wires and stuff falling out all over the place, so I have started wiring up the circuit on a perf-board. We went to my sister's wedding over the weekend, so this is the first time I have gotten back to the project since I verified that, at least in principle, the "analog switch + PWM signal + parallel resistors = digital potentiometer" solution would work. Well, I'm sorry to report that it won't work after all. The problem is that the internal resistance of the switch is about 180 Ohms (measured between the pins with the switch in the "open" state), and that seems to be enough resistance that the welder never gets to max output. For the time being, I think I'm going to just go back to direct PWM output, so that I can get some kind of an alpha product put together, but I need to leave room on the perf-board for any additional components I'll have to put in (resistors and such), so I'm tempted to try to solve the issue before moving forward.