buildbotics / bbctrl-firmware

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

G53 and G92.2 offsets not handled correctly in simulation #297

Closed DougCoffland closed 2 years ago

DougCoffland commented 3 years ago

G53 tells the controller to move in absolute coordinates. Assume the following:

Then execute the following command

G53 G0 X50

The system will correctly move to the following:

However, in the simulation, it seems to add the current X position to the target position in the G53 move which would result in X absolute position being 150. If this is beyond the upper soft limit, then 'OVER' is displayed and the axis line turns yellow.

The same thing happens when using G92.2 to adjust the code. G92.2 is supposed to disable the offsets. Once again, executing the following code works correctly;

G92.2
G0 X50
G92.3

This moves to absolute position 50 and sets the position and offsets correctly. However, it results in a 'OVER' condition in the simulation if the current x position plus 50 is greater than the upper soft limit.

This problem occurs in the current version (0.4.15) and in the current beta release (1.0.0rc15).

DougCoffland commented 3 years ago

Refer to this topic on the forum for more information.

https://forum.buildbotics.com/viewtopic.php?f=5&t=226

DougCoffland commented 2 years ago

Here is a commented gcode program that demonstrates this issue. The comments explain how to set up the machine for the failure and explain what happens in the simulation and in the actual execution

(set x lower soft limit to -100mm and x upper soft limit to 100mm and then home the machine)
(then move to x = -75mm and then set the x position to zero by clicking set offset.)

G21  (metric units)
G53 G0 X-50

(the previous move should move 25mm to the right to get from X = -75mm to get to absolute position X=-50mm)
(but the simulation actually adds -50mm to -75mm and attempts to go to X=-125mm, this is out of bounds,)
(so it reports under.)
(When you run the program it correctly moves 25mm to the right which is absolute position X=-50)
DougCoffland commented 2 years ago

fixed in version 1.0.2