Spindle motor control

I’m upgrading my spindle motor to variable speed. The control unit uses a potentiometer to vary the speed… My CNC is Arduino controlled, anyone know of a way to wire the speed control unit to the Arduino so I can use the built in speed controller in “Candle grbl controller” ?? Thanks.