I think that easiest way to solve the problem of rotating of plate P2 will be using a mechanism like this:
To use it, join plate P1 to an additional plate with length of 10 cm (height and width depends on the dimensions of mechanism) like this:
After join of "unknown element" with P1 and after placing P2 on "unknown element", construction will look like this:
I still need to find way to prevent plate P2 from falling, I don't think that screws will be enough to attach this mechanism to the plates.