586,036 active members*
3,540 visitors online*
Register for free
Login
Results 1 to 5 of 5
  1. #1
    Join Date
    Aug 2008
    Posts
    3

    Sleep/Timer Commands

    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. #2
    Join Date
    Mar 2004
    Posts
    1543
    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.

  3. #3
    Join Date
    Aug 2005
    Posts
    25
    Another option would be to put in a external (hardwired) timer relay and run the coil for the relay from a Camsoft output.

    AL

  4. #4
    Join Date
    Apr 2003
    Posts
    332
    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. #5
    Join Date
    Mar 2004
    Posts
    1543
    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

Similar Threads

  1. Boost and sleep mode
    By mr.praktik in forum LinuxCNC (formerly EMC2)
    Replies: 7
    Last Post: 01-18-2008, 01:52 AM
  2. G2 and G3 Commands
    By Bohemund in forum G-Code Programing
    Replies: 19
    Last Post: 05-28-2007, 03:12 PM
  3. machine sleep mode
    By mcash3000 in forum Fanuc
    Replies: 1
    Last Post: 11-15-2006, 05:59 PM
  4. Sleep Command
    By howling60 in forum CamSoft Products
    Replies: 12
    Last Post: 03-02-2006, 04:27 PM
  5. Sleep Vs. Ena#
    By FLUTE HEAD in forum Xylotex
    Replies: 1
    Last Post: 06-21-2005, 02:53 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •