MICROPROCESSOR CONTROL OF WELDING APPARATUS

Abstract: Stick and stud welding apparatus which utilizes a microprocessor (30) and related, RAMs (32) ROMs (33) and peripheral interface devices (3 1, 32, 35) to control the welding parameters. The ideal desired weld current and weld cycles in the case of stud welding can be selected depending upon the mode of operation and/or stud conditions. The program for the microprocessor instructs the microprocessor to periodically compare the actual welding current to the ideal current, compute the difference and alter the phase firing time of an SCR bridge to compensate or adjust the welding current to the ideal current. In the case of stud welding mode, the program further instructs the microprocessor to reference the selected number of cycles, compute the total energy delivered across the stud and workpiece gap from actual current, welding terminal voltage and time and enlarge the number of actual weld cycles to a given percentage of that initially selected to provide a total energy input to the stud as selected. In the stud mode, the pilot arc current and cycles may likewise be selected and controlled. Such parameters as pilot arc current, pilot arc cycles, main welding current, main welding current cycles, total energy, welding terminal voltage and error occurrence are displayed visually by means of lights (28) and/or written printout (29).

Description: Description MICROPROCESSOR CONTROL OF WELDING APPARATUS Technical Field The present invention applies to welding apparatus and, more specifically, to means and apparatus for con¬ trolling welding current in a stick and/or stud welding apparatus utilizing a microprocessor and associated peripheral devices. Background Art In stick welding apparatus, it is extremely important that the welding current be regulated within very close approximation of an ideal current for any given specific welding application. Likewise, in stud welding apparatus, it is important not only that the weld current for a given size of stud be maintained extremely close to a given desired current but it is also important that the total energy generated by the arc very closely equal an ideal predetermined value. The total energy in stud welding is the product of the weld current, voltage and time that the weld current is on. Historically in the very early beginning of welding of the type of stick welding and stud welding, welding current was controlled by such devices as a saturable reactor. " Variation in the input to the reactor windings would control output from the transformer and thus the welding current. In the case of stud welding, this un¬ regulated but variable current applied over a given time was the only means of controlling total energy. Addition¬ ally, such devices were used as a fixed power supply to- gether with a plurality of different resistors in series with the power supply, one of which would be chcsen by plugging into an output terminal associated with that resistor as the means of selecting output current. This latter method while selectible was unregulated during the welding operation whether in stick mode or in stud mode in which a timed function for initiating and terminating the weld was also utilized. In subsequent welding apparatus and particularly stud welding apparatus, attempts were made to regulate the total welding energy. Devices of this type would utilize a rectified AC input and a variable timer to initiate and terminate the welding cycle. A transformer winding associated with the power supply could provide a signal indicative of the welding current which would be applied to an R-C network which would adjust the variable timer in accordance with the the level of welding current to terminate the welding cycle in some approximation of when the desired total energy had been reached. In more modern and improved stick and stud welding controllers, an analog approach to welding current regu¬ lation has been utilized. In these devices, an AC power supply is utilized through an SCR bridge to provide the welding current. Devices such as operational amplifiers operating in conjunction with means to generate a refer¬ ence signal indicative of the level of welding current and a reference indicative of the desired current level are utilized to control phase firing of the SCR≤ in an effort to achieve the desired welding current level. Welding current controllers of this type used in arc stud welding operate only for a fixed time and do net have the capability of total weld energy computation. The prior art devices including the analog devices have many disadvantages and drawbacks. The analog devices, while an improvement over the devices preceding them, are not as accurate as desired. Analog devices are temperature sensitive and this is one of the major prob- lems affecting their accuracy. Additionally, vide °'--?I variations in range are difficult to compensate for and handle in analog devices. In arc stud welding, current ranges are from as low as 50 amps to as high as 2,000 amps. Accuracy in controlling the exact total energy in the weld and particularly in stud welding is becoming extremely important. In such industries as the nuclear power industry it is critical. The welding controllers of the prior art also are generally inflexible. None of the arc stud welding con- trollers heretofore known have any appreciable regulation or control of the pilot arc. The controllers heretofore essentially only regulate current and do not attempt to compute and, in the case of stud welding, control the total energy input to the stud welding operation. The prior art controllers likewise have no capability of altering or generally varying the welding current wave form to different significant values at given predeter¬ mined points throughout the welding cycle. Other matters of inflexibility concerning analog con- trollers and other controllers heretofore known is their inability to store the parameters affecting a weld in a given weld cycle such as output current, number of cycles, voltage, total energy and the like. Additionally, none of the controllers heretofore known provide any visual readout of all of these parameters nor do they provide a permanent record such as a printout of these various parameters. In the case of such industries as the nuclear power energy, a printout of each weld is extremely desirable. The welding controllers heretofore known for stick and particularly for stud welding and especially the analog controllers are not cost effective. To modify or add to those devices heretofore known to provide all of the features described above would be extremely difficult, cumbersome and expensive if not totally unfeasible. OMPI Afa λVIrO -ά - Disclosure of Invention It is an object of the present invention to overcome the disadvantages of the stick and stud welding control¬ lers as hereinbefore described. It is a further object of the present invention to provide a stick and stud welding controller providing great accuracy and flexibility by the utilization of a microprocessor system which, through appropriate inter¬ face devices, senses the actual welding cycle parameters and appropriately computes and alters the weld cycle in accordance with desired and preselected ideal parameters. The stick and stud welding controller of the present invention carries out the foregoing objects by the utili¬ zation of a microprocessor system which includes, inter alia, ROM memory, RAM memory, and peripheral interface adapters communicating with various input and output devices as hereafter described. 'The main welding current is supplied by means of a three phase input current which is regulated through a phase fired SCR bridge to provide the output welding current. Welding current is sensed by means of welding current transformers associated with the output of the SCR bridge. The welding current signals together with the welding terminal voltage and phase rotation are provided to the microprocessor system as digital representations of these variables or parameters by means of an analog to digital converter. The welding controller system is capable of con¬ trolling welding current for stick welding and for stud welding. The system includes two sets of thumbwheels into which the number of weld cycles can be selected and placed as well as the welding current for both the pilot arc and main welding current or, in the case of stick welding, the welding current alone. The welding controller also in- eludes a switch for selecting the stick or stud welding 0_,iPI ode as well as switches to permit the variables set in the thumbwheels to be registered either as main welding current parameters or pilot arc parameters. Additionally, a visual display is provided together with a display select switch to select the various parameters desired to be displayed. A mechanical printer is also provided which prints out all of the welding parameters calculated and stored by the microprocessor. Appropriate input out¬ put devices are employed to facilitate interfacing of the foregoing devices to and from the microprocessor system. In the stick mode of operation, the stick mode switch is set and the appropriate welding current level selected in the current thumbwheels. This information is auto¬ matically stored in the memory of the microprocessor system. During welding the microprocessor continuously monitors the welding current and compares this current to the ideal current set in the thumbwheels. The difference between the actual and ideal current is calculated and used in conjunction with a lookup table to calculate the change in phase angle firing of the SCRs necessary to bring the actual welding current into conformity with the ideal welding current selected. The welding current controller, when in the stud weld¬ ing mode, will have set in the thumbwheels the desired number of cycles for the pilot arc and the desired current for the pilot arc. The pilot arc switch is selected which will then store these values into the microprocessor system's memory. Thereafter, the desired or ideal weld¬ ing current cycles and welding current current value is selected and stored in the memory of the microprocessor system. Upon initiation of the welding cycle, the micro¬ processor system will select an initial SCR phase angle firing from memory for the pilot arc. Thereafter, the actual pilot arc current will be computed and compared to the pilot arc current selected and the necessary phase angle correction computed and applied to the SCRs to bring the pilot arc current into regulation equal to that selected. The microprocessor system will reference the desired number of pilot arc cycles and continue the pilot arc for that number of cycles. Near the completion of the pilot arc sequence, the current level in the pilot arc is sensed to determine if it is at a necessary mini¬ mum. If it is not, the pilot arc sequence is aborted and reinitiated a specified number of times. Otherwise, the main welding current sequence is then initiated. The regulation of the main welding current is the same as the pilot arc. At the end of the main welding current cycle, the microprocessor will have computed and stored the various welding parameters such as current, number of cycles, welding voltage, total energy, and will also have computed such values as the percent of devia¬ tion of the number of actual cycles required to achieve the total energy versus the desired number of cycles. Based upon these calculations, various error signals will be displayed and, depending upon the nature of the error signal, the condition of the equipment altered from dis¬ playing the error signal to total shutdown of the equipment. At the end of the weld cycle, the operator may choose and have displayed on an illuminated display any of the parameters calculated and stored in the microprocessor system such as the welding terminal voltage, welding current, total energy, number of weld cycles, both for the pilot arc welding sequence and the main welding sequence. Additionally, a mechanical printer is interfaced with the welding controller which, when in the stud welding mode, will for each weld print out all of the foregoing param- aters for a permanent record. Other objects and advantages of the present invention OMPI will become apparent to those skilled in the art from the detailed description thereof which follows in conjunction with the drawings. Brief Description of Drawings Figures 1 and 2, when consolidated, provide a com¬ plete block diagram of the stick/stud welding controller of the present invention; Figures 3-13 are schematic diagrams of the compo¬ nents set forth in the block diagram of Figures 1 and 2 together with the interconnections between the respective components and the logic devices therebetween; Figures 14-37 are logic flow diagrams upon which the microprocessor program is based for the particular main routine, subroutine or interrupt service routine as labeled bn the flow chart; and Figure 38 is a timing diagram illustrating the re¬ lationship of the weld cycles to the phase angle firing timing and adjustments. Best Mode for Carrying Out the Invention I. Functional Block Diagram Figures 1 and 2 A functional block diagram of the stick/stud welding controller of the present invention is shown in Figures 1 and 2 of the drawings. A table of components is set out in section V entitled "Charts" and reference to the table can be made for the component designation and manufacturer of the various components in the block diagram to be described hereinafter. Figures 1 and 2 illustrate only the functional block diagram of the microprocessor system and the input output peripheral devices. The remainder of the welding system which is controlled by the invention and which is of a conventional nature has not been shown inasmuch as it is not believed necessary to an understanding of the C-.JΓI invention. The components in the remainder of the stud welding system include such standard configurations of component assemblies as the stud welding gun and its in¬ cluded lift solenoid and trigger, a secondary power supply and control circuitry for operation of the gun solenoid and associated equipment and a three phase power supply including the associated transformers and a six SCR bridge together with associated welding cables and welding cable line inductor. This equipment to which the present invention applies is of a standard and conven¬ tional nature as heretofore known. Referring to Figures 1 and 2, and particularly the insert appearing in Figure 1, each of the three output lines from the welding transformer includes a current transformer 10 which is tied into a bridge 11 to provide a signal which will be representative of the current flowing in each of the phases of the transformer. This input signal is applied to the welding controller of the present invention as shown in Figures 1 and 2 by means of the two input lines 12 shown on the right-hand side of Figure 2. Other inputs from the standard welding compo¬ nents to the welding controller and as shown on the right- hand side of Figure 2 and whose function will be described in more detail hereinafter, are the line pair 13 indi- eating closing of the trigger switch; line pair 14 indi¬ cating the welding cable for the stud welding gun is inserted in the proper receptacle for stud welding, line pair 15 across the weld terminals providing the controller with weld terminal voltage and three lines 16 connected across the three phase input to the welding power supply. As shown in Figure 2, outputs from the welding con¬ troller of the present invention to the standard welding components heretofore described include twelve lines 17 constituting six line pairs to each of the SCR gates for phase firing. Additionally, a gun solenoid energize- deenergize line pair 18 serves to energize and deenergize the gun solenoid. Lastly, an override line pair 19 is wired to the main welding power supply circuit breaker to deenergize the breaker totally shutting down the welding power supply and welding controller upon energization of the line pair all as will be described hereinafter. Shown at the upper portion of Figures 1 and 2 of the drawings are several peripherals to which the micropro¬ cessing system of the present invention communicates. These peripherals include a display select thumbwheel 20 which will output a binary coded decimal signal indicative of the nature of information to be displayed in an illum¬ inated display 28 which consists of four seven segment light emitting diodes. The peripherals include a three thumbwheel selector 21 into which the number of cycles may be selected for either pilot arc or welding current and a four thumbwheel selector 22 into which the pilot arc current or main welding current can be selected. These selectors 21 and 22 likewise provide a binary coded decimal output. A selector switch 23 is provided which provides a binary output indicative of the selection of either stick or stud mode. A lift check switch 24 is provided which provides an output signal indicative of having chosen the mode for checking the lift of the gun solenoid or not as the case may be. A lockup key switch 25 is provided which is a switch operable by a key under control of the operator and/or supervisor as desired. The switch provides three separate binary outputs depending upon the position setting. The three outputs are for "access"; "set" and "lockup". A second switch entitled pilot arc key switch 26 is provided which likewise utilizes the same key as for the lockup key switch and may be in the possession of the operator or the supervisor as desired. The pilot arc key switch provides a two state output one for "access" and one for "set". The lockup key switch and the pilot arc key switch, as will be described in more detail hereinafter, provides binary signals which are utilized in the logic of the microprocessor system to set and store the pilot arc and weld current parameters for both the number of cycles and current. When both switches are in the "access" mode, then the settings set the the thumbwheels 21 and 22 for number of cycles and current respectively will be stored as the parameters for the pilot arc. When the pilot arc switch is moved to "set" and the lockup key switch is set to "access", then the settings in the thumbwheels 21 and 22 will set the number of cycles and main welding current parameters which will be stored in the processing system. In this configuration, whenever the thumbwheels 21 and 22 are changed, .the parameters will automatically be changed in memory for the number of cycles and current for the main welding cycles. When the lockup key switch is moved to the "set" position, those values in the thumbwheels 21 and 22 will be set in memory and subsequent changing of these wheels will not affect the setting theretofore stored. Lastly, when the key switch for the lockup key switch 25 is in the "lockup" position, the logic will permit the welding con¬ troller to disenable the controller upon the occurrence of certain error conditions as hereinafter described. A trigger optical isolator 27 is provided which senses the closing of the trigger at the stud welding gun and provides an output signal for the microprocessor system which is optically isolated from the stud welding gun itself. Lastly, a mechanical printer 29 which provides a paper tape printout of the parameters measured and cal¬ culated during the weld cycle is provided to provide the operators with a permanent record of each weld. The welding controller includes a microprocessor 30 which basically includes eight data lines, sixteen address lines of which eleven are used in the present configuration, an interrupt request line and control lines of which three are used in the configuration of the present invention. Reference should be made to Figure 5 for a more detailed microprocessor pin connection detail. The microprocessor utilized is a Motorola 6802 microprocessor. The microprocessor communicates with a versatile interface adapter (VIA) 31 which is manufactured by Synertek as number SY6522. The VIA includes two 8-bit bidirectional I/O ports, two 16-bit programmable timer/ counters and serial data port, among other features. The VIA is the device through which the microprocessor com- municates with the welding components heretofore described and as will be described in more detail hereinafter. Reference should be made to Figure 9 for the pin detail connections for the VIA. The microprocessor 30 also communicates with a com- bination RAM, I/O, timer, array (RIOT) 32. The RIOT is manufactured by Synertek as model No. SY6532. This device is comprised of a 128 x 8 static RAM, two software con¬ trolled 8-bit bidirectional data ports allowing direct interfacing between the microprocessor unit and peri- pheral devices, a software programmable interval timer and interrupt circuit capabilities. The pin connection details for the RIOT device 32 are shown in Figure 7 of the drawings. The microprocessor 30 receives its instructions from ROM memory 33. The ROM memory consists of six K of memory made up of three number 2716 ROM memory devices. The memory device pin connection details are shown in Figure 6 of the drawings. The microprocessor 30 also communicates through an address decoder array 34 to the RIOT 32 and to an analog to digital converter 35 to be described hereinafter as well as the VIA 31. The details of the address decoder array components and logic are shown in Figure 5 of the drawings to which reference can be made for further detail. .An analog to digital converter 35 is provided which passes analog data converted to digital upon the data bus for manipulation by the microprocessor 30. The analog to digital converter 35 is directly addressed by the micro- processor upon the address lines and also through the address decoder 34 as heretofore described. The details of the analog to digital converter pin connections are shown in detail in Figure 10 of the drawings. The overall function or operation of the stud weld- ing controller of the present invention shown in Figures 1 and 2 is best described and understood by describing a typical stud welding cycle beginning from startup. The main power switch (not shown) to the transformers, associated gun control circuitry and the microprocessor control assembly is turned on to power up the equipment. Upon power up, a reset generator 36 resets the micro¬ processor 30, the VIA 31, 50 microsecond pulse generator 37 and the RIOT timer 32 to initialize the microprocessor assembly. The program passes through a restart routine which by means of the three input lines 13 through an isolation transformer 38 and A/D converter 35 will deter¬ mine phase rotation and store that rotation in memory for future reference. The RIOT timer 32 will be cycling through an inter- rupt routine to continuously read the status of the vari¬ ous switches, thumbwheels, trigger optical isolator and refresh the display in a sequence programmed into memory. At this time the stick/stud switch 23 will be placed in the stud mode. During the RIOT interrupt routine, the RIOT timer 32 through switch decoder 39 will read the status of switch 23 and that information passed back through the RIOT timer and stored in memory by means of switch buffer 40. Likewise, at this time the lockup key switch 25 and pilot arc switch 26 can be set to access mode and the appropriate number of cycles and pilot arc current selected into thumbwheels 21 and 22 respectively which readings will be read and stored in memory. There¬ after, the pilot arc switch 26 will be returned to set position and then the thumbwheels 21 and 22 may be set for the main welding current cycles and current. If desired, the lockup key switch 25 may then be returned to set or lockup as previously described. The values in the thumbwheels 21 and 22 for the main welding current cycles and current will have been stored in memory as the RIOT timer reads these thumbwheels * during its inter- rupt routine. If a lift check is desired, the lift check switch 24 may be set to the lift check position. This switch status will be stored in memory and if the trigger is ' actuated, the stud welding controller will go through an entire stud welding sequence except that the pilot arc and main weld¬ ing current will not be turned on. Upon initiation of the welding cycle, the trigger is closed and this will be sensed by line pair 13 at the trigger optical isolator 27. The closing of the key switch will be read by the RIOT interrupt routine and this will be passed through the RIOT timer to memory. During the background routine to be described in more detail herein¬ after in the discussion of the flow charts, the setting of the bit representing closing of the trigger will be sensed and the stud welding routine begun. The first thing occurring in the sequence is to turn on the pilot arc current and begin lifting of the stud. The output of the three phase bridge on line pair 12 is passed through divider buffers 41 or 42 representing a high current range and a low current range respectively to the A/D converter 35. The microprocessor through the A/D converter will read the pilot arc current range from either the high current range lines or low current range lines depending on the level of current. As will be described in detail hereinafter, under the section per¬ taining to flow charts, the microprocessor will then sense whether the pilot arc current is sufficient to constitute a good contact and pilot arc. If .not, the pilot arc current will be turned off and the stud allowed to plunge against the workpiece in a hammer fashion sufficient times to bring the pilot arc current above a predetermined level or until a predetermined number of hammer cycles have occurred after which the entire sequence will be shut down. Firing of the SCRs is under the control of the VIA 31. As will be discussed in detail hereinafter under the section pertaining to flow charts for the program, the microprocessor will sense the closing of the trigger switch and which, in combination with a signal from Schmitt trigger 43 representing a zero cross of one of the three phases providing an initializing reference, will activate timer 2 in the VIA. Upon timer 2 timing out, a timer 2 interrupt routine is initiated which by means of the program brings line PB7 low to the 50 microsecond pulse generator 37 which provides a trigger pulse to SCR gate driver 44. At the same time, timer 1 is started and, upon timing out, starts timer 1 routine, which will be described in detail hereafter, which selects the SCR pair to be fired and which via line 45 to the SCR gate driver 44 provides the remainder of the information necessary to place the firing signal upon the appropriate pair of SCR lines 17 to fire the appropriate phase of the SCR bridge. During the entire cycle the terminal voltage across the welding terminals is determined. This determination is made by utilization of a low pass filter 45 whose output passes to a voltage to frequency converter 46 for isola¬ tion and then through an optical isolator 47 and in turn back to a frequency to voltage converter 48 and ultimately through a low pass filter 49 to the A/D converter 35. The microprocessor in its routine will read the terminal volt¬ age from the A/D converter and store it for future com¬ putations. Simultaneously with the initiation of the pilot arc welding current, the -microprocessor addresses and passes data to the VIA to create a signal upon line 50 to a gun solenoid drive interfacing device 51. The gun solenoid drive interface 51 creates the necessary driving current to lift and drop the gun solenoid. As will be described in detail hereinafter in respect to the flow charts, once sufficient pilot arc current has been established, the microprocessor then continues on with the pilot arc welding sequence. After-a predetermined number of pilot arc cycles has occurred, the microprocessor will read the actual pilot arc current from the A/D con- verter 35 and compare this current to the ideal pilot arc current which has been stored in memory. Appropriate cal¬ culations will be made in the timer 1 service interrupt routine to be described in detail hereinafter to vary the parameters for firing the SCRs in each phase to appro- priately adjust the actual pilot arc current to meet the ideal pilot arc current. After the predetermined number of pilot arc cycles stored in memory has been achieved, the microprocessor program passes into the main welding cycle. During the main welding cycle and after a predeter- mined number of cycles have occurred, the microprocessor will reset and control the VIA for setting of timers and firing of the SCRs as described in respect to the pilot arc current. Additionally, during the timer 1 routine, calculations will be made respecting the actual weld cycle current during each phase which will be added to an average and the average compared to the ideal weld current stored in memory. Appropriate calculations will be made, as hereinafter described in regard to the flow diagrams, to adjust the firing parameters of the SCRs to bring the 5 main welding current in conformity with the ideal weld¬ ing current. Additionally, by utilization of the termi¬ nal voltage parameters together with the actual welding current and the number of cycles of current which have passed, the microprocessor will compute the actual weld 10 energy. This will be compared to the ideal total weld energy desired and if required, appropriate adjustments will be made to extend the number of main welding cycles to a given percentage to bring the total weld energy into conformance with the ideal total weld energy. At the end 15 of the weld cycle, the total weld energy and other param¬ eters Will be compared to the ideal weld parameters and different error codes set up depending on the degree to which the ideal parameters were achieved. During the main welding sequence, a counter will 20 control the time at which the microprocessor through the VIA directs the gun solenoid drive interface 51 to drop the gun solenoid. Additionally and as will be described in detail hereinafter, the weld sequence is set for hot plunge and the welding energy will be maintained on for 25 approximately six cycles after contact of the stud with the molten pool of metal. These latter six cycles are not taken into the calculations performed by the micro¬ processor for total energy. The stud welding controller and microprocessor routine 30 includes a safety feature known as the chuck saver circuit which will prevent retriggering of the stud welding gun until the stud welding gun chuck has been withdrawn from the- stud. This is to prevent the obvious burning of the chuck against the stud. This is accomplished by means of 35 control lines 52 and 53 into and out of the VIA and a OMPI chuck saver interface 54. A 15 volt input 55 to the chuck saver together with a connecting line 56 to the welding terminals provides a signal indicative that the stud and chuck are still engaged. This is sensed in the appropriate part of the microprocessor routine through the VIA and an appropriate bit set to prevent retrigger- ing until the connection between stud and workpiece has been broken. An override protection circuit 58 is provided which, upon the occurrence of certain conditions, will pull the main breaker cutting power from the welding apparatus. This condition occurs whenever the voltage upon the welding terminals is greater than 10 volts and line 57 to the override circuit 58 is inactive indicating an absence of welding, i.e. no closed trigger and SCR trigger pulses. The override circuit 58 is a protection against accidental energizing of the stud which could occur under such con¬ ditions as a broken-down or shorted SCR. The stud welding controller assembly VIA line 61 and a gun sensor optical isolator 60 is able to determine whether an error has been made in that the stud welding gun cable or stick welding cable is inserted into the wrong receptacle. The receptacle on the welding apparatus for the stud welding gun includes a cam lock which provides a signal when a welding cable has been engaged with the terminal for the stud welding gun. The microprocessor will check the stick/stud switch and compare this to the status of the cam lock switch as reflected through the gun sensor optical isolator 60 and determine the mismatch. If there is a mismatch, an appropriate error sigal will be generated and the equipment rendered inoperative until the proper match is completed. At the end of the welding cycle, the microprocessor will have stored in memory the parameters of pilot arc welding current, number of pilot arc weld cycles, main GV.T1 welding current, voltage and number of cycles and also the computation of the total weld energy. The RIOT timer routine will service the display select 20 and appropri¬ ately retrieve from memory and display in display 28 by means of digit decoder 57, digit driver 58 and segment driver 59 the selected information in the display. Addi¬ tionally, upon the occurrence of any error, the RIOT timer routine will alternately display the error number together with the parameter selected in the display select. In the stick welding mode, the stud welding con¬ troller microprocessor assembly will automatically go to the routine for controlling of welding current bypassing the pilot arc and hammer routines as will be described hereinafter in greater detail. During the stick welding cycle, an initial number of cycles will be ingored to * provide for arc stabilization. Thereafter,- the timer 1 routine will ascertain the phase current and average the phase current with sixteen prior phases and compare the current to that stored in memory from the current thumb- wheel 22. Appropriate calculations will be made by the microprocessor to direct the VIA to control the SCR firing to bring the stick welding current into conformity with that selected. As will be described in detail hereinafter as respects the flow charts, at any time the welding cur- rent drops below a predetermined value indicating extin¬ guishment of the arc or imminent extinguishment, then the welding -controller will shut down the welding sequence. At the end of welding, the only display that will occur will be the average weld current that was calculated. II. Schematic Diagrams Set out in the drawings in Figures 3-13 are the schematic diagrams heretofore referred to and which present the detailed wiring to and from the various components of the microprocessor assembly illustrated in the block dia- grams of Figures 1 and 2. Additionally, these schematics illustrate the pin designations for each of the various components and also the logic incorporated between the various devices. It is not believed necessary that a detailed explanation of the schematics is necessary in view of the explanation of the function of each of the blocks as shown in Figures 1 and 2 which can be readily identified in each of the schematics set forth in Figures 3-13. III. Flow Charts A. In General Set out in Figures 14-37 of the drawings are the flow charts which depict the steps which the computer program executes in the data processing carried forth in the sub¬ ject invention. Following hereinafter is a flow chart table or listing depicting the different routines and sub¬ routines involved. A brief summary or description of the function of each of the routines or subroutines will be undertaken in the subsections which follow. A greater definitive understanding of any particular routine or sub- routine may be had by a thorough review of the specific routine itself taken in conjunction with the assembled program which follows in section V hereinafter. For a basic understanding of the interrelationship of the restart routine, background routines and interrupt routines with one another, reference should be made to Figure 14 of the drawings. As will be explained more fully hereinafter, the restart routine includes a self-check which, if successfully completed, moves into the background routine. The background routine, as may be seen from Figure 14, is a continuous loop back to itself which pro¬ cesses various states such as pilot arc and main welding current unless there is an interrupt to the microprocessor of the nature shown on the left-hand side of Figure 14. Flow Chart Table Figure (1) Restart routine 15 & 16 (2) Background (a) Start 17 (b) State 0 initialization for weld 18 (c) State 1 pilot arc initialization 18 (d) State 2 end of pilot arc 19 (e) State 3 dummy state 19 (f) State 4 main weld sequence 20 & 21 (g) State 5 hot plunge 21 (h) UPDCYC 23 (i) State 6 end of stud weld 22 (j) State 7 hammer termination * ' 22 (k) STKRTN stick weld 24 (1) DSPFMT display format 25 & 26 (3) Interrupts (a) Zero cross-service interrupt 27 & 28 (b) Timer 2 service interrupt 29 (c) Timer 1 service interrupt 30 (1) Detail 1 - compute regulated base phase angle 31 (2) Detail 2 - sample Avg, get next SCR pair 32 (3) Detail 3 - compute adjustment 33 (4) Detail 4 - compute change 34 (5) Detail 5 - store change in timers 34 & 35 (d) RIOT timer 36 & 37 B. Summary of Flow Charts (1) Restart: The restart routine is shown in Figures 15 and 16 of the drawings. In general, the restart routine checks all of the operable components such as the ROM, RAM, checks for line voltage frequency and initializes the peripherals such as the VIA and RIOT. Additionally, pilot arc param¬ eters permanently stored in the memory are set in the event C PΓ • that the operator has not set alternate parameters. Further yet, the phase rotation of the incoming power is sensed and set. If all tests are successfully completed, the restart routine moves on the background routine. (2) Background: (a) Start: The start routine is shown in Figure 17 of the drawings. The start routine is one of many con¬ secutive routines in the primary background loop through which the microprocessor will continue until the presence of an interrupt. During the start phase of the background routine and as shown in Figure 17, the program is checking the setting of all switches and determining the presence of errors. Additionally, the major determination is made as to whether the program is to continue in the stud weld- ing mode or through the- stick routine (STKRTN) . Any faults or errorsare displayed through the display format. If the trigger is not closed, the program sets the state to zero and goes to display format. If the trigger switch is closed, the background start routine- goes to a subroutine known as "watch". The watch subroutine sets the reset generator to zero or initial timing to avoid timing out of the reset generator that would reset the entire system upon timing out. The reset generator is a built-in safety precaution which provides a reset signal after a predetermined time, the expiration of which would indicate such factors as the processor being unable to continue the proper execution of its program. Following the exercise of the watch subroutine and while in stud welding mode, the program proceeds to a state subroutine depending upon the state set. There are eight states, as will be hereinafter explained. The program will execute a given state and return from subroutine. If the program has set the next state to other than zero, the program will return to sub¬ routine "watch" and then the next state subroutine. Other- wise, the program will return to background start. (b) State 0 (initialization for weld) : The state 0 or initialization for stud weld subroutine is shown in Figure 18 of the drawings. During this subroutine, such functions as initializing all RAM flags is accomplished and the hammer circuit counter is set to 40. Addition¬ ally, the ROM table is consulted together with the weld current settings and an initial SCR firing angle computed for beginning of the welding current. Thereafter, the state counter is incremented by 1 and the program advanced to the next state which, in this case, would be state 1. (c) State 1 (pilot arc initialization) : The state 1 or pilot arc initialization subroutine is shown in Figure 18 of the drawings. In this subroutine, the pilot arc parameters of pilot arc current and number of cycles are set. Thereafter, the program moves to state 2. (d) State 2 (end of pilot arc) : The state 2 sub¬ routine* or end of pilot arc routine is shown in Figure 19 of the drawings. If the switches are in the lift check mode, the program progresses on through the remainder of the sequence utilized in a complete welding cycle. If lift check is not enabled, then the program will see if the pilot arc cycle has reached the required number of cycles stabilizing the current and, if not, will return from subroutine. Otherwise it will loop back until the third SCR pair has been fired. Once the third SCR pair firing has been sensed, the program continues to determine if the pilot arc is greater than 30 amps and, if so, con¬ tinues through the program placing in appropriate memory the initial firing parameters and initializing averaging accumulators preparatory to main welding current calcula¬ tions. If the pilot arc current was less than 30 amps indicating a fault condition, state 7 is set and the pro¬ gram proceeds through the functions as shown in Figure 19 to the return from subroutine and state 7. State 7 is the hammer circuit operation routine, which, upon C PI co pletion, initially returns to state 0 as will be illustrated in the discussion of state 7. (e) State 3 (dummy state) : State 3 shown on Figure 19 is a dummy state which essentially increments the state counter to state 4 and moves ahead into the program. (f) State 4 (main welding sequence) : The main weld¬ ing sequence set forth in state 4 is shown in Figures 20 and 21 of the drawings. In the initial part of state 4, the program seeks to determine whether or not the service interrupts are firing the SCR's and computing the current and voltage. When this begins, the program progresses through updating the current accumulator and voltage accumulator once per cycle untilfiring is done. There¬ after, the main weld sequence program computes the average weld current and average terminal voltage and further com¬ putes the actual energy. Next, the actual energy is com¬ pared to the ideal energy and if within three percent of the ideal energy, moves through the program setting the hot plunge cycle counter to 6 to permit the hot plunge following deenergization of the gun solenoid to continue for a period of 6 cycles. The state counter then is in¬ cremented to 5. At the end of the weld, the energy is checked. If it is less than 97% of the ideal welding current, the number of cycles is increased by the percentage that the energy was low up to 10%. When these additional cycles are com¬ pleted,, the energy is checked again. If it is still less than 97%, then an error 2 flag is set. In any case, the weld is terminated after the second check. (g) State 5 (hot plunge) : State 5 for the hot plunge subroutine is shown in Figure 21. This subroutine waits for setting of the zero cross flag and, when set, clears the zero cross flag, deenergizes the gun solenoid and then proceeds to loop until the hot plunge cycles equal 0 where- upon the state counter is set to 6. Thereafter in the routine the lift check flag is checked and if set, returns from subroutine, and state 6. If the lift check flag is not set, the routine then checks for the presence of a printer option and, if present, initializes the printing routine (not shown) and thereafter, turns off the weld override circuit while immediately thereafter turning on the chuck saver output. After a predetermined time, the chuck saver output, which applies a gating pulse to an SCR, is terminated. The SCR continues conducting until disengagementof the stud with the workpiece. As long as the SCR is conducting, the program will not continue past the point of waiting for the stud to be disengaged. The routine then proceeds into the subroutine of UPDCYC to be described immediately following. (h) UPDCYC routine (update cycles) : The UPDCYC update cycle subroutine is shown in Figure 23. in this subroutine the dialed in number of weld cycles plus any incremented cycles are added together and placed in memory for future reference. Thereafter, the routine checks to see if the lift check bit is set and, if so, proceeds on to clearing all accumulators not associated with the lift check and returns from subroutine. If the lift check bit is not set, then the determination is made if fifty per¬ cent of current was achieved and, if so, this determina- tion coupled with cycles increased will set an error 3 flag providing that an error 7 flag has not been set. If fifty percent current was not achieved, then an error 1 flag would be set. As respects the determination of parameters for each of the error flags, attention is directed to the error code chart under section V following. (i) State 6 (end of stud weld) : The state 6 sub¬ routine or end of stud weld routine is shown in Figure 22. Again the lift check bit is checked and, if present, the program proceeds to determine whether the trigger has been released. If not, the program loops back until the trigger is released and thereafter resets the trigger flag to permit repeat of the trigger cycle. If the lift check bit is not set, the remaining flow paths in state 6 essentially determine whether the chuck saver input signal has terminated and if not, delays until such has occurred. The routine further determines whether the output signal across the stud and workpiece has terminated and, if not, delays until such happens and ultimately when the output signal has ceased, indicating that the chuck has been pulled from the stud, turns off the chuck saver output signal and thereafter, returns from subroutine. The ter¬ mination of state 6 will set the state counter to 0 returning to the main background loop. (j) State 7 (hammer termination) : State 7 or the hammer termination subroutine is shown in. Figure 23. State 7 is reached through one branch of state 2 shown'in Figure- 19 wherein the pilot arc current is less than 30 amps indicating the need of the hammer action. The sub¬ routine checks for the passage of an initial delay period following deenergizing of the pilot arc which occurs in state 2. Following the delay period, the routine proceeds to decrement the hammer counter by 1 each loop and resets the state counter to 1 to return through states 1 and 2. In these states the gun solenoid is energized and de- energized creating a hammer action until either the pilot arc senses greater than 30 amps as shown in state 2 upon which the normal welding procedure continues or a count of 20 hammer actions has been reached at which point "done hammering" will have been determined as yes and the routine branched to determine whether the trigger is closed. If the trigger is closed, the routine will loop until the trigger is open. Once the trigger is opened the state counter will be set to 0 and routine returned to state 0 at which, upon closing of the trigger, another attempted weld cycle could be commenced. (k) STKRTN routine (stick weld routine) : The STKRTN or stick weld routine is shown in Figure 24. In the stick routine, the routine will continuously loop until a zero cross flag has been set. Thereafter, the flag is cleared and a determination made whether the initial phase angle has been set. If not, the INANG routine is called which goes to a ROM table to set the initial phase angle and the ANGLE routine is undertaken to get current parameters. A housekeeping routine in the nature of clearing the accumulators, etc. is undertaken. The routine then passes into the display format (DSPFMT) routine which will be described hereinafter and after which having passed through will return to the beginning of background and ultimately loop back to the stick routine to the point of determination of zero cross flag. Having determined that the initial angle is set, the routine branches through determination of a sample having been received and will loop until such has been received. After determination of the sample, the display will be blank and the sample flag cleared. A determination will be made if the current equals 0 or if the current has not continued through 8 phases, whereupon then the routine will continue back around to background. Once the eighth update phase has been sensed, the averages of the voltage and current in the eight previous cycles are computed and the accumulators and counters reset to again recompute a following eight cycles. In the event the stick/stud switch has been changed to stud during the routine, this will be determined and the suck mode flag cleared and the routine passed into display format routine. The display format routine, as to be described hereinafter, will convert the display select thumbwheel setting from binary coded decimal to binary and set up the display buffers in accordance with the type of information desired to be displayed and as ^ υ -.-_ O PI set in the thumbwheel. (1) DSPFMT routine (display format routine^; The DSPFMT or display format routine is shown in Figures 25 and 26 of the drawings. This routine is undertaken at many points in the various states and routines described hereinbefore. Essentially, the display format routine checks for thumbwheel parameters, checks and displays errors and selects errors upon a priority and also con¬ verts the display thumbwheel selector from binary coded decimal to binary in order to set up the display buffers to display the type of information desired to be dis¬ played, i.e. current, voltage, cycles, watt seconds, pilot arc current, pilot arc cycles and output current voltage. In the initial part of the routine, depending on whether the switch has been set for stick or stud welding, a determination is made whether the thumbwheels are set within parameters, i.e. stick welding greater than 50 amps and less than 400 and stud welding greater than 50 amps and less than 2,000. If not within the parameters, an error 5 signal is generated. Additionally, the cycle thumbwheel is checked to determine if within parameters, i.e. a setting of greater than 0 and, if not, an error 6 signal is set. If there are no errors, the routine pro- ceeds to set up the seven segment buffer which corre¬ sponds to the seven segments of the front panel light emitting diode displays, and checks to see if the enable KHz flag is set and, if so, clears the enable flag and enables the KHz interrupt and, in any event, returns to background. In the event of the occurrence of one or more errors, the routine determines from a priority table the highest priority error. Error codes 1, 2, 3 and 7 and the associated data with the error code will be alternately displayed in the display. ' A flash counter is decremented to set a toggle error/data flag which is interpreted in the routine at the "display error" question point to create alternate branches (5) or (4) for the alternation of data and error respectively. (3) Interrupts: (a) Zero cross interrupt service routine: The zero cross interrupt service routine is shown in Figures 27 and 28. In summary, this interrupt routine determines whether or not the background routines are in state 2 (pilot arc state) , state 4 (main weld sequence) or state 5 (hot plunge) during which current regulation, computa¬ tion and measurement is to take place or in the remaining states in which no such computations, adjustments or the like takes place. Looking to Figures 27 and 28 and assuming that the background is in a state other than state 2, 4 or 5, the routine proceeds to the decision of "waiting for switch read" which delay is occurring in the background (start) which, if still delaying, will decre¬ ment the counter for 20 zero crosses to provide time for reading of all of the conditioned switches. If not wait¬ ing for reading of the switches, the program proceeds to determine whether the background routine is in state 0. If in state 0, the determination is made if in stick mode and, if not in stick mode which means in stud mode, then the subroutine of conditionally checking line voltage is undertaken and the zero cross flag is set. The routine checks to see if the delay counter utilized in the various states has been set to 0 and, if not, decrements that counter and in subsequent passes through the zero cross routine, will continue to decrement the delay counter until the 0 condition exists. Thereafter, the zero cross interrupt is cleared followed by clearing of the interrupt mask. The clear interrupt enables any pending interrupt from other sources to occur from this point on because none of the following events are time critical and a pending interrupt might be time critical. The next portion of the zero cross routine continu¬ ing from point 6 is to determine a safety feature to pre¬ vent confusion of the stud cable and stick cable being reversed and placed in the wrong terminal. If such con¬ dition occurs, an error 8 flag is set; otherwise it is cleared. The remainder of the routine deals with the printer option. If a printer option is included in the apparatus, a check is made one time to see whether the print heading is then made available in the printer buffer for access in the printer. Thereafter, other prints of the data will occur through portions of the KHz interrupt service rou¬ tine. In the zero cross routine and in the condition of a 2, 4 or 5 state (the stick routine through housekeeping has a state 4 value set for this routine purpose) and if timer 1 (to be discussed hereinafter) has not been enabled, then timer 2 will be started. Timer 2 routine, to be described hereinafter, generally starts the SCR firing and computations respecting firing adjustments to regulate current. If timer 1 is enabled, as hereinafter described, a test will be made as to whether fewer than 4 SCRs have fired indicating a spurious zero cross under such conditions. If so, the routine is essentially termi¬ nated through path 1. Following initiation of timer 2, the zero cross rou¬ tine determines whether or not a state 5 condition exists via path 3 and, if so, the state 5 counters (hot plunge) are decremented and the zero cross flag set to ultimately count out the required cycles or time for the hot plunge state 5 routine. If the zero cross routine occurs during a state 2 condition via path 3 onto path 4, the routine will essen- tially proceed as heretofore described decrementing the delay counter for the pilot arc state 2 mode. If the zero cross service routine is occurring during state 4, then the cycle counter is in the state 4 main welding sequence state and will be decremented each time the zero cross interrupt routine occurs. Addition¬ ally, the determination will be made whether or not the state 4 is in the adjustment mode which occurs in the stud welding mode. If so, the routine sets the zero cross flag and moves on out of the routine as heretofore des- cribed. If in the nonadjusting mode, meaning that the state 4 flag has been set in the stick mode, then the routine will conditionally start line voltage monitoring and pass on out of the routine in the same manner. (b) Timer 2 interrupt service routine: The timer 2 interrupt service routine is shown in Figure 29 of the drawings. It is to be-recalled that timer.2 was started in the early portion of the zero cross routine and set for a predetermined time that was fetched from memory (FIRTIM) . This initial setting of timer 2 at the begin- ning of the welding cycle is a number dependent on the ideal current desired and determining the initial base phase angle used and thereafter a value is calculated in the timer 1 routine as will be described hereinafter. Upon initiation of the timer 2 interrupt routine, upon timing out of timer 2, the routine interrupt flag is cleared and, if not in the lift check mode or an error 7 flag present, the first SCR pair is fired. The routine initializes the SCR count to keep con¬ trol of the pairs fired. Additionally, line PB7 to the 50 microsecond pulse generator is set. The versatile inter¬ face adapter (VIA) is set to the auto toggle mode for the PB7 output to the 50 microsecond pulse generator firing the SCRs. The VIA has the capability of toggling line PB7 alternately high and low for a time duration between the toggling controlled by the time set in timer 1 and _C_ PI the latches of timer 1. The PB7 output is toggled low for one millisecond and the timer 1 latch set for 1.777 milliseconds which totals a time period equal to the time estimated for the beginning of the next phase. This toggling action will continue throughout the remaining phases under the timer 1 interrupt service routine to be described hereinafter and in conjunction with the timing diagram of Figure 38. Additionally, timer 1 is started and timer 2 is disabled. At the final termination of the timer 2 interrupt service routine, the routine checks to see if the back¬ ground program is in pilot arc state 2 and if so, ener¬ gizes the gun solenoid lifting the stud and beginning the initiation of pilot arc. (c) Timer 1 interrupt, service routine: Before pro¬ ceeding with the flow diagrams depicting the program involved in the timer 1 interrupt service routine, reference should be made to the timing diagram of Figure 38 which will facilitate an understanding of the flow diagrams. Referring to Figure 38, there is illustrated at the top portion of the drawing the typical three phase wave form as seen by the SCRs in the SCR bridge. All of the timing diagrams in Figure 38 are refer¬ enced to the zero cross line. It is to be recalled that the zero cross interrupt service routine begins when the difference between a selected pair of phases of the three phase power supply is equal to zero. The Schmitt trigger shown in Figure 2 of the drawings which generated the zero cross interrupt has an internal hardware delay of 600 microseconds following the true zero cross before the interrupt is generated. As discussed in the zero cross interrupt service routine, and as a part of that routine, timer 2 is conditionally started upon the occurrence of the zero cross interrupt service routine. Thus, since there is the 600 microsecond delay following true zero cross, timer 2 is started 600 microseconds from true zero cross as. shown in Figure 38. Each time a zero cross occurs, and as shown in Figure 38, timer 2 is again con¬ ditionally restarted. As previously discussed in the zero cross interrupt service routine, when timer 2 is started, the program initially recalls from memory an initial time to set into timer 2 (FIRTIM) . Timer 2 must time out for the amount set in the timer and adjusted in the timer 1 interrupt service routine before an interrupt occurs. When the interrupt occurs upon timer 2 timing out, as shown on line 3 of Figure 38, then the timer 2 interrupt service routine begins. The timer 2 interrupt service routine occurs within the time required to execute the instructions set forth in the timer 2 interrupt service routine shown in Figure 29. Essentially during this interrupt service routine, and as previously discussed, the SCR output pair C-B' is chosen, the SCR count is set to 1 and line PB7 is set to low as shown on line 2 firing the SCRs for the first pair. Additionally during the timer 2 interrupt service routine and as previously discussed, the VIA timer 1 is set to automatic toggle which will toggle automatically between high and low states each time timer 1 counts down to zero. Perhaps a note regarding the operation of the VIA is in order here. When the VIA timer 1 counts down to zero, it is automatically reloaded from the timer 1 latches, which should have previously been initialized. Also, in the PB7 toggle mode when timer I is loaded from any source, PB7 is automatically toggled. The typical sequence during regulation is: (a) on falling edge interrupt, reload latches for 1.777 ms.; (b) on rising edge interrupt, dis¬ able toggle mode, read timer, adjust time, write to timer, enable toggle mode and reload latches for 1.0 ms. Ini- tially, in the timer 2 interrupt service routine, timer 1 OMPI which is toggling line PB7 is set for 1.0 milliseconds and the latch is set for 1.777 milliseconds which will be the time until the next toggle to the high state. Simultane¬ ously, timer 1 is initiated to begin its time out and timer 2 is disabled. Upon timer 1 timing out, an inter¬ rupt signal is generated as shown on line 10 of Figure 38 thus initiating the timer 1 interrupt service routine. At this point, the timing will have proceeded 1.0 milli¬ seconds past the firing of the initial SCR pair and PB7 line (line 2 of Figure 38) will be on the rising edge. As will be described in detail hereinafter during the timer 1 interrupt service routine, the current will be sampled during the rising edge of PB7 and this value stored. During the initiation of the welding cycle as shown in Figure 38, there will have been no prior calcu¬ lations of the firing angle and timer 1 will automatically time for 1.777 milliseconds before PB7 falls firing the next SCR pair C-A' as shown on lines 4 and 6. During period 3, as shown on line 2 and which during the low state is a fixed 1.0 milliseconds, timer 1 interrupt service routine will compute the regulated base phase angle which, as described hereinafter, will be continu¬ ously recomputed utilizing the previous base angle during each 1.0 millisecond period until the next zero cross at which the last regulated base phase angle will then be the time set into timer 2 during the zero cross interrupt. Also, during regulation, any active timer will be adjusted based on the current sampled on. the rising edge of PB7 associated timer 1 interrupt. In this manner the firing of the initial pair of SCRs will be readjusted based on the current conditions which had existed in the prior cycle, i.e. actual current versus ideal. Upon the occurrence of the next rising edge of PB7 or period 4 as shown on line 2 of Figure 38, the timer 1 interrupt service routine will sample the actual current, C-.-ΓPI VIPO compare it to the ideal current and recompute the adjust¬ ment to the phase adjustment angle necessary to be placed in timer 1 to adjust the theretofore 1.777 milliseconds necessary to achieve the ideal current. The manner in which this computation is made will be explained in the discussion of the timer 1 interrupt service routine flow charts which follow. The recomputation of the base phase angle again occurs in period 5 and the computation of the adjustment to timer 1 time occurs in period 6 and this continues on until the. next zero cross. Upon the next zero cross, the zero cross interrupt service routine is commenced and the cycle is repeated until ultimately the number of cycles and/or readjusted number of cycles for the welding current is achieved and the welding current discontinued in the case of the stud welding controller being in the stud welding mode. As will be pointed out hereinafter in the discussion of the timer 1 interrupt service routine, the foregoing descriptions of events occurring will be altered if the stud welding controller is operating in the pilot arc state if in the stud welding mode or in the stick welding mode. Essentially in the pilot arc state of the stud welding mode or stick mode, the calculations used to compute the regulated base phase angle and the phase ad¬ justment angle use an average of a rolling 16 phases as in the case of the main welding current computations in the stud welding mode. Attention will now be directed to Figure 30 which is the broad outline of the timer 1 interrupt service routine. At the beginning of the timer 1 interrupt service routine, the interrupt mask is cleared and the decision is made as to whether or not the microprocessor system is trans¬ mitting data to the mechanical printer. If so, the rou- tine loops until the printing is done. This occurs in the initial startup of the equipment and every 55th line thereafter, during which the printer prints an appropriate heading. If printing is not occurring, then the routine determines whether or not PB7 is rising or falling upon the occurrence of an interrupt from timer 1 which is generated upon either the rising or falling edge of PB7. For the purposes of the description of the timer 1 interrupt service routine, it will be assumed that the interrupt is from a falling edge PB7. In this case the routine will compute the regulated base phase angle and return from the interrupt. If the timer interrupted the zero cross routine, the control will return to that routine, not background. The manner in which the regula¬ ted base phase angle is computed will be described in the description of the flow charts pertaining to detail 1 which follows hereinafter. Assuming for purposes of explanation that the timer 1 interrupt occurs upon the rising edge of PB7, then the routine will take the current sample, compute the average of the required number of samples (2 or 16 as heretofore described) and select the next SCR pair. This occurs in the routine set forth in detail 2 in Figure 32 which will be described in detail hereinafter. Following the selection of the next SCR pair, etc., the decision is made whether or not an adjustment to the phase angle firing should be made. This decision will be no in the beginning of pilot arc and in stick mode until current, meaning an arc has been initiated, is sensed. The appropriate flags are set elsewhere which will control this decision. An example of such would be in the pilot arc state during the very initial few phases. Assuming for purposes of explanation that the decision is made that adjustments are to be computed. The routine then passes to the compute adjustment routine which is set forth in detail 3 as will be described in detail 3 hereinafter. The amount of adjustment to the regulated phase angle, i.e. the time set in timer 1 is computed based upon the electrical current conditions existing in the prior phases. Following the computation of the required adjustment, the adjustment is applied to the count read from the timer and restored in the timer so that the appropriate adjust¬ ment is made to the timing of timer 1 to adjust the timing out of timer 1 and the creation of the timer- 1 interrupt on the falling edge PB7 to fire the next pair of SCRs. Detail 5 is shown in Figure 34 and a subroutine of detail 5 is shown in Figure 35 respecting the adjustment of the timer. Assuming for the purposes of explanation of the timer 1 interrupt service routine that the appropriate flags are set to not require adjustment of the adjusted phase angle, then the decision is made whether an initial high angle set in the background for the pilot arc state and stick welding modes is to be maintained or dropped. The pilot arc state requires two phases to be fired and the stick mode requires sensing of a current level sufficient to indicate an arc has been initialized before the flag permitting dropping from high angle to initial angle is set thus permitting a decision at this point to be yes. If the decision is no indicating that two conditions have not been met, then the routine exits the timer 1 interrupt service' routine and returns from the interrupt until the sufficient conditions have occurred for the decision to be yes to drop from the high angle to initial. When the decision is made to drop to initial angle, then the routine enters the subroutine of compute change shown in detail 4 in Figure 34. The routine then moves into the store and adjust change in timers routine set forth in detail 5 which will likewise be discussed herein- after. χ -^ REΛ C PI Turning now to detail 1 shown in Figure 31, a dis¬ cussion will now be undertaken of the subroutine for com¬ puting the regulated base phase angle. The determination is made whether the system is in the first phase of a cycle and if yes, the terminal voltage is set in RAM and thereafter ignored. The routine then passes through a series of determinations to determine an error 7 condition which is a low terminal voltage in the main welding se¬ quence. Thereafter, the sample received flag is set and the determination made whether or not adjustments are to be made. If not, the routine essentially passes out of the routine after clearing accumulators and setting latches. When adjustments are to be made, the routine next up¬ dates the current average accumulator with the current sample previously received and increments the counter and passes on to a determination whether the cycle counter has timed out and, if not, continues with the computations. If computations are to be made, the determination is then made whether the controller is in the stick, pilot arc or main stud welding mode. The mode determines whether or not the average is to be based on two phases or 16 phases. The microprocessor now makes the computations for the change in base phase angle in accordance with the cal¬ culations set forth in the flow diagram, explanations to the right side thereof and as further described in the chart on calculations set forth in section V charts. Additional determinations are made whether or not the cal¬ culations are out of range and if so, boundaries on the range are- set to prevent loss of control. Thereafter, the average accumulators are cleared and the timer 1 latch is set for the 1.0 millisecond timing which will be utilized in timer 1 following the timing out of timer 1 and in the period following the falling edge of PB7. Turning now to detail 2 in Figure 32, the current is sampled and scaled by means of the analog to digital converter and the determination made whether the current equals 0 and, if not, the no current flag is cleared. Thereafter, an average of the current samples in the four preceding phases is determined. The decision is then made whether six pairs of SCRs have been fired which, if yes, indicates that no more SCRs should be fired in that cycle whereupon timer 1 is dis¬ abled and the SCR ports from the VIA are cleared. If less than 6 SCRs have been fired indicating that additional firings are to be done, then through the program the next pair to be chosen is identified which will follow the down edge of the PB7 pulse. Finally, the determinations are made whether in the lift check mode, state 7 or error 7 and the appropriate decision is made as shown in the flow diagram. Detail 3 for computing adjustment of phase angle firing is shown in Figure 33 of the drawings. Initially in this routine and if in the stick mode, the determina¬ tion is made whether there are three consecutive 0 current readings indicating loss of arc and, if so, the state is cleared and the weld cycle aborted. If not, the decision is made whether adjustment is to be made and, if not, which would be the case of a flag set in background for the initial firing phase, then the routine is ended. If the skip adjustment flag is not set, the computations are made to adjust the adjusted phase angle in accordance with the equations and logic set forth in the flow diagram and the notes on the right-hand side thereof together with the calculations set forth in section V charts. Additionally, checks are made to whether or not the determinations or calculations are out of range and if so, ranges are set for the phase adjustment to maintain control. The calcu¬ lated result is saved at address TTIM and the subroutine returns back to the main routine as set forth in Figure 30. The compute change subroutine is shown in detail 4 in OMPI Figure 34. In this routine, which is entered following a determination of whether the initial high angle is to be dropped, the decision is made whether in the stud welding mode or stick mode. This subroutine will be entered only if in the nonadjust mode and the determination was made that background was either in pilot arc or stick. Thus, if the stud mode decision is yes, then the background must be in the pilot arc state and in that condition the pilot arc initial current I j _. is set in the appropriate register and the routine moved on to the store change in timers routine. If background is in the stick mode, then the decision is made whether the current is less than 20 amps indicating an unstable or nonexistent arc. If yes, the routine is returned to background and no computations are made. If the current is greater than 20 amps in the .stick mode, then the routine passes to the housekeeping for stick arc routine which resets various accumulators. Current ad¬ justments will be provided as if in the stud welding mode. The store and adjust change in timers routine of detail 5 is shown in Figures 34 and 35. Initial determi¬ nation is made whether timer 1 is enabled in that it could have been disenabled under certain conditions such as the six SCR pairs having been fired. If timer 1 is enabled, then the subroutine to adjust timer is undertaken. This is shown in Figure 35. In-the "to adjust timers" routine, the timer is first read to determine the elapsed time in the appropriate timer. Thereafter, the timer is looked to as to whether or not the timer is in the rollover condition and, if not, the amount of time computed in detail 3 is algebraically added- to the timer amount. A check is made to see whether the recomputed time has exceeded the maximum and if so, the arbitrary 100 microseconds time is placed into the timer to immediately terminate the timing providing a O ?Γ failing edge of PB7. If not in overflow, then the actual computed time, after checking whether timer 2 is being adjusted, is written to timer 1 to control the time of firing the next SCRs which occurs on the falling edge of PB7 upon timing out of timer 1. If this routine was called for the purpose of ad¬ justing timer 2, then the logic is to change the mode of PB7, write to timer 2 the appropriate adjusted time, put the PB7 mode back to automatic toggling of PB7 and set the latches for 1 millisecond. Returning back to Figure 34, if timer 2 is enabled, then the previously described routine will occur to change timer 2, etc. If timer 2 is not enabled, then the "to adjust timer" routine is not passed through. Following the accomplishment of the logic determining whether or not timer 1 is written to, and in any event, the base phase firing angle time (FIRTIM) is adjusted based upon the calculations which were done under detail 1. This is so that the base phase angle firing time is always available to the zero cross routine. Thereafter, the routine returns to the main routine shown in Figure 30 which essentially is a return from interrupt. (d) RIOT timer interrupt service routine: The RIOT timer interrupt service routine is shown in Figures 36 and 37 of the drawings. That portion ofthe flow diagram shown on the left-hand side of Figure 36 essentially determines a missing phase and creates an error 4 signal. In the reset routine in Figure 16, an initial delay of 150° was set from zero cross to check a peak voltage occurring on a reference input to determine A, B, C or A, C, B rotation. The routine waits for the time to sam¬ ple the B phase and then looks to RAM for a flag set for determination of whether A, B,C or A, C, B rotation. If A, C, B rotation, then the routine passes out and waits for the time for checking of a phase. On the other hand, -J-US- if rotation was A, B, C, then the delay is changed to sample 60° later. The 150° delay in Figure 16 pertains to determining of rotation only and occurs one time. The line voltage monitoring is done periodically once per minute in idle mode. The timing for line voltage monitoring is only indirectly related to rotation deter¬ mination timing. This manipulation is simply made to set the sampling period that will be later used to sample phase "A" upon the occurrence of the time to sample phase "A". Upon the occurrence of the time to sample phase "A", the comparison is first made if phase "A" is low and, if so, an error 4 code set. If phase "A" is not low, then a comparison is made between phase "A" and phase "B", which values have both been stored in RAM previously, to determine if they are within 40%. The interreaction of the three phases, one to another, will indicate the loss of either the "B" or "C" phase resulting in the differential between "A" and "B" phases being in excess of 40%. Upon this occurrence, an error 4 signal is set. If an error is indicated, then the testing frequency is increased to a higher rate. If no error is detected, then the error 4 is cleared. Moving to the right-hand portion of Figures 36 and 37, the KHz routine broadly accomplishes the functions of reading all of the status switches and thumbwheels and provides the display refresh as well as the display select and the trigger switch logic. It is believed that the routines for servicing the switches, providing displays, etc., are sufficiently set forth in the flow charts of Figures 36 and 37 and need not be explained further. IV. Assembled Program Set forth in the Appendix attachedis a copy of the assembled program in the assembly language for the Motorola 6802 microprocessor which carries out the logic functions of the flow charts heretofore described. V. Charts Set out immediately hereinafter are the following charts which have been referred to in the preceding des¬ cription of the stud/stick welding controller of the present invention. (1) Error codes; (2) Table of components; (3) Calculations. (1) Error Codes Meaning/Conditions Clearing Action 00 Self-test failed. This results None; uncondi¬ in a total machine lockup. tional and un¬ clearable lockup. Remove and restore power to attempt another self-test. 01 Less than 50% current detected. None; uncondi¬ This would indicate a major tional and un¬ hardware malfunction (e.g. an clearable lockup. open SCR) . This will result in Remove and restore the display alternating the power to weld error code with the current, again. and disallowing any further welds, unconditionally. 02 Total energy not within three Turn key switch percent of the requested total if lockup option energy. This would occur if selected. Change the requested current could display selector not be delivered, even though or any system the number of cycles had al¬ parameter, if no ready been increased by 10% lockup, to remove maximum. It will result in error code from the error code and current display. No oper¬ alternating on the display. ator intervention Error Code Meaning/Conditions Clearing Action It will also optionally lock up required if no the machine until the error is locku . cleared via the key switch (see section I, 9 for details) . 03 Total energy is within three None; self- percent, but the number of cycles clearing. Warning was increased to achieve this only - no opera¬ result. It results in an alter¬ tor intervention nating error code and number required. of cycles on the display. 04 One or more phases of the None; uncondition¬ primary are missing. It re¬ al and unclear- sults in an unconditional able lockup. Re¬ machine lockup. move and restore • power to attempt to weld again. 05 Current set out of range, Change thumbwheel (i.e. below 50 amps or above setting. 500 amps in stick mode, or below 50 amps in stud mode) . 06 Zero cycle firing time set. Change thumbwheel setting. 07 Terminal voltage less than lOv. None; self- This condition will be caused clearing. Warning by a "shorted" or a hangup in only - no operator the gun. The weld current will intervention be turned off within 3 phases required. (8.4 ms) . This protects the main SCR bridge from needless excess surge current. The error code and terminal voltage will alternate on the display. Error Code Meaning/Conditions Clearing Action 08 Gun sense. A cam lock interlock Place cable in switch is used to determine the correct cam lock presence of a cam lock in the for either "stick" "stick" connector. If the unit or "stud" mode. is in the "stick" mode, the error will display if the "stick" con¬ nector is vacant. If the "stick" connector is mated, the error will display when in the "stud" mode. 09 Printer error. Error will be Reconnect printer, displayed when the printer is replace paper or not connected, or out of paper wait for comple¬ or during printing. tion of printing. (2) Table of Components Reference Character Component Model # 30 Microprocessor MC6802 31 VIA SY6522 32 RIOT SY6532 33 ROM 2716 34 Address decoder See Fig. 5 35 A/D converter ADC0808 36 Reset generator 4093/74LS123 37 50 Λ.S pulse gen. 74L5123 For other components - see details of Figs. 3-13. (3) Calculations The following calculations will be performed: (1) The initial base phase angle from zero cross to firing the first phase will be computed using the function B = -1.25 * I + 5273 where I is the ideal current B is the initial base phase angle in time (microseconds) . (2) Average terminal voltage This is a displayed value. The terminal voltage will be measured once per cycle, and the average voltage will be computed at the end of the weld as the arithmetic mean of the voltages. (3) Average weld current This is a displayed value, and is also used in the total energy computation. It is computed as the arithme¬ tic mean of all the current readings (one per cycle) . The first cycle is not included in the average. (4) Total energy This is a displayed value, given by the following equation: E=V(avg) * I(avg) * T Where: E is the energy in watt-seconds . V(avg)is the average terminal voltage I(avg)is the average weld current T is the weld time in seconds. This number is computed at the completion of a weld. (5) During every phase any running timer is adjusted by T(n)-T(n-1) where T(n) =G* (I-A)+B G is the gain for the regulated current I is ideal current A is actual current B is the same as in 1 T(n-l) is from the previous cycle. (6) Every two or sixteen phases, the base phase angle (B) is recomputed using: B(n+1) = G(I-m) + B(n) where G is same as in 5 I is same as in 5 m is the average current during the previous two cycles in stud mode or sixteen cycles in pilot arc or stick mode B(n) is the previous base phase angle. (7) There will be a table of gains (G) for each current from 50 to 2,000 amps in 50 amp increments. Interpolation will be used for values between table entries. " The present invention may be embodied in other spe¬ cific forms without departing from the spirit or essential attributes thereof and accordingly, reference should be made to the appended claims rather than to the foregoing specification as indicating the scope of the invention.

Claims: Claims What is claimed is: 1. In apparatus for welding two metallic members by heating by an electric welding arc including an alterna- ting current power supply, holding means for holding one of the metallic members through which weld current is passed in creating the welding arc and weld current cable means interconnecting the current power supply and the holding means, the improvements for controlling welding current parameters comprising: a general purpose digital computer; programmable weld current reference means accessible by the computer into which the ideal weld current can be set and providing an ideal weld current reference signal; weld current sensing means accessible by the computer providing an actual weld current signal proportional to the actual weld current; current regulating means under control of the com¬ puter capable of initiating, varying and terminating the output of the current power supply; and a program for the general purpose computer to instruct the computer to periodically compare the ideal weld current signal to the actual weld current signal and adjust the current regulating means to adjust the actual weld current to equal the ideal weld currents. 2. The apparatus of Claim 1 wherein the holding means is a stud welding gun for welding a stud to a workpiece and wherein the improvements further include programmable weld cycle reference means accessible by the computer into which a preselected number of weld cycles can be set and providing an ideal weld cycle reference signal; weld cycle counting means accessible by the computer; and wherein the program further instructs the computer to compare the ideal weld cycle reference means to the weld cycle counter means and terminates the weld cycle upon a given relationship between the two occurring. 3. The apparatus of Claim 2 further including weld¬ ing voltage sensing means accessible by the computer pro- viding an actual weld voltage, signal proportional to the actual welding terminal voltage; wherein the program further instructs the computer to compute and store each of the average welding current, average welding voltage and total welding cycle time and compute and store the total weld cycle energy as the product of the average welding current, average welding voltage and total cycle time. 4. The apparatus of Claim 3 further including alpha/ numeric display means interfaced with the computer; and . wherein the program instructs the computer to re¬ trieve and display at the alpha/numeric display the values of the average welding voltage, average welding current, number of cycles for the welding cycle and total weld cycle energy. 5. The apparatus of Claim 3 wherein the program instructs the computer to periodically within the welding cycle compare the ideal weld current reference signal to the actual weld current reference signal and to increment the programmable weld cycle reference means proportion- ally to the difference and to a fixed maximum percentage of the initial programmable weld cycle reference means setting.. 6. The apparatus of either Claims 3 or 4 wherein the program instructs the computer to compare the ideal weld current reference signal to the actual weld current signal at the end of the weld cycle and to create differing error signals indicative of the percent of deviation of the actual welding current below ideal welding current. 7. The apparatus of Claim 6 wherein the program instructs the computer to display the generated error signal at the alpha/numeric display means. 8. The apparatus of Claim 6 wherein the program instructs the computer upon the presence of selected error signals to generate a program interrupt causing a program lockup. 9. The apparatus of Claim 2 wherein the welding gun includes a lift solenoid; lift solenoid control means interfaced to the compu¬ ter; programmable pilot arc reference means accessible by the computer and providing an ideal pilot arc current reference signal; programmable pilot arc cycle reference means acces¬ sible by the computer into which a preselected number of pilot arc cycles can be set and providing an ideal pilot arc cycle reference signal; and wherein the program instructs the computer by means of the lift solenoid control means to initiate lift plunge in accordance with the pilot arc reference signal and to regulate the current regulating means in accordance with the pilot arc current reference, signal and initiate the main welding current upon reaching the predetermined number of pilot arc cycles. 10. The apparatus of Claim 9 further including a two state lift check switch accessed by the computer; and wherein the program instructs the computer upon the lift check being in a predetermined state to execute a complete weld cycle with the exception that the current regulating means is inhibited. 11. The apparatus of Claim 10 further including a two state hot/cold plunge switch accessed by the computer; and wherein the program instructs the computer upon the hot/cold plunge switch being in a predetermined state to increment the ideal weld time reference signal to increase C- P the weld cycle by a predetermined number of cycles to maintain the welding current on until the stud reaches the workpiece. 12. The apparatus of Claim 11 wherein the program instructs the computer to ignore the incremented weld cycles in computing average current, average voltage, weld cycle time and total energy period. CM::

Inventors: GUM CHARLES E, HOWE RODNEY C, MACINSKAS DEAN P, PEASE CHARLES C, RAYCHER ROBERT J, ROSEN RONALD, WILKINSON HAROLD C, WILLIAMS FRANCIS J
Applicants: OMARK INDUSTRIES INC
Application year: 1982
Main classification: B23K9
IPC codes: B23K9, G05F1