Hi,
It look like a "PRU hunting" issue. When the stepgen try to reach "position-cmd", due to internal calculation with float variables, it is common that the stepgen algo. cannot reach a stable state at 0 speed. It sort oscillate between fraction of +/-0.0...1 "step" and trigger a direction change every period of the servo loop.
A "minvel" parameters has been added to the stepgen to avoid that, to try it add the line:
setp hpg.stepgen.00.minvel 0.001
This will "stop" the stepgen to generate step&direction change when the velocity goes bellow 0.001 (in practice it means a null velocity - motor stopped).
Try with higher values (0.01, 0.1) if you still see the problem. To find a "good" value, you can decrease this value until the problem appear again, and multiply by a factor 10 that limit value.
Another more proper way is to use the halscope and look at the signal "hpg.stepgen.00.velocity-fb", you will probably see this value going a little positive and negative at "0" speed, you need to set "hpg.stepgen.00.minvel" above the maximum/minimum value "hpg.stepgen.00.velocity-fb" at 0 speed, do x2 or x3 on this value for some margin and use that for minvel.
Hope this will solve your problem.
/Damien