Ever-increasing demand for complex freeform surfaces machined by ultra-precision five-axis machines necessitates efficient on-machine surface measurement (OMSM) systems. While OMSM offers significant advantages in metrology efficiency and machining accuracy, integrating it with these machines presents a challenge due to complex data synchronization and processing. This paper addresses this challenge by proposing a dedicated controller for synchronized acquisition of sensor measurement data and machine coordinate data. Additionally, a straightforward sensor alignment method is presented. The effectiveness of the proposed OMSM system is demonstrated through successful 2D and 3D measurements, significantly streamlining the traditional time-consuming offline coordinate measuring machine (CMM) and optical profilometer measurements.