We report on the realization and characterization of an active control system of the optical holographic setup used for fabrication of holographic gratings in liquid-crystalline composite materials. The system exploits a reference diffraction grating and a piezomirror in closed-loop feedback. The piezoelectric mirror exhibits a hysteresis that depends not only on the applied voltage, but also on the history of the mirror motion. In an open-loop configuration, the hysteresis can be reduced by adjusting the delay time between the application of two different control voltage values; in a closed-loop operation, it is possible to eliminate the residual hysteresis. By testing the system in different conditions, it has been shown that residual fluctuations are comparable to the resolution of the piezomirror operation.