Hello Guest it is March 29, 2024, 04:32:38 AM

Author Topic: M0 and M2 command  (Read 6035 times)

0 Members and 1 Guest are viewing this topic.

M0 and M2 command
« on: December 06, 2013, 06:29:27 AM »
OKay I am not sure what is wrong with thsi program, but what I am trying to do is have the program send teh ball end mill down to zero and I raise teh knee so the workpiece just touches teh cutter and now I have a good z axis zero.  Problem is that when M0 comands a single block move the spindle does not seem to continue running till I hit cycle start for teh proghram to go on.  This is lines N10-N30

Then in lines N30 -N50 I want the cutter to go down into the middle of the part, retract, and then I can measure to verify we are in the middle with my calipers.  then I hit cycle start program carries on from N70 and all is well.

Then there is this message I get.  'Compensation too complex' or something like that.  All I am trying to do is rough out a pocket that is less than .211 X .381 and then clean it all up lines N200 to lines N270 



(Tool 3/16” ball 4Fl Carbide)
(Work piece .495 diam suit blank )
N10   G20 G17 G90 G54 S2000   
N20   G0 Z-.1 X0 Y0    M3
N30   G98 M0
N40   G73 Z-.275 R-.095 Q.030 S6000 M3 F10
N50   G80   
N60   G0 Z0 X0 Y0 M2           
N70      X.089 Z-.1  M3 F34
N80   G1 X-.089 Z-.252
N90      x.089  Z-.403
N100     X-.089 Z-.355
N110     x.089  Z-.406
N120     X.010
n130 G41 x-.182 P.0935         
N140     Y-.097
N150     X.182
N160     Y.097
N170     X-.182
N180     Y0 X-.1905
N190     Y-.117              F15
N200  G3 X-.0968 Y-.1055 R.09375
N210  G1 X.0968
N220  G3 X.1905 Y-.0118 R.09375
N123  G1 Y.0117
N240  G3 X.0968 Y.1055 R.09375
N250  G1 X-.0968
N260  G3 X-.1905 Y.0118 R.09375
N270  G1 Y-.117
N280  G0 Z0
N290    G40 
N300     X0 Y0 M5 M30   



As always thansk for all teh help

Offline Bodini

*
  •  216 216
    • View Profile
Re: M0 and M2 command
« Reply #1 on: December 06, 2013, 01:16:48 PM »
What is the M2 on N60 for?  I had to delete it just to get Mach to load the gcode.
Re: M0 and M2 command
« Reply #2 on: December 06, 2013, 03:53:42 PM »
What is the M2 on N60 for?  I had to delete it just to get Mach to load the gcode.

so that the machine will stop after making that peck.  I pull out the part and then measure to see that everything is in the right location ( centered) put the part back in adjust my DRO's and hit cycle start for the program to continue.    I didn't have to delete that. 

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: M0 and M2 command
« Reply #3 on: December 06, 2013, 08:56:26 PM »
You are not giving Mach ROOM to do COMP (;-) It has to be able to do the comp moves.

Take and SCALE mach in the X and Y axis set it to say 10. THEN run the program and you will SEE the comp in action.

Also NOT a good idea to be resetting the DROS during a program. The idea is to KNOW where you are when you start the program not try and figure it out mid program.

Rule is you need at least tool diam X .625 of free space motion for mach to comp correctly. You may want to try comping mach above the part then bring it down into the part to run the final profile.

Just a thought, (;-) TP

Offline Bodini

*
  •  216 216
    • View Profile
Re: M0 and M2 command
« Reply #4 on: December 07, 2013, 01:15:38 PM »
What is the M2 on N60 for?  I had to delete it just to get Mach to load the gcode.

so that the machine will stop after making that peck.  I pull out the part and then measure to see that everything is in the right location ( centered) put the part back in adjust my DRO's and hit cycle start for the program to continue.    I didn't have to delete that. 

Well if it works for you, then so be it, but.... as far as I've read:

M0 = stop with no questions asked.
M1 = stop if the Optional Stop LED is activated
M2 = END the program
M30 = END the program and REWIND

M2 or M30 are intended for the last line of the gcode.
Re: M0 and M2 command
« Reply #5 on: December 07, 2013, 07:04:51 PM »
OK so lines N130-180 I will get rid of cutter comp and reprogram for cent to cent.  

BR549 I ain't got the dough for reliable encoders and my machine never really knows where it is within .005"  I used to touch off the part to cutter using MDI now I wanna do it quicker.  Think of this as 2 different continuous programs.  In one I finds my origin and in the other I am cutting the part.  

My problem is that when running a demo of this program Before the touch off in lines n10-n30 and n30-n50 the cutter seems to stop rotating before the block stop or cycle stop.  I don't see why? 
« Last Edit: December 07, 2013, 07:07:54 PM by Mountainman »

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: M0 and M2 command
« Reply #6 on: December 07, 2013, 07:50:43 PM »
Encoders have nothing to do with anything. You can find positions simply by touching off at key points. Once you set the origin it is a matter of programming the correct moves and the machine will follow the moves.

With stepper that machine never KNOWS where it is at it jusr assumes it is at positions based on the moves given. The controller knows where it SHOULD be based on the number of step commanded and that is all.

Run the code under single step and SEE on what line the spindle starts to slow down. That should answer that question.

(;-) TP



Re: M0 and M2 command
« Reply #7 on: December 08, 2013, 09:05:21 AM »
If teh machine could return to the commanded position within .0005 every time, I wouldn't have to touch off every time I hit cycle start.  Servo drivers don't command a given number of steps like stepper drivers.  They command the difference between what they are told to command and the movement that has occured as measured by the encoder.   Steppers are more accurate than servo with encoders that can't keep up.

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: M0 and M2 command
« Reply #8 on: December 08, 2013, 11:24:57 AM »
 Steppers are more accurate than servo with encoders that can't keep up.

Therein lies your problem, you have a poorly designed/setup servo system.
Also if I recall this is a Bridgeport, so dont expect the accuracy and repeatability that you might expect with a nice heavy rigid VMC.



Hood
Re: M0 and M2 command
« Reply #9 on: December 08, 2013, 11:42:40 AM »

Therein lies your problem, you have a poorly designed/setup servo system.
Also if I recall this is a Bridgeport, so dont expect the accuracy and repeatability that you might expect with a nice heavy rigid VMC.

Hood
   Yes it is a BP, but, my ballscrews have max of .001 backlash on Y axis and .0005 on X axis.  I know my encoders are (r@p.  I wanna get a whole new package I can't afford till I get some money saved up.