This article describes an application of fuzzy logic in a gap controller for an electrical discharge machine. The controller was built using an STM32F4 microcontroller with an ARM Cortex M4 core. Gap controllers are one of the key control circuits in electrical discharge machines. The performance of a gap controller determines machining speed, tool electrode wear and machined surface quality. As the EDM process is of stochastic nature and simple controllers fail to deliver adequate performance, the best option is to use fuzzy logic in such a controller. The article also describes the operation of the controller and discusses the results of tests on an actual controller.