Z motor moving untill pm tilting

When the pm motor is tilted,
Can’t make the z-axis motor move upward?
I need this for a better separation