.. _tutorials_application_welding: 6.4.1 Welding Tutorials =================================== The **Welding Tutorials** section provides examples for controlling welding applications using the Doosan Robotics API. It covers both **analog** and **digital** interfaces, along with **weaving** (oscillation) motion, parameter adjustment, and TCP calibration. These examples demonstrate how to integrate the welding interface with a real robot motion sequence to achieve synchronized weld control. **Tutorial Flow** 1. **Analog Welding Control**: Configure and adjust analog welding conditions. 2. **Digital Welding Control (EtherNet/IP)**: Set up digital interface and process mapping. 3. **Weaving Patterns**: Apply trapezoidal, zigzag, circular, or sinusoidal weaving motion. 4. **Real-time Parameter Adjustment**: Modify welding conditions dynamically during operation. 5. **Welding TCP Calibration**: Calibrate the welding tool center point (TCP). 6. **Monitoring & Signal Output**: Monitor welding data and control digital welding signals. --------------------------------------- Analog Welding Control --------------------------------------- **Purpose** |br| Enable analog welding control interface and set base welding conditions such as voltage, current, and wire feed speed. .. code-block:: cpp CONFIG_ANALOG_WELDING_INTERFACE analog_if{}; CONFIG_ANALOG_WELDING_SETTING analog_set{}; // Enable analog interface. The configuration is passed by value. Drfl.app_weld_enable_analog(analog_if); // Set analog welding condition analog_set._fTargetVoltage = 22.5f; // V analog_set._fTargetCurrent = 160.0f; // A analog_set._fTargetFeedingSpeed = 6.5f; analog_set._fTargetVel = 10.0f; // travel speed, mm/s Drfl.app_weld_set_weld_cond_analog(analog_set); **Check** |br| Analog interface is activated successfully, and the configured parameters (voltage/current/feed) are applied to the external welder. --------------------------------------- Digital Welding Control (EtherNet/IP) --------------------------------------- **Purpose** |br| Establish communication with the welder through EtherNet/IP and configure both R2M (Robot-to-Machine) and M2R (Machine-to-Robot) signals. .. code-block:: cpp CONFIG_DIGITAL_WELDING_INTERFACE_PROCESS r2m_process{}; CONFIG_DIGITAL_WELDING_INTERFACE_MONITORING m2r_monitoring{}; // Set up the EtherNet/IP interface. Each direction and each group of // signals has its own configuration type. Drfl.app_weld_set_interface_eip_r2m_process(r2m_process); Drfl.app_weld_set_interface_eip_m2r_monitoring(m2r_monitoring); // Enable digital interface Drfl.app_weld_enable_digital(1); **Check** |br| Digital interface activates successfully and EtherNet/IP connection status is valid. --------------------------------------- Weaving Patterns --------------------------------------- **Purpose** |br| Configure and apply a weaving pattern (trapezoidal, zigzag, circular, or sinusoidal) to simulate weld bead oscillation. .. code-block:: cpp // Zigzag and sinusoidal weaving take the pattern as arguments: // offset Y, offset Z, gradient, weaving width, weaving cycle Drfl.app_weld_weave_cond_zigzag(2.0f, 1.0f, 0.0f, 5.0f, 3.0f); // Trapezoidal weaving takes a configuration structure instead CONFIG_TRAPEZOID_WEAVING_SETTING weave{}; weave._fOffsetY = 2.0f; weave._fOffsetZ = 1.0f; weave._fGradient = 0.0f; Drfl.app_weld_weave_cond_trapezoidal(weave); **Check** |br| The robot follows the configured oscillation pattern and maintains consistent bead width across the welding path. --------------------------------------- Real-time Parameter Adjustment --------------------------------------- **Purpose** |br| Adjust welding parameters dynamically during operation for adaptive control. .. code-block:: cpp unsigned char real_time = 1; unsigned char reset = 0; float target_voltage = 23.0f; // V float feeding_speed = 7.0f; // wire feed float travel_speed = 10.0f; // mm/s // real-time flag, reset flag, voltage, feeding speed, travel speed, // offset Y, offset Z, width rate Drfl.app_weld_adj_welding_cond_analog( real_time, reset, target_voltage, feeding_speed, travel_speed, 0.0f, 0.0f, 1.0f ); **Check** |br| Voltage, wire feed and travel speed update in real time without interrupting the welding process. --------------------------------------- Welding TCP Calibration --------------------------------------- **Purpose** |br| Calibrate the TCP (Tool Center Point) for accurate weld torch alignment. .. code-block:: cpp unsigned char mode = 0; // measurement mode float stickout = 15.0f; // torch stickout float target_pos[9][6] = { }; // nine taught joint postures LPMEASURE_TCP_RESPONSE result = Drfl.measure_welding_tcp(mode, stickout, target_pos); **Check** |br| The call returns the measured TCP and the measurement error, and the calibrated position matches the torch tip location. --------------------------------------- Monitoring & Signal Output --------------------------------------- **Purpose** Monitor welding data and control digital outputs for arc start/stop signals. .. code-block:: cpp // Start monitoring Drfl.set_on_monitoring_welding_data(OnMonitoringWeldingData); // Force a welding signal. The first argument selects the signal, as defined // by the welding interface configuration; the second carries its value. unsigned char command_type = 0; Drfl.set_digital_welding_signal_output(command_type, 1.0f); // Arc start std::this_thread::sleep_for(std::chrono::seconds(2)); Drfl.set_digital_welding_signal_output(command_type, 0.0f); // Arc stop **Check** |br| Monitoring callback provides real-time welding feedback, and the digital output toggles the external welder correctly. .. note:: - The ``app_weld_*`` functions and ``measure_welding_tcp`` are compiled only when ``DRCF_VERSION`` is defined as 2. The header defaults to 3, so a default build does not expose them. - Welding tutorials require an external welding machine (analog or digital EtherNet/IP) configured with the correct parameters. - All welding operations must run under **Auto Mode** with **Servo ON**.