This tutorial goes over the steps to restrict the motion of Firgelli linear actuators to a custom stroke length. Alternatively you can buy a Linear Actuator that has a built in adjustable limit switch like this one in the link below
adjustable limit switch Linear Actuator
https://www.firgelliauto.com/products...
External limit switch kit:
https://www.firgelliauto.com/products...
To see a written tutorial version:
https://www.firgelliauto.com/blogs/tu...