Equations of motion for rod and rotor
The rotor's angle and speed are measured in the lab frame; the motor shaft sees the difference between the rotor and rod speeds. The body's moment of inertia includes the rod and the wheel's mass carried at its center, but not the rotor's spin about its own axle.