Hello Guest it is March 28, 2024, 09:45:31 PM

Author Topic: Can someone review my code adn explain M01  (Read 5543 times)

0 Members and 1 Guest are viewing this topic.

Can someone review my code adn explain M01
« on: March 01, 2008, 12:59:47 AM »
Hi Guys,

Well I am still learning this Mach3.  I am still only practicing doing dry simulation with a pen loaded to my router and no router yet.  I made this simple circle pocket and everything seems to work out except in the beginning of the program.  The pocket I am cutting is only .01 deep , the matrial is .1" thk, but in the begining of the program during the M01 step, the z will go to -.4593, why?  Had this really had a cutting bit, it would have cut into my table.  When I set up the zero position in mach3, I set it up so that the tool is at the top of the work piece.
Can someone look at my code and see if there is something wrong.  The code was generated with solidcam using FANUC as the controller.

May be someone can run the code?
Thanks,
rene

Offline Chip

*
  • *
  •  2,055 2,055
  • Gainesville Florida USA
    • View Profile
Re: Can someone review my code adn explain M01
« Reply #1 on: March 01, 2008, 02:54:08 AM »
Hi, Rene

M1 is optional program stop, Just pauses G-code.

Remarked out allot of the top code, Added some lines of G-code hear and there..

I think it will do what you want, It's sloppy but should work, Looks good hear.

Set cutter to touch top of material at corner and zero axies.

Check with solidcam, See if thay have a Mach3Mill.Post.

Hope this Helps, Chip
« Last Edit: March 01, 2008, 02:57:48 AM by Chip »

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: Can someone review my code adn explain M01
« Reply #2 on: March 01, 2008, 06:10:34 AM »
does this happen before the M1 or just after? could be something to do with the tool offset?
Hood

Offline jimpinder

*
  •  1,232 1,232
  • Wakefield, West Yorks, UK
    • View Profile
Re: Can someone review my code adn explain M01
« Reply #3 on: March 01, 2008, 10:25:52 AM »
Your program, before the M01 quite rightly cancels all offsets.

If you then look at the two lines after the tool change to Tool 1 and remarks, you will see a G54 call and a G43 call.

These call for offsets from different tables - and when the table then moves, it will apply them.
The G54 offset comes from the table in Config/Fixtures and the G43 comes from Config/Tool Table.

Open both these tables and make sure there are no offsets for G54 and for Tool 1.

Alternatively you can cancel the G54 and the G43 call, which will leave your tool where you set it.

Not me driving the engine - I'm better looking.
Re: Can someone review my code adn explain M01
« Reply #4 on: March 04, 2008, 01:21:38 AM »
Hi Chip,

I was trying to follow along with your changes. I ran your modified program and could see that there no longer are any pauses where I had to hit the cycle button again.  With my original program, I had to hit the cycle buttom at least three times before it went into the cut mode.  Your program also send the tool back to zero right after it finishes the last cut and it only raised the tool slightly off the part which is nice because I had to watch it raise painfully slow up to 2".

This happens before M01 but when it finishes if ends up on M01.  I have attaced pics of the Config/Fixtures and Config/Tool Table.  Tool table looks all empty but config/fixtures does have an offset.  Should these all be zero?

I did not think I had to learn g-code because I thought the cam did it all but I looks like there is alot of g-code tweeking that needs to be done. Can anyone point me to a good tutorial?

Thannks,
skipper

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: Can someone review my code adn explain M01
« Reply #5 on: March 04, 2008, 02:17:47 AM »
I did not think I had to learn g-code because I thought the cam did it all but I looks like there is alot of g-code tweeking that needs to be done. Can anyone point me to a good tutorial?

It is always good to know Gcode but I must admit I am fairly poor on it, however you CAM package should almost always put out code that you dont have to tweak. Your problem is in settings, some in CAM and some in Mach. For example if you have a look in the General config page of Mach you will see an opttion to stop on M1 command, you could take the check out of that box if you wanted. Most of the rest are in SolidCAMs options, you can define start heights, safe distances etc there.
Hood

Offline jimpinder

*
  •  1,232 1,232
  • Wakefield, West Yorks, UK
    • View Profile
Re: Can someone review my code adn explain M01
« Reply #6 on: March 04, 2008, 02:55:52 AM »
Learning GCode is a bit like learning mental arithmatic.  If you don't know anything about it, how do you know when the machine has gone wrong.

If you Google GCode there are one or two sites that will give you an idea of the rules of GCode. However - it isn't that difficult to get started. G0 moves you in a straight line from here to your new destination, G1 does the same at cutting speed, G2 and G3 move you in a circle at cutting speed. That is all there is to it and with those four instructions, you can write all the programs you need.

As Hood said, your problem is not with the code but with the settings, and the main problem with all programming is starting at a position that everybody knows. Start the machine at position 0,0 with all offsets cancelled and away you go. Practise writing a few moves your self, or a short program. Leave the cutting tool out and watch the machine trace out what you have written. Another thing I do with some of the complicated bits is to put a piece of soft material - pine or soft plastic - and let my machine chew that up, rather than damage it on steel.

If you study the rest of the GCode list on Mach 3 you will find that the rest of the instructions are mostly to do with offsets and different drilling patterns - but the basic four movements are all you need.

Have a go - you can't hurt the machine - and you can't hurt Mach 3. You can, by the way, write a program and run it in  Mach 3 without the machine attached. This, with the toolpath display, is an excellent feature that lets you see what the machine would cut before you even attach it. I use this feature on my office computer to check programs before going throuh to the workshop.
Not me driving the engine - I'm better looking.

vmax549

*
Re: Can someone review my code adn explain M01
« Reply #7 on: March 04, 2008, 11:44:23 AM »
Look at your safe Z settings you can set it to anything(;-) It can be set to machine coords OR work coords. If it is set to the -.4 setting , then when you call the M1 it will got to the safe z setting.

Turn off the safe z if it is on and retest.

(;-) TP