Can I achieve real-time speed control use MOVEP?

My script is as follows. I use UR5E and needs to change speed on every waypoint. But when I got TCP speed using speed = get_actual_tcp_speed() textmsg("TCP Speed: ", speed), I found the actual speed are different from the target speed even though I use a larger accel_mss (for example, the target speed is 0.019 but the actual speed may be 0.015,0.016 or 0.02). Is this right? how to exactly control the speed on every waypoint?

movep(p[-0.517287, 0.127085, -0.040110, -0.497385, -0.091463, 0.023245],accel_mss,speed_ms,0)
speed_ms= 0.014
socket_send_line(“G1 P1.0”, “socket_01”)
movep(p[-0.517999, 0.128532, -0.040803, -0.497385, -0.091463, 0.023245],accel_mss,speed_ms,0.001)
speed_ms= 0.014
socket_send_line(“G1 P1.0”, “socket_01”)
movep(p[-0.518743, 0.129959, -0.041577, -0.497385, -0.091463, 0.023245],accel_mss,speed_ms,0.001)
speed_ms= 0.015
socket_send_line(“G1 P1.0”, “socket_01”)
movep(p[-0.519365, 0.131118, -0.042319, -0.540721, -0.109104, 0.030271],accel_mss,speed_ms,0.001)
speed_ms= 0.015
socket_send_line(“G1 P1.0”, “socket_01”)
movep(p[-0.520293, 0.132615, -0.043407, -0.580746, -0.126889, 0.037975],accel_mss,speed_ms,0.001)
speed_ms= 0.016
socket_send_line(“G1 P1.0”, “socket_01”)
movep(p[-0.521024, 0.133727, -0.044299, -0.617815, -0.143469, 0.045875],accel_mss,speed_ms,0.001)
speed_ms= 0.016
socket_send_line(“G1 P1.0”, “socket_01”)
movep(p[-0.521928, 0.134983, -0.045412, -0.650371, -0.158162, 0.053456],accel_mss,speed_ms,0.001)
speed_ms= 0.017
socket_send_line(“G1 P1.0”, “socket_01”)
movep(p[-0.522787, 0.136140, -0.046534, -0.675862, -0.170250, 0.060000],accel_mss,speed_ms,0.001)
speed_ms= 0.018
socket_send_line(“G1 P1.0”, “socket_01”)
movep(p[-0.523751, 0.137378, -0.047807, -0.693713, -0.179617, 0.065136],accel_mss,speed_ms,0.001)
speed_ms= 0.018
socket_send_line(“G1 P1.0”, “socket_01”)
movep(p[-0.524739, 0.138472, -0.048999, -0.705641, -0.186872, 0.069054],accel_mss,speed_ms,0.001)
speed_ms= 0.018
socket_send_line(“G1 P1.0”, “socket_01”)
movep(p[-0.525665, 0.139524, -0.050162, -0.714106, -0.192956, 0.072252],accel_mss,speed_ms,0.001)
speed_ms= 0.018
socket_send_line(“G1 P1.0”, “socket_01”)
movep(p[-0.526680, 0.140497, -0.051298, -0.720629, -0.198357, 0.075033],accel_mss,speed_ms,0.001)