![]() | |
| Home Page | Mark Forums Read | Today's Posts | My Replies | Classifieds | Reviews | Photo Gallery | Web Links | Share Files | Advertise With Us | Ad List |
| |||||||
| G-Code Programing Discuss G-code programing and problems here! |
| This forum is sponsored by: |
![]() |
| | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
| |||
| |||
| OK guys, I have two machines, one is a Kitamura HX500i and the other is a Makino A51. I need to run a warmup program for the axis and the spindle for atleast 30 minutes prior to production to ensure all the axis and the spindle is warmed up enough to produce parts with consistency. We have seen as much as .003" change in dimensions from running a part with the machine "cold" and after running a warm-up program for a period of time. We have a down time of approx 4 hours between 2nd and 1st shift (2am to 6am) and want to try to get a macro program to start a program at a set time (lets say 0500 hrs everyday). I was thinking of maybe having the operator start a program at the end of 2nd shift, or incorporate a macro to start the warm up if the machine sits for a set period of time waiting (i.e. when the operator leaves at the end of 2nd shift with the pallet #2 ready to go, it goes in normally, but when that done, the machine will just sit waiting on the pallet ready button to be pressed for the pallet #1 to go back in, but as the operator has gone for the day and pallet #1 still has finished parts so dont want to rerun over it, the machine just sits waiting). Is this possible? What variables would I look at? Thanks, Jake |
|
#2
| |||
| |||
Yes its possible, but it would require modification to the PMC program, or a relay that is controlled by one of the interface signals, to effectively press the pallet ready button. Post back if you want to get involved with that and I or other Forum members will be able to explain. Regards, Bill |
|
#3
| ||||
| ||||
| if the machine is left running after the operator leaves it should be possible as long as the machine has not got to the M00 or APC wait command. you could have a macro time check at the end of the program that checks the time and if after 2am (when no one is there) then sit there and wait until 5am then run a macro that does a warmup. if not between 2am to 6am it skips the macro warmup and runs as per normal. Initially I'm not thinking of it in CNC Macro terms, more in very rough pseudo-code computer programming terms. Basically just ideas. something like..... Let's say the time is 2:48am when the machine reaches the end of the program..... Function (convert_current_time_to_decimal) Begin A = hour macro variable (e.g. 02) A = A + 100 (=200) B= minute macro variable (e.g. 48) C= A+B (248) End (Skip Normal Working Hours) IF C > 600 GOTO 100 (i.e. any time from 6am to 23:59, operator there working) the next line is only read if time is between 000 (midnight) and 1:59am (159) IF C < 200 GOTO 100 (i.e. operator is still present and working) the next line is read if time is 2am or after (Time is now after 2am) IF C > 200 THEN WHILE C > 200 AND < 500 DO1 DWELL 60 seconds (i.e. G04 U60.0 or whatever time period you want) Convert_Current_Time_To_Decimal (this calls the above Function) C = C (i.e. set old time value to current time value) END1 RUN warmup 100 END *edit* Adding a rough macro. The manual says time is one variable (#3012). I had previously thought each component (H:M:S) was separate. This makes it even easier as the time variable is a decimal number. The actual macro might look like this..... (Note I have not checked if this runs nor have I check the formatting for the IF or WHILE). The theory is solid though ![]() % O0001 (normal program here) ...... ...... M98 P9000 (call macro. check current time variable and run warmup program when time is after 5am) M00 (APC command here or whatever is called to keep the machine going on the next pallet) M30 % O9000 (time check) IF [#3012 GT 060000] GOTO 100 (i.e. any time from 6am to 23:59, operator present. #3012 within range 060000 to 235959) IF [#3012 LT 020000] GOTO 100 (i.e. operator is still present and working. time between midnight and 2am. #3012 within range 000000 to 015959) IF [#3012 GT 020000] THEN (time is now after 2am but before 6am) (not sure of the exact formatting for a double WHILE check with an AND.....) WHILE [#3012 GT 020000 AND LT 050000] DO1 (maybe WHILE [[#3012 GT 020000] AND [#3012 LT 050000]] ??) G04 U60.0 (wait 1 minute or U600.0 wait 10 minutes etc.) END1 M98 P0002 (call warmup program) N100 M99 % % O0002 (warmup program) (some warmup stuff here) ..... ..... M99 % I pulled this out of my ass. Be kind with your comments and corrections Last edited by fordav11; 02-02-2012 at 06:52 AM. |
|
#5
| ||||
| ||||
| I ironed out the bugs. I still couldn't get the WHILE with AND working on the machine just an alarm (125 FORMAT ERROR IN MACRO) but not really needed anyway. Two nested WHILE's will do the same thing. This is tested and works.... % O9000 (CHECK TIME / RUN WARMUP) #100=20000 (START WAITING) #101=50000 (START WARMUP) #102=60000 (END WAITING) #103=#3012 (TIME WHEN THIS MACRO STARTS) IF [#3012 GT #102] GOTO 100 (AFTER 6AM) IF [#3012 LT #100] GOTO 100 (BEFORE 2AM) IF [#3012 GT #100] THEN (AFTER 2AM) WHILE [#3012 GT #100] DO 1 WHILE [#3012 LT #101] DO 2 G4 U1.0 #100=#3012 END 2 END 1 M98 P0002 (RUN WARMUP PROGRAM) N10 M00 M99 % The way it works is the start time is checked and if not within the range 2am to 6am it jumps to N10 #100 is checked and the outer loop (DO 1) starts #101 is checked and the inner loop (DO 2) starts. #100 is re-used and counts up every second because of the dwell. The current time is getting closer to the warmup time (#101) each second. Because #100 is getting larger every second as well the current time eventually becomes equal to #100 which ends the outer loop (DO 1) at the same time as the inner loop ends (DO 2) At that point the M98 is read. The added variables at the top allow you to watch (or debug) the progress by monitoring the variables on the macro variable page. #103 is there purely to see when the macro actually started (assuming the machine was running when everyone went home #103 = the time when the PALLET of parts was completed. Note the time format. it's 24 hour military time etc. 020000 is 02:00:00 (2am) but the leading zeros are truncated so 2am = 20000. 6am = 60000. 3:30pm is 153000. etc By changing #100,#101 and #102 and the IF checks you can get this to start any time you want or skip it entirely. Last edited by fordav11; 02-03-2012 at 08:27 PM. |
| Sponsored Links |
|
#7
| ||||
| ||||
| that's interesting. thanks for the info. 6006 is not listed in my manual (Fanuc Series 21i Model A Parameter Manual B-63090EN/01) an older 18 series manual has it listed. It disables all logical operations! my parameter is set to 0. I will test this next week and report back.... I also discovered it is listed in the later revision B-63090EN/02 parameter manual. |
|
#11
| ||||
| ||||
| I'm not really trying to evaluate anything to true or false. I just want to do one calculation AND another calculation until they are LT or GT something else then exit the WHILE This is what I tried. it doesn't work. WHILE [[#3012 GT 20000] AND [#3012 LT 50000]] DO 1 at this point is doesn't really matter because I solved the initial problem using two WHILEs it's more of a curiosity now Last edited by fordav11; 02-06-2012 at 07:23 AM. |
|
#12
| |||
| |||
| Please try this and check if it works: #1 = #3012; WHILE [[#1 GT 20000] AND [#1 LT 50000]] DO 1; |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Okuma CNC Lathe Safety Cycle Start System Sub Program | kurmay | Okuma | 1 | 11-17-2011 08:38 AM |
| Outputting Common variable values into a program (with automated program number) | yaji63 | Fanuc | 0 | 12-27-2010 02:55 AM |
| Dry-run system variable? | machzero | Okuma | 3 | 06-12-2009 09:08 AM |
| okuma time variable | Bala | Okuma | 1 | 11-28-2007 04:55 AM |