The invention discloses a compact variable-stiffness rotary flexible joint. The compact variable-stiffness rotary flexible joint comprises a joint driving disk, a joint output disk, a joint driven inner disk, a first
cam, a first driven variable-stiffness adjusting seat, a first group of compression springs, a plain shaft, a first variable-stiffness adjusting seat, a
turbine lead screw structure, a second variable-stiffness adjusting seat, a second group of compression springs, a second driven variable-stiffness adjusting seat, a second
cam, a cylindrical gear, a worm, an absolute
encoder, a motor and a circular-arc rack. By adopting the flexible joint, flexible driving output can be realized, external
impact is reduced, and the service life of a
robot is prolonged; meanwhile,
joint stiffness can increase and decrease sequentially along with the increase of the flexible deformation angle of the joint, the robustness and running stability of the
robot are enhanced, the
joint stiffness can be adjusted actively under the own driving action, and the adaptability to different working tasks is enhanced; moreover, the flexible joint has an online flexible deformation detection function, so that feedback results of flexible deformation and output torque can be obtained, and online stiffness adjustment is realized.