Jump to content

Welcome to eMastercam

Register now to participate in the forums, access the download area, buy Mastercam training materials, post processors and more. This message will be removed once you have signed in.

Use your display name or email address to sign in:

Mdi program question


Recommended Posts

Long story short. Replaced X axis ballscrew and maintenance wants to run the table back and forth for few hrs to break in the ballscrew. Is there a few lines I could manually command from mdi with a m99 at end so that it would loop back and run for say 2 hrs total or a program that will run for an exact 2 hrs.. thanks in advance.

Link to comment
Share on other sites

You could use a DO/WHILE loop checking the cycle time...

 

WHILE[#nnnnLE120]DO1

G0G91X40.

G0G91G28X0

END1

M30

 

The nnnn being the parameter that captures cycle time. I'm on a plane right now so I can't get to my manuals or else I'd find it.

Link to comment
Share on other sites

Using a while loop and the timer function will allow will allow you to write a program to run for a set length of time. Whether you can run a simple program like that in MDI really depends on the control. I have run machines that only accepted one line at a time and others where the MDI was essentially a blank program file.

Link to comment
Share on other sites

I know you already solved your issue but I figure I will post this in any case. This is a simple program I wrote awhile back to warmup the machine for a specific amount of time. A few variables would likely need to be tweaked depending on the requirements of your control.

(AUTO MACHINE WARMUP ROUTINE
(THIS PROGRAM WILL PAUSE FOR A SPECIFIED LENGTH OF TIME AND THEN BEGIN WARMING UP
(YOUR MACHINE. 

G90 G40 G71 G94 G01 G25
(G25 = WAIT FOR SPINDLE TO REACH PROGRAMMED RPM = OFF, G26=ON

G50.6 P40.00	(SET FEEDRATE OVERRIDE TO 40%

(# OF HOURS BEFORE THE MACHINE WARMS UP. IF DESIRED, SETUP BEFORE
(YOU LEAVE FOR THE NIGHT AND THE MACHINE WILL AUTOMATICALLY BEGIN WARMING UP 
(AFTER A PRE-DETERMINED INTERVAL. I AM THE ONLY GUY WHO RUNS MY MACHINE. WOULDN'T
(USE THIS IF OTHER PEOPLE OPERATE YOUR EQUIPMENT. USE THIS FEATURE WITH CAUTION.

#101=0.000 (SET TO 0 TO WARM-UP IMMEDIATELY
	
(PAUSE HERE FOR #101 NUMBER OF HOURS BEFORE INITIATING THE WARMPUP ROUTINE
	
	#101=#101*3600	(WITH #101=1, NCPLOT SHOWS THIS AS ONE HOUR, MIGHT NEED TO DIVIDE BY 1000
	G4 X[ROUND[#101]]	(FOR YOUR CONTROL.


#1=0.5      (NUMBER OF HOURS TO WARMUP
#2=120     (DESIRED X TRAVEL, FROM HOME
#3=70       (DESIRED Y TRAVEL, FROM HOME
#4=80       (DESIRED Z TRAVEL, FROM HOME

#5=1000	(SPINDLE LOW RPM
#6=2000	(SPINDLE MEDIUM RPM
#7=3000	(SPINDLE HIGH RPM

#8=20		(% OF TIME @ LOW RPM
#9=30		(% OF TIME @ MEDIUM RPM

      #10=100-#8-#9	(REMAINING TIME IS SPINDLE @ HIGH RPM	

	#8=#8/100
	#9=#9/100
	#10=#10/100

IF[#8GT1] THEN #3000=1	(% OF TIME @ LOW RPM MUST BE LESS THAN 100%
IF[#9GT1] THEN #3000=1	(% OF TIME @ MED RPM MUST BE LESS THAN 100%
IF[#8+#9GT1] THEN #3000=1(% OF TIME @ LOW & MED RPM (COMBINED) MUST BE LESS THAN 100%

(MOVE TO HOME POSITION
G00
G53 Z-1 X1 Y-1 F600
M01

(RESET THE HOUR TIMER
#3002=0
G4X1
G103 P1 (LIMIT THE LOOK AHEAD TO 1 BLOCK
WHILE[#3002LT#1]DO1
#11=#7	(HIGH RPM
IF[#3002LE[#1*[#9+#8]]] THEN #11=#6	(MED RPM
IF[#3002LE[#1*#8]] THEN #11=#5		(LOW RPM
M4S[#11]
G00 U[#2] V[-#3] W[-#4]
#11=#7	(HIGH RPM
IF[#3002LE[#1*[#9+#8]]] THEN #11=#6	(MED RPM
IF[#3002LE[#1*#8]] THEN #11=#5		(LOW RPM
M4S[#11]
U[-#2] V[#3] W[#4]
#103=#3002
END1

#102=#3002	(TOTAL WARMUP TIME

(T0101
(G00 X0 Y0
(G01 F500

(RESET FEEDRATE OVERRIDE TO 100%
G50.6 P100.00
G26	(WAIT FOR SPINDLE TO REACH PROGRAMMED RPM
M30

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.

Join us!

eMastercam - your online source for all things Mastercam.

Together, we are the strongest Mastercam community on the web with over 56,000 members, and our online store offers a wide selection of training materials for all applications and skill levels.

Follow us

×
×
  • Create New...