![]() | |
| Home Page | Mark Forums Read | Today's Posts | My Replies | Classifieds | Reviews | Photo Gallery | Web Links | Share Files | Advertise With Us | Ad List |
| |||||||
| CamSoft Products Discuss Camsoft PC based CNC controller products here! |
| This forum is sponsored by: |
![]() |
| | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
| |||
| |||
Hi, I'm running a 3-axis milling machine on Camsoft and I'm looking for a way to turn the lubracation of the axis ON and OFF in order to save oil. As an exemple, while a program is running, I'd like to turn on the lubrication for 1 minute, then OFF for 3 minutes, and so on. I've noticed that the SLEEP command seems to paralyse the entire machine for the time it's... sleeping. Using the TIMER command, it seems that I can turn the pump either ON or OFF... but not the two alternately. How can I manage the axis lubrication according to a certain period of time? |
|
#2
| ||||
| ||||
| SLEEP doesn't apply in your situation. You need code in the timer.fil. RUNTIME is a command that puts how long you've been running into a variable. Do some math to divide this by 4 minutes and look at the remainder. Then use an IF THEN statement to turn on your output during the portion of your 4 minute cycle you'd like. karl P.S. If you want to run the oiler only when running a program, take a look at LOADING. It will have a value of 2 when in cyclestart mode. Last edited by Karl_T; 08-18-2008 at 11:43 AM. |
|
#4
| |||
| |||
| Phil, The simplest method is to set your the TIMER ON logic command to set the millisecond time interval 60000 for 1 minute for the lube I/O and use a variable counter to toggle back and forth between on and off Select an un-used variable for this: In the TIMER.FIL file write: \333={\333+1} IF \333<4 THEN #7=0 ' I/O for Lube OFF IF \333=4 THEN #7=1:\333=0 ' I/O for Lube ON Alternative: Or else you could always replace SLEEP with the IF THEN GOTO and TIME commands in a loop until the time elapses with the need for the TIMER.FIL file. In the Macro.Mac Library you can modify this macro which is checking for time elapsed into a routine that uses the TIME to do the lube. [TIMED IO CHECK] ' The following routine checks to see if a prox switch is hit within 500 ms if not then display a message ' Change time 500 ms and I/O relay # as needed #83=1 ' Engage air cylinder to move TIME RESETMS ' set millisecond time counter to zero LOOP: TIME MS;\55 ' read how many milliseconds has elapsed IF \55>500 THEN LABEL1 AIR TOO LOW;12:EXIT IF #59=0 THEN GOTO :LOOP ' if switch not hit then re-check again ' If made it here then switch was hit within 500 ms
__________________ (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management) |
|
#5
| ||||
| ||||
| I'll be more elegant. The above macro runs all the time unless you get tricky with turning TIMER on and off. Also you have to run TIMER at that interval. So my solution (in timer.fil): LOADING \900 RUNTIME \901 \902={\901/4-INT(\901/4)} IF\900=2THENIF\902<.25THEN#7=1:GOTO:OILEREND #7=0 :OILEREND Put this command in startup.ini TIMER ON 1000 'can be any other interval if needed Karl Last edited by Karl_T; 08-22-2008 at 10:05 AM. |
| Sponsored Links |
![]() |
| Tags |
| sleep, timer |
| 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 |
| Boost and sleep mode | mr.praktik | LinuxCNC (formerly EMC2) | 7 | 01-17-2008 06:52 PM |
| G2 and G3 Commands | Bohemund | G-Code Programing | 19 | 05-28-2007 09:12 AM |
| machine sleep mode | mcash3000 | Fanuc | 1 | 11-15-2006 10:59 AM |
| Sleep Command | howling60 | CamSoft Products | 12 | 03-02-2006 09:27 AM |
| Sleep Vs. Ena# | FLUTE HEAD | Xylotex | 1 | 06-21-2005 08:53 AM |