Closed wdevauld closed 10 years ago
I personally like having the option to choose, but I think relative coordinates are more useful for most people.
Sorry, I am not very comfortable with HTML and JS but I know gcode and CNC, so hope you don't mind me posing suggestions on how to fix this without actually implementing the solution. Let me know if this is helpful or not.
Two ways we could make this work:
A toggle box to switch between relative and absolute. The relevant lines I think are 102 and 144 in app_datahandler.js G90 just needs to be changed to G91 to switch to relative, do it with a variable and you are off to the races.
A home offset button which sets an origin offset (this is probably a better idea) From the manual: use G10 L20 P1 to make the current position the origin in the G54 coordinate system, P2 for the G55 coord system So we would to run that command before the gcode gets run, and change the G90 in app_datahandler.js to G54 for that job. 0,0 will now be where the laser currently is but it doesn't touch the machine coordinates.
Either solution should have the ability to leave it at G90, there are certain things (like repeat cuts in a jig) that absolute coordinates are fantastic for.
Can you share this manual? I have a reference from CamBam that lists G-codes, is that what you are using?
I guess, what is the difference between the G54 and G55 coord systems? Is one relative, and one absolute? Just like G90 and G91?
-W
On Tue, Mar 25, 2014 at 11:24 AM, dbynoe notifications@github.com wrote:
I personally like having the option to choose, but I think relative coordinates are more useful for most people.
Sorry, I am not very comfortable with HTML and JS but I know gcode and CNC, so hope you don't mind me posing suggestions on how to fix this without actually implementing the solution. Let me know if this is helpful or not.
Two ways we could make this work:
A toggle box to switch between relative and absolute. The relevant lines I think are 102 and 144 in app_datahandler.js G90 just needs to be changed to G91 to switch to relative, do it with a variable and you are off to the races.
A home offset button which sets an origin offset (this is probably a better idea) From the manual: use G10 L20 P1 to make the current position the origin in the G54 coordinate system, P2 for the G55 coord system So we would to run that command before the gcode gets run, and change the G90 in app_datahandler.js to G54 for that job. 0,0 will now be where the laser currently is but it doesn't touch the machine coordinates.
Either solution should have the ability to leave it at G90, there are certain things (like repeat cuts in a jig) that absolute coordinates are fantastic for.
Reply to this email directly or view it on GitHubhttps://github.com/Protospace/LasaurApp/issues/2#issuecomment-38594520 .
http://www.lasersaur.com/manual/gcode The lasersaur basically is based on grbl a minimal gcode implementation for the atmega embedded chip. So its massively cut down from the standard. Cambam is sort of a jack of all trades it writes the gcode, but each machine will have its own gcode interpreter that may or may not support all gcode commands, so how a program runs on mach3 may not be the same as it runs on linuxcnc or grbl. That is where the post processor in cambam comes in, but that's a long story. Our firmware is here: https://github.com/Protospace/LasaurApp/tree/master/firmware/src if you really want to get under the hood of what the machine is actually doing.
Basically it looks like they are using G54 as a table offset and G55 as a custom offset. Its similar to the way fixture offsets work on a CNC mill.
Also upon further digging it looks like there already is code in appmover to set offsets by shift clicking the page. ( $("#cutting_area").click(function(e) {) So it might just be a matter of copying that function and passing it the current position rather than a mouse click.
Also in the main branch:https://github.com/stefanix/LasaurApp/blob/master/frontend/js/app_mover.js there is a subroutine called function assemble_and_set_offset that seems to do what we are talking about.
The g-code generation should be in relative mode instead of absolute mode.