buildbotics / bbctrl-firmware

Buildbotics CNC Controller Firmware
https://buildbotics.com/
Other
67 stars 24 forks source link

Losing steps on sequential arc moves #275

Open DougCoffland opened 3 years ago

DougCoffland commented 3 years ago

I get violent failures and massive step losses when running sequential helical moves. The following program fails starting at line 41:

Bug1_3_19.nc.txt

The following program has 0.1 second delays inserted ahead of each of the arc moves starting at line 41. It works correctly, but obviously slows thing down a lot.

Bug1_3_19_c3.nc.txt

A second form of this failure is to use the P option for multiple turns in a single helical move. This fails as well.

DougCoffland commented 3 years ago

After further review, it seems that this problem is somehow related to the configuration. I created a program that fails and it is attached. (see short5.nc.txt)

I have also attached two configuration files called fails.json and works.json. One works, the other doesn't, but I can't seem to see where they differ in a place that should matter.

These configurations require that the X is assigned to Motors 0 and 3, Y is assigned to Motor 1, and Z is assigned to Motor 2.

fails.json.txt works.json.txt short5.nc.txt

jcoffland commented 3 years ago

I think the problem is that the failing config has "junction-accel": 1000000. It's dangerous to change this parameter. The default is 200000 so that is 5x higher.

DougCoffland commented 3 years ago

I played around with my machine to find the highest possible value for junction-acceleration. In my case, it was 425,000.

However, I noticed that once the system has failed, you cannot just set the junction-acceleration back to a working value, but you have to reboot (or estop). For instance, after rebooting, I set the value to 425,000 and run my test program. It works correctly. Then, I raise the setting to 1,000,000 and it fails. Then, I lower it back to 425,000 and it still fails. Then, I estop. After the estop, it works correctly again at 425,000. This caused a lot of confusion in determining the best speed for my machine.