         digitalWrite(motor_left_forward, LOW);
         digitalWrite(motor_left_backward, HIGH);
     }
+    //configuring up motor PWM
+    motor_up_pwm = byte(abs(motor_up_speed));  
+    if(motor_up_speed >= 0){
+        digitalWrite(motor_up_forward, HIGH);
+        digitalWrite(motor_up_backward, LOW);
+    }
+    else{
+        digitalWrite(motor_up_forward, LOW);
+        digitalWrite(motor_up_backward, HIGH);
+    }
     Serial.write(motor_right_pwm);
     Serial.write(motor_left_pwm);
+    Serial.write(motor_up_pwm);
     Serial.flush();   
   }
 }

  else return -1.0;
}

float compute_Right_Wheel_Raw_Speed(float value_x, float value_y){
  return (X_factor*value_x - Y_factor*value_y*sign(value_x));
}

float compute_Left_Wheel_Raw_Speed(float value_x, float value_y){
  return (X_factor*value_x + Y_factor*value_y*sign(value_x));
}

float compute_Right_Wheel_Speed(float value_x, float value_y){
    return map(compute_Right_Wheel_Raw_Speed(value_x, value_y), min_right, max_right,-MOTOR_MAX_PWM,MOTOR_MAX_PWM);
}

float compute_Left_Wheel_Speed(float value_x, float value_y){
  return map(compute_Left_Wheel_Raw_Speed(value_x, value_y), min_left, max_left,-MOTOR_MAX_PWM,MOTOR_MAX_PWM);
}

//
void compute_Resize_Parameters(){
   min_right = compute_Right_Wheel_Raw_Speed(-100.0, -100.0);
   max_right = compute_Right_Wheel_Raw_Speed(100.0, -100.0);
   min_left = compute_Left_Wheel_Raw_Speed(-100.0, 100.0);
   max_left = compute_Left_Wheel_Raw_Speed(100.0, 100.0);   
}


void setup() {
 Serial.begin(9600);
 Serial.flush();
 pinMode(motor_right_forward, OUTPUT);
 pinMode(motor_right_backward, OUTPUT);
 pinMode(motor_left_forward, OUTPUT);
 pinMode(motor_left_backward, OUTPUT); 

 digitalWrite(motor_right_enable, LOW);
 digitalWrite(motor_left_enable, LOW);
 compute_Resize_Parameters();
}

void loop() {
  
    analogWrite(motor_right_enable, motor_right_pwm);
    analogWrite(motor_left_enable, motor_left_pwm);
    delay(100);
}

void serialEvent(){

float max_right;
float min_left;
float max_left;
float min_up;
float max_up;

const long interval = 200;     
long previousMillis = 0;
