winder / Universal-G-Code-Sender

A cross-platform G-Code sender for GRBL, Smoothieware, TinyG and G2core.
http://winder.github.io/ugs_website/
GNU General Public License v3.0
1.88k stars 763 forks source link

Pause on M6 tool change #172

Open Legendaire opened 10 years ago

Legendaire commented 10 years ago

When milling a PCB board and drilling the holes a person changes drills exactly ten million three hundred and fourty seven times. Right now M6 is ignored. Can we get UGCS to pause sending new g-code to the controller so the tools can be changed? I know that Mach3 does this.

gerritv commented 10 years ago

In the meantime you can always enhance your CAM post-processor to implement an M6 by moving somewhere, stopping spindle, pause, you change tool, hit resume and go on your merry way? M6 being implemented would help of course but while M6 is in force you can't by definition jog, etc. I tried this using CamBam, works ok. Plus it really should be enhanced in Grbl.

Legendaire commented 10 years ago

The coincidence of you writing now is rather ironic. I am just testing a different g-code sender which allows pauses. I have to manually find each m6 command but that's fine. There are only a few in the program and it has a text search function. The name is gcode step and alignment tool (at least that is what the title bar says).

On Sat, Aug 16, 2014 at 8:54 AM, Gerrit notifications@github.com wrote:

In the meantime you can always enhance your CAM post-processor to implement an M6 by moving somewhere, stopping spindle, pause, you change tool, hit resume and go on your merry way? M6 being implemented would help of course but while M6 is in force you can't by definition jog, etc. I tried this using CamBam, works ok. Plus it really should be enhanced in Grbl.

— Reply to this email directly or view it on GitHub https://github.com/winder/Universal-G-Code-Sender/issues/172#issuecomment-52396809 .

gerritv commented 10 years ago

His gcode comes from pcb2gcode. I will take a look at it as this is where the gcode changes should be made, i.e. it already seems to be doing a repositioning to tool change location and M0 for pause. The only real thing to remove is the M6 and G64 for Grbl. Also perhaps embed the G81 to G01 code. Of course it would be wonderful if Grbl handled the canned drill cycles but those are not simple to implement due to their modal behaviour. I think UCS could handle the Pause status better, at present I have to pause and resume the file when Grbl gets to an M0. My concern is that in many cases people are wanting UCS to do things that it should not do, e.g. filter out gcode that should be fixed in post processor or earlier in the sequence. The gcode file should stand on its own 2 feet otherwise you create a situation where your file will run with only a specific combination for software. Thank you for pointing me to that GSAT tool, it led to some useful knowledge on setting up milling jobs.

Legendaire commented 10 years ago

I tried it out today. The good news is it will pause. The bad news is it won't let you jog when you do. I had to remember the coords I was at and use those for a g92 command in universal gcode sender. I sent the tool to xy zero and manually jogged by turning the stepper by hand on the shapeoko

  1. Let me finish this on my laptop... On Aug 17, 2014 6:09 AM, "Gerrit" notifications@github.com wrote:

His gcode comes from pcb2gcode. I will take a look at it as this is where the gcode changes should be made, i.e. it already seems to be doing a repositioning to tool change location and M0 for pause. The only real thing to remove is the M6 and G64 for Grbl. Also perhaps embed the G81 to G01 code. Of course it would be wonderful if Grbl handled the canned drill cycles but those are not simple to implement due to their modal behaviour. I think UCS can to handle the Pause status better, at present I have to pause and resume the file when Grbl gets to an M0. My concern is that in many cases people are wanting UCS to do things that it should not do, e.g. filter out gcode that should be fixed in post processor or earlier in the sequence. The gcode file should stand on its own 2 feet otherwise you create a situation where your file will run with only a specific combination for software. Thank you for pointing me to that GSAT tool, it led to some useful knowledge on setting up milling jobs.

— Reply to this email directly or view it on GitHub https://github.com/winder/Universal-G-Code-Sender/issues/172#issuecomment-52421452 .

gerritv commented 10 years ago

M0 specifically does not allow any movement, it all needs to be done before that block is executed. I am working my way through compiling pcb2gcode for Windows. I will hack at that over the next day or so, need it later on anyway :-)

Legendaire commented 10 years ago

I don't know if it was executing an m0 behind the scenes or not. It definitely wasn't in my gcode program. It just stopped sending gcode to the grbl board from what I can assume. One may set the program to pause on any line just like a debugger. ... let me finish what is so much easier to type on a keyboard than a small phone screen... I used a feeler gauge and a multimeter to get the tool's zero. I closed UGCS. When in the other program I unplugged the power to the steppers and told the software to jog .88mm z+ (the height of my feeler). I was ready to go again. I told the software to start at the m6 tool change. grbl ignores m6 but it sure makes it easy to find m6 in a gcode text file. It's too many steps at the moment but it worked for the bas relief I was carving. Using the two tools took the time down from 5 hours to 1.6 hours. A dremmel with the electronic speed control to keep the spindle speed constant make a difference too. Let me know how your compiling goes. We are going to be using this mill for a lot of pcb boards I can predict.

On Sun, Aug 17, 2014 at 9:30 AM, Gerrit notifications@github.com wrote:

M0 specifically does not allow any movement, it all needs to be done before that block is executed. I am working my way through compiling pcb2gcode for Windows. I will hack at that over the next day or so, need it later on anyway :-)

— Reply to this email directly or view it on GitHub https://github.com/winder/Universal-G-Code-Sender/issues/172#issuecomment-52423404 .

chamnit commented 10 years ago

@gerritv and @Legendaire : Please see my post regarding moving while paused by feed hold or M0. ShapeOko Forums

In short, Grbl won't be doing this due to safety concerns when new users will very likely misuse a feature like this. I will perhaps add it later as a compile-time option for advanced users, who know what they are doing and understand the potential consequences are when messing with the flow of a g-code program.

gerritv commented 10 years ago

@chamnit I agree. I think Grbl does a fantastic job executing gcode correctly as does UCS. It should not by default skip those requirements. M0 is a Pause, not a 'lets move the tool around and confuse the next gcode block' :-) If someone builds a gcode file carefully they can get away with it, but that is not to be expected from most gcode CAM generators. For tool changes the CAM should already be generating a move to tool change location, turn off motor, pause, start motor, mimicking an M6.

A compile option set to default proper operation of M0 would be an option for those who need and understand the repercussions.

@Legendaire , made good progress on the Windows build, will finish it tonight I think. Have to finish installing some prerequisite libraries.

Legendaire commented 10 years ago

How will we zero a tool if we can't move the spindle over a height block during a tool change? There must be at least one other person out there who will used two different tools to complete a job. I'd hate for this to become some kind of sticky issue causing problems with future development.

On Sun, Aug 17, 2014 at 10:28 AM, Gerrit notifications@github.com wrote:

@chamnit https://github.com/chamnit I agree. I think Grbl does a fantastic job executing gcode correctly as does UCS. It should not by default skip those requirements. M0 is a Pause, not a 'lets move the tool around and confuse the next gcode block' :-) If someone builds a gcode file carefully they can get away with it, but that is not to be expected from most gcode CAM generators. For tool changes the CAM should already be generating a move to tool change location, turn off motor, pause, start motor, mimicking an M6.

A compile option set to default proper operation of M0 would be an option for those who need and understand the repercussions.

@Legendaire https://github.com/Legendaire , made good progress on the Windows build, will finish it tonight I think. Have to finish installing some prerequisite libraries.

— Reply to this email directly or view it on GitHub https://github.com/winder/Universal-G-Code-Sender/issues/172#issuecomment-52424824 .

chamnit commented 10 years ago

@Legendaire : There are plenty of ways to do this without having to move mid-program. Pros did not have this capability for decades and have come up with work-arounds. (A pro CNC machinist was the one advising not to introduce jogging during a pause to Grbl. He's personally seen lots of bad accidents related to this when they could first do this with their controllers.)

For example, you can create separate g-code programs for each tool and set up the work flow by moving the spindle to a pre-defined location. There you can change out the tool easily, make your adjustments, and start the next g-code program. Or, you can make a poor-man's tool changer by pre-measuring and setting your tool length offsets with a stop-collar. So, every time you switch out to a tool, the stop-collar is flush against the chuck or collet. This is repeatable to within a 0.001".

I could go on and on. Perhaps I could start a Wiki page on this issue, so there can be place where people can put their ideas on how to do this easily. I'm certain there are lots tips like this in old machining books.

gerritv commented 10 years ago

Using G43.1 for tool length offset will help. @Legendaire the challenge is in getting Grbl simulate an M6 tool change. Even doing a move to tool change location, change tool, measure tool offset and continue is an issue as the M0 already has commands behind it in the buffer (I think). So setting G43.1 tool offset won't even help. As @chamnit suggests, using stop collars is probably your best option to avoid touching off the tool. Then you can pre-code the G43.1 tool offset. I need the M6 capability soon as well, hence my interest in a workable solution. First I will finish getting pcb2gcode on Windows, I learned to hate Unix in the 1980's :-( I suspect that pretty soon we need to think of moving off the ATMega chip, that is the limiting factor in adding more gcode support. And time of course but I am motivated to help with Grbl coding so that would help @chamnit.

Legendaire commented 10 years ago

I looked into the stop collars. I am going to use that idea on our large cnc mill. Stop collars are around four bucks a piece on ebay from what I can see. There are only a few tools we use regularly on our big cnc. I was going to buy r8 tool holders for each but a stop collar looks to be much cheaper for our purposes. However, at four bucks a piece and needing to buy fifty of them for pcb drills and the like gets pricey. Since pcb drills are so tiny they break easy due to vibration and runout. It looks to me like the stop collars will be just a bit out of balance breaking more pcb drills. Then one has to stop everything they are doing and put a new stop collar on and calibrate it. Have two or more break would make for a grumpy day in a hobby that is to be relaxing. I love the idea but I don't think stop collars will work with micromachining bits or pcb drills. For g-code programs in hsmworks it is possible to do a different program for each step in the operation. I have not done it but I can only imagine it is possible. I'd have to write a special post processor so that for any tool change it sends the tool to something like 0,0,3 ". The g-code program will no longer be running so I can only imagine one can jog the z. For pcbgcode there is no way for me to change the output of the file. One would have to modify the g-code by hand. It looks like gerritv is working on something in that arena. The question is what cam processor will have problems next? Do we want to make a list of how to modify every cam processor out there? I am the type of guy who enjoys things that make life easy. For example, my dream is to have a tool changer on the shapeoko or any other mill I have. Then all the tools are set to a known length and there would be no need to adjust for z on each and every tool change. It also allows for greater accuracy since being off by just .0005" on a bas relief is noticeable. I have changed all tools manually up to this point. This brings me to gerritv's suggestion of the g43 tool offset. I've removed that code from every program I have since I didn't see a use for it and it would most often send the endmill through the table when used. I assumed it was really designed for automatic tool changers and set tool holders not the collet system we use on the big cnc or shapeoko. I've tried to read up on how it works but it's confused the hell out of me since it never seemed to do what it said in the documentation. It is probably a question for another thread. I don't want to fork too far away from the M6 statement. However, I must ask how does g43 work and how can one use it to make life easier?

gerritv commented 10 years ago

i have had an extremely frustrating day trying to compile pcb2gcode on Windows. It has nested includes that result in a large # of compile errors on a non-tolerant compiler. Now fighting with libgerv which is even worse. It all reinforces my dislike of anything *nix, too many variations etc. I digress however, I will write something about G43 in the morning. I can't actually test anything because my machine is in bits. I should probably get that going before spending more time on coding :-) Is there a way to converse over email? Mine is listed.

Legendaire commented 10 years ago

At first, since this showed up in my email, I thought we were speaking over email:) I'd prefer not to feed the spam monsters my email address by posting on a forum. How do I find your email?

On Mon, Aug 18, 2014 at 12:34 AM, Gerrit notifications@github.com wrote:

i have had an extremely frustrating day trying to compile pcb2gcode on Windows. It has nested includes that result in a large # of compile errors on a non-tolerant compiler. Now fighting with libgerv which is even worse. It all reinforces my dislike of anything *nix, too many variations etc. I digress however, I will write something about G43 in the morning. I can't actually test anything because my machine is in bits. I should probably get that going before spending more time on coding :-) Is there a way to converse over email? Mine is listed.

— Reply to this email directly or view it on GitHub https://github.com/winder/Universal-G-Code-Sender/issues/172#issuecomment-52453781 .

gerritv commented 10 years ago

Click on my name, there is a masked email address there. I use DoNotTrackMe with chrome, works great for masking emails.

Legendaire commented 10 years ago

Mach3 allows jogging during a pause. It won't if you are in a canned drill cycle though. But if mach3 pauses the program for a manual tool change it will allow you to jog. I would just find it odd that they would put this in there if it was all that dangerous. I am not saying it is safe but I see they are doing it. Do we know what the danger is?

Legendaire commented 9 years ago

Sonny, I recently made an arduino shield for our shapeoko2's limit switches, spindle stuff, probing, etc. It has all the things the things the GRBL shield doesn't expose. I read the documentation on version .9g and it said the z-limit switch pin was moved so the spindle could use the hardware pwm on that pin. I made the shield accordingly. When I finished soldering the whole thing together the z-limit switch was still on pin 11 and hadn't moved. Is there a setting I am missing? Eric PS. GrblPanel is coming along nicely. Garret is a pretty good guy. I can't wait until he releases some source code.

gerritv commented 9 years ago

@Legendaire You need to flip a variable in config.h, recompile to get the PWM mode activated

Tku for compliment :-) Back at working on it shortly

Gerrit

YURI0869 commented 5 years ago

Hello, I was wondering if anyone can help me. I just got my CNC 3018 mill machine and I thought it quite as easy as 3D printing. I was wrong. I tried to convert my selected Jpeg using inkscape and makercam to convert it to usable design. I got this message on the panel M6 error. What does it mean and how do I fix it? Another thing, some of the design I converted has layers of lines. I wonder if it is because of the picture or I am not doing it right to be used on my milling machine. Please help and Thank you.

skendrot commented 5 years ago

Any update to this issue?

David75s commented 5 years ago

Hello, I was wondering if anyone can help me. I just got my CNC 3018 mill machine and I thought it quite as easy as 3D printing. I was wrong. I tried to convert my selected Jpeg using inkscape and makercam to convert it to usable design. I got this message on the panel M6 error. What does it mean and how do I fix it? Another thing, some of the design I converted has layers of lines. I wonder if it is because of the picture or I am not doing it right to be used on my milling machine. Please help and Thank you.

Im having the same issue...did you figure it out?

YURI0869 commented 5 years ago

David75s. Sorry I was not able to find out. Since I post that question, no one has answered me yet. So I decided to concentrate on my 3D printing instead for now.

JacksCrafts commented 5 years ago

David75s and Yuri0869 , not sure what you are asking. M6 is about tool change. I am guessing you are not wanting to change bits in the middle of a run.

M6 error. What does it mean and how do I fix it? Open you gcode in notepad or a gcode editor and delete it.

YURI0869 commented 5 years ago

JacksCrafts, thank you I will surely look into it. But I am still a newbie with CNC got a lot to learn in terms of converting gcodes. Thank you.

karoria commented 5 years ago

Converting gcodes will work only for 2d. For a complete cnc experience, you must get used to a professional software like Autodesk Fusion 360. It is free for hobby purposes. So give it a try for advance CAM tools inside it and see the magic. You can also make 3d print files with this software.

JacksCrafts commented 5 years ago

Yuri you are welcome. If you have questions I am glad to help. You can email my gmail at jackscrafts2 . I would suggest going to Youtube and go through the Vectric tutorials. You can learn a lot with them even if you do not buy their program. Vectric makes it easy to understand.

JacksCrafts commented 5 years ago

Yuri you are welcome. If you have questions I am glad to help. You can email my gmail at jackscrafts2 . I would suggest going to Youtube and go through the Vectric tutorials. You can learn a lot with them even if you do not buy their program. Vectric makes it easy to understand.

David75s commented 5 years ago

Finally found out there error code explanations I found if I just hit ignore it starts right up and goes

On Wed, Apr 10, 2019, 7:42 AM JacksCrafts notifications@github.com wrote:

David75s and Yuri0869 , not sure what you are asking. M6 is about tool change. I am guessing you are not wanting to change bits in the middle of a run.

M6 error. What does it mean and how do I fix it? Open you gcode in notepad or a gcode editor and delete it.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/winder/Universal-G-Code-Sender/issues/172#issuecomment-481655575, or mute the thread https://github.com/notifications/unsubscribe-auth/AvKakPoJR2hHe3qHJSqktTu19JHjLh68ks5vfc4QgaJpZM4CJhI4 .