Tuesday, January 27, 2009

Tested the controller

It has been quite a while since i have posted. Well i finally tested the spot welder controller about a week ago. It worked perfect the first time, no tinkering required. I have a great deal of control over the weld. For example i can weld two peices of 24awg stainless wire -Length-Wise-. Or i can burn a hole through two peices of 22gauge stainless sheet.

I am considering changing the power factor method. At the moment i simply wait for the zero crossing of the mains and then enable the current transformer and begin to count consecutive waves. This works, but it seems to be very peaky. If i evenly distribute the ratio to 1 second it should distribute the heat more evenly. At the same time this will give me the ability to specify another control parameter. I will be able to adjust the term of the of ratio so that i can fine tune the weld. 

I have no pictures at the moment. 

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.