Position feedback Ur3e to an external system

Our UR3e streams its TCP position data to an external PLC.

The path is a simple linear movement along the X direction with Y and Z ideally being constant. Speed 250 mm/s.

The movement was programmed with both Script and polyscope.

An analysis of the recorded movements (see below) in 4ms sample time throws up the following question.

There are fluctuations in the height (z-axis) up to 1-2 mm ( e.g. row 5,6,7) and also in y direction. Is this a fluctuation caused by robot controller? An inaccuracy in program can only lead to either increasing or decreasing tendency in z axis but not fluctuations.

Polyscope recording:

Script recording:

Also there is a difference in positions recorded between polyscope and script for the same path.

A feedback will be helpful.

Thanks and regards,
Vignaesh