Not sure how you determined the position constraints that you want, but usually to limit a variable you would use clamp.