The design of a feedback system based on the application of electron cyclotron (EC) current drive in high-density tokamak plasmas is presented. A realistic evaluation is given of the current drive produced by high-power gyrotron tubes for EC-wave beams injected from the low field side in the O-mode polarization. The driven current, calculated using a relativistic analytical formalism along the ray trajectories, is inserted in a consistent theory of nonlinear tearing-mode evolution. Results of modeling calculations are presented, showing the possibility of controlling by means of a digital system the evolution of the width of rotating magnetic perturbations by phase-locked modulation of the gyrotron power source.