What's new
What's new

840d Spindle warm up program help

imachine909

Cast Iron
Joined
May 17, 2010
Location
South East
I have a cnc mill with a 840d control. When we run the program "warmup" the program warms the spindle up to 24,000 rpm we want to limit this at 15,000 rpm. How can I do this I have attached the program. Can we change it in the program on do we need to change a parameter in the machine if so which one?


%_N_WARMUP_SPF
;$PATH=/_N_CMA_DIR
N100 PROC WARMUP DISPLOF SBLOF
;Spindle warmup
N110 DEF STRING[40] DATAFILE = "/_N_COM_DIR/_N_WARMUP_LOG_MPF"
N120 DEF REAL FRONT_TEMP, REAR_TEMP
N130 DEF BOOL LONG_WARMUP,FIRST_WARMUP
N140 DEF REAL PREV_SWORD,MAX_S,MAX_TOOL,START_T,DELTA_T
N150 DEF REAL INTV,S_RATE,TEMP_LIM,S_INC,S_DEC
N160 DEF INT PREV_SDIR,IVAR,ERROR
N170 INTV = 10
N180 TEMP_LIM = 60
N190 S_INC = 0.01
N200 S_DEC = 0.02
N210 IF ($P_TOOLNO == 0)
N220 SETAL(66900)
N230 M17
N240 ENDIF
N250 MAX_TOOL = $TC_TPC1[$P_TOOLNO]
N260 PREV_SWORD = $P_S[0]
N270 PREV_SDIR = $P_SDIR[0]
N280 MAX_S = $MA_SPIND_VELO_LIMIT[AX6]
N290 IF (MAX_TOOL <> MAX_S)
N300 SETAL(66901)
N310 M17
N320 ENDIF
N330 MSG("Spindle warmup - press NC START to begin")
N340 M5 M0
;N350 START_T = $AC_OPERATING_TIME
;N360 IF (NOT ($A_DBB[0] B_AND 1))
;N370 MSG("Wait for pre-lube completion")
;N380 REPEAT
;N390 G4F1
;N400 UNTIL ($A_DBB[0] B_AND 1)
;N410 ENDIF
N420 LONG_WARMUP = $A_DBB[0] B_AND 'B100000'
N425 FIRST_WARMUP = $A_DBB[0] B_AND 'B1000000'
N430 M36 M49
N431 IF (FIRST_WARMUP)
N450 MSG("First time warmup started")
N460 IF ISFILE(DATAFILE)
N470 DELETE(ERROR,DATAFILE)
N480 ENDIF
N490 WRITE (ERROR, DATAFILE, "FIRST TIME SPINDLE WARMUP STARTED ON "<<$A_MONTH<<"."<<$A_DAY<<"."<<$A_YEAR<<" AT "<<$A_HOUR<<":"<<$A_MINUTE<<":"<<$A_SECOND)
N500 M3S=MAX_S * 0.10
N510 WHILE ($AA_S[0]<$P_S[0]*0.9)
N520 MSG("Wait for spindle up to speed")
N530 G4F0.5
N540 ENDWHILE
N550 FOR IVAR = 1 TO 60
N560 STOPRE
N570 FRONT_TEMP = $A_DBW[256] / 100
N580 REAR_TEMP = $A_DBW[258] / 100
N590 DELTA_T = ROUND(($AC_OPERATING_TIME - START_T)/0.6)/100
N600 MSG ("ELAPSED TIME "<<DELTA_T<<" SPINDLE SPEED "<<$P_S[0]<<" FRONT "<<FRONT_TEMP<<" DEG C REAR "<<REAR_TEMP<<" DEG C")
N610 WRITE (ERROR, DATAFILE, "ELAPSED TIME "<<DELTA_T<<" SPINDLE SPEED "<<$P_S[0]<<" FRONT "<<FRONT_TEMP<<" DEG C REAR "<<REAR_TEMP<<" DEG C")
N620 G4F10
N630 ENDFOR
INTV = 30
S_INC = 90/120/100
S_DEC = S_INC * 2
N780 S_RATE = 0.10 + S_INC
N790 REPEAT
N800 S=MAX_S * S_RATE
N810 WHILE ($AA_S[0]<$P_S[0]*0.9)
N820 MSG("Wait for spindle up to speed")
N830 G4F0.5
N840 ENDWHILE
N850 STOPRE
N860 DELTA_T = ROUND(($AC_OPERATING_TIME - START_T)/0.6)/100
N870 FRONT_TEMP = $A_DBW[256] / 100
N880 REAR_TEMP = $A_DBW[258] / 100
N890 MSG ("ELAPSED TIME "<<DELTA_T<<" SPINDLE SPEED "<<$P_S[0]<<" FRONT "<<FRONT_TEMP<<" DEG C REAR "<<REAR_TEMP<<" DEG C")
N900 WRITE (ERROR, DATAFILE, "ELAPSED TIME "<<DELTA_T<<" SPINDLE SPEED "<<$P_S[0]<<" FRONT "<<FRONT_TEMP<<" DEG C REAR "<<REAR_TEMP<<" DEG C")
N910 G4F=INTV
N920 IF (FRONT_TEMP < TEMP_LIM)
N930 S_RATE = S_RATE + S_INC
N940 ELSE
N950 S_RATE = S_RATE - S_DEC
N960 ENDIF
N970 UNTIL (S_RATE >=1.0)
N980 S=MAX_S
N990 WHILE ($AA_S[0]<$P_S[0]*0.9)
N1000 MSG("Wait for spindle up to speed")
N1010 G4F0.5
N1020 ENDWHILE
N1030 FOR IVAR = 1 TO 60
N1040 STOPRE
N1050 DELTA_T = ROUND(($AC_OPERATING_TIME - START_T)/0.6)/100
N1060 FRONT_TEMP = $A_DBW[256] / 100
N1070 REAR_TEMP = $A_DBW[258] / 100
N1080 MSG ("ELAPSED TIME "<<DELTA_T<<" SPINDLE SPEED "<<$P_S[0]<<" FRONT "<<FRONT_TEMP<<" DEG C REAR "<<REAR_TEMP<<" DEG C")
N1090 WRITE (ERROR, DATAFILE, "ELAPSED TIME "<<DELTA_T<<" SPINDLE SPEED "<<$P_S[0]<<" FRONT "<<FRONT_TEMP<<" DEG C REAR "<<REAR_TEMP<<" DEG C")
N1100 G4F30
N1110 ENDFOR
N439 ELSE
N440 IF (LONG_WARMUP)
N450 MSG("Long warmup started")
N460 IF ISFILE(DATAFILE)
N470 DELETE(ERROR,DATAFILE)
N480 ENDIF
N490 WRITE (ERROR, DATAFILE, "SPINDLE WARMUP STARTED ON "<<$A_MONTH<<"."<<$A_DAY<<"."<<$A_YEAR<<" AT "<<$A_HOUR<<":"<<$A_MINUTE<<":"<<$A_SECOND)
N500 M3S=MAX_S * 0.25
N510 WHILE ($AA_S[0]<$P_S[0]*0.9)
N520 MSG("Wait for spindle up to speed")
N530 G4F0.5
N540 ENDWHILE
N550 FOR IVAR = 1 TO 6
N560 STOPRE
N570 FRONT_TEMP = $A_DBW[256] / 100
N580 REAR_TEMP = $A_DBW[258] / 100
N590 DELTA_T = ROUND(($AC_OPERATING_TIME - START_T)/0.6)/100
N600 MSG ("ELAPSED TIME "<<DELTA_T<<" SPINDLE SPEED "<<$P_S[0]<<" FRONT "<<FRONT_TEMP<<" DEG C REAR "<<REAR_TEMP<<" DEG C")
N610 WRITE (ERROR, DATAFILE, "ELAPSED TIME "<<DELTA_T<<" SPINDLE SPEED "<<$P_S[0]<<" FRONT "<<FRONT_TEMP<<" DEG C REAR "<<REAR_TEMP<<" DEG C")
N620 G4F10
N630 ENDFOR
N640 S=MAX_S * 0.5
N650 WHILE ($AA_S[0]<$P_S[0]*0.9)
N660 MSG("Wait for spindle up to speed")
N670 G4F0.5
N680 ENDWHILE
N690 FOR IVAR = 1 TO 12
N700 STOPRE
N710 DELTA_T = ROUND(($AC_OPERATING_TIME - START_T)/0.6)/100
N720 FRONT_TEMP = $A_DBW[256] / 100
N730 REAR_TEMP = $A_DBW[258] / 100
N740 MSG ("ELAPSED TIME "<<DELTA_T<<" SPINDLE SPEED "<<$P_S[0]<<" FRONT "<<FRONT_TEMP<<" DEG C REAR "<<REAR_TEMP<<" DEG C")
N750 WRITE (ERROR, DATAFILE, "ELAPSED TIME "<<DELTA_T<<" SPINDLE SPEED "<<$P_S[0]<<" FRONT "<<FRONT_TEMP<<" DEG C REAR "<<REAR_TEMP<<" DEG C")
N760 G4F10
N770 ENDFOR
N780 S_RATE = 0.75
N790 REPEAT
N800 S=MAX_S * S_RATE
N810 WHILE ($AA_S[0]<$P_S[0]*0.9)
N820 MSG("Wait for spindle up to speed")
N830 G4F0.5
N840 ENDWHILE
N850 STOPRE
N860 DELTA_T = ROUND(($AC_OPERATING_TIME - START_T)/0.6)/100
N870 FRONT_TEMP = $A_DBW[256] / 100
N880 REAR_TEMP = $A_DBW[258] / 100
N890 MSG ("ELAPSED TIME "<<DELTA_T<<" SPINDLE SPEED "<<$P_S[0]<<" FRONT "<<FRONT_TEMP<<" DEG C REAR "<<REAR_TEMP<<" DEG C")
N900 WRITE (ERROR, DATAFILE, "ELAPSED TIME "<<DELTA_T<<" SPINDLE SPEED "<<$P_S[0]<<" FRONT "<<FRONT_TEMP<<" DEG C REAR "<<REAR_TEMP<<" DEG C")
N910 G4F=INTV
N920 IF (FRONT_TEMP < TEMP_LIM)
N930 S_RATE = S_RATE + S_INC
N940 ELSE
N950 S_RATE = S_RATE - S_DEC
N960 ENDIF
N970 UNTIL (S_RATE >=1.0)
N980 S=MAX_S
N990 WHILE ($AA_S[0]<$P_S[0]*0.9)
N1000 MSG("Wait for spindle up to speed")
N1010 G4F0.5
N1020 ENDWHILE
N1030 FOR IVAR = 1 TO 6
N1040 STOPRE
N1050 DELTA_T = ROUND(($AC_OPERATING_TIME - START_T)/0.6)/100
N1060 FRONT_TEMP = $A_DBW[256] / 100
N1070 REAR_TEMP = $A_DBW[258] / 100
N1080 MSG ("ELAPSED TIME "<<DELTA_T<<" SPINDLE SPEED "<<$P_S[0]<<" FRONT "<<FRONT_TEMP<<" DEG C REAR "<<REAR_TEMP<<" DEG C")
N1090 WRITE (ERROR, DATAFILE, "ELAPSED TIME "<<DELTA_T<<" SPINDLE SPEED "<<$P_S[0]<<" FRONT "<<FRONT_TEMP<<" DEG C REAR "<<REAR_TEMP<<" DEG C")
N1100 G4F10
N1110 ENDFOR
N1120 ELSE
N1130 MSG("Short warmup started")
N1140 M3S=MAX_S * 0.5
N1150 WHILE ($AA_S[0]<$P_S[0]*0.9)
N1160 MSG("Wait for spindle up to speed")
N1170 G4F0.5
N1180 ENDWHILE
N1190 MSG("Short warmup in process - spindle speed "<<$P_S[0])
N1200 G4F60
N1210 S=MAX_S * 0.75
N1220 WHILE ($AA_S[0]<$P_S[0]*0.9)
N1230 MSG("Wait for spindle up to speed")
N1240 G4F0.5
N1250 ENDWHILE
N1260 MSG("Short warmup in process - spindle speed "<<$P_S[0])
N1270 G4F60
N1280 S=MAX_S
N1290 WHILE ($AA_S[0]<$P_S[0]*0.9)
N1300 MSG("Wait for spindle up to speed")
N1310 G4F0.5
N1320 ENDWHILE
N1330 MSG("Short warmup in process - spindle speed "<<$P_S[0])
N1340 G4F60
N1350 ENDIF
N1355 ENDIF
N1360 S=PREV_SWORD M=PREV_SDIR M37 M48
N1370 MSG("Spindle warmup complete - press NC START to resume program")
N1380 M0
N1390 MSG
N1400 M17
 
Why is a spindle warmup program so long?
How about:
S1000M03
G04P1000
S5000
G04P1000
S10000
G04P1000
S15000
G04P1000
M30
 
We are just running what came with the machine. I am not opposed to a shorter one but the owner is wanting the original changed.
 
That is the longest warm up program I have ever seen.

Looks like the MAX_S lines control rpm's, changing the multiplier should adjust the speeds.
 
Tedger so you are say change line N280 to
N280 MAX_S = 15000
I don't need the rest of the line?

Booze Daily yes we could change the override to 60% but that isn't a long term fix for us.
 
usually end program with M99 instead of M2 or M30
.
when it gets to M99 program just restarts at the beginning and it will keep repeating til you feed hold and press reset
 
"I have a cnc mill with a 840d control. When we run the program "warmup" the program warms the spindle up to 24,000 rpm we want to limit this at 15,000 rpm. How can I do this I have attached the program. Can we change it in the program on do we need to change a parameter in the machine if so which one? "

Like jancollo said the MAX_S is the variable that stores the max spindle rpm, which is currently set at 24,000.

N250 MAX_TOOL = $TC_TPC1[$P_TOOLNO]; $TC_TPC1[$P_TOOLNO] This is the max allowable rpm of the tool in the spindle
N260 PREV_SWORD = $P_S[0]
N270 PREV_SDIR = $P_SDIR[0]
N280 MAX_S = $MA_SPIND_VELO_LIMIT[AX6]; $MA_SPIND_VELO_LIMIT[AX6] is a machine variable, which yours is set to 24,000
N290 IF (MAX_TOOL <> MAX_S); I believe if Max_tool is not equal to Max_S it will fault out in a subprogram.
N300 SETAL(66901); Is this a sub program?
N310 M17
N320 ENDIF


So you could change your machine and tool parameter ( $MA_SPIND_VELO_LIMIT[AX6] and $TC_TPC1[$P_TOOLNO]) to 15,000 Rpm.



Or you could change the MAX_S and MAX_TOOL variables in the program like so.

%_N_WARMUP_SPF
;$PATH=/_N_CMA_DIR
N100 PROC WARMUP DISPLOF SBLOF
;Spindle warmup
N110 DEF STRING[40] DATAFILE = "/_N_COM_DIR/_N_WARMUP_LOG_MPF"
N120 DEF REAL FRONT_TEMP, REAR_TEMP
N130 DEF BOOL LONG_WARMUP,FIRST_WARMUP
N140 DEF REAL PREV_SWORD,MAX_S,MAX_TOOL,START_T,DELTA_T
N150 DEF REAL INTV,S_RATE,TEMP_LIM,S_INC,S_DEC
N160 DEF INT PREV_SDIR,IVAR,ERROR
N170 INTV = 10
N180 TEMP_LIM = 60
N190 S_INC = 0.01
N200 S_DEC = 0.02
N210 IF ($P_TOOLNO == 0)
N220 SETAL(66900)
N230 M17
N240 ENDIF
N250 MAX_TOOL = $TC_TPC1[$P_TOOLNO]
N260 PREV_SWORD = $P_S[0]
N270 PREV_SDIR = $P_SDIR[0]
N280 MAX_S = $MA_SPIND_VELO_LIMIT[AX6]
N290 IF (MAX_TOOL <> MAX_S)
N300 SETAL(66901)
N310 M17
N320 ENDIF
N330 MSG("Spindle warmup - press NC START to begin")
N340 M5 M0
N341 MAX_TOOL = 15000
N342 MAX_S = 15000



Back up the the original warmup program before you make any changes. And ask the manufacturer of the machine this question as I am sure they would help. Take my advice with a grain of salt as I am just a stranger on the internet.
 
Tedger so you are say change line N280 to
N280 MAX_S = 15000
I don't need the rest of the line?

Booze Daily yes we could change the override to 60% but that isn't a long term fix for us.

If you only change line 280 to MAX_S = 15000 I think it will fault do to the If statement on line 290
 
Tedger so you are say change line N280 to
N280 MAX_S = 15000
I don't need the rest of the line?

Booze Daily yes we could change the override to 60% but that isn't a long term fix for us.

Right now that line makes it look at the parameter for max spindle speed. Try changing it to a maximum rpm and see if it works. You can always change it back.
BTW, I agree that this is way overkill for a warmup program.
 
I was thinking that to change the warm up speed without messing with the variables you can just change the multipliers on lines 500,640,and add a multiplier to line 980. Example:

N500 M3S=MAX_S*0.20,
N640 S=MAX_S*0.40,
N980 S=MAX_S*0.60

What I don't know is how the check loops will respond, but it would be easy to undo if it bombs out.
 
usually end program with M99 instead of M2 or M30
.
when it gets to M99 program just restarts at the beginning and it will keep repeating til you feed hold and press reset

You have 8910 posts. Of which I'm guessing 8910 of them are useless.
Tell us how your post solves his issue. Please, we're waiting.
 
If you only change line 280 to MAX_S = 15000 I think it will fault do to the If statement on line 290

Yeh, I think you are correct. SETAL means Set alarm so it would throw alarm 66901 if line 290 isn't true.
I like CNCburnouts idea of;
N341 MAX_TOOL = 15000
N342 MAX_S = 15000
 
Changing the multipliers caused a loop alarm. Honestly I am not sure about the M2 or M30 how the machine ends the program. This machine came with this program and we have been using the program for a few years. But now we have changed the spindle to a max 15,000 rpm and need the program changed. Also this is our first 840D control and it is a completely different language for us.
 
Changing the max spindle speed in the machine didn't work. The program ran till it need to go above 15,000 and said waiting on spindle speed.
 
...This machine came with this program and we have been using the program for a few years. But now we have changed the spindle to a max 15,000 rpm and need the program changed.
If you've changed out the spindle, that old program may not even be appropriate for the new one. Not just the RPM's, but the temp check and the ramp up ramp down sections would (in theory) need to be adjusted. I would expect the machine parameters for the spindle rpm and temp limits should also be reset. There's a lot going on in that macro- more than just a simple warm-up.

I think I would do what everyone else does, and use the format that Mtndew posted in post #2. At least until you figure out how to change the machine parameters to match the new spindle.
 
Changing the max spindle speed in the machine didn't work. The program ran till it need to go above 15,000 and said waiting on spindle speed.

Like every one has said the simplified warm-up program would be good to get you going. But if you are still curious on whats going on in the manufacture's warm-up program I can help explain more. But how did you change the max spindle speed in the machine? Did you change the $MA_SPIND_VELO_LIMIT[AX6] value saved on the controller?

N1210 S=MAX_S * 0.75
N1220 WHILE ($AA_S[0]<$P_S[0]*0.9)
N1230 MSG("Wait for spindle up to speed")
N1240 G4F0.5
N1250 ENDWHILE


On one of these loops you said you got stuck, just kept on getting a message saying "Wait for spindle up to speed". The while statement on line 1220 is what is keeping you from going forward. $AA_S[0]<$P_S[0]*0.9 really means While the actual spindle speed is less then last programmed spindle speed times 0.9 KEEP LOOPING. So if you just changed the the spindle over ride to 60% it will never go forward.


*EDIT
Mtndew's proposed program would be a good program to use in the mean time but hopefully you know that a dwell on a 840D is G04 F1000.
 








 
Back
Top