In CS223a homework there is a question to calculate DH parameters of given robot as below:
When he try to solve DH parameters of the robot in the solutions he set first and second frame positions same as below:
As you can see first frame of the joint shifted through Z, and now first and second frame starting positions are same.
I would like to know what is the rule for this? By intuition I believe joints frames can be shifted through Z axis. Is it the only rule? Is there any other thing I should know?
PS: Solution manual for HW2 https://see.stanford.edu/materials/aiircs223a/solution2.pdf