//////////////////////////////////////////////////////////////////////
// Bluefin proprietary source code. Copyright (C) Bluefin Robotics Co.
// and its licensors.
// 
// FILENAME: bpauvTailCone.cfg
// PURPOSE: List of BPAUV tailcone parameters, such as actuator geometry.
// AUTHOR:  dgreen
// DATE:    7/11/00
//
// NOTES:  
//  for explanation of meaning of these constants 
//  see the file tailcone_transform.mcd in the software
//  documentation folder of the Starteam repository.
//  for BPAUV and the stp100 + sv203 manuals
// MODS:
//
////////////////////////////////////////////////////////////////////


//speedPerRpm = 0.005;      // Waterspeed (m/sec) per prop rpm

// PROPELLER CONSTANTS
  propPitch = .05 ;         //Meters per radian               
  maxDeltaThrottle = 5;    // maximium allowed change in throttle position per call to setThrottlePos
  propeller_board_num = 1;       // board number of the pontech sv203 propller motor controller  
  minThrottlePos = 63;          // full reverse throttle position for sv203
  maxThrottlePos = 189;         // full ahead throttle position on sv203


//  RUDDER CONSTANTS
 rudder_board_num = 2;        // board number of the stp100 rudder controller
 rudder_L1 = 0.333;           // meters	
 rudder_L2 = 0.075;	      // meters
 rudder_R0 = 0.302;	      // meters 
 rudder_Theta_zero = 1.045;   // radians 
 maxRudderAngle = 0.1744;      // radians
 minRudderAngle = -0.1744;     // radians	
 rudderStepDelay = 400;       // delay units
 rudderMinStepDelay = 400;  
 rudderAccel = 10;              
 rudderHome = 137;	      // AD1 value when rudder at home
 rudderPot1CntsToSteps = 22;

//  ELEVATOR CONSTANTS
 elevator_board_num = 3;      // board number of the stp100 elevator controller
 elevator_L1 = 0.35;          // meters
 elevator_L2 = 0.076;         // meters
 elevator_R0 = 0.311;         // meters
 elevator_Theta_zero = 0.936; //0.936; radians
 maxElevatorAngle = 0.209;    // radians	 
 minElevatorAngle = -0.209;   // radians	
 elevatorStepDelay = 400;     // delay units
 elevatorMinStepDelay = 400;  
 elevatorAccel = 10;            
 elevatorHome = 123;          // was 123 AD1 value when elevator at home
 elevatorPot1CntsToSteps = 23;


//
// The following motor constants are scaled for the fixed-point micro code,
// and must be 16 bit integers. The control gains include the sampling period 
// where required.  That is Ki-here = Ki-cont*Ts, and Kd-here = Kd-cont/Ts.
//
//  motorKmInv = 1236;         // (10e-4 pwm counts)/(rpm) Loaded (Operational)   
  motorKmInv = 800;         // (10e-4 pwm counts)/(rpm) Loaded (Operational)   
//  motorKmInv = 2048;

//  motorKmInv = 758;          // (10e-4 pwm counts)/(rpm) No load (In lab)
//  motorKmInv = 758;          // (10e-4 pwm counts)/(rpm) No load (In lab)
  motorKp    = 50;            // Position gain, (10e-4 counts)/(prop rpm)v
  motorKi    = 50;          // Integral gain, (10e-4 counts)/(prop rpm)
//  motorKi    = 0;          // Integral gain, (10e-4 counts)/(prop rpm)
  motorIntLimit = 2000;
//  motorKi    = 0;            // Integral gain, (Kp,Ki,Kd)=0 => OPEN LOOP
  motorKd    = 200;            // Rate gain, (10e-4 pwm counts)(prop rpm)
//  motorKd    = 0;            // Rate gain, (10e-4 pwm counts)(prop rpm)
  debug = False;
