Hello Guest it is September 26, 2023, 05:37:24 AM

Author Topic: Is this possible?  (Read 7179 times)

0 Members and 1 Guest are viewing this topic.

Re: Is this possible?
« Reply #10 on: October 18, 2010, 12:09:57 PM »
Hi Tweakie,

I am thinking about using an external switch, a magnetic sensor switch, to control a takeup roller on my CNC Quilter with a value assigned to it to trigger the hotkey combination that would activate the roller motor.

Re: Is this possible?
« Reply #11 on: October 18, 2010, 01:46:52 PM »

2 ways to do what you need.

1. wire ALL probes in series on one set of pins. Then which ever one trips the input THAT is the active probe. Very simple logic.

2. Use a mach output signal to drive a flip flop relay to reverse the probe input between 2 probes. Call it from VB monitor the flip flop to see which is     active.  More complicated logic.

I thought of #1 but the problem was that is if probe 2 is needed and probe 1 contacts first, there is no way to deal with that.

#2 has promise.  I'm using a gecko G540 drive which has two outputs and I'm using them both.  Right now I have a three position switch on the machine that selects the probe.  In Mach I also have a switch (so to speak) that selects the probe because each probe has different logic associated with it.  So first you have to select the probe on the machine, then you have to select the same probe in Mach.  

The probe won't change during the program run cycle.  Ideally I want to have buttons on the mach screen to select probe 1 or 2, then have a macro at the beginning of the program set things up to read from the correct probe.  A Mach controlled relay in place of the switch on the machine would work.

One other idea would be to use a double pole switch on the machine and use one input to mach.  If that input were low, call it probe 1.  If the input were high, call it probe 2.  This method would eliminate the on-screen switches in Mach and instead just check the "probe state" input and set things up based on that.  I'd rather have a button on the mach screen over a mechanical switch on the machine, but ultimately, I just want one switch.  Sounds like it may be easier to put it on the machine and read it's state from Mach.  Could have an LED on screen to indicate switch position.  This way I can still use G31 to probe, which has never let me down.  I think I've talked my self into giving this a shot.  
« Last Edit: October 18, 2010, 01:49:06 PM by rrc1962 »

Offline BR549

  •  6,965 6,965
    • View Profile
Re: Is this possible?
« Reply #12 on: October 18, 2010, 03:54:51 PM »
OK you have my curiousity up. WHY would you need 2 probes so close together as they would get confused as to which one tripped???

(;-) TP
Re: Is this possible?
« Reply #13 on: October 18, 2010, 06:53:14 PM »
There are some initial positioning and offset differences depending on which probe is used.  A macro that runs at the beginning of the program sets all that up.  

basically what I did was use a DPDT switch on the machine.  One pole switches the two probe inputs and the other switches to ground when probe 1 is selected.  That runs back to the controller where mach sees it as an input (Input 1).  When my macro runs, it checks the state of input 1 and sets things up accordingly.  It works very well.

My only concern is that I have an LED on screen for the two probes.  Probe 1 is active when input 1 is active, so I have OEMLED 821 lit (true) when probe 1 is active.  Basically, probe 2 is active when OEMLED 821 is false so no LED is really needed for probe 2, but for cool factor I wanted to add one.  I added a userLED, then wrote a macropump that just sets it's state opposite that of OEMLED 821.

This works great, but I'm concerned about this piece of code running all the time and using valuable resources.  It's just a simple if then else like this....

If getOEMLED(821) = False Then
   setUserLED(1102, 1)
   setUserLED(1102, 0)
end if

Offline BR549

  •  6,965 6,965
    • View Profile
Re: Is this possible?
« Reply #14 on: October 18, 2010, 07:16:46 PM »
Put in into a brain and mach will never know it is there(;-)
Re: Is this possible?
« Reply #15 on: October 18, 2010, 07:35:01 PM »
But then I'd have to learn all about brains. :)
Re: Is this possible?
« Reply #16 on: October 18, 2010, 08:27:14 PM »
Figured it out.  Brain works much better.  Thanks for that tip.