Detecting when a lead screw has reached the end of it's travel

We use a lead screw to push the plunger on a dispenser and we have a sensor to detect when the dispenser is empty. The problem is that we can’t position the sensor far enough down so it trips before the dispenser is fully empty. We are going to ditch the sensor and instead detect when the lead screw is fully extended. I can see several ways of doing this and was curious if you have a recommendation. Here are my current thoughts:

  1. Move to a certain current value (which will increase when the lead screw stops)
  2. Detect the failed motion (probably an amplifier fault)
  3. Look for position errors and trigger if it exceeds a configured value.
  4. … other ideas.

It sounds like you are effectively homing to a hard stop. What you described in 1, 2, and 3 are the values I would look at to determine that. However I think the most consistent threshold would be 3 since current can fluctuate quite a bit, and you’d typically have your position error limit trigger way before you generate an amplifier fault.

Are the dispensers a consistent length? If so (or you have a finite and reasonable number of them) and you know where the screw is starting, you could figure out your expected stroke in terms of user units and then move to some position before the end.

If you are going to try homing to a hard stop, Scott suggested setting a torque limit on the drive to prevent mechanical damage, commanding motion past the end, and using the position error limit. He also suggested to make use of the “duration” value (ie don’t trigger until the limit has been exceeded for a duration)