 
 const byte EEPROM_ID = 0x99;  // used to validate EEPROM initialized
 
-double pwm_val = xv_config.pwm_min;  // start slow
+double pwm_val;
 double pwm_last;
 double motor_rpm;
 
+boolean debug_motor_rpm = false;
 boolean motor_enable = true;
-
-PID myPID(&motor_rpm, &pwm_val, &xv_config.rpm_setpoint,xv_config.Kp,xv_config.Ki,xv_config.Kd, DIRECT);
+boolean retransmit = true;
+
+PID rpmPID(&motor_rpm, &pwm_val, &xv_config.rpm_setpoint, xv_config.Kp, xv_config.Ki, xv_config.Kd, DIRECT);
 
 int inByte = 0;  // incoming serial byte
 unsigned char data_status = 0;

  }
  else {
    Serial.print("Setting Kp to: ");
    Serial.println(sVal);    
  }
}


}

void initSerialCommands() {
  sCmd.addCommand("help",       help);
  sCmd.addCommand("Help",       help);
  sCmd.addCommand("GetConfig",  getConfig);
  sCmd.addCommand("SaveConfig", saveConfig);
  sCmd.addCommand("ResetConfig",initEEPROM);

  sCmd.addCommand("SetRPM",  setRPM);
  sCmd.addCommand("SetKp",   setKp);
  sCmd.addCommand("SetKi",   setKi);
  sCmd.addCommand("SetKd",   setKd);

  sCmd.addCommand("ShowRPM",       showRPM);
  sCmd.addCommand("HideRPM",       hideRPM);
  sCmd.addCommand("MotorOff",      motorOff);
  sCmd.addCommand("MotorOn",       motorOn);
  sCmd.addCommand("RetransmitOff", retransmitOff);
  sCmd.addCommand("RetransmitOn",  retransmitOn);

  // XV Commands  
  sCmd.addCommand("GetPrompt",  getPrompt);
  sCmd.addCommand("GetVersion",  getVersion);
}

void showRPM() {
  debug_motor_rpm = true;
  Serial.println("Showing RPM data");
}

void hideRPM() {
  debug_motor_rpm = false;
  Serial.println("Hiding RPM data");
}

void motorOff() {
