Hello Guest it is May 17, 2021, 03:37:29 PM

Author Topic: Home, Limits, Soft Limits  (Read 3122 times)

0 Members and 1 Guest are viewing this topic.

Home, Limits, Soft Limits
« on: May 16, 2017, 01:52:04 PM »
I am new to Mach4 software and am setting up a new controller with a PMDX-424 card on a Series 1 Bridgeport. I do not understand the definition of, and the relationship between the home position, the limit switch positions and soft limits. I also do not know the procedures for setting up these items or how the software reacts to these positions. The Mach4 CNC Controller Configuration Guide pdf does not explain this. Our machine has normally open limit switches for each axis which are activated (closed) at the limit of the positive direction and negative direction.

Re: Home, Limits, Soft Limits
« Reply #1 on: May 17, 2017, 01:02:54 AM »
welcome aboard. The confusion over these terms is very common when starting out and can still catch you out years down the track.
A large part of CNCing is understanding these terms and being able to use them sensibly.

You may have noticed with Mach4 enabled on the file ops tab there is a button 'Help Docs?'. On that button you'll find a directory of useful
manuals and reference documents. Over a period of time you will probably find several other useful documents and they can be added to this
list, I have some for ENUMs and pound variables and more for LUA coding.

This one is useful
Mach4 CNC Controller
Mill Operations Guide

If your new to CNC then
CNC Programming Handbook by Peter Smid
is pretty much the bible for CNC.

The upshot is that when you turn a machine on the machine has no idea of 'where it is' unless you have some very expensive absolute linear encoders,
and if you had those 'why piss about' with Mach4 when you can afford Fanuc/Seimens? Consequently you need to home or reference  your machine.
Its common to use one extreme corner of the machining envelop as reference but is not in fact required. The simplest way to achieve that is to fit
microswitches, one to each axis, called home switches. When you home or reference your machine you will drive an axis until it triggers its home
switch, back up a little until it deactivates again, and set its 'machine co-ordinate' for that axis to zero. The next axis in the list will now be homed
in the same way. When all axes are homed the machine knows where it is and will maintain that knowledge throughout the session. It will know
for instance that its getting to very close to the end of travel on an axis and will fault out if you try to exceed the travel limit if you've set soft limits

Most users fit limit switches as well, one at each end of an axis. If the machine tries to drive off the end of an axis it will trigger a limit switch and
go into emergency shutdown. Emergency shutdowns will often mean that the machine loses an accurate measure of its location and so restarting
the machine to continue with the job clamped in the vice may be out of whack and wreck the part. For this reason we try to avoid banging into the limits
whereas soft limits can be used and the machine can shut down and protect itself in a controlled manner and so that much easier to restart the
job if required.

Soft limits only work if the machine is referenced, its no good telling the machine 'don't go beyond 1000mm' if the machine doesn't know where it
started from. You can program Mach to know what the extents of your machine are, very useful. It will also warn you if the part program you've
just loaded exceeds your machine boundaries.

There are a number of techniques and tricks that can be used to reduce the number of switches and wiring by combining some functions together.
They can be confusing if your just starting out, I would recommend separate home switches but all six limit switches can be linked in series. While
even more comprehensive arrangements can be devised this one is reasonably simple to implement and understand and still offer good results if
soft limits are used intelligently.

My wife left with my best friend...
     and I miss him!
Re: Home, Limits, Soft Limits
« Reply #2 on: May 17, 2017, 01:20:37 AM »
Mach4 CNC Controller
Mill Operations Guide
from page 40.

Reading your post you say that your limit switches are normally open. The most common method with Mach is normally closed.
Do the switches fitted have NC contacts in addition to the NO ones?

The ESS allows plenty of inputs so assigning one pin to each limit switch is doable but will require extra BoBs.
I would still recommend separate home switches. As your home switches reference your machine repeatability is desirable, I would
go for good quality roller plunger microswitches very securely mounted and adjusted. If your steppers or servos have index contacts
then you can use index homing as well for extremely accurate homing.

My wife left with my best friend...
     and I miss him!

Offline Chaoticone

  • *
  •  5,626 5,626
  • Precision Chaos
    • View Profile
Re: Home, Limits, Soft Limits
« Reply #3 on: May 18, 2017, 08:10:49 AM »
All good advice Joe. One little thing needs cleared up though.

When you home or reference your machine you will drive an axis until it triggers its home
switch, back up a little until it deactivates again, and set its 'machine co-ordinate' for that axis to zero.

That is exactly right but only if your home offset is set to 0. In other words, referencing sets the machine coordinates to whatever you have set for the Home Offset. This is true if using home switches or homing in place. Referencing is the only way to establish machine coordinates.

Home switches are a convenient way to accurately and repeatedly reference a machine to a known position.

Limit switches are used to set the absolute max/min travel of an axis. In many ways they mimic an estop that is not dependant on someone pressing. The machine presses them if travel limits are exceeded.

Soft limits do the same job as limit switches except they work in software and can bring the machine to a controlled stop and does so taking into account the motor tuning for each axis (a lot like anti-lock brakes in a car). Soft limits are set and work in machine coordinates so they are of no use if machine coordinates are not consistently and accurately established.

Home switches and limit switches can double as each other. In other words, they can be the same physical switch, wires and inputs. Limits are ignored during homing (referencing) and home switches are only recognized during homing.

All home and limit switches can use a single input (if your wiring scheme and your hardware will allow it of course). The thing that makes this possible is Home Order. If you want to be able to home more than one axis at the same time you will have to use separate home switches for each of those axis.

Home and limits can be normally open or normally closed. I prefer normally open set up so they are part of a normally closed circuit. This way if a wire gets cut and opens the circuit motion stops and I immediately realize there is a problem. If not done correctly a wire could break and when the limit is needed it simply doesn't work and you had no warning. There are ways to use normally open switches to get a normally closed circuit. A really effective setup is often one switch for each axis that is used for both limits and the home switch for that axis. If I need to explain further let me know.

Work coordinates are an offset of machine coordinates.

Depending on your wiring, configuration, etc. you may get limit switch triggered warnings when you enable Mach. These are not false. Say for example a power supply supplying power to limit switches is enabled and disabled with Mach and the switches are setup to supply voltage to an input else there is a limit fault. Well, if that is the case when Mach is enabled there is a limit switch fault (even if only for a split second).
« Last Edit: May 18, 2017, 08:21:48 AM by Chaoticone »
;D If you could see the things I have in my head, you would be laughing too. ;D

My guard dog is not what you need to worry about!
Re: Home, Limits, Soft Limits
« Reply #4 on: May 19, 2017, 08:55:46 PM »
Craig, Chaoticone,  Thank you for your answers, very helpful.

I think I have the home switches working correctly. I jogged the X, Y, Z axes until they tripped the switches. Then moved off those locations and selected the Reference All Axes (Home) button. The table moved to the tripped switch positions, then moved back off those positions, stopped and set all three Machine Coordinates to zero. After I again moved the table off the zero positions, selecting the Reference All Axes (Home) button always brought the table back to the same position even after the controller and computer were shut off and restarted. Does that sound correct for the home position?

I want to use the same set of switches as limit switches. In the Homing / Soft Limits tab, are the soft max and soft min actually the settings for the positive and negative limits? If so, the Digital Readout reading from the home position to the limit switch trip position is the number to put in the Soft max or Soft min? One number will be fairly small and the other large, almost the maximum travel for the table in that axis??

« Last Edit: May 19, 2017, 08:59:27 PM by Ron19 »
Re: Home, Limits, Soft Limits
« Reply #5 on: May 21, 2017, 12:40:46 AM »
Hi Ron,
yes you've got that right.

For instance if you're X home switch is at the extreme right of travel with machine co-ord of X=0, by definition of 'home',
then the other end of the X axis will be positive using conventional direction notation, say X=36, for  36 inch travel machine.
You would enable soft limits for the X axis with the softmin=0 and softmax=36. Likewise for other axes.

Note that soft limits work on machine co-ords. If you have a piece of material in the machine say 6 inch square you would
manually drive to the lower lefthand corner and 'zero' X and Y. The DROs now represent the position of the cutter relative
to the lower lefthand corner of the material, known as the 'work co-ords'. Mach still retains knowledge of its own machine
co-ords however just it doesn't display them, unless you ask, as it just confuses you.

You can see the relationship of the DRO position, the machine co-ords, the work offset and others on the machine diagnostic tab.

You can now implement limit switches as well. I assume from the way you worded your post that your three home switches are
on separate pins? To double as a limit switch each home switch will also have to be at the very end of travel. You will now require
a limit switch at the other end of travel, one for each axis for three switches.  If you have enuf inputs you should assign
each limit to one pin. So your X axis home switch is lets say pin 11, your X++ pin will also be 11 but your X-- (limit switch) may
be 12 say.

When referencing your machine you wish Mach to regard pin 11 as Xhome but once finished homing regard it as X++, ie a limit.
I have separate homes and limits so am only guessing here...when 'RefAll' is in operation limits are ignored, thereafter all limits
are active and operation of any of the six switches will cause an Estop.

In order to prevent the machine from banging into the limits its common to specify softlimits just inside the hard limits and permit
a graceful shutdown. Using the example from above X softmin=0.5 and X softmax=35.5.


My wife left with my best friend...
     and I miss him!