CNC Router Axis Limits

The range of motion of a CNC axis is limited by three progressively more restrictive methods: mechanical hard stops, electrical limit switches, and software limit positions. Each method eats away at the usable range of motion for an axis but also provides protection against specific user, software, and hardware failures. They are all necessary to make a reliable machine that operates consistently without damaging itself but the design considerations add more parts and complexity to the machine.

Continued CNC Design, with Hard Stops and Limit Switches

During normal operation only the software limit positions will be relevant. The CNC knows where each axis is and where it is allowed to be. A GCode instruction that would send an axis beyond its programmed software limit positions would result in a program fault and safe axis deceleration. Problems such as lost steps, encoder counts, or inconsistent homing could cause the CNC to have an inaccurate understanding of where each axis is, which ruins its ability to limit the commanded positions of those axes.

If the CNC loses track of where an axis is actually located the next line of defense is an electrical limit switch. The limit switch communicates to the CNC that an axis has just crossed a dangerous threshold and should be decelerated immediately. In order to avoid erroneous triggers when the CNC is operating near its software limits there must necessarily be some kind of offset between the software position limit and the point where the electrical limit switch detects the axis. There are still failure modes where the electrical limit switch does not cause a safe and immediate deceleration, such as electrical issues, software configuration mistakes, or the CNC losing its ability to command motion at all on a particular axis.

The last line of defense is the mechanical hard stop. When the software and electrical limits have failed the mechanical hard stop needs to safely decelerate the axis without causing damage to the machine. There is a lot of energy in a heavy machine moving at full speed and there is no guarantee that the motors will not still be pushing as hard as they can even after the machine has contacted the hard stop. In order to absorb all of that energy without sending shockwaves through the structure hard stops typically include some amount of compliance in order to give the axis some distance to safely decelerate.

Hard Stops

Design Approach

The kinetic energy of a runaway axis needs to be absorbed by a compliant mechanism. The squishier the mechanism is the slower the axis will decelerate. Slow deceleration is good for minimizing loads on the axis but comes at the cost of decreasing the usable range of motion of the machine.

When sizing the bearings a maximum deceleration of 20g was assumed. This load case was based on collisions at the tool not collisions with a hard stop, but represents a good upper bound for what the machine should be able to handle (every once in a while). I will use 10g as the design deceleration rate for each axis at its hard stop to leave some margin.

The total deflection in a hard stop due to stopping an unpowered moving mass with a maximum deceleration can be solved for because of the dual constraints that both depend on deceleration distance: Kinetic energy from the moving axis now contained in the deflected hard stop, and the maximum force applied to the axis to decelerate it.

The kinetic energy in a moving object is described by \(E_k = \frac{m v^2}{2}\) while the potential energy in a spring is described by \(E_s = \frac{k x^2}{2}\)

The force applied by a spring is described by \(F_s = k x\) while the force applied to an accelerating object is described by \(F_a = m v\)

Combining these questions lets you solve for the total deceleration distance (\(x_a\)) or required spring rate (k) based on known object mass (m) and velocity (v) as well as a desired maximum deceleration rate (a):

\(x_a = \frac{v^2}{a}\)

\(k = \frac{m a^2}{v^2}\)

Because each axis has a slightly different mass and maximum speed they each have a different ideal spring rate and deceleration distance. Below is the calculation for each axis (keeping in mind that the Y axis has two sets of hard stops, so the mass is being divided in half).

AxisXYZ
Mass (kg)3542.520
Max Velocity (mm/s)275220150
Ideal Stopping Distance (mm)0.770.490.23
Ideal Spring Rate (N/mm)445484508554

Material Selection

As you can tell, these spring rates are quite high (much larger than you find on vehicle suspensions and giant die springs, for example). They could be lowered by decreasing the maximum deceleration target, but this would increase each stopping distance and reduce usable axis length.

Besides coils of metal (a traditional ‘spring’) you can also use solid chunks of material as a kind of ‘spring’ (like a rubber bumper). Every material has an intrinsic ‘elasticity’ which describes the relationship between its compression and the restoring force generated by the compression. This material property (E) can be converted to a spring constant (k) based on the thickness of the material (t) and the area under compression (A) using this formula:

\(E = \frac{k t}{A}\)

Elasticity is not the only material property that matters for this use case – the hard stop needs to survive the collision as well! Materials also have a maximum pressure that must must be exceeded in order to avoid deforming the material (‘yield strength’). The yield strength of a material is expressed as a pressure (Force per area, similar to Elasticity) so a minimum required yield strength (\(\sigma\)) can be determined (with a factor of safety, FOS) based on the area under compression (A), maximum deceleration force (\(F_a\)), and axis stall force (\(F_s\)) using this formula:

\( \sigma > FOS \times A (F_a + F_s) \)

A common point of comparison between materials is the ratio of the Strength (\(\sigma\)) to the Elasticity (E) because it removes the exact area of the material (A) from the equation and simply describes at what strain (deflection as a percentage of spring length) the material will fail. For these hard stops, the ‘yield strain’ requirement is:

\(\frac{\sigma}{E} > FOS \times \frac{F_a + F_s}{kt} \)

The only parameter limiting how small the ratio can be is the thickness of the hard stop material (t). Personally, I think anything more than a few inches thick would be annoying to package so I will set an arbitrary limit of 50mm for the thickness of the spring. The minimum required yield strain for each axis (with a factor of safety of 3) is calculated below, and is dominated by the X axis if you want to use the same material for all axes.

AxisXYZ
Maximum Deceleration Force (N)343341691962
Axis Stall Force (N)267016693216
Ideal Spring Rate (N/mm)445484508554
Minimum Yield Strain (ratio)0.0820.0410.036

There are plenty of material selection charts out there (often called ‘Ashby Charts’) which basically plot two different material characteristics (like density, strength, or elasticity) on the two axes and include bubbles to represent the performance of various materials. Below is an Elasticity-Strength material selection chart, with the area that meets our criteria outlined in green.

It looks like elastomers will be the best option. Also note that larger yield strains allow the use of thinner hard stop bumpers, which increases axis range of motion. Additionally, higher strength materials allow the use of smaller pressure areas. Combined, this makes polyurethane look like the best option.

While elasticity is generally applicable in both compression and tension, strains over 100% obviously don’t make sense in compression (how do you compress something more than its original thickness?). For most polyurethane sheets typical compressions don’t appear to exceed 20%-30%. Targeting 10% compression for nominal loading leaves the same safety factor of 3 before damage or extreme nonlinearity occurs.

You can buy strips of adhesive-backed urethane on mcmaster or msc with various strengths and stiffnesses (urethane is typically graded by durometer). 90A is the stiffest offered in this form factor by both websites, although 75D is available in other form factors (roughly 10x stiffer).

The modulus is not a simple linear number for urethane (in compression at least) and there are plenty of charts showing the nonlinearity of the pressure/strain curves. Depending on where you look the pressure at 10% deflection is between 530 and 625 psi. The average 580psi at 10% deflection corresponds to 5800psi (or 40MPa) when expressed as a modulus of elasticity.

With the material selected there is now enough information to determine the ideal thickness and pressure area for the hard stop on each axis, assuming a target of 10% compression, or ‘strain’ (\(\epsilon = \frac{x}{t} = 0.1\)) with both the deceleration force and stall force applied. Each of the two forces combine to create a maximum displacement in the spring (x) based on the standard spring equation, \(F=k x\)

\( x = \frac{F_a + F_s}{ k} \)

\( t = \frac{x}{\epsilon} \)

Finally, the ideal area of compression can be calculated by reorganizing the earlier equation for calculating the modulus of elasticity, \(A = \frac{k t}{E}\)

AxisXYZ
Maximum Deceleration Force (N)343341691962
Axis Stall Force (N)267016693216
Ideal Spring Rate (N/mm)445484508554
Maximum Displacement (mm)1.370.690.61
Ideal Thickness (mm)13.76.96.1
Ideal Pressure Area (mm2)153014601300

So it looks like the X axis is the driving factor, requiring about a half inch of bumper thickness. The total pressure area is very reasonable, equating to about a 1.5 inch diameter circle. I think this meets everyone’s expectations of a hard stop bumper: hard rubber, 0.5″ thick, 1.5″ diameter. Maybe it wasn’t worth all of this effort, but it is good to know that the hard stops will be able to protect the machine from damage!

Sizing the Bumpers

A common theme in this router design is the use of 3/4″ aluminum plates as gantries on each axis. Typically, these are milled down to about 15mm thick on the surfaces that interface with the bearings, presenting a 15mm thick edge to the extents of the travel. A rectangular bumper at each end of travel that contacts these edges might be more convenient than a circular bumper (which would require two ‘wide’ dimensions, instead of just the one existing ‘wide’ dimension).

If the same 1/2 inch 90A urethane is used on each axis for convenience, and the contact area is set to 15mm in one dimension, then the length of each strip can be calculated based on the 10% strain target. Again, this involves using both the equations that represent the force balance at the end of decelerations well as equations dealing with dissipating kinetic energy in the moving axis to potential energy in a compressed spring. The spring rate (k) is the common factor between these two regimes so solving both the energy balance and force balance equations for the spring rate, then equating them, can remove the unknown from the equation.

\( \frac{m a^2}{v^2} = k = \frac{m a + F_s}{\epsilon t}\)

Rearranging this equation allows it to be expressed as a quadratic with the acceleration (a) as the only unknown.

\((\frac{\epsilon t m}{v^2} )a^2 + (-m) a + (-F_s) = 0\)

When solving the quadratic for acceleration you can ignore the negative solution because deceleration has been treated as a positive number in this study.

\(a = \frac{ m \pm \sqrt{m^2 + \frac{4 m \epsilon t F_S}{v^2}}}{2 \frac{m \epsilon t}{v^2}}\)

The new target spring rate is calculated as an intermediate value by using the previous energy balance equations. The ideal length of urethane strip can be calculated from the new target spring rate by rearranging the initial equation for elasticity and splitting the area (A) into length (l) and width (w) components.

\(l = \frac{k t}{E w} \)

Based on the common thickness of 0.5 inch, width of 15mm, target strain of 10%, and shore 90A urethane material selection the ideal length of the bumper can be calculated for each axis.

AxisXYZ
Axis Stall Force (N)267016693216
Stage mass (kg)3542.520
Maximum Velocity (mm/s)275220150
Target Deceleration (m/s^2)1036263
Target Spring Rate (N/mm)495433953524
Target Bumper Length (mm)1057275

The X axis is just slightly over the 10g target deceleration because the 13.7 mm ideal thickness was rounded down to 12.6mm to meet stock availability. The Y and Z axes are well below 10g because they don’t actually need the full thickness of the half inch urethane. Making 3-4 inch long bumpers for each axis seems very achievable. The lengths will probably get rounded to something easy and consistent and then one final calculation can be done to double check everything.

Packaging the Bumpers

Ideally these bumpers don’t need a dedicated structure but can adhere to other existing components, in order to reduce part count. The yet-to-be-designed motor mounts on the X and Y axes seem like great candidates for some multi-functional design. I want to continue to use 2D shapes in 3/8″ aluminum plate because there are already other parts matching this style in the design.

Both sides of the extrusion have a plate that mounts to the top three threads in the end of the Y axis base extrusion. The motor side has a cutout for the motor face as well as threaded mounting holes to secure the motor while the passive side has a simple 45 degree connecting angle. The urethane bumper itself lives right above where the motor connects, in the same location on both ends of the axis. It is 70mm tall instead of the 72mm ideal, and protrudes about 25mm above the tope of the extrusion.

Because the NEMA 34 motor hangs over the edge of the main Y axis base extrusion I had trouble packaging the bolt heads going into the ends of the 45mm extrusion without them colliding with the motor. Stepping the extrusion down to 40mm pitch (which accepts M8 instead of M12 threads in the ends) made mounting a plate and motor to the end much easier (no counterboring).

Obviously this support plate is undergoing a large amount of bending. The motor is heavy and cantilevered, but luckily the plate is thick and the only dynamic force it needs to react is torque, a force it is well oriented to handle. A simple beam-bending estimation will be done with all of the plates together in order to verify their strength.

Making the cutout for the motor not include the 4th bolt was an intentional choice. Not only does the 4th point of contact seem unnecessary, but by avoiding any closed internal contours in the plate it can be cut on a bandsaw by hand.

The X axis is very similar to the Y axis in that a mounting plate bolts into the threads in the end of the extrusion that defines the axis. However, a vertical support column with clearance holes is sandwiched between the mounting bracket and the end of the extrusion. The motor side of the X axis adds extra height to the bracket in order to support the motor. Similar concerns about the bending forces on these mounts exist.

While the motor mount hard stop on the Z axis was similar to the other axes, the passive end hard stop was much more difficult to package. The Z axis is a little trickier than the other two because the spindle carriage is designed to descend well below the gantry carriage.

There are a few potential ways around this, but my favorite involved fixing the hard stop bumpers to the moving carriage so I could place them on the upper extents of the spindle carriage. By designing a shoulder into the gantry carriage for clearance the spindle carriage could be kept very compact.

Unlike the X and Y axes the Z axis does not have a primary piece of extrusion with convenient threaded holes at the end. For the passive side I simply used some 1.5″ x 3/8″ angle extrusion that bolts to the spindle carriage. For the motor mount side I didn’t want to deal with cutting all of the motor mount features into a piece of angle extrusion so I elected instead to use a section of T slot extrusion as a 90 degree bracket to adapt the motor plate to the carriage plate.

Bumper Mount Strength

As a quick check to ensure that the aluminum holding up the urethane bumpers can also withstand a full force collision each mount can be modeled as a simple cantilever beam in bending. For each mounting plate style the beam has a width, thickness, force, and distance to the force.

The specific aluminum being used (probably 6061-T6 for these plates) has a ‘yield stress’ property describing how much load it can take before it permanently deforms. By comparing the applied stress from the bending load on the bracket to the yield stress of aluminum (knocked down by a factor of safety) the design will be verified.

The classic formula for bending stress (\(\sigma\)) relates it to the applied moment (M), where within the beam you are measuring the stress (y), and the cross section of the beam (I) known as the ‘area moment of inertia’.

\(\sigma = \frac{M y}{I} \)

For these mounting plates which have a rectangular cross section (of width ‘w’ and thickness ‘t’) the area moment of inertia is calculated as \(I = \frac{w t^3}{12}\). The outside edge of the beam will have the most stress, so the value of y is simply half the thickness of the beam. The moment applied to the plate is approximately the product of the total force on the bumper (F) with the distance from the mounting point of the plate to the center of the bumper (d) as a lever arm.

\(\sigma = \frac{6 F d}{w t^2}\)

Because the limiting factor for the stress is the yield strength (\(\sigma_y\)) of the aluminum plate divided by the design safety factor (FOS), and all of the variables are fixed except the width of each plate, it makes sense to simply solve the equation for the width to determine the minimum required width of each mounting plate.

\(w > FOS \times \frac{6 F d}{\sigma_y t^2}\)

using 275 MPa as the yield strength of aluminum, 2 as the factor of safety, and 0.375″ as the common thickness for each plate, the minimum plate width is calculated below for each axis. Note that the motor size of the Z axis (Z+) has slightly different geometry and stall force compared to the passive side (Z-) and is broken out separately below.

AxisXYZ+Z-
Force (N)6206427743244716
Effective Distance (mm)37.537.54734.5
Minimum Width (mm)112779878
Modeled Width (mm)16080120100

So it looks like all of the brackets will be fine, although the Y axis is barely scraping by. The geometry on that bracket is hard to represent as a beam with a ‘width’, so it is probably a better candidate for finite element analysis.

FEA stress plot of Y axis end plate

In this analysis I ignored the effects of the motor (which could apply some rigidity to the plate because of its steel faceplate, but would also apply forces from its weight that could compound with the crash load case). The area of the plate that contacts the extrusion was given a translation constraint and three washer-sized disks around the bolt holes were given preload forces pointing back towards the extrusion of 2500N each. The inner edge of the three M8 clearance holes were fixed to prevent the model from floating away. A 4277N force was applied to a square at the mounting location of the urethane.

The plate definitely appears to be acting like a beam in bending with a characteristic width at the slight diagonal I predicted. The stress in this area is below half the yield stress, so within the acceptable limits. There are slight peaks in stress at one of the motor mount holes and at the corner of the extrusion. That stress is still not above the yield stress, but if those points did yield it would probably just get the material out of the way and let the giant bent portion take more of the load.

Limit Switches

The purpose of a limit switch is to detect that an axis has crossed beyond its software limits, but not yet interacted with its mechanical hard stop. Because of this, it must be offset slightly from the beginning of the hard stop contact which eats into the usable range of motion of the axis.

Limit switches can also be used for homing (zeroing) an axis, which adds the extra constraint of needing high repeatability in position sensing. using the same switch for both purposes is an easy way to save on part count and complexity so I will definitely want to take advantage of that approach.

Limit Switch Styles

A common, cheap, popular limit switch is the ‘micro limit switch’: usually a black plastic body with a tiny button that is actuated by a dinky sheet metal lever, possibly with a roller attached to the end of the lever. While cheap and simple, the sloppy pivot and dinky sheet metal make this type of switch easy to damage and prone to poor repeatability.

Micro limit switch

Another common limit switch in industry is the beefier more expensive professional limit switch. These are normally made of metal, pivot around axes with bearings or bushings, and are extremely reliable. Some might even be adjustable! There are cheaper plastic alternatives available, but in any case the large form factor makes them difficult to package.

Industrial limit switch

Both of these types of limit switches must physically contact the part in order to sense it. There are definitely ways to make that work without putting the switch at risk of being destroyed by the fast-moving hard-hitting machine axis, but there are also non-contact sensors that can act as limit switches.

Inductive proximity sensors are a very affordable non contact sensor option, but the caveat is that they can only detect metal. Additionally, the ferrous properties of the metal impacts how close or far away the metal needs to be in order to trigger the sensor. These sensors are almost as affordable as micro limit switches, especially when bought straight from china, but are significantly more robust and repeatable.

Inductive proximity sensor

Typically these sensors are built into a threaded barrel. M12 and M8 threads are popular options. Different sensors will have different sensing ranges, like 2, 5, or 10 mm. The rated sensing range is typically applicable to steel while aluminum will be about half the distance. They are best at detecting metal moving in their axial direction, and are less repeatable when detecting metal moving across the face of the sensor.

Another non-contact sensor that can be used as a limit switch is the photo-interrupter. These sensors work by having a (typically infrared) emitter on one side of a slot, and a receiver on the other. This type of sensor is meant to detect fast moving edges that pass through the emitter/detector pair with high repeatability.

Photo-interrupter

Photo interrupters come in many different form factors so that the mounting flange and break beam pair can be oriented in tons of different ways relative to each other. They can be slightly more expensive than inductive proximity sensors, but still accessible to hobbyists. The small plastic body makes them somewhat less durable than other sensors, but it is less relevant because of the non-contact nature of the sensing. The small slot width can drive the design of a specialized ‘flag’ feature or part just to interface with the sensor, which is a downside compared to other sensors that can detect existing bulky flat plates.

Because of the low cost, high repeatability, and non-contact sensing method photo-interrupters appear to be the best option for the combination limit and homing switches on a CNC router. 3D printing a cheap and easy flag feature to interface with the slot on the sensor does not sound like a big deal.

Limit Switch Mounts

There is definitely a good argument for mounting the limit switches to the same bracket that supports the urethane bumpers. This simplifies the design and reduces the number of parts in the machine, which is always good. However, I’ve always been skeptical of mounting limit sensing devices to the same structure that gets smashed by a failure of that device.

If the urethane compresses more than expected and the non-contact switch gets hit, will it stop working? You definitely do not want a situation where the motors fail to disable and continue to power into their hard stop until an operator shuts off the machine. If the limit switch is being used for homing then would even slight yielding from a hard stop impact offset the sensing position of the switch?

Mounting the limit switch to a more stable structure near the extents of travel solves the above problems, but usually requires another part. Because the limit switch does not carry any load its mount can be made from 3D printed plastic which is a super easy manufacturing method for hobbyists. The complexity of the extra part in the design seems worth it if the manufacturing method is so accessible.

That being said, making common limit switch mounts for each axis extent is way more friendly than 3D printing a super-optimized unique bracket for each extent. The X and Y axes both have 40mm T slot extrusion running parallel to the rail and a 15mm thick moving plate spaced exactly 30mm off the rail. This simple angle bracket can adapt a Panasonic photo interrupt sensor (PM-T65) to work on both extents of the X and Y axes.

Common X and Y axis limit switch bracket

This bracket is secured to the T slot rail with a single M8 screw, while clocking is controlled by two protruding features in the base that interface with the T slot channels. The actual sensor (which is super tiny) cantilevers off of the bracket so it can interface with the M4 stud screwed in to the Y axis gantry plate. There are a few zip tie mounts imbedded in the 3D printed plastic for convenience, and the entire bracket should be able to be printed upside down with no support material.

Again, the Z axis is trickier than the X and Y because there is nothing protruding below the spindle gantry to mount a sensor to. I ended up using the same stud as a flag, but a different sensor (PM-L65) because of the mounting surface angle. Both sensors are triggered by the same stud.

Z axis lowered to its negative limit with limit switches circled

There may have been an opportunity to do something similar to the Z axis setup on the X and Y axes by drilling and threading the extrusion in random places (instead of using a 3D printed mount), but I didn’t want to rely on the accuracy of a hand-aligned hole compared to machined or pre-located features.

Software Limits

The physical limits of the axis are simply the distance between the hardstops (uncompressed), less the width of whatever hits the hardstops. Ideally the electrical limits are just far enough away from the bumpers so that the axis can safely decelerate from top speed before contacting the bumpers, with maybe a little margin added in. Finally, the software limits should also be placed at least far enough away from the electrical switches to allow for a controlled deceleration from max speed before triggering the switches.

Because each axis was designed to 1g of acceleration,(a), the stopping distance (d) can be calculated based on this information and each axis’s theoretical top speed (v) using the standard linear motion equations.

\(d = \frac{v^2}{2a}\)

Things like the detection repeatability of the switches, or the detection time and processing lag of a triggering event, are so tiny by comparison that they aren’t worth including. Instead just tossing a factor of safety of 2 on the deceleration distance will probably be fine.

AxisXYZ
Maximum Velocity (mm/s)275220150
Deceleration Distance (mm)3.82.51.1
Mechanical Travel Distance (mm)1354814180
Sensor-Bumper Offset (mm)888
Sensor-Software Offset (mm)855
Usable Axis Range (mm) [in]1322 [52.0]788 [31.0]158 [6.2]

The X axis already had the least amount of margin of any axis, and has the most expensive ball screw (20mm x 20mm), but it managed to meet the 52 inch range of motion criteria after all of the buffers were added. The Y axis has plenty of extra room, but stepping down from a 1000mm screw to a 900mm screw actually increases the price dramatically! I don’t mind the extra range of motion so I will maintain the longer Y axis. The Z axis moves so slowly that in theory it does not need much buffer, but a 5mm minimum just felt safe.

This design step pretty much closes out the axis design portion of the project! There are plenty of secondary features still on the list, like spindle mounting, cable management, part fixturing, machine mounting, and controls.

Leave a Reply

Your email address will not be published. Required fields are marked *