 /**************************************/
 /*                LOOP                 /
 /**************************************/
-void loop()
-{
+void loop(){
 //wait for mqtt commands
 //send out mqtt status
 calculateRPM();
 discSlipCheck();
+lockedRotorCheck();
 //if commanded != actual caution torque slip
 //if commanded != actual over time, report full error
 now = millis();

    }
  }

void motionControlStart(){}
//enable start relay
//check for rotation within x seconds
//rotation state yes
//current rotation value xx
//if rotation doesn't start, report error

void motiionControlStop(){}
//disable start relay

//current rotation value 00
//if rotation doesn't stop, report error

void discSlipCheck(){
    if (rpm < (DESIREDRPM_TABLE - ROTATIONVARIANCE)){
        discSlipPrecond++;
        }
    else
        if (discSlipPrecond > 0){
        discSlipPrecond--;
        }
    if (discSlipPrecond > DISCSLIPCOUNT){
    //SEND MQTT MESSAGE HERE
    // "Caution! - Disc Slip Detected"
    //
    }
}

void lockedRotorCheck(){
    if (rpm <= LOCKEDDISCRPM){
        digitalWrite(STARTRELAYPIN, LOW); // immediately shut down if RPM lowByte
        }                                 // disc is stuck or stopped 
        //SEND MQTT MESSAGE HERE "WARNING! Disc has stopped rotation"
              
}

void allStop(){
    digitalWrite(STARTRELAYPIN, LOW);
    // wait here until MQTT command to restart or system power cycle
    //motionControlStart();
    