Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: QSRP on February 23, 2013, 05:15:51 PM

Title: Homing Sequence
Post by: QSRP on February 23, 2013, 05:15:51 PM
I am setting up my homing switches and I would like to know if there is a way of changing the homing sequence.  Right now my "Y axis" homes before the "X axis".  I would like to reverse this and have the "X axis" home first and then the "Y axis".  Is there a way to do this?
Title: Re: Homing Sequence
Post by: Hood on February 23, 2013, 05:22:45 PM
You can edit the VB script in the RefAll button, if you go to Operator menu in Mach then Edit Button scripts you will see the RefAll button flash. Click it and the editor will open, change round the order of the lines so it is as below and that will home Z then X then Y then A.
DoButton( 24 )
DoButton( 22 )
DoButton( 23 )
DoButton( 25 )

Hood
Title: Re: Homing Sequence
Post by: Chaoticone on February 23, 2013, 05:27:05 PM
Yes, look in your ref all vb button.  Click on the user tab then edit button scpipt.  All vb buttons on the screen will begin to flash, raf all is one of them.  I think it will be 24 for z, 23 for y, 22 for z.  Just change the 23 and 22 around.  Watch it close and make sure it does what you want after you change and save your changes.

Brett
Title: Re: Homing Sequence
Post by: QSRP on February 23, 2013, 08:12:47 PM
Thanks Hood and Chaoticone for your help.  That solved my original issue but somehow it created another.  Now when the home switches make contact, they do not back off.  As soon as one axis hits the switch, that axis stops and the next begins.  It does this for all 3 axis.  Any thoughts on this?
Title: Re: Homing Sequence
Post by: Chaoticone on February 23, 2013, 08:26:03 PM
What hardware are you running?  Smooth Stepper? Do have any slaved axis?

Brett
Title: Re: Homing Sequence
Post by: Chaoticone on February 23, 2013, 08:32:39 PM
Also, what version of Mach are you running?

Brett
Title: Re: Homing Sequence
Post by: Hood on February 24, 2013, 04:31:30 AM
Do the LEDs turn green and machine coords get set to zero?
Hood
Title: Re: Homing Sequence
Post by: QSRP on February 24, 2013, 10:08:33 AM
Thanks again for your help Hood and Chaoticone.  Let me give you the whole story here as well as what I am using.

When I posted this thread, I was running MACH3 Version R1.84.002, which is what came with the controller when I bought it.  I have not used this for a while and here recently I installed 3 Home switches.  One for the "X axis ", One for the "Y axis" and One for the "Z axis".  I got everything wired up and configured in the inputs section of the Pins & Ports configuration and in the Home / Limit configuration.  At this point everything worked just fine except for the Homing order.  It would start out with homing the "Z axis" and when it hit the Home switch, it then reversed direction until it came off of the switch.  It then did the same for the "Y & X Axis".

I then posted the thread and both responses were directing me to the Operator menu in Mach3 and then Edit Button scripts for the RefAll button.  Because this option is not in the R1.84.002 version, I downloaded the latest version of Mach3, Version R3.043.066, and installed it.  I made all the config changes and changed the homing order.  And this is when the new issue popped up.  The Homing order is what I prefer, "Z, X, Y", but now when each of the 3 Axis hit the Home switches, they trip the switch, LED turns Green and the next axis starts homing without the previous axis not backing off of the switch.

Is this normal?  How do I fix it so the back off of the switches?

I am running the following:

Controller:
CNC Stepper System by Camtronics, Inc.

Stepper Motors:
MCG
2phase  1.8 step motor
1.3A, 0.5 Ohms, 18.61 W

Thanks for everyones help.
Title: Re: Homing Sequence
Post by: Hood on February 24, 2013, 10:22:06 AM
Ok because the LEDs are turning green then that means Mach has seen the switches being triggered, backed off until they close and then set machine coords, so looks like it is working fine. What I suspect is you possibly had a high debounce in your previous setup and thus the signal that the switch had closed was being delayed.
Hood
Title: Re: Homing Sequence
Post by: QSRP on February 24, 2013, 11:16:05 AM
Thanks Hood but I am very confused now.  You state, "because the LEDs are turning green then that means Mach has seen the switches being triggered, backed off until they close and then set machine coords, so looks like it is working fine."  This is not happening though.

Since I have installed the switches, the machine has not touched any of the switches.  I have all the axis in the middle of their travel.  when I hit the "Ref All Home", the axis moves but before I gets to the switch, I manually depress the switch.  In the older version, once I tripped the switch, it reversed direction until I let off of the switch breaking the contact.  The next axis did not start until the previous switch was backed off and opened the contact.  All my home switches are normally open.

Now with the version, I am doing the same thing but now when the first axis switch is tripped, the next axis starts without my breaking the contact of the first switch.

Why do the axis not reverse direction when the switch makes contact with the newer version?  I would just go back to the older version that worked correctly but I cannot find anywhere in it where I can change the homing order.  I have to have the homing order "Z, X, Y because of the switch locations.
Title: Re: Homing Sequence
Post by: Hood on February 24, 2013, 11:38:14 AM
First off it is a bad idea to have normally open switches, especially if using them as limits as well. Reason for that is if there is a problem with the switch such as a broken wire then the first you will know about is when the axis sails past the limit switch and hits the end of travel.

Ok have a look on diagnostics page and see if the home switches LEDs are lit when not triggered, if so change the active state of them.
Can you attach your xml and I will see if there is a problem with your config.
Hood
Title: Re: Homing Sequence
Post by: QSRP on February 24, 2013, 11:59:11 AM
I wired them normally open because that is how the manual says to do it.  On the diagnostics page, the home LEDS are not lit until they have contact made.

Attached is a copy of my XML file.
Title: Re: Homing Sequence
Post by: Hood on February 24, 2013, 12:17:10 PM
Long time since I looked at the manual but I would be surprised if it  recommends normally open.

Ok will the axis move right to the switch if you let it? If not then set some Debounce  Interval on General Config page, try 2000 and if it helps work down until it happens and then slightly increase.
Hood
Title: Re: Homing Sequence
Post by: Chaoticone on February 24, 2013, 12:48:55 PM
I would just go back to the older version that worked correctly but I cannot find anywhere in it where I can change the homing order.  

ftp://machsupport.com/Mach/

Brett
Title: Re: Homing Sequence
Post by: Hood on February 24, 2013, 01:22:47 PM
Just a thought, please if you go to an older version try something more recent, maybe 057. reason I say that is 066 and 067 are disasters for Turn, I have also found some issues with them and mill so this may be another.
Oh and BTW you will have to copy Bretts link without the http:// part or it wont work, for some reason the forum automatically adds that to any link.
Hood
Title: Re: Homing Sequence
Post by: QSRP on February 24, 2013, 04:59:32 PM
Thanks both for the help and assistance.  When I said I wired the switches to normally open because that was what the manual said.  It was not the MACH3 manual, it was the Camtronics manual.

I did wire the switches to normally closed and changed the config.  In this setup, when I hit the Ref. All Home, the axis move only a few thousandths and then start the next axis without ever a switch being made.  I can see in the diagnostics page that when I have the switches wired for normally closed, the axis LEDs are lit and if I activate the switch, the LEDs go out.

I switch it back to normally open and everything works fine except for the motors not reversing when the home switches are made.

I am ready to just give up.

Pat
Title: Re: Homing Sequence
Post by: Hood on February 24, 2013, 05:12:52 PM
Ok you had the active state set wrong when you connected the switches Normally Closed, they should have been set Active High instead of Active Low.

Did you try some Debounce Interval (Config menu then General Config)
If that doesnt help please try an older version of Mach but not as old as the one you had as it will be very interesting to see if this is yet another issue with the lockdown and development versions.
Hood
Title: Re: Homing Sequence
Post by: QSRP on February 25, 2013, 07:52:44 AM
Hood & Chaoticone

I have taken all of your advise and appreciate all the help you both have given me.  I got so frustrated yesterday because I do not understand how to do this configuration stuff so I just walked away for the day.  Because of this, I have taken your advise and downloaded the R3.043.057.  I will install this Version tonight and start over from the beginning.  The first piece of advise you gave me and what I want to get working right is having the homing switches wired for normally closed.

I will let you know how things go.

Thanks,
Pat
Title: Re: Homing Sequence
Post by: QSRP on February 25, 2013, 11:53:09 AM
Another question I have is this.  When I wire the Home switches for normally closed, Should I wire them individually to separate inputs or wire them in Series and to just one input?
Title: Re: Homing Sequence
Post by: Hood on February 25, 2013, 01:20:57 PM
You can do either, you can have all axis in on one input or have each axis on an input or even all switches seperate (assuming you have enough inputs)
Hood
Title: Re: Homing Sequence
Post by: QSRP on February 25, 2013, 07:16:27 PM
So I got home today and got 3 extra switches out and wired them all in series.  I did it this way because it was easier to access these than the ones on the machine.  After I wired them, I connected all 3 axis to Pin #10.

Once I did this, I then configured all three except for the enables.  I wanted to try one axis at a time so I enabled each one, tested and then to the next switch.  Once I saw that all 3 worked separately, I then enabled all 3 and tested them all with all 3 enabled.  Everything worked fine.

From here I centered my Z, X &Y and turned on the power to the controller.  By the axis being in their middles, if anything went wrong I knew I could get everything stopped before a crash.

Now I hit the Ref All Home and the Z axis started homing in the correct direction.  I tripped the first switch and the Z axis stopped and reversed direction until I released the switch.

Right after I released the switch, the x started and then stopped and the Y then started and stopped.  This all happened without me tripping any switches except the first one.  So I went in to the General Config and put in a Debounce Interval of 2000.

Now I hit the Ref All Home again and the Z axis started homing in the correct direction.  I tripped the first switch and the Z axis stopped and reversed direction until I released the switch.

After the Z axis homed and Zeroed, then the X axis started to home and it too was going in the correct direction.  I then tripped the second switch and the X axis stopped and reversed direction until I released the switch.

So far so good.  Now that the X axis homed the Y axis started homing and it is going in the correct direction as well.  Again I tripped the third switch and the Y axis stopped and reversed direction until I released the switch.  It too zeroed.

I also forgot to mention I am running the Version R3.043.066 and I went into the VB Ref All Home and changed the Homing sequence.  I got the Debounce Interval down to 250 right now and will try to go lower once I have rewired the switches on the machine.

So everything seems to be working now and I want to thank both of you for your help and advise.

Pat

Title: Re: Homing Sequence
Post by: QSRP on February 25, 2013, 07:28:00 PM
I have one other question.  What size wire should be used for these switches?
Title: Re: Homing Sequence
Post by: Chaoticone on February 25, 2013, 07:59:23 PM
The size wire all depends on the current the circuit they are hooked to has to handle.  If your just wiring the limits to a BOB or parallel port, and they aren't carry any load, which I don't think they will, they can be tiny, 24-22 gauge and probably much smaller.  I try to use 16 Ga but some connectors aren't big enough for it.  It would be best to wire them with shielded cables.  Good shielded cat 5 or cat would probably work but I have no idea how its wired so take that with a grain of salt.  Good your making progress.

Brett