Hybrid techniques for the digital control of mechanical and optical systems