Hello Guest it is April 26, 2024, 08:19:31 PM

Author Topic: Mach4: How do I get my Auto Oiler to turn on and off automatically?  (Read 658 times)

0 Members and 1 Guest are viewing this topic.

I'm fairly inexperienced with Mach4, so I'm unsure what files I need to submit. If you let me know I can go pull them off the machine and upload them.


1)  The machine has an auto oiler and auto tool changer on it. It came with a custom user interface and touch screen. I've accidentally left the oil pump running twice now. I'm not sure what the best way to go about it is, but I felt like if it turned on the oil pump whenever it was running an operation, that would likely be suffecient to keep everything oiled, and then turned it off when the op was done? I'm not sure how to program that, or if it is possible.

2)  I had another question, I just got in a new Auto Tool Setter today. For my probe I use a Haimer 3D Probe with dial gauge. Am I supposed to zero it out on the bed with a gauge block like I normally do, then use the Tool Setter for the other tools? Does the software take into account the location of where I probed with the gauge block and the fact the tool setter sits 4" above that?

3) I run a 2" Face Mill in Tool Slot 2 always. Is there a way to program a script or something in Mach4 that spins the face mill backwards at a low rpm and offsets it from the tool setter?

4) The new tool setter has an air nozzle. I'd like to take advantage of that. I bought an electronic valve for a spare air line I brought into the machine, but I could not figure out how to get it to just shoot a burst of air. I'm fine buying a new setup if there's a recommended kit or something.

5)  I'd honestly be happy to pay someone to go over all the code/ui and clean things up. I know there is some sloppy code in there. I have run into so many minor issues and my only conclusion is that there are a bunch of scripts to do a specific task but they aren't aware of each other. So if I don't know how the machine coding works or a specific back end order of operations, I end up messing ********* up. One example would be with the Auto Tool Changer. I've had multiple issues where after I measure a tool offset manually, I click on the ATC to change to the next tool to measure it, and the alignment is completely off. The carrousel crashes into the spindle, gets stuck, the order of the tools gets thrown off, I've even had it break a holder, and now I am down a holder because I cannot find a replacement lol. I feel there are a lot of issues that someone with experience might be able to look at and assist with.
Re: Mach4: How do I get my Auto Oiler to turn on and off automatically?
« Reply #1 on: November 21, 2021, 03:30:57 PM »
Hi,
I suspect all of 1) to 4) are doable.

May I suggest we tackle one at a time.

As far as the oiler goes would it be acceptable to have the oiler running ONLY when the spindle is running? In which case we could use:
rpm, rc = mc.mcSpindleGetMotorRPM(   number mInst) if the rpm is non zero we would turn the oiler on.

Another possibility:
dir, rc = mc.mcSpindleGetDirection(number mInst) this API tells us when the spindle direction is forward, reverse or off. Clearly if the spindle is either running forward
or backward then you'd want the oiler running.

Another idea along the same lines is to monitor Mach signals OSIG_SPINDLE_ON, OSIG_SPINDLE_FWD, OSIG_SPINDLE_REV and turn the oiler on whenever one or more of these
signals is active.

Another idea is to turn the oiler on when and only when you are moving the axes, say:
velocity, rc = mc.mcMotorGetVel(number mInst,    number motor), we could monitor each of the axis motors and if one or more of the motor has non zero motor speed, ie
the axis is moving then turn the oiler on.

A less comprehensive but easier way would be to monitor OSIG_RUNNING_GCODE. This signal would be active ONLY when running Gcode, ie doing a job. It would not be
active if you are jogging or MDIing, would that be acceptable?

As you can see I've come up with a number of ways to have the oiler turn on....and I feel sure many more could be devised. A straight out timer so the oiler turned on
for a minute every five minutes say.

Do any of these ideas appeal?

Craig



'I enjoy sex at 73.....I live at 71 so its not too far to walk.'

Offline MrFixit

*
  •  7 7
  • Series 2 Boss 6 CNC mill - retrofitted+updated
    • View Profile
Re: Mach4: How do I get my Auto Oiler to turn on and off automatically?
« Reply #2 on: November 24, 2021, 10:18:33 AM »
I have attached a screenshot of the Mach4 control setup of how I control my lube pump without having to script. I have since found that scripting is a good thing to learn how to do though.  It opens up a whole new world of making the screens efficient and suited to how you use your machine.

I just have the lube pump running when the machine status is enabled.  There are some other options that are more specific to cut down on pump run time if that is a concern. IE, spindle active, as Craig suggested using.
I have some relays that are built into my motion controller expansion card. 
I am able to tie an output to a pin on the motion controller and wire a 120vac control circuit into the corresponding relay.
If you don't have any integrated relays, you would just need to add a relay controlled by the output pin you select on your controller.

I haven't tackled the low lube oil switch input that needs to go back into Mach4 yet though.  I'm not sure the best way to monitor its status without bogging more important things down.I believe it will involve assigning an input pin to a signal number. Then if i understand correctly there is a function to monitor for a change in signal state that i can incorporate somewhere as an alert or flashing light or feed hold or something.