Physical Pendulum: Sign of Torque I was looking into some of the motion equations for a physical pendulum that oscillates in small angles (using the approximation $\sin(\theta) \approx \theta$). Specifically, I was interested in ways to describe the angle $\theta$ between the pendulum and the vertical ("negative $y$") direction, as illustrated below:

Let's say that the pendulum's moment of inertia with respect to its axis of rotation (the blue dot in my illustration) is $I$; that its total mass is $M$; and that the distance between its center of of mass and its axis of rotation is $d$ (the axis is above the center of mass).
I showed (won't burden this question with those calculations) that in this situation, I can consider the force of gravity as though it is acting solely on the center of mass, and so the net external torque $\vec{\tau}$ is given by:
$$
\vec{\tau} = \left( d \cdot \hat{r} \right) \times \left( - Mg \cdot \hat{y} \right) = -Mgd\sin(\theta)\hat{z} \approx -Mgd\theta\hat{z}
$$
using the right hand rule.
The next step was to use Newton's second law and obtain that:
$$
\vec{\tau} = \frac{d\vec{J}}{dt} = I\cdot\ddot{\theta}\hat{z}
$$
Which then gives me:
$$
\ddot{\theta} + \frac{Mgd}{I}\theta = 0
$$
which is a differential equation I can solve.
However, if I instead observe the pendulum at a stage in its rotation in which it is in the other side, but using the same axes:

then using the right-hand rule I (erroneously, I presume) obtain that this time, the net external torque is given by:
$$
\vec{\tau} = Mgd\theta\hat{z}
$$
that is to say: the same magnitude as before but in the opposite direction. This results in this being my differential equation in this case:
$$
\ddot{\theta} - \frac{Mgd}{I}\theta = 0
$$
to which the solution is rather different.
Obviously, this seems off: I'm describing the same motion here and should therefore obtain identical results. Thinking about it logically I was able to tell that $\theta$ and $\ddot{\theta}$ should be of opposing signs (assuming angles on the right side are "positive" and that positive $\hat{z}$ is the direction associated with a counter-clockwise rotation) and so the first of the two equations seems to be the one I was after; but I'm struggling with proving this to myself through simple algebra, for some reason.
I suspect that the cause may be that I implicitly consider $\ddot{\theta}$ to be a "signed" function with its sign signifying the current direction of rotation, while $\sin(\theta)$ was "approximated" out of an "unsigned" $\sin(\theta)$ (since $\theta$ the way I described it is always in $[0,\frac{\pi}{2}]$), and so the solution should be to turn it into such a "signed" function. Once again, I can logically think (split it into the positive/negative cases) and determine that if it is signed as described ($-\frac{\pi}{2}$ to $\frac{\pi}{2}$, left to right) then $\vec{\tau} = -Mgd\theta\hat{z}$; but I feel like I've been overcomplicating this and would appreciate hearing an explanation from someone with a deeper understanding.
To summarize this as a question:
How, as algebrically as possible (which isn't to say I wouldn't greatly appreciate physical clarifications/solutions as well!), could I determine that $\vec{\tau} = -Mgd\theta\hat{z}$ (assuming that I'm even right and that it is), regardless of the side in which the pendulum currently is?
 A: The problem is that you are using $\theta$ in both cases, but on the left side, $\theta<0$ (according to the first image), so the sign works out either way. You have changed the sign of theta without changing what the sign of the torque means, which is why the sign error pops up. In other words, in your second attempt you are trying to use a left-handed coordinate system for $\theta$ while still keeping a right-handed coordinate system for the torque.
Obviously, the torque does change signs as the pendulum crosses the equilibrium point; this is what lets the motion change direction. The important conceptual point is that the torque always acts to move the system towards equilibrium.
An analogous problem would arise for a horizontal spring-mass system, where you you look at the mass on the right and set up $F=-kx$, but then you switch to defining $x$ to be measured from the left while still defining positive force as being to the right. Then you would arrive at $F=kx$.
A: It does not matter where you draw the angle, but which direction an increasing value goes. If it is counter-clock-wise it is a positive angle, and if it is clock-wise a negative angle.

Specifically to your question, to solve problems you need free body diagrams drawn with all angles in a positive sense if possible. If not possible, then special care must be taken to account for that and you must indicate in the drawing which angles are negative (shown below with -θ)

Also, notice that the resulting torque due to a positive angle (left drawing) is -τ and this is the source of the negative sign in
$$ \tau = - (d \sin \theta) M g $$
But on the right drawing, the torque is positive and the source of the negative sign comes from the angle
$$ \tau = (d \sin (-\theta)) M g $$
Both of the above figures result in the same equation, representing the same situation.
The underlying assumption is that a positive torque will cause positive angular acceleration in both cases if conventions are followed.
$$ \tau = I \ddot{\theta} $$
If you have a non-conventional set up where $ \tau = + (d \sin \theta) M g$ because you considered a clockwise (CW) angle as positive then you have to modify the equations of motion accordingly with
$$ \tau = I (- \ddot{\theta}) $$
You know this is because positive torques are CCW and positive angles are CW in this unique case.
Summary
Always decide on a convention on angles and torques, and be consistent, or take care to adjust the equations where conventions are not followed.
