Rotational motion simulation

I want to simulate rotational motion.
I stack two stepped rings.
I want to reproduce the motion of the upper ring moving up and down according to the step when the lower ring is fixed and the upper ring is rotated.
With my settings, it just rotates, but the up and down motion cannot be reproduced.
Please tell me how to set it up.