I'm planning to build a head-mounted camera stabilizer for pro GoPro camera. The idea is that when I tilt my head the camera would stay at a user-set angle.
I'm using an accelerometer and a gyro to measure camera angle $\theta$ and angular velocity $\dot{\theta}$, and some motor to control the camera angle. I derived the following differential equation for the system (which is basically an inverted pendulum) where $l$ is length of the rod, $\theta$ is the angle of the camera due to gravity, $m$ is the mass, $g$ is the gravitational acceleration, $b$ is damping coefficient (due to friction) and $\tau$ is torque. $\tau_{motor}$ will be the input of the system.
$\tau_{total} = \tau_{motor} - \tau_{gravity} - \tau_{friction}$
$I\ddot{\theta} = \tau_{motor} - mgl\sin\theta - b\dot{\theta}$
$ml^2\ddot{\theta} = \tau_{motor} - mgl\sin\theta - b\dot{\theta}$
$\ddot{\theta} = \frac{1}{ml^2}\tau_{motor} - \frac{g}{l}\sin\theta - \frac{b}{ml^2}\dot{\theta}$
From here I'll continue designing the control algorithm using state-space methods such as state-feedback control (I choose camera angle $\theta$ and angular velocity $\dot{\theta}$ as states and $\tau_{motor}$ as input).
Now here's the question:
I want to test how my control system behaves when a person tilts his head (I'll be using Matlab and Simulink). How should I incorporate the tilting of the head (or rotating of the body of the motor since the motor will be attached to head) into my control design? I guess it can be thought as a disturbance to system (or another input)? How should it be incorporated to the system model (meaning the differential equation above)? Should there be maybe more differential equations? I thought it would be nice to give the system the the angle of the body of the motor (meaning the angle of the head) as function of time and observe how the control system works. In other words I would like to see how the controller works if I tilt my head for example back and forth.
On the other hand, is this a good approach or should I just use another torque $\tau_{disturbance}$ to test the controller? I'm pretty sure that it isn't the same as tilting the motor body, but would perhaps lead to good enough model for the controller?