How close to 5 kHz can I set the PWM frequency on an UNO pin 11? I'm rebuilding a laser CNC machine and using LaserWeb4 as the control interface and GRBL 1.1 as the low-level interface to the stepper motors, limit switches and the laser. I have all the motion sorted out and am working on the laser control.

Figure 1. The GRBL 1.1 pinout. Pin 11 is used for spindle (cutter) speed on a milling machine or laser power control on a laser cutter.
The machine is using a Synrad 48 Series laser module which requires a 5 kHz PWM frequency (page 45 - 46).
The GRBL 1.1 sketch can be configured for a variety of PWM frequencies. See cpu_map.h.
  // Prescaled, 8-bit Fast PWM mode.
  #define SPINDLE_TCCRA_INIT_MASK   ((1&lt;&lt;WGM20) | (1&lt;&lt;WGM21))  // Configures fast PWM mode.
  // #define SPINDLE_TCCRB_INIT_MASK   (1&lt;&lt;CS20)               // Disable prescaler -&gt; 62.5kHz
  // #define SPINDLE_TCCRB_INIT_MASK   (1&lt;&lt;CS21)               // 1/8 prescaler -&gt; 7.8kHz (Used in v0.9)
  // #define SPINDLE_TCCRB_INIT_MASK   ((1&lt;&lt;CS21) | (1&lt;&lt;CS20)) // 1/32 prescaler -&gt; 1.96kHz
  #define SPINDLE_TCCRB_INIT_MASK      (1&lt;&lt;CS22)               // 1/64 prescaler -&gt; 0.98kHz (J-tech laser)

  // NOTE: On the 328p, these must be the same as the SPINDLE_ENABLE settings.
  #define SPINDLE_PWM_DDR     DDRB
  #define SPINDLE_PWM_PORT  PORTB
  #define SPINDLE_PWM_BIT     3    // Uno Digital Pin 11

It seems that my options are 62.5 kHz, 7.8 kHz, 1.96 kHz or 0.98 kHz.
Why does it matter? Two excerpts from the Synrad manual:

Tickle frequencies [a 'keep-awake' signal at zero power] lower than 4.5 kHz may compromise laser performance, ..., and stress the RF [radio frequency] electronics thereby reducing long term reliability while tickle frequencies greater than 5 kHz may cause unintended lasing.
Because laser output follows PWM input with a rise and fall time constant of ~100 µs, the laser cannot precisely follow Command signal frequencies over t kHz with duty cycles greater than 50%.

Can anyone see a workaround for this within the constraints of the GRBL configuration?
I can only think of a hardware solution to filter the PWM out and run it through another device to convert the analog signal to a 5 kHz PWM.
Many thanks.
No, you cannot have hardware PWM at 5&nbsp;kHz on pin 11 of an Arduino
Uno. The closest you can get is 3.92&nbsp;kHz. You get that by setting
the prescaler to&nbsp;8 and configuring the timer for phase correct PWM,
instead of the fast PWM mode usually used by GRBL. Your options for
getting 5&nbsp;kHz are to use either software PWM or change the pinout.

You can get a quite accurate 5&nbsp;kHz PWM signal on pins&nbsp;3, 9
and&nbsp;10. You can do software PWM at 5&nbsp;kHz on any pin, but this
is prone to have significant jitter, which your laser may well not like.