# Configuration file for ALTREG
#
#     May 10, 2022
#     Battery system: Generic, LiFeP04, LiFeP04 (Get Home), 1, 560
#     Alternator: APS, HPI-185EXT-24
#     BMS: REC, Q BMS 16S
#     BMS notes: MUST be 'Victron' variant.  BMS directs charging, use with 'LiFeP04 Get-Home' Charge Profile.  Use RJ45 cross-over cable. Supports remote sensing of battery amps and temperature via CAN.
#
#     Protected for use only with Wakespeed products.
#     Any usage without express written permission from Thomason Jones Company LLC is strictly prohibited.
#     (c)2021 Thomason Jones Company.
#
# ALTREG config file
$CCN: 0,1,70,1,1,1,1,3,0,0,0.0,0@
# CCN Parameter 0 - Value '0' - specifies use of DIP switches for battery instance
# CCN Parameter 1 - Value '1' - sets charging device instance to 1 (default)
# CCN Parameter 2 - Value '70' - sets the priority of this charging device instance to '70'
# CCN Parameter 3 - Value '1' - allows the regulator to potentially assume role as "remote battery master"
# CCN Parameter 4 - Value '1' - specifies the shunt is connected to the battery (vice alternator)
# CCN Parameter 5 - Value '1' - enables OSEnergy status reception via CAN bus
# CCN Parameter 6 - Value '1' - enables sending NMEA2000 status messages via CAN
# CCN Parameter 7 - Value '3' - enables SMA/Victron comms AND active regulation of battery current to 0A instead of disabling alternator 
# consider changing above parameter to '2' to disble alternator charging when BMS limits charging to 0A
# CCN Parameter 8 - Value '0' - associates regulator with engine it is mounte on (default = 0)
# CCN Parameter 9 - Value '0' - selects CAN bitrrate of 250kbps (default)
# CCN Parameter 10 - Value '0.0' - causes transition to disabled mode when DC-disconnect command is recieved
# CCN Parameter 11 - Value '0' - disables battery aggregation (default)

$SCA: 0,120,0.62,0.46,0.31,0,0,0,10000,0,650,30,0,0,0@
# SCA Parameter 0 - Value '0' - specifies use of the battery sensor for battery temperature
# SCA Parameter 1 - Value '120' - specifies target upper alternator temperature of 120C
# consider lowering this for margin on alternator and connected cables (105C rating)
# SCA Parameter 2 - Value '0.62' - limits alternator current to 62% of "demonstrated capability" when not in "small" or "half-power" mode
# SCA Parameter 3 - Value '0.46' - limits alternator current to 46% of "demonstrated capability" when not in "small" mode
# SCA Parameter 4 - Value '0.31' - limits alternator current to 31% of "demonstrated capability" when not in "half" mode
# SCA Parameter 5 - Value '0' - disables pull-back factor for reducing field drive at low RPMs (see warning about ingition/run with PBF disabled)
# SCA Parameter 6 - Value '0' - disables alternator amperage capacity.  With '0', reduced power modes will scale PWM duty cycle which may or may not relate to delivered amperages
# SCA Parameter 7 - Value '0' - disables a system watts capacity which is used to protect engine or belts
# SCA Parameter 8 - Value '10000' - amps shunt ratio (50mv/500A)
# SCA Parameter 9 - Value '0' - do not flip polarity of shunt measurement
# SCA Parameter 10 - Value '650' - specifies idle RPM.  '0' enables auto determination of idle RPM and is default.
# consider making above value 0 to enable auto determination
# SCA Parameter 11 - Value '30' - specifies the delay in seconds from when first powered before applying load to engine.
# SCA Parameter 12 - Value '0' - disables critical "required sensor" checks
# SCA Parameter 13 - Value '0' - disables ignoring of critical "required sensors"
# SCA Parameter 14 - Value '0' - disables a BMS current limits

$SCT: 16,3.1707317073170733,0,1,0@
# SCT Parameter 0 - Value '16' - specifies 16 poles in the alternator (wakespeed gave this value)
# SCT Parameter 1 - Value '3.1707317073170733' - specifies the engine/alt drive ratio (based on values provided by APS)
# SCT Parameter 2 - Value '0' - disables a non-zero minimum field if using "Tach Mode" - approach anything other than "disbled" with caution
# SCT Parameter 3 - Value '1' - enables "Tach Mode" - default is '0' (disabled)
# SCT Parameter 4 - Value '0' - disable RPM triggered "half power mode"

$SCN: 0,ALTREG,1234@
# SCN Parameter 0 - Value '0' - reserved, set to '0'
# SCN Parameter 1 - Value 'ALTREG' - name used for CAN ID
# SCN Parameter 2 - Value '1234' - regulator password

$SCO: 8,0.0,2.0,0,0,0@
# SCO Parameter 0 - Value '8' - specifies the 8th Charge Profile Entry to be used
# SCO Parameter 1 - Value '0.0' - battery capacity mulitplier (against 500AH) but is overriden by CAN values given
# consider making above parameter 1.12 to match actual value (560) but also allow CAN override
# SCO Parameter 2 - Value '2.0' - corresponds to a system voltage of 2.0*12 = 24V
# SCO Parameter 3 - Value '0' - disables "lockout" which prevents changes without a master or factory reset
# SCO Parameter 4 - Value '0' - specifies default Feature-IN behavior
# this should probably be '1' so 'feature-in' = High -> normal behavior, and = Low -> force into FLOAT
# SCO Parameter 5 - Value '0' - specified default Feature-OUT behavior


$CPA:8 13.2,0,0,0@
# the '8' corresponds to the Charge Profile Table Entry that will be modified by this command
# CPA Parameter 0 - Value '13.2' - specifies voltage of 13.2 (26.4) to transition from BULK to ACCEPT (Absorption)
# CPA Parameter 1 - Value '0' - disables time/duration based exit of ACCEPT (Absorption)
# CPA Parameter 2 - Value '0' - disable current based exit of ACCEPT (Absorption)
# With the above two parameters set to zero, ACCEPT (Absorption) phase is bypassed
# CPA Parameter 3 - Value '0' - reserved, must be '0'

$CPO:8 0,0,0.0,0@
# the 8 correpsonds to the Charge Profile Table Entry that will be modified by this command
# CPO Parameter 0 - Value '0'  - disables OVER-CHARGE
# CPO Parameter 1 - Value '0' - disables OVER-CHARGE
# CPO Parameter 2 - Value '0.0' - disables OVER-CHARGE
# CPO Parameter 3 - Value '0' - disables OVER-CHARGE

$CPF:8 13.2,0,0,0,0,0.0,0@
# the 8 correpsonds to the Charge Profile Table Entry that will be modified by this command
# CPF Parameter 0 - Value '13.2' - specifies the voltage used during FLOAT
# note, consider setting the above value to '0' which will cause all charging to stop during 'FLOAT' especially if using Charge Enable to Feature-In
# CPF Parameter 1 - Value '0' - limits amps to battery to '0' during 'FLOAT'
# CPF Parameter 2 - Value '0' - disables time/duration based exit of FLOAT
# CPF Parameter 3 - Value '0' - disables a battery-discharge-amps based return to BULK
# CPF Parameter 4 - Value '0' - disables a amp-hours-discharged based return to BULK
# CPF Parameter 5 - Value '0.0' - disables a voltage based return to BULK
# This value should be like 13.1 to allow return to bulk since charging is disabled in FLOAT per change to CPF parameter 0 to '0'
# CPF Parameter 6 - Value '0' - disables an SOC based return to BULK



$CPP:8 0,0.0,0,0.0@
# the 8 correpsonds to the Charge Profile Table Entry that will be modified by this command
# CPP Parameter 0 - Value '0' - disables time/duration based exit of POST-FLOAT
# CPP Parameter 1 - Value '0.0' - disables a voltage based return to BULK
# CPP Parameter 2 - Value '0' - disables a amp-hours-discharged based return to BULK
# CPP Parameter 3 - Value '0.0' - disables charging during POST-FLOAT

$CPE:8 0.0,0,0,0@
# the 8 correpsonds to the Charge Profile Table Entry that will be modified by this command
# CPE Parameter 0 - Value '0.0' - disables EQUALIZE mode
# CPE Parameter 1 - Value '0' - disables an Amp cap while in EQUALIZE
# CPE Parameter 2 - Value '0' - disables EQUALIZE mode
# CPE Parameter 3 - Value '0' - disables amp based exiting of EQUALIZE

$CPB:8 0.0,0,2,50,0.0,5,40,25,150@
# the 8 correpsonds to the Charge Profile Table Entry that will be modified by this command
# CPF Parameter 0 - Value '0.0' - disables temperature based voltage compensation
# CPF Parameter 1 - Value '0' - stops additional compensation when batt temp is below '0'
# CPF Parameter 2 - Value '2' - disables charging if battery temp below 2C
# consider matching/corrodinating above parameter with REC BMS limits for low temp
# CPF Parameter 3 - Value '50' - disables charging if battery temp above 50C
# the wakespeed will ignore any BMS charge commands when the above limits are violated
# CPF Parameter 4 - Value '0.0' - disables battery voltage based reduced charging modes
# CPF Parameter 5 - Value '5' - if battery temp =< 5C, enter reduced charge mode
# CPF Parameter 6 - Value '40' - if battery temp >= 40C, enter reduced charge mode
# CPF Parameter 7 - Value '25' - reduced charge mode amps for nominal 500AH battery (0.05C rate)
# reduced charge overides any BMS charge commands when the above parameters dictate reduced charge mode
# CPF Parameter 8 - Value '150' - max charge rate for nominal 500AH battery (0.3C rate) 
# not clear if this parameter overrides BMS current charge limits when CAN is operational