A method of performing a welding operation on a workpiece (100, 310) using a programmable logic controller that is communicatively coupled to a non-transitive memory device and a welding machine, the method comprising: obtaining, by the programmable logic controller, a dimension of the workpiece (100, 310) to be welded from a technical drawing stored in the memory device; and being characterised by the following steps: obtaining, by the programmable logic controller, one or more default values for a plurality of welding parameters for the welding operation from the memory device, wherein the plurality of welding parameters comprise an oscillation width (w) and an oscillation speed (Vo); obtaining, by the programmable logic controller, a pitch for the welding operation; calculating, by the programmable logic controller, a rotational speed (Vs) for the workpiece (100, 310) during a first portion of the welding operation; performing, with the welding machine, the first portion of the welding operation using the rotational speed based on a first instruction received from the programmable logic controller; obtaining, by the programmable logic controller, a new value for at least one of the group consisting of the oscillation width, the oscillation speed, and the dimension, wherein the new value is used during a second portion of the welding operation; calculating, by the programmable logic controller, a second rotational speed for the workpiece (100, 310) during the second portion of the welding operation using the new value, wherein the pitch is maintained as constant; and performing, with the welding machine, the second portion of the welding operation using the second rotational speed based on a second instruction received from the programmable logic controller. obtaining, by the programmable logic controller, a dimension of the workpiece (100, 310) to be welded from a technical drawing stored in the memory device; and being characterised by the following steps: obtaining, by the programmable logic controller, one or more default values for a plurality of welding parameters for the welding operation from the memory device, wherein the plurality of welding parameters comprise an oscillation width (w) and an oscillation speed (Vo); obtaining, by the programmable logic controller, a pitch for the welding operation; calculating, by the programmable logic controller, a rotational speed (Vs) for the workpiece (100, 310) during a first portion of the welding operation; performing, with the welding machine, the first portion of the welding operation using the rotational speed based on a first instruction received from the programmable logic controller; obtaining, by the programmable logic controller, a new value for at least one of the group consisting of the oscillation width, the oscillation speed, and the dimension, wherein the new value is used during a second portion of the welding operation; calculating, by the programmable logic controller, a second rotational speed for the workpiece (100, 310) during the second portion of the welding operation using the new value, wherein the pitch is maintained as constant; and performing, with the welding machine, the second portion of the welding operation using the second rotational speed based on a second instruction received from the programmable logic controller.