For Litex-CNC I've found that the uncommanded movement is not due to the driver. Somehow when a joint follow error occurs, LinuxCNC goes into EStop. However the motion planner (
motmod) is still commanding new positions to the driver, thus it keeps moving. This is a really weird error. The only way how I see I can solve this, is by preventing a joint follow error. But
if an error occurs, I don't know what will happen.
I think the source of the joint follow error is due to the acceleration speed of the driver is the same as the acceleration of the motion planner. Due to rounding errors, the commanded speed cannot be reached within one cycle and thus the driver is trying its best to compensate. There are two possible problems to this problem:
- Add a contingency in the driver (let's say 10%) on the acceleration.
- Follow the hostmot2 (Mesa cards) approach and allow for an acceleration of 0, which means that the acceleration is completely handled by the motion planner.
I'll try option 1 first to see whether this solves the joint follow error and then modify the code to the second option if it does.
Backup plan
I still like the flexibility of my version of the driver, in such away that you can make it tailormade to the machine based on a config-file. If above is not working, my plan is:
- to base a template on LCNC or ColorCNC;
- create a Python-script which makes the source code of a driver based on the template and the settings in the JSON-file;
- compile the dedicated driver.
Wondering what your opinion is on the backup plan.