Re: PPMC developments



Jon Elson wrote about not being able to come out of estop:

>
For steppers, of course, there shouldn't be an amp fault input.  On my
servo system, I also don't have individual amp fault signals.
<

Yes, but the code in emcmot.c calls the function that reports amp
faults, and it should be coded always to return "no amp fault", which if
it's zero corresponds to an ini file polarity of 0. This is part of the
external interface dispatcher that you wrote for the PPMC:

extern int extAmpFault(int axis, int * fault)
{
  if (axis < 0 ||
      axis >= EMCMOT_MAX_AXIS) {
    return -1;
  }

  *fault = 0;

  return 0;
}

If you cloned the parallel port interface code for steppers, you got the
one from extsmmot.c, which is this:

extern int extAmpFault(int axis, int * fault)
{
  return 0;
}

I never thought about this, but it doesn't change the fault variable, so
if this is uninitialized, your code will look at it unchanged and see a
fault. That can be fixed in the .ini file, but I should have set *fault
to zero just to be safe, e.g.,

extern int extAmpFault(int axis, int * fault)
{
  *fault = 0; /* clear any "fault" */
  return 0;
}

--Fred



Date Index | Thread Index | Back to archive index | Back to Mailing List Page

Problems or questions? Contact