Page 1 of 1

Home all - then occasional safe Z warning.

PostPosted: Tue Apr 22, 2025 6:05 pm
by ian8555
I have a fault that happens occasionally,

I power up the system, home all, then when I press safe Z, Uccnc will display an error about soft limits in Z being triggered.

At this point my homing is done and the MC is 0, the safe z in the settings is also 0.

I think it may be some error in the math that happens within the M216 here:

Code: Select all
// Go to safeZ

exec.Getactualoffset();

double safeZ = exec.mainform.UCsetup.UCset.Generalsettings.SafeZ;
double Softlimitsrelative = exec.mainform.UCsetup.UCset.Axis[2].UC100axis.SoftLimitP - exec.ofc.Wzval - exec.ofc.TOZval - exec.ofc.G92zval;

if (exec.mainform.UCsetup.UCset.Generalsettings.Enablesoftlimits)
{
  if (safeZ > Softlimitsrelative)
  {
    safeZ = Softlimitsrelative;
   
    DialogResult result = MessageBox.Show(exec.mainform.MSG.Message[45], "Confirmation", MessageBoxButtons.YesNo);
    if (result == DialogResult.No)
    {
      return;
    }
  }
}


Is there any chance that the homing sequence or this code is rounding to zero causing the error?

Re: Home all - then occasional safe Z warning.

PostPosted: Tue Apr 22, 2025 8:48 pm
by rvalotta
Not sure if its related but I had a experience recently where when i tried to move to 0 on a axis i received the soft limit error... It seems that UCCNC doesn't do a <= or >= type condition so 0 will fault it.. The suggestion made to me was to fudge the axis numbers so they are 0.0001 bigger then what uccnc things they are

Re: Home all - then occasional safe Z warning.

PostPosted: Wed Apr 23, 2025 1:38 pm
by ger21
The problem is that Safe Z is in work coordinates, so it's actual position can and will change depending on where you set Z zero at.