C******************************************************************* SUBROUTINE TYPE73(TIME,XIN,OUT,T,DTDT,PAR,INFO,ICNTRL,*) C version from: 12/22/89 C SAMPLE INPUT AND OUTPUT VALUES FOLLOW THE VARIABLE DEFINITIONS C******************************************************************* C**** Subroutine represents a charge controller for a system including C**** PV-array, load and battery storage. C**** The controler represents a series type controler. C**** A blocking diode is included in the model. It prevents that the C**** battery is being discharged through the cell. It is assumed that C**** voltage drop at the diode is constant throughout the simulation C**** and just depends on the diode material used in the system. C**** The user has to provide this information as a parameter C******************************************************************* C Variables: C VB -- battery voltage [volts] C VD -- low limit on voltage, when battery discharging C VC -- high limit on voltage, when battery charging: cutoff voltage C VDA -- limit on voltage, above battery can again begin to discharge C after being charged C VCA -- limit on voltage, above battery can again begin to charge C after being discharged C VDIODE -- voltage of diode C VCELL -- voltage send to cell C VLOAD -- voltage send to load C F -- fractional state of charge C FD -- discharge limit on F C FC -- charge limit on F C FDA -- limit on F above battery can be discharged again after C being charged C FCA -- limit on F below battery can be charged again after C being discharged C IBMIN,IBMAX -- min. and max. battery current permitted C IB -- battery current C************************************************************** C C SAMPLE INPUT AND OUTPUT VALUES C C INPUT SAMPLE VALUES C XIN(1) VB 220.0 C XIN(2) IB 25.0 C XIN(3) F .9 C XIN(4) VC 225.0 C XIN(5) VD 200.0 C C PARAMETERS C PAR(1) FD .7 C PAR(2) FC 1.0 C PAR(3) FDA .72 C PAR(4) FCA .98 C PAR(5) VDA 223.0 C PAR(6) VCA 215.0 C PAR(7) IBMAX 40.0 C PAR(8) IBMIN -40.0 C PAR(9) VDIODE .7 C C OUTPUTS C OUT(1) VCELL 220.7 C OUT(2) VLOAD 220.0 C OUT(3) FAIL 0.0 C C***************************************************************** IMPLICIT NONE DOUBLE PRECISION XIN, OUT INTEGER INFO INTEGER ISTORE,NSTORE,IAV REAL TIME,T,DTDT,ICNTRL,PAR,S REAL VB,VC,VD,V,VDA,VCA,VDIODE,IB REAL F,FD,FC,FDA,FCA,IBMIN,IBMAX,FAIL REAL VCELL,VLOAD,DUMMY DIMENSION XIN(5), OUT(3), PAR(9), INFO(15) COMMON /STORE/ NSTORE,IAV,S(5000) C**** store is used to store values from previous timestep C********************************************************** INFO(6)=3 INFO(9)=0 C-------------------------------------------------------- C**** Initial call of component IF(INFO(7).LT.0)THEN C**** storage allocation INFO(10)=1 CALL TYPECK(1,INFO,5,9,0) ISTORE=INFO(10) C**** Iinitialization of auxiliary variables used in secant C**** method S(ISTORE)=0. C**** SET PARAMETERS FD=PAR(1) FC=PAR(2) FDA=PAR(3) FCA=PAR(4) VDA=PAR(5) VCA=PAR(6) IBMAX=PAR(7) IBMIN=PAR(8) VDIODE=PAR(9) DUMMY=0. C------------------------------------------------------ C**** first and following calls in time step ELSE DUMMY=S(ISTORE) C**** Following calls in time step C**** Set inputs VB=XIN(1) IB=XIN(2) F=XIN(3) VC=XIN(4) VD=XIN(5) C**** check on discharge rate IF(IB.LT.0.)THEN IF(IB.LT.IBMIN)THEN FAIL=1 ENDIF ELSE IF(IB.GT.IBMAX)THEN FAIL=2 ENDIF ENDIF C**** initially no restrictions are made, battery can either C**** be charged or discharged IF(DUMMY.EQ.0.)THEN C**** check on low limit of F and V IF((F.LT.FD).OR.(VB.LT.VD))THEN C**** load will be disconnected from battery and from cell, C**** but cell can still charge battery VLOAD=0. VCELL=VDIODE+VB DUMMY=1. C**** check on high limit of voltage ELSEIF((F.GT.FC).OR.(VB.GT.VC))THEN C**** cell will be disconnected from battery and load, C**** battery will be discharged VCELL=-333. C**** this is just a characteristic value that the cell C**** recognizes that it is being disconnected VLOAD=VB DUMMY=2. ELSE C**** no restrictions VCELL=VDIODE+VB VLOAD=VB ENDIF ELSEIF(DUMMY.EQ.1.)THEN C**** battery can only begin to discharge again, when VB is C**** greater than VDA and F is greater then FDA IF((F.LT.FDA).OR.(VB.LT.VDA))THEN VLOAD=0. VCELL=VDIODE+VB ELSE C**** no restrictions VCELL=VDIODE+VB VLOAD=VB DUMMY=0. ENDIF ELSEIF(DUMMY.EQ.2.)THEN C**** battery can only begin to charge again, when VB is C**** less than VCA and F is less than FCA IF((F.GT.FCA).OR.(VB.GT.VCA))THEN VCELL=-333. VLOAD=VB DUMMY=2. ELSE C**** no restrictions VCELL=VDIODE+VB VLOAD=VB DUMMY=0. ENDIF ENDIF ENDIF S(ISTORE)=DUMMY C**** SET OUTPUTS OUT(1)=VCELL OUT(2)=VLOAD OUT(3)=FAIL RETURN 1 END