Monday, November 3, 2008

Fixed cycle counting


It's been awhile since i have worked on the spot welder controller. I sat down tonight to fix the cycle counter hardware. I originally used two diodes and a resistor divider. This worked but it also added a great deal of phase shift to the signal. I replaced the diodes and resistor divider with a 100K resistor. After looking more closely at the attiny2313 data sheet i was reminded that the device has integrated clamping diodes. So i can simply use a voltage reference to fetch the signal as the diodes will clamp .5 on either side of the wave in respect to the supply. I also added a section that allows the adjustment of power cycles for the manual section of the controller.

The picture above is a screen shot of the fixed cycle counter and phase relationships. At this point i am ready to test the controller. I don't have time to test it right now so i hope to get that done tomorrow. I will probably test the controller as is on the bread board though i should build a complete board.

Sunday, October 19, 2008

Ratio Metric Power Factoring


I got around to building a power supply which would allow me to track the AC waveform. I have several uses for this wave. First i plan to use it to control the power factor to the spot welder. The concept here is to count every half wave. I can easily reconstruct a complete wave or a number of waves. This is interfaced with the host microcontroller via two diodes wired for full wave rectifcation. (not to be confused with full wave bridge). The DC side already has a full wave bridge. The reference point being ground, and the output of my full wave rectifier gives me a pulse for every 180 degrees of power.

In theory i should be able to fetch the zero power condition, ie.  0,180,360.  but the reality of my electronics thus so far is 20 degrees on either side of the wave. I need to work on the resistor divider section. I may end up using a summing amp so that i can offset the wave by 1.5v and limit the amplitude to a safe 5v.

As can be seen in the photo my code is doing what it is suppose to. However the hardware is not scaling the wave correctly. I have a small phase shift that is offsetting the zero cross detection. The high current transformer is very reactive when near saturation and it would not take kindly to an abrupt disruption in current flow. I don't want to see exactly what happens if i try to use it as is.

Before i attempt a test run i need to correct the phase shifting and offest the voltage in order to properly align the IRQ with the power wave.

Friday, October 10, 2008

Handpeice button naming


I replaced the shift register inside the handpeice and added some wire to test everything. The stick works just as expected. After talking with a good friend Matt, i found that the directional section is called the point of view. And of course the trigger (which i knew before hand).

The other three buttons still have no names as far as i can tell. I tried to find a user manual for the Gravis Blackhawk(which is what i believe the originally joystick to be) I had no luck finding a manual. So untill someone corrects my convention i will assume the below.

Up = Bit4

Down = Bit3

Left = Bit0

Right = Bit7

Trigger = Bit5

Select = Bit1

Start = Bit2

Manual = Bit6

Ok, see i named three of the buttons. They are Select,Start,Manual. These will be spot welder specific buttons. The exact use will be covered later. 

Now that have an input device that works as i expect i can begin to work on the menu subsystem and the spot welder base program.

Thursday, October 9, 2008

Finally got the shift registers


I got the shift registers today. After putting them away i assembled the test circuit which is listed below. My driver almost worked as it was written. I did verify that the shift register in the joystick was damaged. I then found a small bug in my driver, not really a problem with code but a problem with the concept. After looking at the data sheet a little closer i noticed that the eighth bit(H) was directly coupled to the output stage. Initially i assumed that all stages were symetrical in terms of clock relationship. 

Well, after noticing the problem i restructured the driver so that the clock pulse would occur after the data bit reading.

The driver works perfect. I need to replace the damaged shift register and fix some wires i managed to break in the process. After i get the stick assembled and verify that it still works i will be able to write some code to get this thing done.

Tuesday, September 30, 2008

Shift register test circuit


I wont have the shift registers for about a week. Here is a test circuit which serves as an example key interface. Note the two connections named Clock/Data and Shift/Load. These connect directly to the microcontroller's IO pins. All we need here are two pins. One of which is output only and the other I/O. Pin 10 of the shift register is connected to 5vdc. This effectively shifts logical ones through the circuit. This can help in the debug of the driver since the default state of the switch data is logical 1 via the pull up resistor network. Keep in mind that the device is negative true. That means that a zero bit indicates a button is being pressed. As mention earlier, this can be corrected by simply complimenting the value within the driver routine. This circuit can be easily expanded by wiring Qh of a lessor stage to SER of the greater stage. The resistor between Qh and the clock input must also be used on the last stage. If i recall correctly the highest bit is shifted out first.

Problems with joy stick electronics


I finally sat down the other night to interface the joystick. The joystick uses 4 wires. Namely they are 5vdc, Gnd, Shift/Load and Clock. The Clock line is also wired to Q out via current limit resistor. This effectively transforms the clock line input an I/O.  The operation is pretty strait forward here. Send a pulse on the Shift/Latch wire to latch the key data and the clock and read.  Every clock cycle also has a read cycle. When the clock reaches the positive level the I/O Pin of the MCU is changed to read mode. A small delay is used to ensure no noise it sampled. After this the pin is read, since the clock line is an input, and the Q pin is output passed through a current limit. We can clock and read the same pin at the expense of some additional current flowing through the Q data pin and the MCU output pin.

With a stable theory of operation i began to write a driver on the ATtiny2313. This did not take long at all. While testing the driver i thought i had found a bug. I was not getting direct powers of 2 for each button. I double and triple checked my code. I could not find anything to explain these results within my code base. At this point i started to suspect a problem with the hardware. So i held various buttons down in parallel and made mental notes of the make and break codes. At some point i discovered a bit position which masked another bit position - regardless of make and break status. Almost as if this bit had priority over the other bit.

 The circuit in the joy stick uses active pull up resistor networks. I suspected that one of the networks may be bad. After testing the circuit i found that all the resistor networks were good and all solder joints were good. There were no mechanical problems either. The only thing left is a very well hidden bug or the SN74HC165 is defective.

Looking at my code once again i still could not find anything that would cause this problem. I looked in my lab for some spare chips, but i have none. Since i don't have any, and i am writing the driver i should probably buy some for future use. At this point i still have not found a problem with the code. I will order the chips in a few days. I'm not sure how much will be done before i get the new chips. I like to work things one step at a time. 

This is a high speed Cmos device which are known to be static sensitive. I did not observe precautions during the disassembly or testing of the device. I also carried the device across the room in my home which has carpet. It is very likely that i damaged the device.

Monday, September 22, 2008

General thoughts for later use.

At this point i have a decent spot welder base. I plan to add a controller which will give me ratio-metric power factoring via mains cycle counting. All that means is that the controller will turn on the transformer for a given number of cycles. My research shows that anything between 15 and 45 cycles is
normal. So that will be one of the parameters. Hold time is also an important parameter. This is likely to be rated in cycles as well, not sure of the range yet but i suspect that it will be a factor of ten if not more when compared to the power cycles.

The controller will consist of some pretty basic electronics. There will be a main power switch that must be mechanical. The secondary power will be switched from the mains through the mechanical switch via a solid state relay. At this point i am undecided on the type of relay. Namely that is Zero Cross or Random. I'll put forth a little more research here. The controlling factors are peak load and reactance. All i have are 25 amp SSRs so i may need to find something a little tougher for this job.

Also, the large currents which flow through the upper vice-jaws are very likely to have a lot of electromagnetic leakage. EM provisions should be assumed between the joystick hand piece and the controller(if not the entire controller assembly)

The controller will be nothing more than a Atmel Attiny2313 flash Microcontroller. This particular controller has more than enough Sram and Flash program for this project. I plan to use a 4x20 led backlit character lcd module. Industry standard type hard wired in nibble mode. 

The joystick has 8 buttons. This should allow for easier menu navigation for setup and use of the spot welder controller. 

Button Functions we be:

(Menu Use)
Up
Down
Left
Right
Ok(trigger)

Program weld(trigger)
Manual Weld(Upper Trigger)

with two possible reserved buttons depending on how i interface to the internal 74165 parallel load serial shift register. It may be easier to drop a button so that exact serial bit positions can be known at all times.

The system will also need a fan to help cool the welding transformer. 

A side note here, it would be nice to find some sort of small load sensor that could be mounted below the joystick hand piece. Even if it were mechanical it would be better than nothing.

Sunday, September 21, 2008

Initial


I have needed a spot welder for some time now and finally did something about it. Well i have used spot welders in the past so i believed that i was fairly familiar with them. Well yesterday i found a need for a spot welder so i started thinking about building my own. At this point i realized that i did not know as much about a spot welder as i had thought. So i turned to the Internet looking for home made spot welders. I needed some ideas. Luck would have it that the first link i read had a picture of a microwave transformer. I didn't even read the article. I knew where this guy was going from that simple picture. It just so happens that i keep a stock pile of various microwave transformers laying around for projection found a few and sorted them by physical size. The next step was to remove the secondary coil. The first method was an angle grinder with cut off wheel. That worked somewhat until the wheel lost its workable range. Then i moved over to the Saws All. Looking around for blades i found that i broke all my metal blades and only had wood cutting blades. I tried the wood cutting blade which i suspected would cause more problems that it was worth. 

Well it did just that. So i had to go get some blades and while i was out i picked up 10' of 4awg grounding wire and 3/8 OD vinyl tubing. 4awg was the heaviest they had and none of it was insulated. I figured 3/8 OD tubing would be a good insulator. I got home and cut the rest of the coil off. Then i proceeded to push the copper wire into the 3/8 OD vinyl tubing. Working with my 5 year old daughter i was able to get about 6' pushed into the tubing. I cut the excess off and pushed it in the remaining tubing. At this point i knew it was going to be a pretty tough job winding this heavy wire in coils. I managed to get roughly 4 turns on the transformer which left a great deal of excess wire for tapping. I left a marginal amount of wire, probably 3 inches and cut the rest. At this point i decided to test this brute of transformer. I test the primary to verify it was infarct a good circuit. IE no open of short circuits. At the time if testing i thought "gee i hope this primary is good". With that in mind i recommend that you test things first. Should be common sense i know, sometimes i don't think. I got lucky since there were no problems with the primary. Then i test the secondary. My handhold meter was reading 0 which i suspected would happen. So i took the coil into my lab and tested it on a 4wire mode meter. The secondary measured .223~ ohm. All the information i had gathered suggested that the transformer would be of great avail. I plugged it in and tested the secondary. The handhold meter indicated 3.8 volts ac. 

This seemed to be adequate as the math suggested that i should have ~700 amps. At this point i took a piece of cut off 4awg wire and shorted the secondary. Well that made a tought thick spark and the transformer began to growl like most spot welders i was familiar with. At this point i was respectful of my new found knowledge. Even if i could not build the welder the day had turned out to be a success. To get an idea of what i was working with i attached my cat III clamp on current probe. Once again i shorted the secondary coil and this time noted the current. The meter read 750 amp. I also inspected the primary a rough count of turns yielded somewhere around 110 turns. I was not too worried about knowing the turns ratio at this point as i had lucked out on voltage and amperage. But to get an idea of input current i clamped the meter on the supply lines and once again shorted the secondary. The meter read 25 amp. All these numbers match each other in a round about way so i was not going to worry about potential problems.



Well now that i proved that i had a decent power supply for a spot welder i needed to find something to construct it on. After looking around all my parts i ended up with a piece of 2x6 and two peices of 2x2. Before this project i never liked the idea of using wood . I admit that wood is fairly easy to work with. I mounted the transformer to the 2x6 and the centerered the 2x2 in front of the transformer. This pretty much mimics a standard vice-jaw of the lower end spot welders. With the vice-jaw concept i looked around and found two 90degree angle frames. With this i could make a pivot point and a stationary jaw. The spot welder was moving along pretty fast at this point. I had a working transformer, a platform, and vice-jaws. Now i had to find a suitable electrode. After looking around i could not find anything.

At this point i got back on line to check out the original spot welder which gave me the idea of using a microwave transformer. Well, i found another good idea. Use copper tubing as the clamps. Initially i planned on using the rest of the 4awg wire and stapling it to the 2x2. But the copper tube approach made more sense to me at this point. So i looked around and found a piece of 3/8 copper tubing. I cut the tube to my desired length. Now i needed an electrode. I was racing through my mind trying to find a suitable electrode. The article i read used bolts as the electrodes. Being that i have experience using spot welders i know their electrodes wear out pretty fast. So using bolts did not fit my ideal spot welder concept. At that point i realized that i have 6awg. I knew that the diameter of 6awg was pretty close to normal spot welder electrodes so my nugget size should be fairly close as well.

Now i had all the parts to make the spot welder. All i had to do was figure out how to fasten the electrode to the copper tubing vice-jaws. I had to find something easy so that i could change the electrodes when needed. After looking around i came to the conclusion that a simple screw should thread in the end of the tubing. With this i could drill a perpendicular hole for the electrode to slip through. In theory the screw could be tightened to press against the electrode internally locking it in place. A found a screw that could thread into the 3/8 copper tubing. But the threads would not hold. Now i had to find another way. I was already set on the screw method so i used a smalled machine screw with a nut on the end. I then heated the copper and wedged the tubing until the nut would slip nicely inside the tubing. Then i crimped the tubing over the nut to lock it into place. This method was far support to the other and seemed like the winner. 

Now that i had the vice-jaw ready to go i sized it up with the 2x2's. The upper 2x2 is longer than the lower 2x2 to form a handle away from the electrode tip. Once again, i knew the electrodes got very hot on spot welders so i designed the jaws with this in mind. After sizing things up i determined that this particular electrode would work better on the lower vice-jaw. At this point i bend a 90degree into the tubing. This bend would allow me to affix the secondary coil output directly to the tubing. I drilled a hole in the lower 2x2 so that i could adjust the lower vice-jaw electrode. Then i mounted the lower vice-jaw using drywall screws. At this point my spot welder was starting to look like a crude spot welder. This in itself was a great motivational force.

Now all i had to do was build the upper vice-jaw and connect the vice-jaws to the secondary output. I went to get more 3/8 tubing and when i did i happened to notice a peice of 1/2 copper tubing. I knew at that point i had made a mistake using 3/8. By using 1/2 i would not have to heat and wedge the tubing. I could simply push the screw and nut into the tubing and crimp it. This saved a great deal of time. While crimping the vice-jaw i realized that the this particular vice-jaw would not be stationary. I had some welding cable that would solve that problem but i wasn't sure how i would affix the cable to the 4awg wire or the 1/2 tubing. After crimping the nut into the vice-jaw and drilling the hole for the electrode i had to size things up again.

Holding the upper vice-jaw and placing it in various ways it discovered that i had enough tubing to flatten the end of the tubing to form a relatively flat spatial domain. Flat domains are a lot easier to work with than polar. After flattening the tube i again realized that another flat section perpendicular to the end would give me the ability to bend two 90degree in very short distance of one another. This would effectively provide a double back,a flat plane for mounting and ease of upper vice-jaw adjustment. So i did just that. I flattened the end, then flattened the perpendicular plane and bend the angles. Sizing things up once again, my spot welder was starting to look very impressive. To find the interception of upper and lower vice-jaw electrodes i simply pressed the upper 2x2 onto the lower vice-jaw which had an electrode in it. This left an easy to see mark.

At this point i could see the end which gave me even more motivation to finish this project without rest. All i had to do was mount the upper vice-jaw and connect the secondaries. So i mounted the upper vice-jaw using drywall screws just as before. Then i affixed the secondary to the lower vice-jaw, crimped the connection and soldered it. Even though there is a possibility that the vice-jaws will conductor enough heat to melt the solder, i figured it was better than a crimp alone. Now all i had to do was mount the welding cable and give it a test run. I cut a length of cable and sized it up for insulation removal. After stripping the insulation i initially planned on dipping the cable in my solder pot and trying to form another peice of flat material. I turned on the pot and while i waited for it to heat i looked around at all the pieces left over trying to extract some more ideas. 

It was then that i realized that i could take the piece of 1/2 cut off and since Once inside all i had to do was flatten it. This would give me two very good flat spaces to mate. Simply drill two holes and bolt the conductors together. At this point the idea of using solder was gone so i shut off the solder pot. It wasn't even hot yet. I placed the welding wire inside the 1/2 tube like i had thought and flattened it in a hand vice. Everything was looking great so sized things up once more time to be sure i was not making any mistakes. I suspected that a curl in the welding cable may take enough of the flexing stress. After playing with various wire mounting positions i discovered that the curl was not the best way to go. A loose loop had a lot less stress that did a tight curl. I drilled the holes in the vice-jaw mounting plane and in the flattened the plane on the welding wire. Then i affixed the assembled using machine screws and nuts. This made a very good tight connection. Not likely to be a resistance problem. 

All that was left was to affix the cable to remaining secondary conductor. I though i might use the same crimp idea here has with the lower vice-jaw. But after inspecting things i discovered that this was not going to work out to well. I needed another method. While pondering how i could affix this i removed some of the excess vinyl tubing from the 4awg wire and lined things up nicely. That is when i realized that i could simply use two hose clamps. I found two 3/4 hose clamps that looked like they would work. A little over sized but they did the trick. 

Now the spot welder was complete. I blew off all the various metal shavings and saw dust to step back and consider what i had made. This was in fact a spot welder. And it turned out pretty well if i do say so myself. A took a moment to enjoy the pride which comes along with any good project. Then i found some scrap metal to test out.

What i had was very rough spot welder that should work. I knew that i would need a controller and put this problem to the side. Right now all i am interested in is testing out my new toy. I placed the metal in the jaws and plugged the main supply in for a very short period of time. 1-2 seconds perhaps. The welder sparked, and hummed with a subtle growl that indicated that it was intact a spot welder. This was an awesome moment indeed. Nothing particularly special about anything that i have done except that i had done it myself. You don't get this type of feeling by handing over hundreds of dollars and opening a box.

After tinkering a bit i noticed the welding characteristics were very crude. Not that of which i was accustom too with the manufactured welders. After all, they have controllers of which i knew very little about. So i put my welder to the side and began to search for spot welding settings, characteristics, and theory. I find a lot of very useful information. I had everything from operating theory through reading the nuggets down to problem solving. I set out to test this new set of knowledge. This time i had a completely different frame of mind in using the welder. I knew the theory now and with that i performed another weld. This weld was incredible. The nugget was almost perfect(as perfect as can be expected for rough cut electrodes). The heat range was good and the strength was amazing. I could not break this weld. My other welds were hit and miss. Some would hold, some would break with the first flex. 

Now i knew i had a great welder. All i had to do was build a controller for it. Being that i understood the theory as well as operational settings i know i can build a very good welder indeed.