There are number of boards that take GRBL firmware or variants that can be had for relatively cheap. There may be some work in getting the right components to integrate with a K40 but totally doable.
Makerbase MKS DLC32 is one mentioned here fairly frequently.
There are a bunch of ESP32 GRBL shield options. You could even do an old arduino 8-bit option but honestly at this stage there’s really no reason not to go 32-bit for performance reasons.