⬇The below diagram is by no means a complete, simply concept !
In this article, we're diving deep into the modernization of traditional welding equipment using Arduino technology. By replacing old electronic circuits with Arduino, we aim to enhance functionality, reliability, and ease of use. Let's break down how the provided Arduino code revitalizes an essential piece of welding machinery.
The Code Explained
The program begins by including necessary libraries and defining pins and variables. It's structured to control a welding machine's various functions such as wire feed speed, gas flow, and contactor operation, ensuring a seamless welding process.
Libraries and Definitions: The code starts by including the
Wire.h
andstdlib.h
libraries for I2C communication and standard functions, respectively. Then, it defines pins for the trigger, motor speed control, gas relay, contactor relay, and wire feed button input. Some pins are reserved for future development related to wire feed direction control.Global Variables: Variables are set to define minimum and maximum wire speed (
WS_MIN
,WS_MAX
), and gas delay time (GDEL_MIN
,GDEL_MAX
). A boolean flagwelding
tracks the welding status.Setup Routine: Initializes pin modes for inputs and outputs, such as the wire speed control, trigger, gas, and contactor relays. An LED pin is also set up to indicate the system's status.
Main Loop: Continuously checks if the wire feed button is pressed or if the trigger is activated to start the welding process. If welding has occurred, it proceeds to disengage the system appropriately.
Welding Functions:
weld()
: Activates welding by turning on the gas, closing the contactor, and starting wire feed. It sets thewelding
flag to true and lights up an LED as an indicator.inch()
: Provides functionality to feed the wire without fully initiating the welding process, useful for positioning or testing.feed_wire()
: Adjusts the wire feed speed based on an analog input, allowing dynamic control over the welding wire's speed.dis_weld()
: Handles the disengagement process after welding. It gradually turns off the gas and contactor while ensuring the system is ready for the next operation.
In Plain English
This Arduino code transforms a welding machine into a smarter, more user-friendly tool. It allows for precise control over the welding process with functionalities such as:
- On-demand Wire Feeding: Users can inch the wire forward as needed, making it easier to set up or adjust before welding.
- Automated Welding Process: With a simple trigger press, the machine automatically controls gas flow and wire speed, ensuring consistent welds.
- Adjustable Parameters: Wire speed and gas flow delay can be fine-tuned based on the material being welded, offering versatility across different welding tasks.
- Safety and Efficiency: The program includes mechanisms to disengage the welding process safely and efficiently, reducing waste and enhancing the user's control.
This Arduino-based upgrade signifies a leap towards modernizing traditional welding equipment, making it more accessible and efficient for users. By integrating simple code, we unlock powerful features that enhance the welding experience, showcasing the potential of combining traditional craftsmanship with modern technology.
CODE FOR OLED DISPLAY ADDED TO THIS PROJECT
//files to include
#include <Wire.h>
#include <stdlib.h>
//definitions & declarations
#define in_TRIG 2 //trigger pin
#define out_WS 3 //Motor speed control pin
#define out_GAS 7 //Gas relay control pin
#define out_CON 8 //Contactor relay control pin
//#define out_BRK 4 //Motor brake relay control pin
#define in_WF 12 //Wire Feed button input pin
//Variables
int WS_MIN = 2; //Minimum wire speed
int WS_MAX = 255; //Maximum wire speed
int GDEL_MIN = 10; //Minimum gas delay time
int GDEL_MAX = 1000; //Maximum Gas Delay time
boolean welding = false; //flag to indicate has been or finished welding
//*********************************************Main Program*******************************************//
//setup
void setup()
{
pinMode(out_WS, OUTPUT);
pinMode(in_TRIG, INPUT_PULLUP);
pinMode(out_GAS, OUTPUT);
pinMode(out_CON, OUTPUT);
//pinMode(out_BRK, OUTPUT);
pinMode(in_WF, INPUT_PULLUP);
pinMode(13, OUTPUT); //LED Alive pin
digitalWrite(13, LOW);
//Serial.begin(9600);
}
void loop()
{
while(digitalRead(in_WF) == LOW){inch();} //check to see if Inch button is pressed
while(digitalRead(in_TRIG) == LOW){weld();} //check to start welding
if(welding == true){dis_weld();} //if you have been welding: disengage
}
//******************************************Welder control******************************//
/*
Code for controlling the welder (Wire feed, contactor, gas solenoid, trigger type) goes here
*/
void weld() //starts welding welding
{
welding = true; //now/was welding
digitalWrite(13, HIGH);
digitalWrite(out_GAS, HIGH); //turn gas on
//Serial.println("GAS ON!"); //uncomment as necessary
digitalWrite(out_CON, HIGH); //close contactor
//Serial.println(welding); //uncomment as necessary
feed_wire(); //feed wire
}
void inch() //feeds the wire
{
while(digitalRead(in_WF) == LOW)
{
feed_wire();
}
digitalWrite(out_WS, LOW); //turn on brake
}
void feed_wire() //function that feeds wire whilst allowing speed adjustment at same time
{
//digitalWrite(out_BRK, HIGH); //Release Brake on motor
analogWrite(out_WS, map(analogRead(0), 0, 1023, WS_MIN, WS_MAX)); //set the output speed of feed motor
}
void dis_weld() //stop welding and finish with gas
{
int del = map(analogRead(1), 0, 1023, GDEL_MIN, GDEL_MAX);
boolean FLG1 = true;
while(del > 0)
{
while(FLG1 == true)
{
digitalWrite(out_CON, LOW); //turn off current
//digitalWrite(out_BRK, LOW); //apply brake to motor
FLG1 = false; //make flag false so this isn't done again
}
delay(1); //delay 1 ms
if(digitalRead(in_TRIG) == LOW) //read and check that trigger has not been pressed
{
del = 0;
weld(); //if so weld
}
//Serial.println(del);
del--; //decrease del
}
digitalWrite(out_GAS, LOW);
welding = false;
digitalWrite(out_WS, LOW);
digitalWrite(13, LOW);
}