Thanks for spotting that error! I pushed it right to the repo, together with some small updates on the stepgen (mostly debugging).
The main issue you described is:
- the BOARD.stepgen.XX.position-feedback gives erratic readings when machine is in E-stop mode;
- the BOARD.stepgen.XX.position-feedback is static when E-stop is not active;
- do you still get following errors (I assume you do).
It is strange, as with my test setup I, as added a few posts above, I cannot replicate this behavior. Did you change your HAL-file with the changes above, because I see in your original HAL-files you tied into the veloctiy command without setting the parameter
position_mode to False. The code in your HAL-file should look like this:
Code:
net xpos-cmd joint.0.motor-pos-cmd => [TOLP2](CARD0).stepgen.00.position-cmd
net xpos-fb [TOLP2](CARD0).stepgen.00.position_prediction => joint.0.motor-pos-fb
net xenable joint.0.amp-enable-out => [TOLP2](CARD0).stepgen.00.enable
When you are setting the
velocity-cmd pin when in position mode, there will be no data be send to the card (because the commanded position remains 0). Maybe we should throw an warning when this happens?
At this moment I'm on holiday and I don't brought my test-bed with me. Will be back in the beginning of August. Hope that above will solve (part of) your problem.