Small cavities on a sliding surface can improve lubrication performance, which has been verified by many researchers. Electrochemical machining (ECM) is an effective way to fabricate this kind of small cavities on a large scale. When the diameter and the removal volume for the cavities are specified, it is still required to efficiently determine the appropriate machining parameters. This paper presents a machine vision based control system for an ECM variant: the scanning micro electrochemical flow cell (SMEFC). The aim of this system is to control the diameter of the cavity in real-time. With the assistance of machine vision, fast acquisition of the machining parameters for the specified diameter and the specified removal volume is possible. The system configuration is first explained in detail, including hardware and software configuration and the image processing algorithms. The latter are based on the Shi-Tomasi corner detector and are used for feedback control, stability and symmetry evaluation of the electrolyte droplet. For convenience, all of these functions have been integrated into a self-developed unified G-code interface. Furthermore, the theoretical explanation for controlling the machining process by vacuum gap (VG) tuning has been investigated through a two-phase flow simulation model, which revealed how the VG influences the shear rate and the pressure difference near the meniscus. Finally, a case study shows how to use the proposed strategy to get suitable machining parameters for a cavity with a diameter of 900 μm and a target removal volume of 0.03 mm 3 . This demonstrates the availability of a deterministic removal strategy.