Machsupport Forum

Mach Discussion => Mach4 General Discussion => Topic started by: billskeen62 on January 14, 2019, 12:26:59 PM

Title: Noob question on Z Axis setup using soft limits
Post by: billskeen62 on January 14, 2019, 12:26:59 PM
I am setting up a DIY CNC router table using Mach 4 and soft limits. All the axes appear to be working correctly when jogging around the table and clicking on Goto Work Zero returns to the home position correctly.

However, when I run the roadrunner gcode file, I am getting the following error:

Error, Z axis commanded over SoftMaxError

What am I doing wrong? Please point me in the right direction on forum or docs so I can rtfm.  ;D

Attached is my current profile package.

Thanks in advance!
Title: Re: Noob question on Z Axis setup using soft limits
Post by: joeaverage on January 14, 2019, 01:58:31 PM
Hi,
on the Toolpath Tab with the RodRunner Gcode file loaded look at the maximum minimum extents of the Gcode.

Do they exceed the SoftLimit window you set in the SoftLimits page?

Do you have Home switches setup and working?

Craig
Title: Re: Noob question on Z Axis setup using soft limits
Post by: Stuart on January 14, 2019, 02:01:50 PM
Is the tool offset set correctly
Is the WCS set on the machine

Though if I remember correctly the RR does not have the tool offset called out as in g43 hex
Title: Re: Noob question on Z Axis setup using soft limits
Post by: billskeen62 on January 14, 2019, 02:31:04 PM
Ah, I have not setup any tools yet. I was trying to test without putting any tools in the spindle.

Active H Offset is 5
Active D Offset is 0

Home/Soft Limits for Z are: Soft Min -4.000, Soft Max 0.000. I also tried Soft Max 1.000

Limit switches are/were setup and working, but my Soft Limits settings are less than the X,Y,Z home positions to keep from going that far. I wanted to go to a soft home position on the table.

Looks like this is the line on RR file where it stops:

G0 X0.000000 Y0.000000 Z5.00000

Guessing that Z5.0000 is the problem?
Title: Re: Noob question on Z Axis setup using soft limits
Post by: joeaverage on January 14, 2019, 03:05:35 PM
Hi,
there is a difference between Limit switches and Home switches.

If you hit the <Ref All Home> button what happens?

Craig
Title: Re: Noob question on Z Axis setup using soft limits
Post by: billskeen62 on January 14, 2019, 03:29:48 PM
If the spindle is sitting at home, nothing happens.

If I have moved it somewhere on the table, it resets the DROs?  from whatever readings they had to 0.

No axes move.



Title: Re: Noob question on Z Axis setup using soft limits
Post by: joeaverage on January 14, 2019, 03:44:04 PM
Hi,
that tells me that you do not have Home switches set up. In absence of Home switches if you ask Mach to
<Ref All Home> it will 'Home in place'....that is to say it will reset the machine coordinates to zero at your
current location.

Sorry to say but that renders your SoftLimts as junk.

Lets say you jog your machine to the center of the table and <Ref All Home>. The machine coordinates of the center
of the table are 0,0.  Lets say you have you soft limits as -12 and +12 for the X axis and -24 and +24 for the Y axis
for a machine of 24 inch movement in X and 48 inch in Y.

If you called a move X30 say Mach would baulk and tell you that move is out-of-bounds.
Title: Re: Noob question on Z Axis setup using soft limits
Post by: billskeen62 on January 14, 2019, 03:50:03 PM
Okay, learning here.

So there is no way to use Soft Limits instead of Home switches?

If I click on Goto Work 0, it moves to where I want it to be. Can the Ref All Home be disabled in a script?
Title: Re: Noob question on Z Axis setup using soft limits
Post by: joeaverage on January 14, 2019, 04:01:57 PM
Hi,
sorry, hit the wrong button and posted before I'd finished....

Now try jogging to the lower left hand corner or close to it and <Ref All Home> again. The machine coordinates of the lower
left hand corner are 0,0. But your soft limit setting have not changed.....they are still -12,+12 for X and -24,+24 for Y.
So if you make a move G0 X-5 Y-5 Mach would say 'Yes that's OK its within the SoftLimit boundaries but in fact the machine
is already at the lower left hand corner and its going to try to go EVEN FURTHER to the left and EVEN LOWER and crash!

The point is that SOFT LIMITS are the extents of the machine FROM SOME DEFINED LOCATION, called the reference point
or home. That point must remain the same every session of Mach. Thus the first thing when you turn Mach on is reference
or home it.

You could jog to some location, like the lower left hand corner and call that home. If you go to exactly that location
and home your machine every time then the Softlimits you set in the table will be consistent.

The more common way is to have home switches so that when you <Ref All Home> the machine will drive, at a programmable
slow speed, in a programmable direction UNTIL the home switch for that axis makes AND THEN reset the machine coordinates
for that axis to zero. It will then do the next axis until all axes are homed.

With good home switches you should be able to get your machine to within a very short distance of 'exactly home' every time
and therefore all your soft limits are consistent.

Craig
Title: Re: Noob question on Z Axis setup using soft limits
Post by: joeaverage on January 14, 2019, 04:06:52 PM
Hi,

Quote
So there is no way to use Soft Limits instead of Home switches?

No, in order for Soft Limits to be useful and consistent you need to home your machine and that means home switches.

Most people use their limit switches as home switches as well. I personally think its poor practice but having said that
most hobby CNCers do it that way.

If you already have limit switches you could probably make them do double service.

Craig
Title: Re: Noob question on Z Axis setup using soft limits
Post by: billskeen62 on January 14, 2019, 05:54:08 PM
Okay, now have Ref. All Home working with the limit switches and Soft Limits turned off. I can jog to anywhere on the table, click RAH and it goes until each limit switch opens, then backs off until they close. I see each switch as it trips in the History box. Now what?

Also, for the Z axis, my Home switch as at the top of the slide. Should I move it to the bottom to keep it from crashing into the table top or will the Soft Limits (when they are active) stop that?

Title: Re: Noob question on Z Axis setup using soft limits
Post by: billskeen62 on January 14, 2019, 05:56:19 PM
Okay, now have Ref. All Home working with the limit switches and Soft Limits turned off. I can jog to anywhere on the table, click RAH and it goes until each limit switch opens, then backs off until they close. I see each switch as it trips in the History box. Now what?

Also, for the Z axis, my Home switch as at the top of the slide. Should I move it to the bottom to keep it from crashing into the table top or will the Soft Limits (when they are active) stop that?
Title: Re: Noob question on Z Axis setup using soft limits
Post by: joeaverage on January 14, 2019, 06:14:26 PM
Hi,
most CNCers have the Z axis home point at the top of travel.

Once you have the machine homed you can now fill in the softlimits. Note that the softlimits are MACHINE COORDINATES.
So your Z axis for instance will have Soft Max of 0 and a Soft Min of -4 say.

Craig
Title: Re: Noob question on Z Axis setup using soft limits
Post by: bryannab on January 15, 2019, 08:48:59 AM
Hello,

OP seems to be in good hands, but I wanted to share our support video on homing and soft limits as well: https://youtu.be/IXuuGRACU1I

Happy CNCing,
Bryanna
Title: Re: Noob question on Z Axis setup using soft limits
Post by: billskeen62 on January 15, 2019, 09:03:08 AM
Thanks Bryanna!

I've watched it a dozen times, slowed it down trying to figure out each step you made.

I've subscribed to that channel too. Looking forward to more content on Mach 4.
Title: Re: Noob question on Z Axis setup using soft limits
Post by: billskeen62 on January 15, 2019, 12:52:21 PM
Now that the home limit switches are setup, the roadrunner file runs successfully. But if I turn on soft limits on, the roadrunner file still errors and stops on the second gcode line in the file with:

Error, Z axis commanded over SoftMaxError

The line is:

G0 X0.000000 Y0.000000 Z0.200000

The Z axis Soft Min = -4.000 and the Soft Max is 0.000

Now what?
Title: Re: Noob question on Z Axis setup using soft limits
Post by: Steve Stallings on January 15, 2019, 01:26:52 PM
The request to go to Z0.200000 is indeed outside the soft limits that you have set.

It is unfortunate that the sample file asks for motion more positive than Z=0 as
it is normal practice to call home at Z=0.

You can get around this by setting up your homing to call the homed location for
Z to be 0.200000 or greater. For example go to  Config > Control> and select the
tab for Homing/SoftLimits. In the row for Z and the column for Home Offset enter
the value 0.250000 and in the column for Soft Max enter the same value.

In the real world, just avoid generating G-code that requests values outside of
the range configured for your machine. You can also utilize work offsets such
that work Z=0.200000 is located at less than machine coordinate Z=0.000000
Title: Re: Noob question on Z Axis setup using soft limits
Post by: billskeen62 on January 15, 2019, 01:41:20 PM
Would it be okay to just go through the sample file, setting anything greater than 0.0000 for the Z axis to 0, save with a new file name, load it and run?

Part of the reason I am being so careful is the table is 2" higher than the lowest the Z axis can travel. That is before I put any waste board on it.

Never mind on changing all the values as there a hundreds of them > 0. Doing as you suggested now to test again.
Title: Re: Noob question on Z Axis setup using soft limits
Post by: Steve Stallings on January 15, 2019, 01:50:19 PM
You should be able to set Z soft min to a value suitable to protect your table.

Granted this may simply move to problem to being one of the machine stopping
when Z min is exceeded, but this is what you actually want if the goal is to
prevent cutting the table.
Title: Re: Noob question on Z Axis setup using soft limits
Post by: billskeen62 on January 15, 2019, 01:58:11 PM
Yes, the Soft Min of -4.000 stops the Z from hitting the table, but that is before I put a tool in. I'll adjust to a bigger number, depending on the tool, like -2.000 then, correct?

BTW, "Thank You"  to you, Bryanna, joeaverage and others for all the help. It is appreciated.
Title: Re: Noob question on Z Axis setup using soft limits
Post by: billskeen62 on January 17, 2019, 01:09:38 PM
Got this all working correctly ( I believe) now.

Thanks for all the help.

Now to figure out how to move all this to a new computer with new license.
Title: Re: Noob question on Z Axis setup using soft limits
Post by: bryannab on January 17, 2019, 01:16:31 PM
Hello,

You can package up your profile by going to Help>Support>Package Current Profile. This bundles up your settings including macros and screens. Once you have Mach4 installed on your new computer, use the 'Import' option in the Mach4 Loader to unpackage the profile. You can update the PC ID on your license by going to 'Manage My Licenses' at machsupport.com. Copy the PC ID from the Help>About menu in Mach4 (on the new computer) and paste it into the PC ID field on the licensing page. Click 'Add' and a new license will be generated with that PC ID. You'll receive an email with a link to download it.

-Bryanna
Title: Re: Noob question on Z Axis setup using soft limits
Post by: billskeen62 on January 17, 2019, 01:42:43 PM
Bryanna

You Rock!

That worked.

Thanks you very much and for the quick response too!