Choose Home tab→Assemble group→Rotational Motor.
In the graphics window, select the under-constrained part that you want to define as a motor.
In the graphics window, select the element that you want to use as a rotational axis.
On the command bar, define the motor speed and limits you want.
On the command bar, click Finish.
Tip:
You can use the Simulate Motor command to observe the kinematic motion of the under-constrained parts in the assembly.
Only motors in the active assembly participate in a motor simulation.