System and method for automatically optimizing resistance spot welding parameters
The automatic optimization system for resistance spot welding parameters uses ultrasonic sensors and encoders to monitor the weld nugget size and displacement in real time, and automatically adjusts the welding current and time, solving the problem of unstable weld quality and achieving efficient welding parameter optimization and self-adaptation capabilities.
Patent Information
- Application Number
- CN202511764838.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-27
- Publication Date
- 2026-01-23
AI Technical Summary
In existing technologies, the setting of welding parameters relies on manual trial welding and testing, resulting in a large workload, long cycle, limited test samples, difficulty in timely adjustment according to changes in production conditions, and unstable weld quality.
An automatic optimization system for resistance spot welding parameters is adopted, including a welding parameter PC, a robot controller, a servo welding gun, a welding controller, and a weld spot detection device. The system monitors the weld nugget size and electrode rod displacement in real time through ultrasonic sensors and encoders, and automatically adjusts the welding current and time.
It enables automatic optimization of welding parameters, improves the stability of weld quality and inspection efficiency, reduces workpiece wear, and can adapt to changes in working conditions.
Smart Images

Figure CN121373705A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of resistance welding, in particular to a system and method for automatically optimizing resistance spot welding parameters. BACKGROUND
[0002] Resistance spot welding is a widely used resistance welding method in automobile body manufacturing, household appliance sheet metal processing and metal structure connection. By applying pressure to the stacked sheet metal with welding electrode and passing current, a nugget is formed in the contact area to realize connection. In actual production process, welding current, welding time and electrode pressure are the key process factors that determine the heat input and nugget size of the welding spot and affect the welding stability. In order to adapt to different materials, sheet thickness and surface conditions, the welding process parameters usually need to be set and adjusted on the production line to ensure that the welding spot quality meets the process specification requirements. At present, the setting and optimization of welding parameters usually rely on manual welding and detection, which not only has large operation amount and long cycle, but also has limited detection samples and causes workpiece loss. At the same time, it is difficult to correct the parameters in time according to the changes of production conditions, and automatically adapt and adjust, resulting in unstable welding spot quality.
[0003] However, in the current technology, the setting of welding parameters relies on manual welding and detection, which not only has large operation amount and long cycle, but also has limited detection samples and causes workpiece loss. At the same time, it is difficult to correct the parameters in time according to the changes of production conditions, and automatically adapt and adjust, resulting in unstable welding spot quality. SUMMARY
[0004] The purpose of the present application is to provide a system and method for automatically optimizing resistance spot welding parameters, which at least solves the problem of unstable welding spot quality caused by the difficulty of automatically adjusting welding parameters according to the changes of working conditions.
[0005] The present application provides the following solutions:
[0006] According to one aspect of the present application, a system for automatically optimizing resistance spot welding parameters is provided, comprising: welding parameters PC, a robot controller, a robot body, a servo welding electrode, a welding controller and a welding spot detection device;
[0007] The servo welding electrode is installed on the robot body, and the servo welding electrode comprises a servo motor, an encoder, a transmission device, an electrode arm, an electrode rod, an electrode cap and a welding transformer;
[0008] The robot controller is used to control the movement of the robot body and drive the electrode rod to move in the welding direction by the servo motor, and the encoder is used to feed back the displacement data of the electrode rod to the robot controller;
[0009] The welding controller is connected with the welding transformer, and is used to execute welding action according to the welding current and welding time issued by the welding parameters PC;
[0010] The welding spot detection device comprises a welding spot detector and an ultrasonic sensor, the ultrasonic sensor is installed on the electrode rod, used for ultrasonic detection of the welding spot after the welding is completed and output of the nugget size data;
[0011] The welding parameter PC is respectively communicated with the robot controller, the welding controller and the welding spot detection device through the bus, used for receiving the nugget size data and the electrode rod displacement data, and generating the welding current and welding time parameters according to the nugget size data and the electrode rod displacement data and then issuing the parameters to the welding controller.
[0012] Further, the ultrasonic sensor is fixed at the end position of the electrode rod and contacts the welding spot after the welding is completed for ultrasonic detection.
[0013] Further, the welding parameter PC comprises a spatter judgment module, the spatter judgment module is used for judging whether the spatter occurs according to the instantaneous drop change in the electrode rod displacement curve fed back by the encoder.
[0014] Further, the welding spot detector is used for collecting the welding current signal, the welding voltage signal and the dynamic resistance signal and sending the signals to the welding parameter PC.
[0015] Further, the welding parameters issued by the welding parameter PC to the welding controller comprise the set values of the welding current and the welding time.
[0016] Further, the robot controller is used for continuously collecting the displacement data of the electrode rod in the welding current on stage and sending the data to the welding parameter PC.
[0017] Further, the welding parameter PC further comprises a parameter optimization module, the parameter optimization module is used for generating the new welding current and the welding time according to the nugget size data and the spatter judgment result.
[0018] Further, the welding controller is used for controlling the welding transformer to output the set welding current and to perform the power welding according to the set welding time.
[0019] Further, the robot controller is used for controlling the robot body to keep the contact between the electrode rod and the welding spot after the welding is completed for ultrasonic detection.
[0020] According to two aspects of the present application, a method for automatically optimizing the resistance spot welding parameters, the method comprises:
[0021] S1, setting the initial welding current and the welding time in the welding parameter PC and issuing the initial parameters to the welding controller;
[0022] S2, the robot controller controls the robot body to move and controls the servo welding tongs to perform the welding action;
[0023] S3, the ultrasonic sensor in the welding spot detection device performs ultrasonic detection on the welding spot after the welding is completed and outputs the nugget size data;
[0024] S4, the robot controller sends the electrode rod displacement data of the servo motor encoder to the welding parameter PC, and the welding parameter PC judges whether spatter occurs in the welding process according to the displacement curve;
[0025] S5, the welding parameter PC adjusts the welding current and the welding time according to the nugget size data and the spatter judgment result and issues to the welding controller;
[0026] S6, repeating steps S2 to S5, so that the welding current and the welding time are gradually optimized.
[0027] Through the above scheme, the following beneficial technical effects are obtained:
[0028] The application comprehensively analyzes the nugget size data and the spatter judgment result through the welding parameter PC, realizes the automatic adjustment of the welding current and the welding time, makes the welding parameters be able to be dynamically corrected according to the welding spot quality feedback, so that the welding process parameters gradually converge to the appropriate range, and the welding spot quality is stable when the material difference or the welding working condition changes.
[0029] The application analyzes the electrode rod displacement curve feedback by the servo welding tongs encoder, identifies the instantaneous drop feature of the displacement in the welding current on stage, so as to realize the accurate judgment of the welding spatter, provide real-time reference for the adjustment of the welding parameters, and ensure the stability of the welding process and the consistency of the welding spot quality.
[0030] The application installs the ultrasonic sensor at the electrode rod position of the servo welding tongs, so that the welding spot can be ultrasonically detected in the contact state after the welding is completed, so as to obtain the nugget size data in real time, without disassembling or destructive testing of the welding spot, which can improve the welding spot quality detection efficiency and make the detection result be directly used for the subsequent welding parameter adjustment. BRIEF DESCRIPTION OF DRAWINGS
[0031] Figure 1 It is a system architecture diagram of the resistance spot welding parameter automatic optimization of the application;
[0032] Figure 2 It is a system layout diagram of the resistance spot welding parameter automatic optimization of the application;
[0033] Figure 3 It is a system welding tongs position curve diagram of the resistance spot welding parameter automatic optimization of the application;
[0034] Figure 4 A flow chart of a method for automatic optimization of resistance spot welding parameters. DETAILED DESCRIPTION
[0035] The technical solutions of the present application will be described clearly and completely below with reference to the drawings. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the present application.
[0036] Embodiment one:
[0037] Figure 1 A system architecture diagram of the automatic optimization of resistance spot welding parameters of the present application;
[0038] Figure 2 A system layout diagram of the automatic optimization of resistance spot welding parameters of the present application;
[0039] Figure 3 A system welding tong position curve diagram of the automatic optimization of resistance spot welding parameters of the present application.
[0040] A system for automatic optimization of resistance spot welding parameters, as shown in Figures 1-3 includes welding parameters PC, a robot controller, a robot body, a servo welding tong, a welding controller, and a welding spot detection device;
[0041] The servo welding tong is installed on the robot body, and the servo welding tong includes a servo motor, an encoder, a transmission device, an electrode arm, an electrode rod, an electrode cap, and a welding transformer;
[0042] The robot controller is used to control the movement of the robot body and to control the servo motor to drive the electrode rod to move in the welding direction. The encoder is used to feed back the displacement data of the electrode rod to the robot controller;
[0043] The welding controller is connected with the welding transformer, and is used to perform welding actions according to the welding current and welding time issued by the welding parameters PC;
[0044] The welding spot detection device includes a welding spot detector and an ultrasonic sensor. The ultrasonic sensor is installed on the electrode rod, and is used to perform ultrasonic detection on the welding spot after welding and to output the nugget size data;
[0045] The welding parameters PC are connected with the robot controller, the welding controller, and the welding spot detection device through bus communication, and are used to receive the nugget size data and the electrode rod displacement data, and to generate welding current and welding time parameters according to the nugget size data and the electrode rod displacement data and then to issue the parameters to the welding controller.
[0046] Specifically, the system comprises a welding parameter PC, a robot controller, a robot body, a servo welding tongs, a welding controller and a welding spot detection device, data interaction between the above components is carried out through an industrial bus, the welding parameter PC is responsible for receiving welding detection data and generating welding parameters, the robot controller is responsible for controlling welding actions, the welding controller is responsible for executing welding power-on processes, and the welding spot detection device is used to obtain welding spot quality related data, so that welding execution, process monitoring and parameter updating can be sequentially and cooperatively carried out in the system, and welding parameter adjustment efficiency is improved.
[0047] The servo welding tongs are installed on the robot body, in the welding process, the servo motor drives the transmission device under the control of the robot controller, so that the electrode rod is pressed or loosened along the welding direction, the encoder is used to detect the displacement of the electrode rod and feed back the data to the robot controller, and the welding transformer is used to output the welding current under the control of the welding controller, so as to provide stable pressure and displacement feedback, so that the change of mechanical behavior in the welding process can be effectively monitored, thereby providing reliable data for welding state judgment.
[0048] The robot controller is used to control the robot body to move according to the set path, so that the servo welding tongs move to the target welding position, and the pressing action of the servo motor is executed in the welding process, wherein the robot controller continuously reads the electrode rod displacement data fed back by the encoder and sends it to the welding parameter PC through the bus, so that the welding position movement and the pressing force control have stability, and the displacement change in the welding process is recorded in real time, thereby providing an accurate basis for subsequent judgment of whether the welding process is abnormal.
[0049] The welding controller is connected with the welding transformer in the servo welding tongs, after the welding parameter PC issues the welding current and welding time parameters, the welding controller controls the welding transformer to output the welding current according to the set value to complete the welding action, so as to ensure that the welding current and power-on time are executed according to the setting, so that the heat input of each welding is kept stable, thereby facilitating comparison and analysis of subsequent welding spot detection results.
[0050] The welding spot detection device comprises a welding spot detector and an ultrasonic sensor, the ultrasonic sensor is installed at the position of the electrode rod of the servo welding tongs, the electrode rod is kept in contact with the welding spot after the welding is completed by the robot controller, the ultrasonic sensor emits ultrasonic signals to the welding spot and receives reflected signals, the welding core size data is obtained by analyzing the reflected signals and transmitted to the welding parameter PC, and the welding spot detector is used to collect current, voltage and dynamic resistance and other electrical parameters in the welding process, so as to reflect the power-on state of the welding process, so that the welding spot quality parameters can be obtained immediately after the welding is completed, the detection efficiency is improved, and the situation of relying on destructive sampling on site is reduced.
[0051] The welding parameter PC then receives electrode displacement data from the robot controller and weld nugget size data from the weld detection device via the industrial bus. Based on the data, the welding parameter PC determines the weld quality and whether any abnormalities have occurred during the welding process. It then generates new welding current and welding time parameters and sends the updated welding parameters to the welding controller for execution. This allows the system to adjust the welding parameters in a timely manner when it detects changes in welding quality or abnormal welding conditions, thus maintaining stable weld quality and improving the adaptability of the production process.
[0052] The ultrasonic sensor is fixed at the end of the electrode rod and comes into contact with the weld point after welding to perform ultrasonic testing.
[0053] Specifically, the ultrasonic sensor is fixedly installed at the end of the electrode rod of the servo welding clamp, with the sensor's detection end facing the working surface of the electrode cap. After the welding action is completed, the robot controller controls the robot body to keep the welding clamp position unchanged and controls the servo motor to drive the electrode rod to continue to maintain contact with the surface of the weld point. In this contact state, the ultrasonic sensor emits ultrasonic signals to the weld point area and receives the echo signals reflected back from the internal structure of the weld point. The welding parameter PC analyzes the received echo signals, determines the size information of the weld nugget through the ultrasonic propagation path and reflection characteristics, and uses this size as one of the bases for judging the quality of the weld point.
[0054] The welding parameter PC includes a spatter detection module, which is used to determine whether spatter has occurred during welding based on the instantaneous drop change that appears in the electrode rod displacement curve fed back by the encoder.
[0055] Specifically, the welding parameter PC includes a spatter detection module. This module analyzes the electrode rod displacement data transmitted by the robot controller. During welding, the servo motor drives the electrode rod to apply pressure to the workpiece and maintain contact. The encoder outputs the electrode rod's displacement change curve in real time. Figure 3 During the welding current-on phase, the welding parameter PC continuously monitors the displacement curve. When spatter occurs, the rapid ejection of metal from the weld nugget causes an instantaneous decrease in the force on the electrode rod, resulting in a characteristic rapid drop in the displacement curve. The spatter judgment module identifies this sudden drop to determine whether spatter has occurred during the welding process and uses the judgment result as an important basis for adjusting the welding parameters. This allows the system to promptly identify abnormal working conditions during the welding process, avoid continuously using parameters that may cause spatter or poor welds, and improve the stability of the welding process and the consistency of weld quality.
[0056] The weld spot detector is used to collect welding current signals, welding voltage signals, and dynamic resistance signals and send the signals to the welding parameter PC.
[0057] Specifically, the weld spot detector in the weld spot detection device is used to collect electrical parameters generated during the welding process in real time. While outputting the welding current, the welding controller provides the welding current signal and welding voltage signal to the weld spot detector. The weld spot detector calculates the dynamic resistance of the welding process based on the collected current and voltage, and sends the current, voltage and dynamic resistance signals to the welding parameter PC through the industrial bus. The welding parameter PC can determine whether the welding process is stable based on these electrical parameters, such as whether the current waveform is normal, whether the energization is sufficient and whether the resistance change conforms to the weld nugget formation law, thereby providing an auxiliary basis for subsequent welding parameter adjustment. Through this real-time electrical parameter acquisition method, the system can monitor the welding energization status without adding additional hardware, improving the reliability of welding quality assessment.
[0058] The welding parameters sent by the PC to the welding controller include the set values for welding current and welding time.
[0059] Specifically, after receiving the weld nugget size data uploaded by the weld spot detection device and the electrode rod displacement data uploaded by the robot controller, the welding parameter PC determines new welding parameters based on the current weld quality. The set values of welding current and welding time are then sent to the welding controller via the industrial bus. Upon receiving these set parameters, the welding controller executes corresponding power-on control based on the welding current and welding time, causing the welding transformer to output welding current according to the set values to complete the next welding operation. This ensures that the optimized welding parameters are applied to subsequent welding operations in a timely manner, and that the welding energy input is quickly adjusted when the welding quality deviates, thereby improving the consistency and stability of the weld quality.
[0060] The robot controller is used to continuously acquire displacement data of the electrode rod during the welding current-on phase and send it to the welding parameter PC.
[0061] Specifically, during the welding current-on phase, the robot controller continuously collects electrode rod displacement data fed back by the encoder in the servo welding gun. As the welding current is applied, the workpiece material softens due to heat, and the stress state of the electrode rod changes. The encoder can output the displacement curve of the electrode rod in real time. The robot controller records this displacement data at a fixed sampling frequency and sends it to the welding parameter PC in real time via the industrial bus. The welding parameter PC can analyze whether the welding process is normal based on the change characteristics of the displacement curve, such as whether there is a sudden drop in displacement caused by spatter, thereby ensuring that a continuous and complete welding displacement process record is obtained, providing a reliable process data basis for welding status judgment and welding parameter adjustment.
[0062] The welding parameter PC also includes a parameter optimization module, which is used to generate new welding current and welding time based on weld nugget size data and spatter judgment results.
[0063] Specifically, the welding parameter PC is equipped with a parameter optimization module, which comprehensively analyzes the weld nugget size data uploaded by the weld nugget detection device and the spatter judgment results from the spatter judgment module. After each welding operation, the welding parameter PC obtains the weld nugget size and determines whether the size meets the preset standard. At the same time, it determines whether spatter occurred during the welding process based on whether there is an instantaneous drop in the electrode rod displacement curve. The parameter optimization module determines the direction of welding energy adjustment based on the weld nugget size deviation and spatter situation. It generates new welding current and welding time parameters by increasing or decreasing the welding current and welding time, and sends them to the welding controller for the next welding operation. This allows the welding parameters to be automatically corrected based on the weld quality and welding process status, achieving adaptive response to changes in welding conditions and improving the stability of weld quality.
[0064] The welding controller is used to control the welding transformer to output the set welding current and to perform welding according to the set welding time.
[0065] Specifically, the welding controller is electrically connected to the welding transformer in the servo welding gun. It is used to perform energized welding according to the welding current setting value and welding time setting value issued by the welding parameter PC. After receiving the setting parameters, the welding controller controls the welding transformer to output a welding current of the corresponding amplitude according to the welding current setting value, and controls the energization duration based on the welding time setting value. This ensures that the welding process is completed under the set current intensity and energization duration, thereby ensuring that the heat input of the welding process remains consistent with the setting. This ensures that each welding is carried out under the same process conditions, thereby improving the repeatability of weld quality and providing a stable basis for the welding parameter PC to perform weld detection and parameter optimization.
[0066] The robot controller is used to control the robot body after welding to keep the electrode rod in contact with the weld point for ultrasonic testing.
[0067] Specifically, after welding is completed, the robot controller continues to control the robot body to maintain the stable position of the servo welding gun, keeping the electrode rod in contact with the surface of the weld joint so that the ultrasonic sensor can perform ultrasonic detection. At the moment welding ends, the robot controller does not perform the welding gun lifting action, but maintains the current position of the servo motor, so that the electrode rod and the weld joint form a good contact interface, and provides stable coupling conditions for the transmission and echo reception of ultrasonic signals. Subsequently, the ultrasonic sensor completes the weld joint detection in this contact state, and the collected data is transmitted to the welding parameter PC for weld nugget size analysis. This avoids contact deviation caused by repeated positioning between the sensor and the weld joint, making the ultrasonic detection process more stable and consistent, and improving the accuracy and reliability of weld joint quality detection.
[0068] Example 2:
[0069] Figure 4 This is a flowchart of a method for automatically optimizing resistance spot welding parameters according to a specific embodiment of the present invention.
[0070] The methods include:
[0071] S1. Set the initial welding current and welding time in the welding parameter PC, and send the initial parameters to the welding controller;
[0072] S2. The robot controller controls the movement of the robot body and controls the servo welding gun to perform welding actions;
[0073] S3. The ultrasonic sensor in the weld joint detection device performs ultrasonic detection on the weld joint after welding and outputs weld nugget size data.
[0074] S4. The robot controller sends the electrode rod displacement data of the servo motor encoder to the welding parameter PC. The welding parameter PC determines whether spatter occurs during the welding process based on the displacement curve.
[0075] S5. The welding parameter PC adjusts the welding current and welding time based on the weld nugget size data and spatter judgment results, and sends the data to the welding controller.
[0076] S6. Repeat steps S2 to S5 to gradually optimize the welding current and welding time.
[0077] Specifically, the initial welding current and welding time are first set in the welding parameter PC, and these initial parameters are sent to the welding controller to execute the welding. Then, the robot controller controls the movement of the robot body, so that the servo welding gun reaches the target weld point and completes the welding action. After welding, the ultrasonic sensor in the weld point detection device keeps in contact with the weld point, obtains the weld nugget size data through the transmission and reception of ultrasonic signals, and sends it to the welding parameter PC. At the same time, the robot controller sends the electrode rod displacement curve recorded by the servo motor encoder to the welding parameter PC to determine whether there is a sudden drop in displacement caused by the spray of molten metal during the welding process, thereby determining whether spatter has occurred. Based on the comprehensive result of whether the weld nugget size data meets the preset standard and whether spatter has occurred, the welding parameter PC automatically adjusts the welding current and welding time for subsequent welding, and sends the adjusted parameters to the welding controller to execute the next welding. By continuously repeating the cycle of welding, detection, and parameter adjustment, the welding current and welding time gradually approach the optimal value, thereby keeping the weld quality stable and having the ability to adapt to changes in working conditions.
[0078] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A system for automatically optimizing resistance spot welding parameters, characterized in that, include: Welding parameter PC, robot controller, robot body, servo welding gun, welding controller and weld spot detection device; The servo welding clamp is mounted on the robot body and includes a servo motor, encoder, transmission device, electrode arm, electrode rod, electrode cap, and welding transformer. The robot controller is used to control the movement of the robot body and to control the servo motor to drive the electrode rod to move in the welding direction. The encoder is used to feed back the displacement data of the electrode rod to the robot controller. The welding controller is connected to the welding transformer and is used to perform welding actions according to the welding current and welding time issued by the welding parameter PC. The weld joint detection device includes a weld joint detector and an ultrasonic sensor. The ultrasonic sensor is mounted on the electrode rod and is used to perform ultrasonic detection on the weld joint after welding and output weld nugget size data. The welding parameter PC is connected to the robot controller, welding controller, and weld spot detection device via bus communication. It is used to receive weld nugget size data and electrode rod displacement data, and generate welding current and welding time parameters based on the weld nugget size data and electrode rod displacement data before sending them to the welding controller.
2. The system for automatic optimization of resistance spot welding parameters according to claim 1, characterized in that, The ultrasonic sensor is fixed at the end of the electrode rod and comes into contact with the weld point after welding to perform ultrasonic testing.
3. The system for automatic optimization of resistance spot welding parameters according to claim 1, characterized in that, The welding parameter PC includes a spatter detection module, which is used to determine whether spatter has occurred during welding based on the instantaneous drop change that appears in the electrode rod displacement curve fed back by the encoder.
4. The system for automatic optimization of resistance spot welding parameters according to claim 1, characterized in that, The weld spot detector is used to collect welding current signals, welding voltage signals, and dynamic resistance signals, and send the signals to the welding parameter PC.
5. The system for automatic optimization of resistance spot welding parameters according to claim 1, characterized in that, The welding parameters sent by the welding parameter PC to the welding controller include the set values for welding current and welding time.
6. The system for automatic optimization of resistance spot welding parameters according to claim 1, characterized in that, The robot controller is used to continuously collect displacement data of the electrode rod during the welding current switching phase and send it to the welding parameter PC.
7. The system for automatic optimization of resistance spot welding parameters according to claim 1, characterized in that, The welding parameter PC also includes a parameter optimization module, which is used to generate new welding current and welding time based on weld nugget size data and spatter judgment results.
8. The system for automatic optimization of resistance spot welding parameters according to claim 1, characterized in that, The welding controller is used to control the welding transformer to output the set welding current and to perform welding according to the set welding time.
9. The system for automatic optimization of resistance spot welding parameters according to claim 1, characterized in that, The robot controller is used to control the robot body after welding to keep the electrode rod in contact with the weld point for ultrasonic testing.
10. A method for automatically optimizing resistance spot welding parameters, characterized in that, A system for automatically optimizing resistance spot welding parameters according to any one of claims 1-9, the method comprising: S1. Set the initial welding current and welding time in the welding parameter PC, and send the initial parameters to the welding controller; S2. The robot controller controls the movement of the robot body and controls the servo welding gun to perform welding actions; S3. The ultrasonic sensor in the weld joint detection device performs ultrasonic detection on the weld joint after welding and outputs weld nugget size data. S4. The robot controller sends the electrode rod displacement data of the servo motor encoder to the welding parameter PC. The welding parameter PC determines whether spatter occurs during the welding process based on the displacement curve. S5. The welding parameter PC adjusts the welding current and welding time based on the weld nugget size data and spatter judgment results, and sends the data to the welding controller. S6. Repeat steps S2 to S5 to gradually optimize the welding current and welding time.