Sunday 31 January 2021

The Basics of 3 Axis CNC (Part 1)

 Alternative title ----- Your Mill or Router is not a 3D Printer

This post combined with part 2 is a brief overview of some cnc basics.  It's not intended to be a text book so some things will be over-simplified or glossed over.  If anything it's a response to some frequent new user difficulties spotted many places on the web.

In the normal order of things a machine has an absolute X0 Y0 Z0 position and for simplicity sake this position will be considered to be HOME and the shorthand MPos (machine position) will be used to describe the associated coordinate system.  In reality MPos zeros and HOME may not be the same but that's falls under the topic of machine integration.  This post will pretend that possibility does not exist. 

Click on any image to enlarge
By convention MPos zero origins are at the extreme positive limits of travel and that convention will be used here.  An important concept is negative and positive moves describe the relative movements of a tool placed in the spindle in relation to the table.  In the image to the left, if the table moves to the left (negative ?) it is a positive move from the tools point of view and is defined as a positive move.  And it follows that the table moving to the right is a negative move.  Likewise the table moving away from the column is defined as a positive move. Using the convention established above, the machine is at HOME position when the table is at it's maximum travel to the left and as far from the column as the machine travel allows. The spindle is at HOME when it's all the way to the top of it's travel.  When the machine is in this HOME position the only possible moves away from HOME are negative on any axis and all coordinates are in negative space in terms of the MPos coordinate system.  When work piece offsets are applied a secondary coordinate system will exist but that's jumping ahead a bit. This post will stick to the XY convention in order to simplify the conversation and will stick the Z convention because defining MPos Z0 in any other way creates problems.

For those with routers the link below is nicely illustrated. In fact it's so nice I'm tempted to scrap this post:

https://docs.carbide3d.com/tutorials/tutorial-homing/ 

The grbl wiki also provides a nice explanation in the link below:

https://github.com/gnea/grbl/wiki/Frequently-Asked-Questions#why-is-grbl-in-all-negative-coordinates-after-homing-or-it-so-annoying-and-not-what-im-used-to

To expand on the wiki there is another potential problem if MPos Z0 is not the top of Z travel.  A frequently seen post on the web is a new cnc user wondering why CAM produced g-code crashed the tool into the part or table.  The answer is often found in the g-code commands G28 and G53.  These commands will not crash a conventionally configured machine but if MPos Z0 is at the bottom of travel G53 G00 Z0 is a guaranteed crash.  This post won't discuss tool length offsets other than mention be wary of CAM output of g-code G43.  On a machine that does not use tool length offsets it's best to have the tool table read all zeros in the length column.  Even better policy is to delete any G43 found in the g-code when not running tool length offsets.

Even on a machine without HOME switches a HOME position should be established at MPos X0Y0Z0.  Manually moving to HOME can be as simple as buzzing a weak stepper machine against it's physical positive travel limits or aligning marks etched on the machine (followed by a reset if using grbl).  A random thought is vernier scales attached to a machine would be a very accurate way to HOME but possibly awkward to read.  Another solution is parking the machine at HOME before powering down.  The problem is steppers tend to cog a small amount when power is applied at start-up so don't expect the highest level of repeatability.  If the Z axis is equipped with a ball screw gravity may also allow some drop when power is removed.

One reason to establish a HOME position is to have work piece offsets that are repeatable even if the machine has been powered down. From here on Work Piece Offsets will be referred to as WPos, this could also be thought of as Work Position.  WPos is an additional coordinate system that works in conjunction with the MPos coordinate system.  The MPos coordinate system is used to establish a WPos coordinate system.  The WPos coordinates are where all work is done and while running a machine the MPos can be mostly ignored.

Click any image to enlarge

 

Looking at the image above there is a WPos offset some distance from HOME and this offset has been named G54.  The value of this offset is X -5, Y -2 because it is 5" X and 2" Y away from MPos X0 Y0.  (Remember MPos coordinates exist only in negative space).  In a 3D drawing there would also be a Z offset and the value of that offset would also be a negative number.  The values of G54 are stored in the machine memory.  In most controls G54 is persistent through power cycles and active by default.  Active by default means g-codes that command axis movements will position based on the G54 coordinate system, not the MPos coordinate system   This seems to confuse new users.  HOME the machine at start-up and pay attention to WPos and all will work fine.  It's baffling to see users taking shortcuts in the belief that they're saving time.

Now that the machine has a HOME at MPos X0Y0Z0 it would be useful to know how far it can travel from that position.  This brings up another reason to establish a HOME position .... travel limits.  Without travel limits the machine's work envelope is unknown to the cnc control.  These limits are defined in the control software and in addition there may be limit switches.  Using the imaginary machine described in this post, the limits will be whatever negative movement is possible from MPos X0Y0Z0.  With the machine HOMED and the limits defined the machine will issue an alarm if a program exceeds the machine's work envelope.  Using Linuxcnc, the software limits also prevent the machine from colliding it's hard parts when moving in MDI or jogging manually.  If using grbl  real limit switches may be the wise choice.  If everything written so far has been understood it should be clear how WPos can contribute to triggering this alarm.  It should also be clear that a machine can not know it's work envelope or travel limits without referencing HOME.

continued in Part 2..........                    
 

No comments:

Post a Comment

Note: only a member of this blog may post a comment.