okay....
usually there is no need for a second thread if you don't need an Step Generator. Putting the Ethercat read and write in an faster thread then the calculations is the same as to putting water in an river.

and waste ressources.
delete "base_period_nsec=500000" and put the lcec functions in the servo thread, change the apptimecycle_period in the ec_conf to 1000000. that's it for timing.....
but theres annother
big Problem :
execution order
!!!
the running order of your functions is wrong. You are reading Inputs and writing directly the outputs without any action or calculations, without pids this will not be very terrible, but every command is 1 cycle delayed (f-error will be high).
So think about the execution order like we are using an normal PLC or programming an realtime function. the functions are executed like you have arranged them in hal file. So if an function needs the outputs from annother function it has to be called after this.
reading inputs
.
.
functions (IO Control, Motion, PLC)
.
.
calculations (pids always after motion, kinematics before motion)
writing Outputs
lcec.read_all (reading from hardware) has to be the first addf line in the hal.
lcec.write_all (write to hardware) must be the last addf line in the hal.