Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: fisherjim on December 19, 2007, 02:49:48 PM

Title: Auto oiler
Post by: fisherjim on December 19, 2007, 02:49:48 PM
Hi,

On my lathe, an Emco 220, I have an automatic oiler that should come on every 20meters of travel,  can I set up Mach to give me an output for a second or so to set the relay?

Thanks.
Title: Re: Auto oiler
Post by: Hood on December 19, 2007, 03:11:00 PM
You could set up the macro pump to do that or possibly even a Brain.
Hood

Edit, sorry I misread and thought you said 20 minutes rather than meters, that would probably be more difficult :(
Title: Re: Auto oiler
Post by: poppabear on December 19, 2007, 03:27:34 PM
goto Operator>Edit Brains
When the Brain window opens name it "Oiler" and hit OK
in Brain, hit the + and then on the selection window hit Outputs, pick and output like Enable 1 or the Output that turns on your spindle.
next hit the + again in that window hit Timer
in "A--Delay Trigger" put something like 1200 seconds (20 minutes), make sure that Accumulative is not checked (UNLESS your watching something that turns on and off like your spindle output then you want to check it).
in "B--Pulse Time" put how long you want the oiler output to stay on for in seconds. Make sure the Single shot is not checked.
in "C--Delay till Repeat put 1200 seconds (20 minutes)

hit ok

then hit the Terminate button, put whatever output# you have going to your oiler.

What the Brain will do is, it looks at your what ever your gonna use as your oiler reference. i.e. Enable will oil the machine every 20 minutes as long as mach is on (not in reset condition).
If you watch your spindle output, then the brain will oil the machine for every 20 minutes of spindle run time.

I attached a zip file that has the "Oiler" Brain in it, it watches the Enable1 output, it delays for 20 minutes, oils for 2 seconds, then every 20 minutes of Mach ON time it runs for 2 seconds.

scott
Title: Re: Auto oiler
Post by: fisherjim on December 19, 2007, 03:42:55 PM
Thankyou poppabear, but I need it to trigger every 20 meters not minutes. there is an screen that gives distance moved under Operator-Maintenance hours, can I use this as a distance timer?
Title: Re: Auto oiler
Post by: poppabear on December 20, 2007, 10:37:23 AM
OK,

Then here is a Macropump that will measure your True X Travel, (If you want you can add the Z so get a true sum, but I just used the X for distance).
Here is what you will need to do:

this macro will activate OUTPUT6 once the X axis travels more than 20,000mm, the output will stay on until the X Axis Travels more than 20100 when it passes that point, it will turn off OUTPUT6, and reset the counter to "0".

What you will have to do is caputre the output signal with an external relay, that turns on the oiler through a Timer or whatever, and then once the timer times out, it will Toggle your external relay to shut off the oiler signal, (even if it is still on in mach cause you havent yet moved the required 20100mm to shut it off, this is so your oiler just doesnt keep running if for some reason your X axis stops with the counter between 20000mm and 20100mm).

If you want, you can go into the MacroPump code here (and use the alternate statement as well), and do an "AND" statement with your timer sending back a signal on INPUT1 that shows it has timed out and finished timing.

Open Operator>Vb scripter and put the following script into the window, hit File>Saveas "macropump.m1s"
goto General turn on Macropump, goto general and in Ports and Pins make sure that OUTPUT6 and INPUT1 is enabled (you can change these I/O to your machine, but remember to change them in the macropump.

Here is the Macro:

'MacroPump.m1s

a=Abs(GetOEMDRO(83))
b=GetOEMDRO(806)
c=GetUserDRO(1400)

If a>0 And b=0 Then
c=c+a
SetUserDRO(1400, c)
End If

If c>20000 Then
ActivateSignal(OUTPUT6)
End If

If c>20100 Then
DeActivateSignal(OUTPUT6)
SetUserDRO(1400,0)
End If

'Alternat Last statement
'If c>20000 and IsActive(INPUT1) Then
'DeActivateSignal(OUTPUT6)
'SetUserDRO(1400,0)
'End If

'Enjoy,

'Scott

Title: Re: Auto oiler
Post by: fisherjim on December 20, 2007, 11:06:34 AM
Thank you poppabear you'r a star.

I'll set my machine up and give it a go, I think I have a timer somewhere I can use.

Jim.

By the way,  MERRY CHRISTMAS to you and all who help on this forum.
Title: Re: Auto oiler
Post by: panaceabeachbum on August 14, 2008, 04:26:40 PM
Just curious in the post above it says to hit the + in the brain editor and choose "timer"   I cant find timer anywhere there to choose
Title: Re: Auto oiler
Post by: Hood on August 14, 2008, 04:40:57 PM
You need to clcik on the first entry you made, in the above it is an Output I think. Anyway when this is green and you press the + you will see the Timer as one of the options.
Hood
Title: Re: Auto oiler
Post by: panaceabeachbum on August 14, 2008, 10:05:29 PM
Much thanks , I read these tutorials literaly and if it doesnt say to do a specific function I dont do it for fear of screwing something up

I have the oiler set up on output 6 , is there a simple way to activate the oiler manualy on occasion , either thru an external pushbutton or an onscreen button or thru an unused mcode?
Title: Re: Auto oiler
Post by: Overloaded on August 14, 2008, 10:49:40 PM
this is pretty simple,
Make a little Brain like....

Then enable an input, (I used 1) then assign a hotkey to it. I used "O" for Oil.

Enable the brain and any time O is held, Out6 is active.
Could also use Screen 4 and put a button on screen as well.
Title: Re: Auto oiler
Post by: Overloaded on August 14, 2008, 11:00:33 PM
Ya gotta watch the hotkeys though.....make sure nothing else is asigned to the one you use.
External button is almost as simple to connect to the input.
Be Careful,
rc
Title: Re: Auto oiler
Post by: panaceabeachbum on January 08, 2009, 04:55:07 PM
I have another question about the "oiler Brain"  I have been using it for a few months now and it works great but I am having a little problem.  It sends the signal to my oiler for a preset length of time every 20 minutes of spindle runtime but the problem is it resets the 20 min timer each time the spindle is turned on . If I have a part in which it turns the spindle on and off three times , it gives a shot of oil each time the spindle starts  even if they are only 1 min apart , so on parts with small run time I am wasting a ton of oil. How can I modify the brain so it oils every 20 minutes of spindle run time and doesnt reset each time the spindle is stopped and restarted?
Title: Re: Auto oiler
Post by: Overloaded on January 08, 2009, 08:05:25 PM
Hey RT,
   The brain looks OK to me. Sounds like you are getting an initial SHOT of oil when you start. Like the relay is wired wrong. If your run times are less than the timer, you should get NO oil.
Title: Re: Auto oiler
Post by: panaceabeachbum on January 08, 2009, 08:19:13 PM
the relay is a solid state 20 amp being switched on by pin one port two , every time the spindle is switched on it switches the relay on  for a few seconds , it then cycles agin in 20 minutes . It also triggers the relay everytime the spindle is switched on , I will look thru my wiring tommorow , any thoughts on what I might be looking for ?  Thanks
Title: Re: Auto oiler
Post by: Hood on January 08, 2009, 08:27:03 PM
I suspect that your problem may be that each time your enable signal is stopped then started this resets the timer. If you have this enable signal set to be active only when the spindle is on it will, I would imagine,  do exactly what you see happening. If you used an enable signal that was active when the control was active then the timer would not get reset until the 20 mins were up or you restarted the control.
Hood
Title: Re: Auto oiler
Post by: Overloaded on January 08, 2009, 08:52:50 PM
Not sure what you mean Hood. I changed the Brain to INPUT1 to start and it is an ON delay timer. The output does not come on for 20 min.
Upon reset, it has to wait another 20 min. There should not be a shot of oil at the start...the way I see it  (half blind though)
Title: Re: Auto oiler
Post by: Overloaded on January 08, 2009, 08:55:31 PM
RT, you must not be using the Brain in the earlier reply of this topic. ? ?
Title: Re: Auto oiler
Post by: Hood on January 08, 2009, 08:57:24 PM
What I am thinking is RT has maybe got the brains signal being activated by the spindle coming on and off, for instance if he is using an output that is set for M3 to activate the Brain then it will be reset each time the spindle starts, I might be barking up the wrong tree however..
Hood
Title: Re: Auto oiler
Post by: Overloaded on January 08, 2009, 09:02:07 PM
Thats exactly what I have here. 20 min ON delay.  timer starts by out1 (M3).  If no prgm runs 20 min, it will NEVER oil.
Keep resetting the timer, it will never time out.
Instead of 20 of and 2 on. Maybe 10 off and 1 on so it will get oil on the short runs.
Like to see the Brn.
RC
Title: Re: Auto oiler
Post by: Hood on January 08, 2009, 09:06:48 PM
Ok I see what you are saying, yep the brain must be different right enough, think I need some sleep ;D

Hood
Title: Re: Auto oiler
Post by: panaceabeachbum on January 08, 2009, 10:26:54 PM
I am using the brain downloaded from the first page of this thread, I printed poppabears post and will  go back over it all in the morning, I have fiddled with it enough that I may have un checked  cummulative or changed the delay to some other value. What ever is going on it energizes my relay activating the oiler everytime the spindle is started , even if its stopped and started multiple times in a few minute period, it activates each time. Thanks for the help I will read and re-read all this again tommorow while standing at the machine and I am sure what ever I have changed or screwed up will leap out at me
Title: Re: Auto oiler
Post by: Overloaded on January 09, 2009, 06:43:01 AM
Hi RT,
 With Accumulative checked, the oiler will come on every time you start IF the machine/spindle has been OFF for the duration of the timer. UN check Accumulative and the delay always begins when you start the spindle, then oils after the delay time. This would be better for short runs.
I think that's the crux of it.
RC

Yup...with Accumulative checked, M3 starts the timer but it dont stop when you M5, it runs until it times out at the ON pulse and waits there for the M3 again, then oils and continues on. So if the timer delay is 20 min., your run is 5 and you are down 10, it will oil 5 into the next run. If the run is 5 and you are doun 15, it will oil at the next M3. If there is a way to pause the timer while m3 is OFF, you'd be set.

Title: Re: Auto oiler
Post by: poppabear on January 09, 2009, 08:18:35 AM
Hey RT,

    I have made another Brain for you to try, this one is dependant on Spindle Run Time only, it watches the Spindle ON Led.  I put an initial Oiler delay of 20 minutes as you fellers have been discussing, but, you can change it to what you want.
It uses an accumulator, so the first time after you boot up mach3, and you push or turn on Spindle CW or CCW, the delay will start counting up it is cumlative on Spindle run time, so after total spindle on time reaches 20 minutes it will oil for 2 seconds. Then it will count a delay until repeat of 20 minute of accumlative run time, and shoot again, etc.
it is set to OUTPUT6 as your machine.
NOTE: The Spindle RUN led will turn off AFTER you have pused the spindle off or what ever depending on your spindle Accel/deccel curves. So, if you have a decel of 1 second, the Spindle ON led will still be light for one second AFTER you tell it to be off.........

Scott
Title: Re: Auto oiler
Post by: poppabear on January 09, 2009, 10:52:23 AM
Overloaded pointed out that the above brain is still triggering on M3 regardless of how far in the cycle it is, so that leads me to believe that there is a bug in the way the accumalator is counting on the delays at the input side.

that being the case..........  Put this in your "MacroPump" and smoke it........

'macropump.m1s
'Var(100) is for the counter interlock

DelayTimerAccumalator = GetVar(101) 'delay accumalated time
TimerValue1 = (GetTimer(1)/1000) 'Delay timer (timers are in ms so divide by 1000 for seconds)
TimerValue2 = (GetTimer(2)/1000) 'timer ON for oiler

If GetOEMLED(11) And GetVar(100) = 0 Then
   SetTimer(1)
                SetVar(100,1)
end if
If Not(GetOEMLED(11)) And GetVar(100) = 1 Then
   SetVar(100,0)
End If

If GetOEMLED(11) Then
   NewTimerValue1 = TimerValue1
   TimerDiff = Abs(NewTimerValue1 - OldTimerValue1)
   DelayTimerAccumalator = (DelayTimerAccumalator + TimerDiff)
   SetVar(101,DelayTimerAccumalator)
   OldTimerValue1 = NewTimerValue1
End If

If DelayTimerAccumalator > 1200 Then
   SetTimer(2)
   TimerValue2 = (GetTimer(2)/1000) 'timer ON for oiler
      If TimerValue2 < 2 Then
         ActivateSignal(OUTPUT6)
      End If
      If TimerValue2 >= 2 Then
         DeActivateSignal(OUTPUT6)
         SetVar(100,0)
         SetVar(101,0)
         SetTimer(1)
         SetTimer(2)
      End If
End If
         

'scott
Title: Re: Auto oiler
Post by: jimmybondi on April 18, 2009, 02:26:45 PM
Hi Scott,

i've build brains for an auto-oiler too - and now i want to use the same in macropump :-)

but thats hard (for me) :-(
my first macropump is just 5 minutes old and switch the pulleys ...

my brains
(i've made 3 seperate brains because written in one lobe it didn't work ...)
one brain isn't shown here - it redirect output 10 11 and 12 seperate to Output4

my machine (Maho MH400) needs a lubrication on following events:
- when nothing happen on energized mill: an impulse every 8 hours
- on start of machine (switch on) an impulse
- at start of movement and the last impulse has least more then 32 minutes an impulse at the beginning of movement
- during move still on (on any axis) an impulse every 16 minutes

and every event reset the counter and next impulse occur on nearest event

Maybe that anyone can use this brains and anyone can help me to made it within macropump.
(my brains are really full and more will made Mach3 a little bit lazy ...)

Frank

BTW: it may look a little bit confus - but thats one working ok for me.
When trying to made it more simple it didn't work in every case :-(