         */
         
         //QUAD X SETUP
+        if (pidoutC > 100.0) { pidoutC = 100.0;}
+        if (pidoutC < -100.0) { pidoutC = -100.0;}
         motorCommand[0] = recieverThrotttle - pidoutA - pidoutB + pidoutC; 
         motorCommand[1] = recieverThrotttle - pidoutA + pidoutB - pidoutC; 
         motorCommand[2] = recieverThrotttle + pidoutA + pidoutB + pidoutC; 

      //this should be 90degrees when flat, or 0 error, so we do offset. PI/2 below
      pidoutA = pid_A_calcPID(angle(arm0, downvec), PI/2 + ((PI*0.25) * (recieverPitch/500)), deltatimeseconds);  //WHITE   FRONT  PITCH/ELEV
      pidoutB = pid_B_calcPID(angle(arm1, downvec), PI/2 + ((PI*0.25) * (recieverRoll/500)), deltatimeseconds);   //RED     LEFT   ROLL
      pidoutC = pid_C_calcPID(headingdiff, (PI*0.35) * (recieverYaw/500), deltatimeseconds);      //GREEN   UP     YAW 

      pidoutA = pidoutA * recieverPIDratio;
      pidoutB = pidoutB * recieverPIDratio;
      pidoutC = pidoutC * recieverPIDratio;

    }
      
    
    //do proportional control. SEE stabilisation.ino and api.ino
    if (armed == 1) {           
        digitalWrite(STATUSLED_RED, HIGH);
        /*
        //QUAD + SETUP
        motorCommand[0] = recieverThrotttle + pidoutA + pidoutC; 

    recieverYaw = (recieverYaw * 0.7) + (((double) getRawChannelValue(4)-1500)*0.3);    
    

    

    recieverPIDratio = (double) getRawChannelValue(6); //TURN KNOB
    recieverPIDratio = ((recieverPIDratio - 1500)/500)+1;

