

Robotic arms play an important role in the automation industry. Robotic arms plan processing paths based on the shape of the workpiece. However, the processing path often deviates due to inaccurate placement of the workpiece. To solve the issue of deviations, this paper develops a trajectory compensation system for a robotic arm with offset perception. This system uses the concept of workpiece boundary projection and designs an offset calculation algorithm by comparing the dimensions of the workpiece drawings, correcting errors caused by missing corners of the workpiece. In terms of operation, the system uses photoelectric sensors to quickly scan the workpiece boundary and immediately calculate the displacement and rotational offset of the workpiece. Subsequently, when deviations occur due to different placement positions of the workpiece, the robotic arm’s motion path and action must be corrected and compensated to maintain precision. Tests on selected workpieces show that the corrected rotational angle error is less than 0.4 degrees, and the translational error is less than 0.7 millimeters. Since these correction error values are lower than the 1.0 mm error threshold for the robotic arm’s trajectory tracking control. The offset-sensing robotic arm trajectory compensation system developed in this study can satisfy the requirements of smart automation production lines and arrive at the manufacturer’s application standards.