Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: mhdale on April 20, 2007, 02:20:08 PM

Title: Challenge question regarding Homing & Limit Switches
Post by: mhdale on April 20, 2007, 02:20:08 PM
Hello all, I am currently working on an automation project and since I love MACH3 and happened to have a GREX sitting on my shelf we decided to use the GREX for the motion control of this little project. My question/problem is thus: I Have 2 Unique Axis's each of these axis has 4 Stepper Motors and a limit switch for each motor. The 4 Motors all share a step and direction signal. I need to be able to "HOME" these motors. The simple solution has been forwarded by a respected colleague who suggested homing them to a hard stop but I am not sure how MACH3 would "know" then that they are homed. I am looking for an elegant reliable solution but I have a tendancy to OVERTHINK these problems and end up chasing my tail. All suggestions would be welcomed.
 I had thought to wire the 4 limit switches in series so that when ALL the motors have tripped the limit switches I get a limit signal, but I need to disable the motors as they trigger the limits so they dont move past the limit... again simple to do, but How do I get MACH to RE-ENABLE the motors after the limit has been triggered? It seems that the Homing process is embedded in MACH so I cant Modify it, I suppose I could write a Modified "probing" macro and use the limits as the probe switch, but is it possible to have 2 separate probes?..... O Hey theres my tail!  :D
Thanks in Advance

Mike
Title: Re: Challenge question regarding Homing & Limit Switches
Post by: Chip on April 20, 2007, 05:05:42 PM
Hi, Mike

The hard stop sounds simple, 4 NC switch's wired in Parallel, Mach drives all 4 steppers home at a slow rate, When last switch opens Mach

will move them off the same amount of steps, Till the first switch closes.

Sounds OK, Chip
Title: Re: Challenge question regarding Homing & Limit Switches
Post by: Scott on April 20, 2007, 08:19:33 PM
Hey Mike,

Can you give a little more info about the setup.  Are these four motors all moving the same thing at the same time?  Could you use just one limit switch for the four.  If so, while referencing an axis, Mach3 will come to the switch, trigger it and then move off the switch slightly.  At that point, if the axis is zeroed, your good to go.  If there is some distance from that point to the actual zero, then you can put a home offset for that axis in "Homing and Limits", then issue a G28, and then zero that axis.  A more graceful way would be to use a script.  I have my 'Ref All' button coded to do a G28 and then zero all axis after homing to the switches.

Someone else may have a better way.  I was just intrigued by what it is that you may be doing and just thought I'd give my 2 cents.   ;)

If I'm way off base from what you're trying to do, then disregard.  ;)
Title: Re: Challenge question regarding Homing & Limit Switches
Post by: mhdale on April 21, 2007, 10:00:55 PM
Scott, All 4 of these motors are moving together, they will all share the step and dir signals from the grex. The motors position a 50' long "jig", and initially they will not be positioned correctly in relation to each other. Once Synced up they should never loose position but I want the system to correct any problems that may occur should a belt break or something jam one of the motors. Basically its like having a single controller controlling 4 Machines(for this axis). Does that make sense? If I have a single limit switch then all 4 will move together but only the one with the limit will be correct in relation to the home position the other motors may be out of position. All suggestions and questions are welcome. Sometimes the dialogue can trigger the solution or pehaps someone else out there has done something similar, a different perspecitive is allways welcome :)
Title: Re: Challenge question regarding Homing & Limit Switches
Post by: Chaoticone on April 22, 2007, 06:42:54 AM
Just a quick thought. Could you use 4 switches. one for each motor to enable and disable your drives? Or three and one home switch? With this, you would also need some code added to your home button and a bypass on a relay. Just thinking out loud. I'll post more later, got to go.

Brett
Title: Re: Challenge question regarding Homing & Limit Switches
Post by: mhdale on April 23, 2007, 10:55:54 AM
Brett, That is the direction I have been trying, I have 4 Limit/Home switches with adjustable positions so we can get whole length dialed in. My challenge is in designimng the homing code and creating the bypass circuit to re-enable the motors after they have hit thier respective limits. I am also waaay over my inputs and outputs on this system, I think I will just have to bow down and put together a preliminary I/O handler using a Microcontroller or PLC... I do have a Modbus MODI/O but I havent set it up yet.....trying to get the fundamentals worked out first.
Any suggestions on a simple enable bypass which will allow me to re-enable all 4 motors? I was thiinking of using a set of relays linked to the limit switches to control the motor enable and limit info and the 5th relay to bypass the motor enables. Or is that getting too complex? My first inclination is allways to put together a microcontroller board customizzed for my application but I wanted to keep this system servicable by the average shop floor guy, relays are pretty straightforward arent they?
Mike
Title: Re: Challenge question regarding Homing & Limit Switches
Post by: Chaoticone on April 23, 2007, 11:37:05 AM
Mike,
  I have sent you a personal message.


Brett
Title: Re: Challenge question regarding Homing & Limit Switches
Post by: mhdale on April 23, 2007, 01:06:55 PM
Brett, Got your message, I will try and contact you most likely this afternoon. Hopefully thats convenient.
Mike
Title: Re: Challenge question regarding Homing & Limit Switches
Post by: Chaoticone on April 23, 2007, 01:21:53 PM
That will be fine.

Brett
Title: Re: Challenge question regarding Homing & Limit Switches
Post by: poppabear on April 23, 2007, 03:52:45 PM
mhdale:

   The solution, is simple, (If I understand what you want). Goto  "www.cncbuildingblocks.com", order an "Accustep board", this board has 4 axis on it (as a breakout), and it has a CLPD.  You can set the number of encouder counts, off the home/index postion, each axis is independandly adjustable for how far off of home/index it will travel. I can repeat 1-2 Tenths!! off the encouders.  The count per axis, to move off ref is set by a 8bit binary wieghted switch block.

Very easy to use, good price, good documentation. The guy that sells them is:  Ed Gilbert of "Gilbert Engineered systems".

BTW: Ones the various axis home (to what ever count you decide), it then sends the "Home Signal" to mach, Mach thinks it is home, and the lights say so, but the axis doesn't move any further than what you set it for.

Scott
Title: Re: Challenge question regarding Homing & Limit Switches
Post by: mhdale on April 23, 2007, 04:17:55 PM
Poppa Bear, That looks like a pretty skookum Breakout board with some great features but I am not sure if it will solve my problem. I have 4 Separate motors on 2 of my Axis's which need to home properly.. so I need some way of disabling each motor as it hits home because they all share the same Step and DIR outputs and then re-enabling them to jog off the home/limit. Unless I am mistaken in what that particular breakout board will do, I dont think it gives me anything over what I have already. Basically pretend for some bizarre reason your x and Y axis have 4 motors on each and you need to be able to re-sync them back to home so they all line up... I know its sounds really bizarre but its what I have to deal with.... But thanks for the link looks like some great stuff there!

Mike
Title: Re: Challenge question regarding Homing & Limit Switches
Post by: poppabear on April 23, 2007, 04:27:32 PM
Well from my understanding, you can set each axis to home count independantly (read that per motor).

If that doesnt work, then you could use a PLC.

i.e.   Put in your ladder that when you get the Homing routine, that it jumps to a homing "Stage", or just standard ladder. As the motors hit the switch, that the PLC picks up, the PLC breaks the power to that motor.  Then you "And" all the motor stopped outputs as an input, when all four have made it home, then the motors are re-enabled (pehaps you can put a timer here also), When the Re-Enable output signal activates, then it could also send this as a "Home" Signal to Mach.
The reason I say use a timer above is that, the moters will not re-enable until mach finishes sending its move off home switch signal, thus you motors will stay put, you can also "Time-out" your home switch, to fool mach into thinking that the motor have moved off the home switch, and Mach will "Zero itself there".

A DL 05 from ADC (approx. $100.00), would do the trick.  If you decide to go that route, but dont want to buy the programming software, then I could program it for you, (for a modest fee).

Scott
Title: Re: Challenge question regarding Homing & Limit Switches
Post by: mhdale on April 23, 2007, 05:51:32 PM
I am starting to think I may have to go PLC or microcontroller for the home.......
Title: Re: Challenge question regarding Homing & Limit Switches
Post by: GPDC on April 25, 2007, 03:11:18 PM
FWIW dept....the hell w/multiple LS's.....that's a band aid for your set up....a nice fine thread jam nutted bolt (say the HEAD of a 1/2-20) with a squared end against a hard stop that is initially manually set by feeler gage & you're done.....the single limit switch per axis would then be mechanically " in sync" with all the other motors common to that axis' movement....periodic PM/QC would be all you need methinks...just a thought...would that be workable?
Title: Re: Challenge question regarding Homing & Limit Switches
Post by: mhdale on April 25, 2007, 03:37:27 PM
GPDC The hard stop is the simple solution .. BUT the problem arises when the motor with the single limit switch hits the stop and limit first and lets say motor 3 still has a bit to go... the system thinks its squared but it really isnt.... You would need to go with 4 limit switches wired in series so the system will continue to drive the motors until they are all "bottomed" out against the hard stop.... It is the simple solution, for some reason a nagging voice in my head wont let me do it......sometimes my voice is right.. sometimes wrong.... The client is not very familiar with any automation equipment and I think might think less of us if the system makes whining chattering noises when it homes.... That is my current plan B should I be unable to implement one of the more elegant solutions...
Thanks for the input, I like to see what other people come up with!

Mike
Title: Re: Challenge question regarding Homing & Limit Switches
Post by: poppabear on April 25, 2007, 06:04:44 PM
I thought of another way, if you don't mind doing some VB, and using the macopump.

You can make you a "Sorta-Home" button on your main screen, click this button, it runs a script, that will move each of your 4 motors at a set feed rate to your "Home-limit" switch.
Bring these individual inputs in, and the Macro pump monitors them, as each "Homes" (not a true home....yet), the Macro pump activates an output that cuts the Power to the drive of that motor.
These 4 relays will also be "Anded" together, once all 4 are homed (and power to all 4 motors are cut), then once again the Macro pump picks up that siganl then OEM codes the "Referance" command, (the signal is sent out for you motors to move/home but they wont since the power is off to them). In the Macro pump do a set timer(0) for some small value when it times out at value 1, have it "Activate the home input", then as mach "backs it off the switch" the second value for timer(0), will Turn OFF the "Home input for each motor" Mach thinks
it has moved off the home switch. In General config have Mach auto Zero after homing.
next, have the macro pump re-enable the motor relays, (Perhaps using a 3rd timer zero value, or some other interlock: Led, Dro or other logic that is testable).

Scott
Title: Re: Challenge question regarding Homing & Limit Switches
Post by: mhdale on April 25, 2007, 09:53:00 PM
Scott, If I didnt have so Many I/O to deal with on this system that would definitely be a good solution.  I am trying to hookup a MOD IO to get some more I/O but that comes with its own set of headaches.... I will definitely file that one away as a possible.
Mike
Title: Re: Challenge question regarding Homing & Limit Switches
Post by: poppabear on April 25, 2007, 10:40:27 PM
In that case, I would definatly recommend a PLC, you need some intellegent I/O!!!!  The PLC can handle all of those functions on its on. Mach can tell it to start the process, and the PLC does the 4 axis homing work, then it sends a "done" bit, or home signal to mach.

Scott