Generating a PWM signal,Frequency 20kHz ,Phase shif

int pot = 0;
int set = 0;
	void setup()    {

	TCCR2A = TCCR2A | 0x30;
	TCCR2B = TCCR2B & 0xF8 | 0x01;

					}

void loop() {
  
  pot =127 - (analogRead(A0) / 8);
 set = 127 - pot; 
 
  analogWrite(3, set -127);
  analogWrite(11, pot);
  
			}

input 0 V duty cycle 50%

input 1 V duty cycle 40%

input 2 V duty cycle 30%

According to the code, I need to adjust frequency to 20kHz. How can I modify the code ?

in0.jpg

in1.jpg

in2.jpg

This is a cross-posting, original thread here: I need to adjust frequency to 20kHz - Motors, Mechanics, Power and CNC - Arduino Forum

Please do not cross-post.

And read my signature!