   PID_roll.config(shortPeriod, ctrl.Kp_roll, ctrl.Ki_roll, ctrl.Kd_roll, 0.0-float(throttleMax), float(throttleMax));
 }
 
-void motor_update() {  
+void motor_update() {
   //    roll
   // fl-----fr
   // |  yaw  | pitch
   // bl-----br
 
   op_throttle = int(ctrl.throttlef);
+
   power_FL = op_throttle + op_pitch + op_roll - op_yaw;
   power_FR = op_throttle + op_pitch - op_roll + op_yaw;
   power_BR = op_throttle - op_pitch - op_roll - op_yaw;
   power_BL = op_throttle - op_pitch + op_roll + op_yaw;
   /*
+  power_FL = constrain(power_FL, 0, throttleMax);
+  power_FR = constrain(power_FR, 0, throttleMax);
+  power_BR = constrain(power_BR, 0, throttleMax);
+  power_BL = constrain(power_BL, 0, throttleMax);
   power_FL = tt.interp(power_FL, FL_tt_x, FL_tt_y, FLTTLENGTH);
   power_FR = tt.interp(power_FR, FR_tt_x, FR_tt_y, FRTTLENGTH);
   power_BR = tt.interp(power_BR, BR_tt_x, BR_tt_y, BRTTLENGTH);
   power_BL = tt.interp(power_BL, BL_tt_x, BL_tt_y, BLTTLENGTH);
   */
-  
-  //print("MP "); print(lastShortTimeMS); print(" "); print(power_FL); print(" "); print(power_FR); print(" "); print(power_BR); print(" "); print(power_BL); print("\n");
-
   esc.update(motorPin_FL, power_FL);
   esc.update(motorPin_FR, power_FR);
   esc.update(motorPin_BR, power_BR);

    pid_config();

    //GyroAngle.config( ushort FullScaleRangeDPS,
    //                  ulong deltaTime_UnitsPerSecond,
    //                  float correction_weight
    //                  bool invX, invY, invZ)
    gyro.config(2000, 1000000, 0.005, false, true, true);
    accel.config(false, true, false);//args are for inverting axis
    compass.config(152.0, 197.5, -172.5, 1.076132, 1.039761, 1.0); // see compass_calibrate()
  

// motor power output
long power_FL, power_FR, power_BR, power_BL;

// linear throttle-thrust correction
CurveRemap tt;
/* // unchanged set
#define FLTTLENGTH 2
unsigned short FL_tt_x[FLTTLENGTH] = {0,65535};
unsigned short FL_tt_y[FLTTLENGTH] = {0,65535};
#define FRTTLENGTH 2
unsigned short FR_tt_x[FRTTLENGTH] = {0,65535};
unsigned short FR_tt_y[FRTTLENGTH] = {0,65535};
#define BRTTLENGTH 2
unsigned short BR_tt_x[BRTTLENGTH] = {0,65535};
unsigned short BR_tt_y[BRTTLENGTH] = {0,65535};
#define BLTTLENGTH 2
unsigned short BL_tt_x[BLTTLENGTH] = {0,65535};
unsigned short BL_tt_y[BLTTLENGTH] = {0,65535};
*/
/* // mapped set
#define FLTTLENGTH 14
unsigned short FL_tt_x[FLTTLENGTH] = {0,1843,25384,25465,26711,32691,37411,44993,45244,47404,53389,60687,62966,65535};
unsigned short FL_tt_y[FLTTLENGTH] = {3359,4022,29892,30626,31276,37814,41815,47131,47705,48586,52278,56283,58021,59281};
