t-oster / LibLaserCut

a platform independant library to control Lasercutters. This is the base library for VisiCut
http://visicut.org
Other
59 stars 55 forks source link

Focus value not exported anymore after using execute #213

Open viralatadesbois opened 4 months ago

viralatadesbois commented 4 months ago

Hi, We use a lot of thick material so we make the focus on the surface for engraving and have a focus value for each material set to minus half the thickness (for example for 8mm mdf the cut setting has a focus of -4mm) We generaly export the gcode and send it to the laser cutter via its web interface (it's a Robotseed lasercutter with a smoothieboard). And it works fine. But to spare some times we also use the "execute" button from visicut to send the gcode directly. This is where we have a strange behavior:

Thank you.

mgmax commented 4 months ago

Please give all needed details so that someone else can re-create the problem on their PC with just your information.

mgmax commented 4 months ago

For example, could you upload a ZIP of your settings folder or send screenshots of the relevant parts?

viralatadesbois commented 4 months ago

Visicut-offset-problem.zip

Thank you for your answer. It happens fot what it seems everytime, wathever the offset (positive or negative) we use. I joined our config, and 2 gcodes of the same file exported before and after the "execute" command and we see the line with G0 Z-3 disapeared.

mgmax commented 4 months ago

oops... without even looking at your file, I now remember that I almost fixed that bug two years ago but never found time to finish that...

So the issue is in LibLaserCut, the library that provides the laser drivers of VisiCut. Moving the issue over to there.

See https://github.com/t-oster/LibLaserCut/pull/177 : The currentFocus variable is not reset correctly, so sending the same job twice does sometimes not have the same content.

We should also add a test against such bugs in LibLaserCut. We already have some tests that check that the content is the same when the same job is sent twice . These were introduced in https://github.com/t-oster/LibLaserCut/commit/84435545e1bf4efcce0621ad0d91f964afa1e2db but specifically for the focus we don't do that yet.