Using Arduino Uno to control BLDC motor

I’m trying to run a 500W 48V BLDC motor. The microcontroller that I’m using is arduino Uno. A0 is use for the throttle input, while A1-A3 is use for hall effect sensor. My design and coding works, however, I’m looking for ways to increase the PWM gradually instead of setting the PWM initially and causing the motor to turns harshly the moment the throttle was increased. Please take a look at my coding.

//Thumb throttle
const int potPin = A0; // Analog input pin that the thumb throttle is attached to
int potValue = 0;
int speed = 0;

//hall effect pin setup
int hall_sensor_A = A1;
int hall_sensor_B = A2;
int hall_sensor_C = A3;

//3-Phase signal pin setup
//PWM pin used will be pin 11,10 and 9 with the frequency of 31250Hz
const int A_motor_pwm_hout = 11;
const int A_motor_lout = 7;
const int B_motor_pwm_hout = 10;
const int B_motor_lout = 6;
const int C_motor_pwm_hout = 9;
const int C_motor_lout = 5;

enum WheelDirection
{
DIR_FORWARD,
DIR_STOP,
}
dir;

void MoveWheel(WheelDirection (dir), int (speed))
{
//empty all motor registers
//half bridge driver, hi part is active high
// lo part is active high
analogWrite(A_motor_pwm_hout, 0);//set motor to stop
analogWrite(B_motor_pwm_hout, 0);
analogWrite(C_motor_pwm_hout, 0);

digitalWrite(A_motor_lout, LOW);
digitalWrite(B_motor_lout, LOW);
digitalWrite(C_motor_lout, LOW);

//read the hall sensor
int hall_A = digitalRead(hall_sensor_A);
int hall_B = digitalRead(hall_sensor_B);
int hall_C = digitalRead(hall_sensor_C);

if (dir == DIR_STOP)
{
// do nothing
}

else if (dir == DIR_FORWARD)
{
//commutation of BLDC(the drive)
if (hall_A == 1 && hall_B == 0 && hall_C == 1)
{//101
analogWrite(A_motor_pwm_hout, speed);
digitalWrite(B_motor_lout, HIGH);
}

else if (hall_A == 0 && hall_B == 0 && hall_C == 1)
{//001
analogWrite(C_motor_pwm_hout, speed);
digitalWrite(B_motor_lout, HIGH);
}

else if (hall_A == 0 && hall_B == 1 && hall_C == 1)
{//011
analogWrite(C_motor_pwm_hout, speed);
digitalWrite(A_motor_lout, HIGH);
}

else if (hall_A == 0 && hall_B == 1 && hall_C == 0)
{//010
analogWrite(B_motor_pwm_hout, speed);
digitalWrite(A_motor_lout, HIGH);
}

else if (hall_A == 1 && hall_B == 1 && hall_C == 0)
{//110
analogWrite(B_motor_pwm_hout, speed);
digitalWrite(C_motor_lout, HIGH);
}

else if (hall_A == 1 && hall_B == 0 && hall_C == 0)
{//100
analogWrite(A_motor_pwm_hout, speed);
digitalWrite(C_motor_lout, HIGH);
}
}
}

void setup()
{
Serial.begin(9600);

//setting the PWM frequency
TCCR1B = TCCR1B & B11111000 | 0X01; //timer 1 (D9 and D10) to 31250 Hz
TCCR2B = TCCR2B & B11111000 | 0X01; //timer 2 (D9 and D10) to 31250 Hz

pinMode(potPin, INPUT);

//hall sensor as input
pinMode(hall_sensor_A, INPUT);
pinMode(hall_sensor_B, INPUT);
pinMode(hall_sensor_C, INPUT);

//Output pin setup
pinMode(A_motor_pwm_hout, OUTPUT);
pinMode(A_motor_lout, OUTPUT);
pinMode(B_motor_pwm_hout, OUTPUT);
pinMode(B_motor_lout, OUTPUT);
pinMode(C_motor_pwm_hout, OUTPUT);
pinMode(C_motor_lout, OUTPUT);
}

void loop()
{
//reading and mapping the input
potValue = analogRead(potPin);
speed = map(potValue, 200, 580, 2, 204); //80% duty cycle
Serial.println(potValue);

WheelDirection dir;

if (speed > 2)
{
dir = DIR_FORWARD;
}
else if (speed<=2)
{
dir = DIR_STOP;
}
MoveWheel(dir, speed);

//to disp pot val
Serial.println(analogRead(A0));
delay(2);
}