SYSTEM_NAME = "FIDO Production SN 02"  # change to name once written to Flash drive

FILTEROFFSET = -0  # this is the offset from where "filter" lands and the puck at the center of the clamp
ARMBACKOFF = 1000  # how far the arm should move after the clamp has grabbed the puck

PICKPLUS = 100    # how far to shift the cylinder after first attempt at acquiring puck
PICKMINUS = -100  # how far to shift the cylinder after second attempt at acquiring puck

# Pick position + this many counts to move arm suction cup against puck
GRABATCYL_OFFSET = -2000


SYSTEMVOLTAGE = (41.0/4096.0)           # Counts to volts
SYSTEMCURRENT = (3.3/(0.1275*4096.0))   # Counts to amps

# pressure sensor calibration
PRESS0_PLOW = 0      # zero reading PSI
PRESS0_PHIGH = 12    # max reading PSI
PRESS0_CLOW = 740    # counts at reading zero
PRESS0_CHIGH = 3592  # counts at max reading

# nitrogen pressure sensor calibration (channel 1)
PRESS1_PLOW = 0      # zero reading PSI
PRESS1_PHIGH = 20    # max reading PSI
PRESS1_CLOW =  744   # counts at reading zero
PRESS1_CHIGH = 2850  # counts at max reading

# Flow sensor calibrations.
VOLUME_UNITS = 2.22585E-08   # flow sensor volume units per count
VOLUME_OFFSET = 1000.0       # from flow calibration spreadsheet
VOLUME_COUNTER_FREQ = 14686  # this is 80MHz/(PSC+1) for timer 3
VOLUME_COUNTER_PSC = 5446    # this is PSC for above

# polynomial values for the force resistor,
# calibrated for each force sensor serial number
FORCESN = "28"    # if this stays at "00", the code will not run.
FORCEA = 1.0e-5  # This and the FORCE must be updated on the Flash drive with
FORCEB = 0.0293625  # the correct values for the coeffience of the
FORCEC = -48.73641   # installed Force Resistor in the clamp

# Calibration information for distance sensor, specific to each unit
# New Puck Counter Calibration Parameters
# These values are set during calPuck() calibration process
# Default values until calibration is performed
# Note: Scale numerator is constants.PHYSICAL_DISTANCE_MM (213mm)
PUCK_COUNTER_SCALE_DENOMINATOR = -200  # Default placeholder
PUCK_COUNTER_OFFSET_COUNTS = 221  # Default placeholder

# Liquid reagent pump calibration (shared by preservative and decontaminant)
LIQUID_REAGENT_COUNTS_PER_MICROL = 21.333333  # Stepper counts per microliter
LIQUID_REAGENT_PACE_RATE = 3750000  # Base pace rate for pump speed calculation

# Nitrogen delivery calibration (use uL/sec for unit consistency with liquids)
NITROGEN_UL_PER_SECOND = 1525.0  # Flow rate in uL/sec when valve is open (placeholder - needs calibration)

# Nitrogen pressurization volume (fixed volume, not time-based)
# This represents the volume of nitrogen consumed when pressurizing the sample pathway
# Used conservatively for all pressurization events (pathway alone or with puck in place)
# Value is empirical and should be calibrated by measuring cylinder consumption for empty pathway
NITROGEN_SAMPLE_PATHWAY_VOLUME_UL = 6500  # Volume to pressurize sample pathway (placeholder - needs calibration)