# autoexec.mi for unit 730
					
# Date		e-mail address			comment
# 07-28-2018    craig.loescher@teledyne.com     initial setting
# 08-24-2018	cedwards@skio			renamed, comms #, included vehicle, cal, S/N info from TWRC
# 10-24-2018	cedwards@skio			turned off altimeter filtering by default
# 05-16-2019	cedwards@skio			adding options for battery capacity

name angus

# SERIAL NUMBER RECORD						

# Forward section assy	#0109
# Payload bay assy	#1281
# Aft section assy	#123
# Aft electronic assy	#122
# Aft end cap assy	#121
# Radomefin		#1074
# Pressure transducer	#116209
# Aft hull		#1785
# Fwd hull		#1783
# Freewave master	#961-9927
# Iridium sim card	#8988169234002325199 / MetOcean
# Argos ID		#176869-dec / 4549F5F-hex
# Altimeter		#4100192
# Pitch motor		#166
# 200- Ballast drive	#112
# 1000- Motor controller#NA
# 1000- Pump assy	#NA
# 1000- Valve assy	#NA
# Science persistor	#1598
# science motherboard	#JJ00867
# Science flashcard	#1074
# seabird CTD		#712-9447
# Main board		#0119
# Communication board	#JJ036410
# Iridium phone		#0143
# Main flashcard	#1037
# Main persistor	#1553
# Attitude sensor	#40793
# Air pump		#
# Communications Assy	#0827
# Freewave Slave	#962-1166
# GPS			#1323
# Argos X-cat		#1072
# Air bladder		#1654




#INSTALLED DEVICES						

installed buoyancy_pump
#installed de_pump
#installed hd_pump
installed gps
installed attitude_rev
installed ocean_pressure
installed vacuum
installed battery
installed argos
installed air_pump
installed pitch_motor
installed science_super
installed digifin
installed altimeter
installed iridium
installed recovery
installed coulomb
installed leakdetect
installed veh_temp
installed thruster

#VEHICLE SETTINGS

# Depth Ratings
# Max working depth: 31 for 30m glider, 102 for 100m, 206 for 200m, 360 for 350m, 1050 for 1000m
  sensor: F_MAX_WORKING_DEPTH(m)		155

# Crush Depth: 225 for 30m, 100m, 200m, and 1200 for 1000m
  sensor: F_CRUSH_DEPTH(m)			225   
					
# UNCOMMENT THIS WHEN FLYING A DEEP GLIDER IN SHALLOW WATER
# Reduce this so sensor_processing doesn't think that our dive is a hover!
# sensor: u_hovering_frac_nom_dive_rate(nodim)	0.15

# Required to be above this depth to be considered at surface 
# 4 for G2 glider in shallow water, 7 for G2 glider in deep water
  sensor: u_reqd_depth_at_surface(m)		4

# Disable this in shallow water
  sensor: u_alt_filter_enabled(bool)       	0 		# enable median filter depth for altitude

# Altimeter model, 0 for Benthos and 1 for Airmmar, -1 for experimental
  sensor: f_altimeter_model(enum)		1		# airmar(mod1)

# Argos format 
  sensor: f_argos_format(enum)			1		# 0  rev0 legacy/smartcat (32 byte)
								# 1  rev1 Mar05/xcat  (31 byte)
# current correction on
  sensor: u_use_current_correction(nodim)	1

# Coulomb Counter scale factor DO NOT CHANGE UNLESS DIRECTED TO BY GLIDER SUPPORT.
  sensor: f_coulomb_calibration_factor(%)  	.050 		# calibration factor for the
  sensor: f_coulomb_battery_capacity(amp-hr)	215		# rechargeable lithiums
                                             			# onboard coulomb counter
# Clock Source- 
  sensor: f_clock_source(enum)                    1             #  1 - Use DS3234 RTC (new hardware only G2)
                                                                #  defines the real time clock source.
                                                                #  0 - Use the RTC provided by the persistor (G1)

#IRIDIUM PHONE NUMBERS
						

# IRIDIUM PHONE
# The alternate number is configurable to be available
# In the event of shore side failure resulting in inability
# to complete an iridium call.  Software will "toggle"
# to the alternate number and remain there until told
# otherwise.  Both numbers MUST be uncommented or the masterdata
# default will be used.

#############################PLEASE REMOVE THIS SECTION BEFORE SHIPPING#######################################
# For a commercial card:                                               
  sensor: c_iridium_phone_num(digits)              881600005168       # SkIO RUDICS !no spaces!
  sensor: c_iridium_phone_num_alt(digits)          15085630108       # TWR phone number !no spaces!
#  sensor: c_iridium_phone_num_alt(digits)          15085630109       # TWR phone number !no spaces!
  sensor: c_iridium_lead_zeros(nodim)                  2            # number of leading zeros in phone        
                                                                    # typically 2 for both commercial or military
#############################PLEASE REMOVE THIS SECTION BEFORE SHIPPING#######################################
# For a commercial card:                                               
# sensor: c_iridium_phone_num(digits)              17818711614      # https://sfmc.webbresearch.com or enter users #here
# sensor: c_iridium_phone_num_alt(digits)          17818711051      # datahost https://datahost.webbresearch.com/
# sensor: c_iridium_lead_zeros(nodim)                  2            # number of leading zeros in phone        
                                                                    # typically 2 for both commercial or military
#############################PLEASE REMOVE THIS SECTION BEFORE SHIPPING#######################################
# For a military card:(IN HOUSE TEST)				
# sensor: c_iridium_phone_num(digits)		  6975085630108     # TWR dockserver phone number !no spaces!
# sensor: c_iridium_phone_num_alt(digits)	  6975085630109	    # TWR dockserver phone number !no spaces!
# sensor: c_iridium_lead_zeros(nodim)		       2	    # number of leading zeros in phone 	
								    # typically 2 for both commercial or military
##############################################################################################################
# For a military card:				
# sensor: c_iridium_phone_num(digits)		  6975085632930	    # TWR's LBS dockserver phone number !no spaces!
# sensor: c_iridium_phone_num_alt(digits)	  6975085632029	    # TWR's LBS dockserver phone number !no spaces!
# sensor: c_iridium_lead_zeros(nodim)		       2            # number of leading zeros in phone 	
								    # typically 2 for both commercial or military


#VEHICLE CALIBRATIONS

# Oil volume (deep pump only)
  sensor: f_de_oil_vol_pot_voltage_min(volts)	0.342		# raw AD voltage of fully retracted pot
  sensor: f_de_oil_vol_pot_voltage_max(volts) 	1.932		# raw AD voltage of fully extended pot
  sensor: f_de_oil_vol_in_system(cc)            960             # volume of internal oil reservoir
  sensor: f_de_oil_vol_safety_max(cc)           460.0           # shouldn't go beyond this

# 3 way valve
  sensor: f_valve_restrict(int)                    1174		# ballvalve AD reading at restrict
  sensor: f_valve_open(int)                        3257		# ballvalve AD reading at open
  sensor: f_valve_tolerance(int) 		   160           # +/- tolerance hitting the spot	


# Buoyancy pump (shallow pump only)
  sensor: f_ballast_pumped_nominal_vel(cc/sec)	35		# in, nominal speed, 126 for 30m, 42 for 100m, 26 for 200m
  sensor: f_ballast_pumped_safety_max(cc)	555.0		# in, damage to glider
  sensor: f_ballast_pumped_deadz_width(cc)	20.0		# in, sets x_ limit
  sensor: f_ballast_pumped_db_frac_dz(nodim)	1.0		# deadband as fraction of dead zone
  sensor: f_ballast_pumped_cal_m(cc/Volt)	762.000		# in, slope
  sensor: f_ballast_pumped_cal_b(cc)		-586.580	# in, y-intercept
  sensor: u_ballast_pumped_stop_distance(cc)	4		# in, stopping distance after motor off
		

# Battery Position
# max battpos = safety_max - deadzone
# x_max_battpos = f_safety_max_battpos - f_deadzone_width_battpos
  sensor: f_battpos_deadzone_width(inches)	0.2		# Sets x_ limit
  sensor: f_battpos_db_frac_dz(nodim)		0.5		# deadband as fraction of dead zone
  sensor: f_battpos_nominal_vel(inches/sec)	0.15		# nominal speed for REV.A motor
								# Specs linear relationship between sensor units (inches) and the		
								# voltage we actually read out of the AD for position         
								# battpos(inches) = _cal_m(inches/Volt) * volts + _cal_b(inches
#UNCOMMENT THE CALIBRATION NUMBERS FOR THE GLIDER CONFIGURATION
# sensor: f_battpos_safety_max(inches)		1.1		# in, damage to glider(1000m Lithium)
# sensor: f_battpos_cal_m(inches/Volt)		2.169		# slope
# sensor: f_battpos_cal_b(inches)		-1.581  	# y-intercept(1000m Lithium)

# sensor: f_battpos_safety_max(inches)		1.625		# in, damage to glider(1000m Alkaline)
# sensor: f_battpos_cal_m(inches/Volt)		2.169		# slope
# sensor: f_battpos_cal_b(inches)		-1.581		# y-intercept(1000m Alkaline)

  sensor: f_battpos_safety_max(inches)		1.1		# in, damage to glider(200m Lithium)
  sensor: f_battpos_cal_m(inches/Volt)		2.20		# slope
  sensor: f_battpos_cal_b(inches)		-1.786 		# y-intercept(200m Lithium)

# sensor: f_battpos_safety_max(inches)		1.625		# in, damage to glider(200m Alkaline)
# sensor: f_battpos_cal_m(inches/Volt)		2.169		# slope
# sensor: f_battpos_cal_b(inches)		-1.518		# y-intercept(200m Alkaline)


# vacuum
  sensor: u_vacuum_cal_m(inHg/Volt)		-13.571		# Factory Calibration data
  sensor: u_vacuum_cal_b(inHg)			30.377		# inHg = m V + b

# ocean_pressure
  sensor: f_ocean_pressure_full_scale(bar)	140.000		# pressure @ FS volts (140 for 2000A, 24 for 300A)
  sensor: f_ocean_pressure_min(volts)		0.084		# voltage for 0 pressure
  sensor: f_ocean_pressure_max(volts)		1.557		# voltage for FS pressure

# max fin = safety_max - deadzone
  sensor: f_fin_safety_max(rad)			0.470		# in, damage to glider.
  sensor: f_fin_deadzone_width(rad)		0.02		# in, Sets x_ limit

  sensor: c_thruster_current_cal(nodim) 	0.0407		# A / count cal for thruster current. 08-02-2018 CL

#PAYLOAD BAY SETTINGS AND CALIBRATIONS				

# Turns science computer on
  sensor: c_science_on(bool)			1 


#sensor specific calibration constants for FLBBCDSLC SN 5103

  sensor: u_flbbcd_chlor_cwo(nodim)     	44		 # clean water dark offset, nodim == counts
  sensor: u_flbbcd_bb_cwo(nodim)         	45		 # clean water dark offset, nodim == counts
  sensor: u_flbbcd_cdom_cwo(nodim)       	47		 # clean water dark offset, nodim == counts
  sensor: u_flbbcd_chlor_sf(ug/l/nodim)  	0.0073		 # scale factor to get units
  sensor: u_flbbcd_bb_sf(Mnodim)         	1.908   	 # scale factor to get units
  sensor: u_flbbcd_cdom_sf(ppb/nodim)    	0.0902		 # scale factor to get units
  sensor: u_flbbcd_is_calibrated(bool) 	 	1		 # set to 1 after entering 
                                         			 # calibration constants
