I checked the HAL-file, but as far as I can see the position feedback is correctly connected to the stepgen, so something else has to go wrong.
I see that you already put the following code in your HAL-file:
Code:
setp [TOLP2](CARD0).stepgen.02.debug TRUE
Can you re-enable the code and copy the created output to the forum? To see the output, you have to start LinuxCNC from the command line, just by typing linuxcnc. Any output created from the debug will be printed to the output.It will help me to further pinpoint the cause of this behavior.
Furthermore I see that in the HAL-file, the order of adding functions to the thread can be optimized. Please, use the following order:
Code:
addf [TOLP2](CARD0).read servo-thread
addf motion-command-handler servo-thread
addf motion-controller servo-thread
addf [TOLP2](CARD0).write servo-thread
Above order means that the current state is read from the FPGA. The motion-controller can then determine the required state of the stepgens. Finally this desired state is written to the stepgen. The loop is nice and tight.