You could use a DAC but I think you are right to just go with an E2POT. Since you mentioned that you are fighting pin count, maybe it would be best to go with an I2C bus for that as well as your ADC inputs.
Long arc, short arc, heliarc and in-the-dark!
Sorry to say, the forum ate my post, so now you get the short version:
1) EPOT no bueno. Can't find one that actually meets my specs, specifically the necessary impedance. Basically, they only come in 10k, 50k, and 100k impedance. Yes, there are some others, but they have other problems that are deal-breakers.
2) DAC: I hadn't thought that they would work because, to achieve galvanic isolation, I would need one that could run off the 2.7 volts the welder is supplying on pin 5, but actually it turns out that those exist. Mildly annoying that they're SOT23 form factor, so I would need a breakout. Also would cost me an additional digital output pin to run I2C, but altogether not out of the question. Will keep it in mind. Only problem would be if I wanted to transition the circuit to a welder with a signal voltage of < 2.7 volts or > 5 volts, then the DAC would be sad.
3) My current approach is to build the attached circuit. Easy galvanic isolation. Works exactly like a PWM-controlled potentiometer. Only challenge is to design a filter such that the PWM signal is eliminated while not producing excessive ripple. Given that there are as many as three orders of magnitude between the PWM signal (max frequency about 32 kHz) and my desired signal (pulse rate 30 Hz), I think this should really be doable. Only challenge there is the maximum bandwidth of the optical isolators. PWM frequency cannot exceed that. Still, I think a middle ground can probably be found.
That circuit will still be overlaid with your PWM switching frequency. Filtering it out from that type of voltage divider will not be as easy to still keep your pulses somewhat crisp. I would say you might be up to a 3rd or 4th order lowpass filter, to get something clean. I can't remember if your pedal was the 22K version or the more standard 47K version. If it's the 47K, a 50K E2POT with 100 steps ought to work fine. I believe Mike or Mark mentioned that the SSC pedal for Everlast uses a 50K pot, as well.
Long arc, short arc, heliarc and in-the-dark!
Sorry to say it's the 22k pot. I'm half tempted to just crank the PWM frequency and let the opto-isolators' rolloff do the filtering. The Arduino can do... I don't remember the max, but it's like 32 or 64 kHz PWM I think. If I need to, I can get a high bandwidth isolator with a built in amp, but they're expensive.
Well with a little code and the right circuit you could cascade two 10K pots, for a 20K or parallel two 50K for a 25K. I would think either would be close enough for what you are doing. The opto-couplers will still let through frequencies higher than what I think you want. but give it a go. Have you got a scope to see what is going on? At the frequencies you are using, even a PC soundcard based O-scope program might be adequate.
Long arc, short arc, heliarc and in-the-dark!
You're right. It's just not the direction I've gone. I still have hopes of being able to run the pot with a single output line. There is a lot to be said, though, for a stable output (vs. PWM). One thing that could help is, the Arduino uses digital pins 0/1 for its serial output, so you can't use them at the same time that you're using serial for debugging. But after you're done debugging, or if you're not using serial, they're fair game. So I could use those two pins for I2C interface to a digital pot (assuming I can find one, vs. SPI), and then have a preprocessor directive that just turns off the actual output if I'm using serial to debug.
Ah, but the challenge there is that with I2C, you send an address byte and a a data byte for every command. So that's 16 bits per sample. Which means I would have to drop my sampling rate way down to bring it to a level that the optical couplers could handle. Whereas if I'm sending a PWM signal through the optical couplers, I can potentially just blast away and not care about the frequency rolloff, because the HF signal doesn't really matter anyway.
There are so many different approaches to solving this problem, and so many different pro's and con's of each one, that it's pretty difficult to just name one as the "best".
Sure, sure. So fine, add a low-pass filter with a 100 Hz cutoff frequency after the optical couplers' rolloff. I guess all I'm saying is, the frequency response of the optical couplers seems like it's just going to help me, unless the rolloff in the upper frequencies causes undesirable corruption of the LF component. Still, intuitively, it seems like if the -3 dB point of the optical couplers is around 4 kHz, and my desired signal is around 1-3 kHz, and my PWM signal is up at 32 kHz... seems like things should be fine.The opto-couplers will still let through frequencies higher than what I think you want. but give it a go.
I don't have a scope, no. I've heard of using a soundcard-based scope, although I don't have the hardware to build the interface circuit.Have you got a scope to see what is going on? At the frequencies you are using, even a PC soundcard based O-scope program might be adequate.
While I'm waiting for parts to come, to re-build the welder interface circuit, I did a little more development on the software. I implemented non-linear pedal travel. Basically, it works like this: normally, you have a 1-to-1 mapping of pedal travel to welder output. 50% pedal = 50% welder output, and so forth. But if you think about the way you really use the pedal, let's say you are welding at 150 amps: how much time do you actually spend down at 100 amps or less? Well, the exact threshold may vary somewhat, but you get the point. You're going to start up your arc at some low amperage, and then as soon as the arc starts, you're going to blast on up to your working amperage range and start welding.
Let's say for example that you're going to spend most of your time welding in the upper 25% of your welder's range. So, to keep the math simple, if you've got your output (full pedal) set at 100 amps, you're going to be working somewhere between 75 and 100 amps, mostly. So what if we made the pedal jump from 0 to 75 amps in the first 25% or so of its travel, leaving you with a full 3/4 of the pedal's travel to modulate your working amperage range?
Think about the effect on resolution. You get 75 amps / 25% of travel, or 3 amps per % in the first 25% of the pedal's travel. Then, in the remaining 75% of the pedal's travel, you get 25 amps / 75% of travel, or 0.33 amps per % of travel. MUCH FINER CONTROL! This seems pretty huge. If you want to back off just five amps or so with a regular pedal, you need to back off just 5% of the pedal's travel. With this setup, you back off 15%. Your range of motion is three times as big, and therefore your error is 1/3 as big, and your ability to hit the amperage you're shooting for is tripled.
I have been thinking about this feature for a while, but until I put my foot on the pedal and actually watched the numbers change, it didn't really hit home. As soon as I actually put my foot on the pedal, I realized how huge this could be. At first, I set the cutoff threshold to be 75% of welder output over 35% of pedal travel. I didn't want to make the "fast-up" portion of the pedal's travel so small that you couldn't gradually bring the arc up to welding amps in a controlled way. Immediately, I realized that 35% was way too much. Even with just 25% of the welder's travel dedicated to the "fast-up" portion of the travel, it's easy to ramp the output in a controlled way. And then you hit that big, wide plateau, and you're just cruising along, making these sweeping motions with your foot. It's like a diopter for your pedal!
Anyway, here is a video semi-demonstrating the feature at work. The Box is missing its welder interface circuitry for right now, because I'm waiting on parts to fix some issues that came up when I welded with it for the first time, but the video shows output on a computer screen, anyway, and maybe you will get a feel for how it might work.
I got around to building and testing the "digital potentiometer" circuit that I posted a couple posts back. This is the closest I've come so far to getting the performance that I want. I ended up using a capacitor value of 100 nF, which when combined with an 11k resistor, gives a cutoff frequency of 144 Hz. I expected that, the higher the PWM frequency I used, the better filtering I would get, but I couldn't predict the effect of exceeding the cutoff frequency of the optoisolators.
What I found was that, at PWM frequency 31 kHz (divisor = 1), there was almost no resolution at the top or bottom of the welder's output range. The welder basically stayed at zero until about halfway through the pedal's travel, then the welder jumped to about 45 amps, scrolled quickly through about 55, then jumped to 96 amps (100% output) and stayed there.
At PWM frequency 3.9 kHz, I was able to achieve sub 1-amp output over almost the welder's entire range, but the output skipped from about 80 amps straight to 96 amps.
Best results were obtained at PWM frequency 1 kHz. Output still skipped from about 85 amps straight to 96 amps, but response was excellent throughout the rest of the pedal's travel. Performance was worse with fast-PWM compared to phase-correct PWM.
At lower PWM frequencies, the welder did not register the signal properly, most likely due to lack of smoothing.
I'm guessing that the "skipping" of the welder's output at high PWM frequencies may be due to the cutoff frequency of the optoisolators. At very low PWM values, the signal turns on/off very fast, and likewise at very high PWM values. Perhaps the optoisolator is not achieving full on/off state and is simply misisng the pulses? Whereas in the middle of the range, the rising and falling edges of the signal are most evenly spaced, so the optoisolator is given the biggest window to turn fully on/off.
Or, heck... maybe some other dynamic is occurring entirely. I'm not sure what direction to go from here. I really want to see proper full-range output. One direction to go would be high-speed optoisolators, but that would run about $8 each, and I would need two.
Last edited by joshuab; 09-26-2013 at 04:30 AM.
Can you dynamically change things (freq.) on the fly to fix the skip issue? What Digital pot did you go with?
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.
I can, but it won't address the issue. The lowest PWM frequency that is still smoothed enough to be read by the welder still has the "skip" issue. And I want to keep the PWM frequency high enough to implement pulsing. I have some suggestions to help improve the responsiveness of the optoisolators and I'm going to continue to explore.
None. I used the circuit attached to post #123.What Digital pot did you go with?
If you go back to the pot idea 47K pot and 47K R across will get you 23K range.
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.
Not much to see here, folks. I am doing some work on the circuit that interfaces The Box with the welder, to try to get better performance. I've ordered a nice aluminum enclosure and will be transferring the buttons and such over to it. I've also ordered some spring-loaded terminal blocks, so that I can connect the front panel, the welder cable, and the pedal jack up to the board without having to solder. This will allow me to separate these connections from the main-board if I want to, or easily replace a broken wire, or what-have-you.
While I have time to kill, I've also been working on building up a schematic for the project, and playing around with converting it to PCB. Some of y'all will get a kick out of this:
It's my first PCB, so go easy! I'm sure it leaves a lot of room to improve. BTW, this does NOT include the welder interface circuit, so it's incomplete. Just playing around with PCB layout is all.
If you are really planning on making a PCB for this, you might as well just get the bare AVR chip for it. By doing that you can also get one with enough ADCs to handle your project. Something like the 20MHz ATMEGA328P-PN. You can get them with the Arduino bootloader pre-programmed, so you don't need a stand alone programmer. And if you feel like going SMD you can up your pin count so you have plenty of I/O. Terminal blocks or even just pin headers are a good idea, for sure. It's always a pain to have a board hard wired to the front panel. I try to remember to cannibalize all the nice plugs and headers from any electronic junk, like old PCs, before I toss them.
Long arc, short arc, heliarc and in-the-dark!
What capture software are you using? And I agree on the bare chips as well.
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.
Using DipTrace. I tried Eagle, but gosh it's really clunky to use. I still have Eagle installed, because DipTrace comes with an Eagle script that exports to a format that DipTrace can import, and darn near anything is available as an Eagle file.
I agree about the bare chips. For now, I'm using the Boarduino on headers because I'm sure my first Rev of the board won't be my last, and I want to be able to reuse components easily. What I'd love to do is just drop the existing PCB for the board into my design. I have the file, after all... It may be worthwhile to go with one of the SMD based Arduinos, like the Pro Mini, and just use its PCB like a breakout board. You can get Pro Minis off eBay from China for like $5 a piece. The Boarduino is based on a through hole chip, so it takes more space, but could easily be integrated directly into my PCB. The kit is $17 with PCB, and I don't know if it's even sold without, but it'd be easy to buy the components separately. Lots of options...
DipTrace is way better than Eagle for sure, you might also look at KiCAD, it's open source and has a number of nice features. Word is that there will soon be a free or low cost version of Altium Designer, too. For something that simple, hand soldering SMDs are pretty easy as well. Especially if you are going to spin up your own board design, as you can tweak the footprints like a Schmartboard.
Long arc, short arc, heliarc and in-the-dark!
My very-brief impression of KiCAD is that it's still up-and-coming, and some important features have yet to be developed fully. However, the minute I start running into the free version of DipTrace's limits, I'm going to think hard about other options. I think free DipTrace is limited to 300 pins total, which is plenty for my project, but when I dropped the Boarduino PCB into the project, and then accidentally clicked twice to drop a second one in, that exceeded the limit. And the Boarduino isn't particularly pin-heavy.
What's y'all's opinion on autorouters? I tried routing the board by hand, but about a quarter of the way through, I ran into a situation where I had painted myself into a corner and couldn't reach a pin, even with vias.
Last edited by joshuab; 09-30-2013 at 05:00 PM.
Autorouters are mostly bogus, unless you have a real standard design and have populated all the design rules. For an 8 layer board they are worth the trouble to configure, but not for something like a two layer. Routing is as much art as science. When looking at your first board I was thinking that you could have probably gone with a single layer, if you played with it some more. It does take time, but after a while you will begin to see patterns and find it gets easier. Look at other designs for inspiration.
Long arc, short arc, heliarc and in-the-dark!