Homing not stopping when reaching the limit switch

Hello,

I’m using MpAxisBasic to control an Axis (mapp Motion 5.31.1). I need to home my Axis by using a Limit Switch.

I have configured the homing parameters as follows:

While homing, the Axis moves in the positive direction, reaching the sensor but it never stops. The homing sensor changes from FALSE to TRUE and then FALSE.

I’m using the Trigger 1 input of my Acopos as my Homing Switch.

I have used mappCockpit to check the status of the digital inputs. As you can see in the picture below, the input Trigger 1 is TRUE when the sensor is reached, and the Homing Switch Variable takes the value of Trigger 1. So, I’m reading the correct reaction of the sensor.

It looks like the function MpAxisBasic doesn’t recognize my configuration of the Homing Switch. What am I doing wrong?

Thank you in advance for your help.

Hi Daniel,

you use the mode “Limit Switch”. This means a limit switch like the positive or negative end-switch. If you want to use the homing switch as in your screenshot from the configuration and mappCockpit you have tu use the mode mcHOMING_ABSOLUTE_SWITCH.

BR,
Samuel

Hello. I’ve made something like this. It’s probably not the perfect solution, but it works for me.

image

Thanks, for your reply. That’s interesting, using the ACP10.

In my case, I’m using mapp and after correcting the mode to mcHOMING_ABSOLUTE_SWITCH and selecting the right homing variant, I was able to reproduce this:

image

When homing if the sensor is FALSE:

  1. The axis moves in the positive direction using StartVelocity.
  2. When the sensor is reached (FALSE to TRUE), the axis moves in the negative direction using HomingVelocity.
  3. When the sensor is not detected (TRUE to FALSE), the axis moves again in the positive direction using HomingVelocity.
  4. When the sensor is detected again (FALSE to TRUE), the axis stops with the sensor in TRUE.
  5. The Homing Position is set in the Positive Edge of the sensor.

When homing if the sensor is TRUE:

  1. The axis moves in the negative direction using StartVelocity.
  2. When the sensor is not detected (TRUE to FALSE), the axis moves in the positive direction using HomingVelocity.
  3. When the sensor is detected (FALSE to TRUE), the axis stops with the sensor in TRUE.
  4. The Homing Position is set in the Positive Edge of the sensor.

Basically, it is doing something similar to your code, but all the described sequence is done automatically by the mpAxisBasic function. I just wait until the sequence is done or aborted.

The mpAxisBasic function definitely saves code.