Hello Guest it is April 23, 2024, 08:38:33 AM

Author Topic: Redefine M03 Code to check for RPM's?  (Read 3537 times)

0 Members and 1 Guest are viewing this topic.

Redefine M03 Code to check for RPM's?
« on: April 27, 2011, 03:29:52 PM »
First, I apologize if this is something that has been answered or could be answered by searching the threads... but I'm on a bit of a time crunch here...

I will be a teaching assistant for a shop class that starts in a couple weeks, and there is a lot of prep that needs to be done before the class. I have setup Mach 3 on the CNC lathes (Syil C6-B's) and everything seems to work fine. But because the spindles are controlled manually, we want the program to check for spindle speed before running the program to help prevent tool crashes.

Basically we want to redefine the M03 command so that it:

  • Stops the program cycle (similar to M06 when there is no auto-tool changer)
  • Waits until spindle speed is within +/- 10% of speed set with S#
  • If/when spindle is at correct speed allows user to press Reset and/or Cycle Start
As you can tell, we don't have any strict requirement other than not allowing the students to run the program until the spindle is up to speed. It is also not a big deal if we have to create/use a custom M-code. Any help you can provide, links to guides, example code (or full code  ;)) would be really helpful!

Thanks!

andrewm

*
Re: Redefine M03 Code to check for RPM's?
« Reply #1 on: April 28, 2011, 12:59:16 PM »
This one has a script to Estop the machine when the spindle moves outside a defined area, Not exactly what you wanted, but its a start.

http://www.machsupport.com/forum/index.php/topic,16290.msg110182.html#msg110182

Drew
Re: Redefine M03 Code to check for RPM's?
« Reply #2 on: April 29, 2011, 06:54:55 AM »
Here is another not exactly but more reference.

http://www.machsupport.com/forum/index.php/topic,158.0.html

Darek

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Redefine M03 Code to check for RPM's?
« Reply #3 on: April 29, 2011, 11:28:40 AM »
Add this to the end of the M3 macro. It will get you started in the right direction


While GetOemDro(39) < (GetOemDro(202) * .10)
Wend
 
If GetOemDro(39) >= (GetOemDro(202) * .10) Then   
         Message( "Spindle is up to Speed  PRESS CYCLE START to continue" )
   
 End If
 
Code"M01"

End
 
Re: Redefine M03 Code to check for RPM's?
« Reply #4 on: May 05, 2011, 09:49:55 PM »
Wow... thanks for the responses! I have been really busy as of late and haven't had the chance to try and implement any of this, but I may get a chance to work on it this weekend/early next week. Thank you for your help, I really appreciate it!