Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: BarryM on May 03, 2017, 03:29:59 PM

Title: Limit switch set up on Mach3 with the Gecko g540
Post by: BarryM on May 03, 2017, 03:29:59 PM
I have the Gecko G540 and I'm trying to set it up with Mach3 ,what are the correct settings that mach3 needs to be set.
Title: Re: Limit switch set up on Mach3 with the Gecko g540
Post by: Tweakie.CNC on May 04, 2017, 02:02:13 AM
The G540 Users Manual shows the switch wiring configuration.
The following shows the Mach3 Inputs set-up for the switches.

Hope this helps.

Tweakie.
Title: Re: Limit switch set up on Mach3 with the Gecko g540
Post by: joeaverage on May 06, 2017, 04:22:13 PM
Hi,
I'm guessing you're setting up Mach for the first time and are probably somewhat confused about the choices to make, I certainly
was when I was setting up my mill for the first time.

As Tweakie has shown you it is possible to assign an input pin to each home switch, one per axis. You could in fact assign limit
switches individually also, two per axis but you would run out of available pins with the 540. The method I adopted largely because it
seemed easy to understand at the time was to have one home switch per axis, one Estop and one limit switch input for a total of 5 inputs.
I was using a single PP and BoB at the time and so 5 input was all I had and if I'm not mistaken the 540 has the same limitation.

I bought and fitted three top quality roller plunger microswitches and fitted one to each axis and assigned one input each as a home switch.
Given that your home switches set the zero machine reference of your machine at each turn on it makes sense to use the best and most
repeatable quality switches/sensors to establish it. Limit switches are fitted at the end of all three axes, one at each end for 6 switches.
They are all wired normally closed and in series and assigned to just one input. If any one limit switch goes open the machine faults out
and you will have to manually bring the machine back into bounds before you can reset it. Because all of the limit switches are combined
Mach cant tell which axis is out of bounds nor can it tell which direction triggered the limit. You will have to inspect the machine and decide
how to handle each 'out of bounds' excursion.

You will no doubt have read that you can combine home and limit switches and in interests of saving inputs and the number of switches
many do. When homing the machine temporarily looks to the limit switch assigned to the axis being homed as home switch. If any of the
limit switch 'string' opens then Mach will interpret that event as home switch for the axis being homed. There could be mistakes, for instance
if a Y axis limit switch was accidentally triggered while Mach was trying to home the X axis then homing is compromised and a later crash
or out of bounds error likely result. Having said that lots of people do it this way without problem. I would still recommend that the switches
which will double as home switches be good units to achieve best repeatability.

Craig
Title: Re: Limit switch set up on Mach3 with the Gecko g540
Post by: dorrisant on March 03, 2018, 03:43:04 AM
I have two switches for the x axis, one on each end. I have one switch for the y axis with adjustable stops on each end. I have two switches for the z axis, one at the top and one at the bottom. As I have it wired, I have both of the x axis switches wired in series and connected to input 1 of my G540. The y axis switch is connected to input 2. The two z axis switches are wired in series and connected to input 3. All of the grounds are tied together as in the Gecko manual.

The problem I'm having is that no matter how I configure the settings in ports and pins/inputs, I cannot get the z axis switches to do anything. When on the diagnostic tab, I can see the switches for x and y light up the appropriate input light, but the z axis never indicates anything and will not trigger a stop. I have checked continuity of the switches for all of the axis and see no difference in the measurements with my Fluke meter. I have checked all for voltage too... All three of the above circuits show zero volts to ground in a normal state. If I engage any of the switches from any of the circuits, I get approximately 11 vdc. I don't know if that voltage is correct but it does show that all 3 circuits are functioning exactly the same and that all of the switches are connected NC. I have all three inputs enabled in Mach3, (++, - and Home) for each of the axis. Also, all three inputs use the same input pin for each axis, 10 for x, 11 for y and 12 for the z.

I changed the physical wiring terminal of the z axis switches to the #4 pin of the G540 and changed the input pin to 13 in Mach3. This changed nothing as far as the way the z axis switches are not functioning.

Is there a simple fix for this? Should I wire the switches so that I have each home switch has an individual input... x to input pin 10, y to 11, z to 12 and connect the remaining switches in series to input pin 13? Maybe there is something else mis-configured in Mach3... Maybe my G540 is malfunctioning. I wouldn't think so, but not ruling it out.

Other than this issue, everything seems to be working perfectly, even the spindle control.

What am I missing?

Tony
Title: Re: Limit switch set up on Mach3 with the Gecko g540
Post by: joeaverage on March 03, 2018, 04:45:21 AM
Hi,

Quote
Should I wire the switches so that I have each home switch has an individual input... x to input pin 10, y to 11, z to 12
That was what I recommended in the first place but you've done something different.

If you have three home switches, one for each axis and each on its own pin you will need ANOTHER SIX switches for the limits, one at each end of each axis,
they can ALL be in series NC and connected to ONE pin on the Gecko. As it stands you have what amounts to limit switches on each axis with each axis
having its own pin.

The real problem you have is that somehow you are confusing Machs pin numbers and the Geckos pin numbers and your Z axis switches are not being 'seen' by
Mach. I you can solve that you can probably get the existing arrangement to work.

Craig
Title: Re: Limit switch set up on Mach3 with the Gecko g540
Post by: TPS on March 03, 2018, 06:09:37 AM
can you post your xml please.
Title: Re: Limit switch set up on Mach3 with the Gecko g540
Post by: dorrisant on March 03, 2018, 10:22:25 AM
Craig, I will try to configure the switches as you said... Each axis will have a Home switch connected to the Gecko. So X will go to input one, Y to input two and Z to input three while the remaining switches (connected in series) go to input four. In Mach3, I will assign X Home to pin 10, Y Home to pin 11 and Z Home to pin 12. I will then assign X++, Y++ and either Z++ or Z-  to pin 13. Does this sound correct?

I'm sorry, I do not understand what the XML is that I should post. I will surely do this if it is explained.

Sorry guys, I am new to this kind of configuration. I sure appreciate the help though.

Tony
Title: Re: Limit switch set up on Mach3 with the Gecko g540
Post by: dorrisant on March 03, 2018, 10:32:29 AM
Also, I was under the impression that all switches for the X axis were to be connected to a single input of the Gecko and assigned to it's own pin in Mach3... This may indicate my error.

I was also under the assumption that you could use just one switch for limits and home for each axis...

I'm not saying the above statements are true, I'm just showing you the logic I followed. This detail may reveal my error(s) to you.

Thanks again.
Title: Re: Limit switch set up on Mach3 with the Gecko g540
Post by: TPS on March 03, 2018, 12:13:12 PM
I'm sorry, I do not understand what the XML is that I should post. I will surely do this if it is explained.
Tony

c:\Mach3\Your profilename.xml
Title: Re: Limit switch set up on Mach3 with the Gecko g540
Post by: dorrisant on March 03, 2018, 12:15:43 PM
I found it but am having trouble trying to post it. I keep getting this error:

"Sorry! There is already an attachment with the same filename as the one you tried to upload. Please rename the file and try again."
Title: Re: Limit switch set up on Mach3 with the Gecko g540
Post by: dorrisant on March 03, 2018, 12:16:52 PM
Here...

Title: Re: Limit switch set up on Mach3 with the Gecko g540
Post by: joeaverage on March 03, 2018, 02:24:47 PM
Hi,

Quote
In Mach3, I will assign X Home to pin 10, Y Home to pin 11 and Z Home to pin 12
if you chose to follow what I've recommended, this is correct.

Quote
I will then assign X++, Y++ and either Z++ or Z-  to pin 13. Does this sound correct?
This is not correct, You will need six switches, two on each axis all in series. Note the are separate switches to the home switches.
X++, X--,Y++,Y--,Z++ and Z-- will ALL be assigned to pin 13. Thus if any of the limit switches operates the machine will stop.

This is my recommendation, there are other ways to do this.  They rely on using three switches as both home and limit switches. When the machine is homing
it disregards the limits and treats them as home switches. It economises on switches. The downside it that when the machine is homing it is unprotected
against over limit excursions and an over limit event is most likey when trying to home.

You really need to decide whether you want to have nine switches (three homes, six limits) or wish to economise.

Craig
Title: Re: Limit switch set up on Mach3 with the Gecko g540
Post by: dorrisant on March 04, 2018, 12:59:03 AM
I figured out what my immediate problem was... The signal on pins 12 and 13 of the parallel port cable is not making it all the way through. 10 and 11 are there. I am going to order a UC100 on Monday.

Thanks for the help so far.
Title: Re: Limit switch set up on Mach3 with the Gecko g540
Post by: joeaverage on March 04, 2018, 01:11:14 AM
Hi,
beware that there are a lot of Chinese UC100 knockoffs on Ebay and other places. Make sure you get a genuine one from CNCDrives or their nominated distributor.

Craig
Title: Re: Limit switch set up on Mach3 with the Gecko g540
Post by: dorrisant on March 04, 2018, 01:17:35 AM
From here... right?

https://www.automationtechnologiesinc.com/products-page/breakout-boards-mpg/usb-motion-controller/

Title: Re: Limit switch set up on Mach3 with the Gecko g540
Post by: joeaverage on March 04, 2018, 01:56:34 AM
Hi,
yes I believe Automation Technologies is the US distributor.

Craig
Title: Re: Limit switch set up on Mach3 with the Gecko g540
Post by: dorrisant on March 07, 2018, 10:54:29 PM
Ok... the UC100 arrived. I followed the instructions for the automatic installer. I let it install the drivers, plugged in the UC100 to the computer via the USB, rebooted the computer, started Mach3 and let it do it's thing.

Now I'm having an issue where when I hit the reset button on the screen the following happens briefly:

On the G540
1 - The red "fault" light goes off.
2-  The green "power" light turns on.
When looking at the UC100 In/Out Monitor:
3- The red "Estop" indicator turns off (blank).
4- The blank "idle" indicator turns red.
5- The Pin State of "15. Inp ." (yellow) goes blank.
6- The Pin State of "16. Out." (blank) flashes red.
7- The motors go active (not moving).
8- The Blue and Green LEDs on the UC100 are lit constantly, the Blue flashes off when the Reset button is pressed.

The above lasts about 1/2 seconds.

Then it goes back to the previous state.

Motors inactive, "Fault" lit red,"15. Inp." lit yellow, "Estop" lit red and "Reset" button flashing indicating "Emergency Mode" on the screen.

When I watch via the diagnostics page, I see none of the indicators lit until I push "Reset". When I do that, the "Emergency" indicator flashes briefly.

All of the limit and home switches are showing the proper indications on the diagnostics page.

I had outputs 3, 5 and 7 indicating red in the UC100 Monitor until I checked "Dir LowActive" for X, Y and Z axis in "Motor Outputs". With those checked, those indicators are blank. Even with these unchecked, the machine still does the same thing, except that the indicators for Outputs 3, 5 and 7 are lit red.

I do not see the change of indicator expected when changing the Estop switch position. There is no indication on the diagnostic page or the UC100 monitor.

I was using the older XP based computer for all of the above testing. I decided to try a newer 64 bit Win7 machine. I loaded Mach3 and repeated the driver installation procedure on the new computer only to get the exact same results.

It seems that no combination of Active Hi/Low for any of the inputs including the Estop will get this thing to stay active. I didn't have this problem before the UC100. Without that, inputs 3 and 4 were not making it to Mach3. It would go active, it just didn't respond to inputs 3 or 4. I have tried this with the Max Step Rate set to 100kHz and 50 kHz. Also just for giggles, I tried Dereference axis on Estop both ways, no difference though.
So, no joy as of yet.

Tony
Title: Re: Limit switch set up on Mach3 with the Gecko g540
Post by: joeaverage on March 08, 2018, 07:04:41 AM
Hi,
let me guess you've got everything hooked up and its not working so you are doing things t try to get it to go. You are doing a scattergun thing.
You cannot multitask...your wife may be able to ....but you cant.

Disconnect everything, the motors, the homes and limits, everything except the power supply and the Estop circuit. Work on the Estop alone until you get
it working and understand why.

Then hook up one axis only and work on that.

Trying to get it all going at once will likely see you hit it with a hammer in frustration.

Craig
Title: Re: Limit switch set up on Mach3 with the Gecko g540
Post by: dorrisant on March 08, 2018, 09:39:42 AM
Please don't assume you are conversing with an idiot. 20 years ago, I was automating machines from the 1800s, converting all of the hand driven levers to hydraulic actuators with limit switches and hand-off-auto stations. I even set up hopper feeders etc... The next job I had at a torch tip factory, included building machines that didn't exist until our engineering team built them. I put in more time than anyone into those projects. Point is, I have been doing automation and troubleshooting of the like since the mid 90s. I think I can keep track of some limit switches for three axis as well as the estop. What you are saying is condescending. If you want to see what kind of work I do now, look here: www.volitionamps.com , if I can wire those up, I think you would agree that the wiring we are talking about seems simple by comparison.

I can't count the number of Bridgport mills or Cincinnati lathes that I have installed servos and scales on. I cannot tell you how many Idecs or Slc50s I implemented in years gone by.

I can and do multi-task regularly. I am not just changing stuff at random. I read some of the similar problems and attempt some changes. If I see no change, or nothing in the right direction, I roll them back. I can keep track.

You may not be able to help, but there is no need to assume that just because you don't understand my issue, I am doing heretical things in a haphazard way. My troubleshooting methods are quite refined.

I do admit that this is new to me and others have more experience. That experience can help detect what might be faulty or just mis-configured.

All of this to say, rest assured that my limit switches and estop are connected and functioning properly as far as mechanicaly and electricaly. The interface between Mach3 and the G540 are what I suspect to be bad or mis-configured.

Also, there is a difference between being rather good at something while implementing a new method of arrival and being a total hack. I am the former, not the latter.

I have checked everything you are imply that I should disconnect and recheck. I do this as I go as a general practice. Maybe we could skip ahead to find the real problem.

Shall I post pictures?
Title: Re: Limit switch set up on Mach3 with the Gecko g540
Post by: TPS on March 08, 2018, 09:51:21 AM
i have realy no experience with the UC100,
but the red idle led would make me thinking about.

whats about to contact Automation Technology Support
to get a information what the red idle led want's to tell us.

in the manual i found nothing about red only about green ight.
Title: Re: Limit switch set up on Mach3 with the Gecko g540
Post by: TPS on March 08, 2018, 10:03:25 AM
had a quick look to your XML, you posted.

there is the e-stop is emulated enabled.

is your e-stop realy emulated ?
Title: Re: Limit switch set up on Mach3 with the Gecko g540
Post by: dorrisant on March 08, 2018, 10:06:23 AM
Yes, I will make that call today. I though I saw a hint of non-continuity on pin 15 of the Dsub25 gender changer.
Title: Re: Limit switch set up on Mach3 with the Gecko g540
Post by: TPS on March 08, 2018, 10:07:43 AM
do you have a "real" e-stop button ?
Title: Re: Limit switch set up on Mach3 with the Gecko g540
Post by: dorrisant on March 08, 2018, 10:11:43 AM
The emulated box is unchecked. I'm using an SPST switch for ann estop. It reads 0.2 ohms.
Title: Re: Limit switch set up on Mach3 with the Gecko g540
Post by: TPS on March 08, 2018, 10:17:04 AM
can you see input15 changing if you push the button in the uc100 i/out Monitor?
Title: Re: Limit switch set up on Mach3 with the Gecko g540
Post by: dorrisant on March 08, 2018, 10:22:16 AM
Are you referring to the actual switch I'm using for an estop? Or a "button" in the UC100 in/out monitor?
Title: Re: Limit switch set up on Mach3 with the Gecko g540
Post by: dorrisant on March 08, 2018, 10:32:11 AM
Watching the UC100 in/out monitor closing or opening the mechanical switch does nothing. No change in the monitor... Red box stays red regardless of switch being open or closed.

The only time that Estop light goes out is for the split second after I press reset... Then it goes blank for a half second or so, then back to red.
Title: Re: Limit switch set up on Mach3 with the Gecko g540
Post by: dorrisant on March 08, 2018, 10:39:44 AM
Here are some pics...
Title: Re: Limit switch set up on Mach3 with the Gecko g540
Post by: TPS on March 08, 2018, 10:39:46 AM
can you please post your XML again?

you said Emulated is unchecked, the XML you posted earlier says emulated is checked.

if your e-stop Switch is connected to pin15 the led in UC Monitor shouls Change if you Switch it.
 
Title: Re: Limit switch set up on Mach3 with the Gecko g540
Post by: dorrisant on March 08, 2018, 10:56:15 AM
Sure... and thank you for your help!
Title: Re: Limit switch set up on Mach3 with the Gecko g540
Post by: dorrisant on March 08, 2018, 11:07:12 AM


if your e-stop Switch is connected to pin15 the led in UC Monitor shouls Change if you Switch it.
 

I am not seeing any change with the indicator you circled... It stays yellow regardless of switch being open or closed.

It does blink off briefly when I push the reset button.
Title: Re: Limit switch set up on Mach3 with the Gecko g540
Post by: joeaverage on March 08, 2018, 11:09:35 AM
Hi,
apologies if I have offended, how ever the pic shows that you have disregarded my suggestion.

Quote
2.) Do not allow the current set resistor to touch pins 2, 3, or 4 on the DB9 cable. This will set off a FAULT condition in the G540
This from the G540 manual. I'll repeat my suggestion that you disconnect the motors don't cause a fault condition.

Craig
Title: Re: Limit switch set up on Mach3 with the Gecko g540
Post by: TPS on March 08, 2018, 11:12:19 AM
I am not seeing any change with the indicator you circled... It stays yellow regardless of switch being open or closed.

there is something wrong, it should Change Status.
Title: Re: Limit switch set up on Mach3 with the Gecko g540
Post by: TPS on March 08, 2018, 11:13:39 AM
also your just sended XML says that e-stop emulated is checked.

in worst case i would Setup an new blank Profile.

Title: Re: Limit switch set up on Mach3 with the Gecko g540
Post by: dorrisant on March 08, 2018, 12:46:39 PM
Fresh new xml... Now it is acting differently.

The Estop and all limit/home switches are showing up correctly in the diagnostic screen. It still goes into emergency mode when I press reset.

I turned off the charge pump switch on the Gecko and it works as expected... The Estop won't deactivate the motors because the Gecko isn't looking for the charge pump signal, but that is what I expect.

So it looks like the charge pump signal is interrupted. I will trace this and see where it stops.
Title: Re: Limit switch set up on Mach3 with the Gecko g540
Post by: dorrisant on March 08, 2018, 02:27:48 PM
Changed some directions, etc.. This is the current xml file. All works correctly except for the charge pump. I have to turn the Gecko switch to off to get any mill function.

Two different computers were used to verify that the charge pump is not from a particular computer. Same results from each, so that isolates the problem to common hardware.
Title: Re: Limit switch set up on Mach3 with the Gecko g540
Post by: TPS on March 08, 2018, 02:54:41 PM
question:
for what do you realy Need charge pump ?

sorry i did not get this !?

btw. the XML Looks ok now for e-stop.

Thomas
Title: Re: Limit switch set up on Mach3 with the Gecko g540
Post by: dorrisant on March 08, 2018, 02:57:12 PM
I want the charge pump signal to stop motor activity when it is interrupted.
Title: Re: Limit switch set up on Mach3 with the Gecko g540
Post by: TPS on March 08, 2018, 03:01:54 PM
ok if i have inderstood this, you are using Charge Pump as an "ENABLE" ?

i am allways using the Output enable for this
Title: Re: Limit switch set up on Mach3 with the Gecko g540
Post by: dorrisant on March 08, 2018, 03:14:10 PM
Would you suggest not using the charge pump?

I do not have Enable 1 checked in my configuration.
Title: Re: Limit switch set up on Mach3 with the Gecko g540
Post by: TPS on March 08, 2018, 03:39:47 PM
i would use "ENABLE 1"  instead of "CHARGE PUMP".

i never understood "CHARGE PUMP", maybe depending of my bad english.

sorry i will finish for today, allready late here in Bavaria.

but i think we are very Close.
Title: Re: Limit switch set up on Mach3 with the Gecko g540
Post by: dorrisant on March 08, 2018, 03:55:40 PM
Thank you again for the help.

I used my o-scope to test the output of pin 16 (charge pump) to pin 25 (gnd) at the db25 of the UC100. I can cycle reset and see the signal change state. If I plug the gender changer into the UC100 and check pin 16 I get no change of state. Within the gender changer is where the charge pump signal stops. Off to the local electronics store for a new one.
Title: Re: Limit switch set up on Mach3 with the Gecko g540
Post by: dorrisant on March 08, 2018, 05:45:17 PM
I bought two new gender changers for less than $5. I installed one and this seems to work. All was functional except the charge pump until I changed another setting. In CONFIG--> GENERAL CONFIG, I ticked the box for "Charge Pump On In Estop". I tested this out and the motors go inactive if I close Mach3. This is what I was looking for. All limit and home switches behave exactly as expected. Thus I was finally able to set the machine to machine coordinate home.

Thanks again TPS, your insight was absolutely key to my success!!

...and I didn't have to tear everything down t figure this out.

Tony
Title: Re: Limit switch set up on Mach3 with the Gecko g540
Post by: TPS on March 09, 2018, 09:39:58 AM
Hello Tony,

glad to hear that everthing is ok now.
i am happy that i was able to set a few Triggers for the drirection to go.

Thomas