PDA

View Full Version : Setting up soft limits in UCCNC .. "Logic"



John11668
28-07-2020, 11:43 AM
Hi folks .
Trying to get used to UCCNC
Am trying to get my head around Soft limits and having some difficulty.. Not really intuitive could we say?
So taking things one step at a time lets look at a single axis, for which of course we will choose X

So I have entered the settings for the home switches and they work, home and display resets to zero. so I am fine so far .
I select to use soft limits in general config
My thinking is that I want "soft limits" to define a work area in x positve which is bounded by the lower limit ( say 10) and an upper of say 350. I figured that the software would then stop any motion at 10 and prevent the machine hitting the home limit switch.
So I set lower limit to 10, upper to 350 but now when I home , the table goes all the way to the switch and DRO resets to 10 ??? says soft limit is reached (when actually the home switch has been reached) and a "write offset on homing" appears as 10. So what is the logic in this ??
I have read the manual , which isn't giving me clarity other than i need to set numbers for the soft limits.
I have sought for video tutorials but so far haven't found any which clearly explain what is going on here

I am not getting my head around it . I need to get this clear in my mind before I move on to Z axis and begin to regale you all with the issues setting the soft limits on there. :distress:

ngwagwa
28-07-2020, 11:52 AM
Just set lower limits to 0

Doddy
28-07-2020, 12:13 PM
I'm not at my machine at the moment, and barely remember this - but can you not set the axis to, after homing, traverse to a fixed offset (within the working envelope, and within the desired soft limit). E.g. home to zero, move to 12, with a soft-limit of 10?

EDIT: I'm thinking of what I do with my Lathe which is LinuxCNC, rather than UCCNC, so the above might be a red-herring of the grandest order. Take with a pinch of salt.

John11668
28-07-2020, 12:43 PM
Just set lower limits to 0

OKay ngwagwa and thanks for response , but that doesnt really clarify in my mind what soft limits are trying to achieve . it sounds like a fudge to overcome the problem

John11668
28-07-2020, 12:45 PM
And Doddy


I presume I can do that by calling up an offset in the code , but am wanting to understand the process too.
Having declared soft limits , am I then homing to the soft limit and writing off 10 mm of my table

ngwagwa
28-07-2020, 01:22 PM
[QUOTE=Doddy;119103]I'm not at my machine at the moment, and barely remember this - but can you not set the axis to, after homing, traverse to a fixed offset (within the working envelope, and within the desired soft limit). E.g. home to zero, move to 12, with a soft-limit of 10?

Just tried that Doddy and when the machine backs off after going home it only goes to the softlimit value - so would work if back off and softlimit was set the same.

John. Softlimits prevent machine going past the limits to prevent a crash and (on my set up at least) home switches don't limit movement when jogging.

If you look in configuration - Axis Setup for each axis there is a back off units box - set this value and when homing the axis will move back by te set value - make sure you set it positive or negative s required.

Softlimits will reduce the size of the working area - I have X backoff as -3 and softlimits at 0 so I don't lose anything.
Hope this explains it ?

John11668
28-07-2020, 02:24 PM
So are we saying that the ONLY reason for softlimits is to prevent the machine traversing beyond the home switches and crashing into endstops ( and I guess killing the traverse if we try to go beyond the positive limit, regardless of whether switches are fitted there) . in which case it seems to make sense to have a soft limit of zero and maybe an arbitrary back-off of say 5 , (and I guess that wound be +5 to bring it back within the working area)

So then I guess that I choose an offset in my G code routine to bring the tool to a new start position on my workpiece , Is that so ?

ngwagwa
28-07-2020, 02:36 PM
So are we saying that the ONLY reason for softlimits is to prevent the machine traversing beyond the home switches and crashing into endstops ( and I guess killing the traverse if we try to go beyond the positive limit, regardless of whether switches are fitted there) . in which case it seems to make sense to have a soft limit of zero and maybe an arbitrary back-off of say 5 , (and I guess that wound be +5 to bring it back within the working area)

So then I guess that I choose an offset in my G code routine to bring the tool to a new start position on my workpiece , Is that so ?


Correct re purpose of softlimits ie prevents crashes at end of travel.

Whatever back off you set you don't need to alter the gcode as Zero is still zero. So to clarify on my machine with a back off of minus 5mm after machine has been homed the DRO will display -5mm when displaying machine co-ordinates.

John11668
28-07-2020, 06:37 PM
Correct re purpose of softlimits ie prevents crashes at end of travel.

Whatever back off you set you don't need to alter the gcode as Zero is still zero. So to clarify on my machine with a back off of minus 5mm after machine has been homed the DRO will display -5mm when displaying machine co-ordinates.

But doesnt a backoff of -5 take you beyond the home limit presuming you are homing in negative direction from an x positive position on the table .??

ngwagwa
28-07-2020, 06:46 PM
But doesnt a backoff of -5 take you beyond the home limit presuming you are homing in negative direction from an x positive position on the table .??

As I said earlier make sure you have the right direction for the back off - my home is far right so moves postive in X to get home, therefore I back off negative.Big noise and you got it wrong!

John11668
28-07-2020, 07:53 PM
Got you.
I home left ! (obviously)

Kitwn
29-07-2020, 07:21 AM
Like Doddy I'm using LinuxCNC so cannot comment on how you set up UCCNC but my limit switches are set to be at X and Y = (-15, -15). The spindle then moves to (0, 0) with soft limits set to (-10, -10). This gives 5mm of deceleration space between the soft limit and the switches to avoid an accidental switch activation which will disable the motor drivers and un-calibrate the machine and also allows space for the spindle to move into negative values which it will need to do if you want to do an external profile of an object that touches X or Y = 0 using any tool with a diameter greater than 0.0mm.

This arrangement makes it easier to use fixed guides along the X=0 and Y=0 axes which will put your stock in a position which often needs the spindle to go into 'negative' space.

Kit

John11668
29-07-2020, 10:58 AM
I suppose we all have differences in the way we need to set up . I had not considered this when I originally posted . And it is not surprising that the woodcarvers have different needs to The Heavy metal brigade :cool:
Mine is a milling machine of course.

And it had not occurred to me either that having a profiling tool run past zero (obvious once pointed out) could be useful in milling an external profile too, but I suppose that applying an offset overcomes that need.

My next need is to allow for a touch of backlash on my Z motion . Its not much but I would like to figure out how to apply it .
I have ball-screws on X and Y but for my Z axis I am driving the quill through mechanical gears with a 6/1 reduction. As I say it is not a massive amount as there is little wear but If I understand how to cater for it it will assist my next project.

ngwagwa
29-07-2020, 11:26 AM
I suppose we all have differences in the way we need to set up . I had not considered this when I originally posted . And it is not surprising that the woodcarvers have different needs to The Heavy metal brigade :cool:
Mine is a milling machine of course.

And it had not occurred to me either that having a profiling tool run past zero (obvious once pointed out) could be useful in milling an external profile too, but I suppose that applying an offset overcomes that need.

My next need is to allow for a touch of backlash on my Z motion . Its not much but I would like to figure out how to apply it .
I have ball-screws on X and Y but for my Z axis I am driving the quill through mechanical gears with a 6/1 reduction. As I say it is not a massive amount as there is little wear but If I understand how to cater for it it will assist my next project.

Will backlash be a problem in Z as I would have thought the weight of the spindle would always keep the tool at the lowest position possible thereby eliminating backlash?

Neale
29-07-2020, 04:32 PM
I'm a bit concerned that anyone thinks that "going past zero" is in any way relevant when you are using Mach3/UCCNC. Maybe in the days of archaic controllers that did not have any homing/work offset capability this might have mattered but not today.

The point here is that homing sets machine zero, either directly by putting home switches at the zero point, or somewhere else with an appropriate offset (at the right-hand end of travel, in the most extreme case). But that is absolutely nothing to do with where the zero point is on the work. First thing you do when you plonk the stock on the bed and clamp (assuming that you have already homed the machine) is to move the spindle to where you want (0,0) to be, and then set "work coordinate zero" to that point. Maybe x and y at the same time, maybe separately. Effectively you are doing the same thing when you set tool height - this is setting z coordinate zero, indirectly. Your gcode will, if generated by any modern CAM package, be working in terms of work coordinates. Nothing at all to do with machine coordinates. For example, recently, I have been machining work where the X zero work coordinate is at the right hand side and most of the machining is done with negative X coordinates. I told my CAM software where I wanted X=0, set the spindle to the RH edge of the stock and set work coord X to zero, and away it all went.

This machine/work coordinate confusion is a bit complicated to follow at first sight but it soon becomes second nature and you won't even think about it, but it is absolutely critical to using CAM and the machine in harmony. I sorry if I have misunderstood what was being said, but the idea that you need to set machine zero somewhere on to the bed just so that you can move to negative coordinates could be very misleading to anyone new coming to this.

John11668
29-07-2020, 05:30 PM
Will backlash be a problem in Z as I would have thought the weight of the spindle would always keep the tool at the lowest position possible thereby eliminating backlash?

The quill has a return spring , a bit like a pedestal drill but in an exercise the cutting depth is often increasing so backlash wont be a problem there. But lots of exercises where the quill is being driven up and down frequently so lost motion in each direction in that case . I am presuming if you enter a backlash figure , then a number of steps will be discounted before the Display registers movement. Is that so?

John11668
29-07-2020, 05:52 PM
I'm a bit concerned that anyone thinks that "going past zero" is in any way relevant when you are using Mach3/UCCNC. Maybe in the days of archaic controllers that did not have any homing/work offset capability this might have mattered but not today.

The point here is that homing sets machine zero, either directly by putting home switches at the zero point, or somewhere else with an appropriate offset (at the right-hand end of travel, in the most extreme case). But that is absolutely nothing to do with where the zero point is on the work. First thing you do when you plonk the stock on the bed and clamp (assuming that you have already homed the machine) is to move the spindle to where you want (0,0) to be, and then set "work coordinate zero" to that point. Maybe x and y at the same time, maybe separately. Effectively you are doing the same thing when you set tool height - this is setting z coordinate zero, indirectly. Your gcode will, if generated by any modern CAM package, be working in terms of work coordinates. Nothing at all to do with machine coordinates. For example, recently, I have been machining work where the X zero work coordinate is at the right hand side and most of the machining is done with negative X coordinates. I told my CAM software where I wanted X=0, set the spindle to the RH edge of the stock and set work coord X to zero, and away it all went.

This machine/work coordinate confusion is a bit complicated to follow at first sight but it soon becomes second nature and you won't even think about it, but it is absolutely critical to using CAM and the machine in harmony. I sorry if I have misunderstood what was being said, but the idea that you need to set machine zero somewhere on to the bed just so that you can move to negative coordinates could be very misleading to anyone new coming to this.

As you say Neale it is not at all intuitive to begin with, and I dont believe I have seen a clear explanation in the manuals . ( and some of the videos are even less helpful)
I think I have got it now though.
So by homing and setting soft limits you are defining the extremities of the working area, within which you will place your job.
You then choose a point on your workpiece which you will define as 0,0,0 for you starting point, traverse your tool to that point and you will then set the work coordinates to zero on all axes.
The G code routine will then move the tool in whatever positive or negative directions are needed to complete the work.

I suppose it becomes particularly clear when doing say an engraving job where conventionally you will set z=0 when the tool is touching the surface, then any movement to Z negative involves a cutting depth and movement to Z positive gives a clearance for tool repositioning.

JAZZCNC
29-07-2020, 06:48 PM
So to clarify on my machine with a back off of minus 5mm after machine has been homed the DRO will display -5mm when displaying machine co-ordinates.

I'm not sure that it works quite like that. It's been a few months since I set up a UCCNC machine but I think it Backoff works like most other controllers.? Which is that it looks for the Home switch then after hitting the switch Zero's the DRO, then backs off the set amount and Re-Zero's DRO again. When finished the MACHINE coordinates will show Zero.

It does this so you can have your HOME position or MACHINE ZERO at any point on the machine ie: Centre of travel, away from where the switch is physically located.

SOFT LIMITS are ALWAYS taken from MACHINE ZERO and limit the travel in the + & - directions. So in my Centre of travel example above with 1000mm of total travel, you would have Min soft limit = -500 and Max soft limit =+500.

If MACHINE ZERO was at the switch then soft MIN =0 Softmax =1000

Hope that helps clear a little of the confusion.!
.

JAZZCNC
29-07-2020, 07:23 PM
I'm a bit concerned that anyone thinks that "going past zero" is in any way relevant when you are using Mach3/UCCNC. Maybe in the days of archaic controllers that did not have any homing/work offset capability, this might have mattered but not today.

The Problem here Neale is that word HOME confuses people. They mix it up with WORK ZERO and think that HOME is where the JOB starts.
99% of new users fall foul of this so when I deliver machines to new users I always spend at least 30mins or more explaining and showing how the COORDINATE SYSTEM's and WORK OFFSETS relate to each other and how they relate to CAD etc.

Now John11668: and anyone else who doesn't quite understand. This is where SOFT LIMITS can come into play to save the day.? Let us say your HOME (machine zero)position is at the end of travels on each axis and you have 1000mm of travel.

You ZERO the WORK coordinate 100mm from the MACHINE ZERO. The job is drilling holes in a 1000mm long piece of stock with the last hole located 990mm from 0. What do think will happen .?.....Yep CRASH.!! . . Because your last hole would actually be located 1090mm from MACHINE ZERO. . . . But not if you have SOFTLIMTS turned on because the controller will pre-run through the G-code when you first load it and will warn you that you are going to exceed the SOFT LIMITS and the day is saved...:toot:

So hopefully this shows how MACHINE ZERO and WORK OFFSETS play together.

John11668
29-07-2020, 10:14 PM
Hi Jazz and thanks for your response .
I dont think however you have quite clarified things for me.
So ignoring backoff for now .
I home to machine zero in all axes and the machine defines its position as 0,0,0
I have set soft limits X of 0 and 400.
Soft limits Y of 0 and 200,
and Soft limits Z of 0 and -50
So I have now defined a box 400x 200 x50 which is the envelope within which all work MUST be done .

We now come to the workpiece which I have to plant on the table completely within that envelope and clamp it. I have to bear in mind if I am doing an outside profile that I must consider the cutter and allow at least a cutter radius all round.

I am guessing that my workpiece origin or start point is defined somewhere within it , whether it is right hand end, middle, or wherever so I identify that origin, jog to it , and set all my work parameters to zero at that point.

So really it is only if I have placed my job wrongly and that the toolpath will stray outside the envelope that a soft limits alarm should arise .
Are you saying that it should arise prior to hitting the start button . or will it only arise when the work zero position is defined .

JAZZCNC
29-07-2020, 10:55 PM
So really it is only if I have placed my job wrongly and that the toolpath will stray outside the envelope that a soft limits alarm should arise .
Are you saying that it should arise prior to hitting the start button . or will it only arise when the work zero position is defined .

Ok lets say you define your WORK ZERO in X half way up the work envelope (or put another way 200 in MACHINE coordinates.) And you defined the X ZERO point in CAD to be bottom left corner of the part and the part is 400mm long in X. When you load the code and it does it's Pre-check it should warn you, I don't think it does when you push cycle start the control should warn you before then. (In UCCNC this feature might need turning on in the settings, I think it's called Softlimits pre check)

It's easy to test just set WORK ZERO for X & Y up the top so the part falls outside the cutting area and set you Z axis at the top of travel so no damage can be done if it it doesn't work but you'll know straight away because it shouldn't work at all in which case hit the stop button.

Kitwn
30-07-2020, 07:29 AM
I'm a bit concerned that anyone thinks that "going past zero" is in any way relevant when you are using Mach3/UCCNC. Maybe in the days of archaic controllers that did not have any homing/work offset capability this might have mattered but not today.

The point here is that homing sets machine zero, either directly by putting home switches at the zero point, or somewhere else with an appropriate offset (at the right-hand end of travel, in the most extreme case). But that is absolutely nothing to do with where the zero point is on the work. First thing you do when you plonk the stock on the bed and clamp (assuming that you have already homed the machine) is to move the spindle to where you want (0,0) to be, and then set "work coordinate zero" to that point. Maybe x and y at the same time, maybe separately. Effectively you are doing the same thing when you set tool height - this is setting z coordinate zero, indirectly. Your gcode will, if generated by any modern CAM package, be working in terms of work coordinates. Nothing at all to do with machine coordinates. For example, recently, I have been machining work where the X zero work coordinate is at the right hand side and most of the machining is done with negative X coordinates. I told my CAM software where I wanted X=0, set the spindle to the RH edge of the stock and set work coord X to zero, and away it all went.

This machine/work coordinate confusion is a bit complicated to follow at first sight but it soon becomes second nature and you won't even think about it, but it is absolutely critical to using CAM and the machine in harmony. I sorry if I have misunderstood what was being said, but the idea that you need to set machine zero somewhere on to the bed just so that you can move to negative coordinates could be very misleading to anyone new coming to this.

Neale,
I'm not going to argue with a word of this, and I am coming at it from a wood-working gantry router perspective which is different to a mill. Like you I often reposition the work coordinate zero to suit the job but this will be a known position relative to the homed (0,0) position so that it can easily be re-acquired after an E-stop or other driver-disabling event.

The OP was confused regarding numbers to put into these values but the main points I wanted to make are the need to pull away from the switches to a specified point after hitting them, (0,0) being the obvious label to put on that point in my view, and that the area the workpiece can fit inside will often need to be smaller than the area defined by the soft limits which primarily exist to prevent crashes but also specify the limits of movement of the centre of the cutting tool. The best numbers to use then fall out from there.

Kit

JAZZCNC
30-07-2020, 08:42 AM
Neale,
I'm not going to argue with a word of this, and I am coming at it from a wood-working gantry router perspective which is different to a mill. Like you I often reposition the work coordinate zero to suit the job but this will be a known position relative to the homed (0,0) position so that it can easily be re-acquired after an E-stop or other driver-disabling event.

Kit, you don't need to position the work to a known MACHINE location to get back to WORK ZERO that is the point of the G54, G55,etc WORK OFFSETS and using HOME switches. If you get lost or crash the machine you simply HOME the machine and it uses the WORK OFFSET to get back to WORK ZERO.

The only thing you may need to do is save the WORK OFFSET before starting the job just in case power goes off mid job. However some controllers save the WORKOFFSET before the start of the job, I think Linux does this and UCCNC but Mach3 doesn't which is a pain as it's easy to forget.

Regards Backing off the HOME switch then the only point to me, other than to relocate MACHINE ZERO position is to stop potential false trips if using same switch has limits combined with homing or to square a dual motor gantry.

John11668
30-07-2020, 09:05 AM
I never really expected this post to give rise to so much controversy.
I was really just looking to get clear in my head what settings to put in there.
I think I have achieved that, but it has become clear that different users operate these in a way which suits their own purposes.
At least I now know how I intend to operate in order to have a method which suits me .

Thanks Guys.

JAZZCNC
30-07-2020, 10:06 AM
I never really expected this post to give rise to so much controversy.
I was really just looking to get clear in my head what settings to put in there.
I think I have achieved that, but it has become clear that different users operate these in a way which suits their own purposes.
At least I now know how I intend to operate in order to have a method which suits me .

Thanks Guys.

This isn't controversy John just friendly banter just wait until we really get fired up...:hysterical:

We all use our machines in different ways with different setups and their is no right or wrong way. Plus I guarantee in a years time you'll be doing it a completely different way to now as you learn and advance more.!

Neale
30-07-2020, 10:14 AM
John - one of the difficulties here is that there is a bit of an onion skin effect - it looks simple from the outside, but each time you peel off a layer of understanding, there is another layer of complexity beneath! I don't think that there is any particular disagreement between any of those who have posted, but we each tend to have our own way of looking at things. For example, Kit mentioned woodworking gantry machines and mills as if they are different. Well, of course they are mechanically, but in terms of machine and work coordinates they work exactly the same way. But the complication comes when you watch them at work - in the first case, the tool moves around the work, in the second the tool stays still and the work moves! The only thing that matters is the RELATIVE movement between work and tool, and that is (or should be set up to be) the same in both cases.

Couple of things that have been mentioned. G54, G55, etc - these refer to different work coordinate systems. The motion control software notes the offset between machine and work zeroes when you set them up. It can save these values, so that when you come back to the machine it remembers the offsets and, once you have rehomed the machine, your work zero will be in the same place as before. Sometimes it's useful to have several work coordinate systems, if you have some jigs and fixtures on the machine, for instance. So you can set work zero for each of these, and save them as the G54 (the usual default set), or G55, or G56, etc. Then in your gcode, it will tell the machine which set to use for a particular fixture, say, and you don't need to reset each time.

Jazz also mentioned the "backing off" feature. I'm with him on this - as mentioned a few posts ago, there is no reason to have the machine zero anywhere except in the "bottom lefthand" corner, but you might want to use the opposite end of machine travel for your home position. A friend of mine has his router set up like this - this commercial machine has the home switch at the +X end of the bed, so it homes to there but effectively sets the machine coordinate zero to correspond to the -X end of the bed. However (and I have exactly this problem on my own machine) you can sometimes get a problem when homing. For example, I home X, and by default the machine then leaves X where it is and starts homing Y. But the tiny vibration that is caused trips the X switch which then gives a limit error. Pain in the neck! The answer is to use the backoff feature to move the X position a milllimetre or two off the switch and set zero there. Then there is no accidental switch triggering and homing becomes reliable again.

These discussions come up every so often but it's worth airing because this is a big stumbling block when you first start out. Give it month or two of use and you'll forget you ever had a problem, but it's a real brain-strainer at first!

John11668
30-07-2020, 07:24 PM
I think I am getting it Neale and I must admit I had never considered the Gantry machines.
I did work with NC gantry routers in the aircraft industry in early 70s milling Jaguar wing skins complete with pockets, ribs and stringers. A 70mm slab roughly the size and shape of the wing, was held on the table by Vacuum while most of it was machined away. One man "operated" the machine . Or really he watched it .
Three others removed barrowloads of swarf to the skip in the yard and they really did have to work.

In those days the machines were tape driven and " wizards" came in from elsewhere to set the machines up. CNC was spoken of in hushed voices as a black art.

Quite a few topics have been covered in this thread above , which really have served to reduce the mystery a tad, so now I can go and play a bit and make sure I have grasped the principles .

Thanks to all !

John

Kitwn
31-07-2020, 03:31 AM
Regards Backing off the HOME switch then the only point to me, other than to relocate MACHINE ZERO position is to stop potential false trips if using same switch has limits combined with homing or to square a dual motor gantry.

A precise and detailed description of my own machine!

I love threads like this, I always learn a great deal myself and as I discovered when I took up teaching technical stuff to adults back in the 80s, there's nothing will show up the holes in your own knowledge more effectively (brutally at times!) than trying to explain things to someone else. I now need to swot up on the full details of G54, G55 and other relevant codes and exactly how LinuxCNC uses and saves them.

The difference between machine coordinates and work coordinates is, as Neale pointed out, a confusing one tro begin with but soon becomes one of those fundamental bits of knowledge you don't realise you never knew.

Clive S
31-07-2020, 08:32 AM
. I now need to swot up on the full details of G54, G55 and other relevant codes and exactly how LinuxCNC uses and saves them.


Yes this confuses many people. Have you noticed that you can see the machine coordinates and the current G54,55 etc on some GUIs at the same time. In Linuxcnc you can turn them on and off from the view tab.

Ie. If you have touched off your part ie X0,Y0 in G54 you will see the machine G53 at the same time completely different.

http://linuxcnc.org/docs/2.8/html/gcode/images/offsets.png

http://linuxcnc.org/docs/2.8/html/gcode/coordinates.html

JAZZCNC
31-07-2020, 09:34 AM
I now need to swot up on the full details of G54, G55 and other relevant codes and exactly how LinuxCNC uses and saves them.

Probably without knowing it you and many others have actually been using a WORK OFFSET in fact if you have been using 2. These being G53 and G54.

When you HOME your setting G53 ZERO which is MACHINE coordinate system and when you set WORK ZERO you're using G54 WORK OFFSET. Almost all controllers, Mach3, UCCNC, LinuxCnc, even industrial-grade controllers like Fanuc, etc use G54 by default and unless you specifically need to use a different OFFSET say for things like multiple vises with OP1 OP2 type setup or several Fixture Jigs which all have a ZERO point you don't need to know about them.

Most CAM packages are also set up to use G54 by default which is another reason why many users don't actually know they are using WORK OFFSETS.

If you have a large working area WORK OFFSETS makes cutting several different jobs say as in different materials or thickness very easy because of each Fixture as it's own ZERO.

Kitwn
31-07-2020, 12:58 PM
Clive, Dean,
Thanks for the links and comments.

I've never really thought about being able to save a variety of offsets in the software, though I have been known to use a carbon based data input interface and non-volatile planar organic storage medium to record them in the past. As I'm now starting to use a couple of different jigs for streamlining work, that may be more sensible.