weld control logic