Answer Question
Custom component using Fortran
I am trying to develop a current hysteresis controller using FORTRAN in PSCAD. I am trying to make a comparison between a measured current with the reference current upper band, but it is not working, PSCAD tells me that the measured current is not a parameter, computation or constant.
Inputs are Ia, Imax
Outputs are gate1
The script is appended below:
#LOCAL REAL iref #LOCAL REAL iup #LOCAL REAL ilow iref = $Imax*SIN(TWO_PI*60*TIME) iup = iref + iref*0.1 ilow = iref - iref*0.1 #IF $Ia > iup $gate1 = 0 #ELSE $gate1 = 1 #ENDIF !
Inputs are Ia, Imax
Outputs are gate1
The script is appended below:
#LOCAL REAL iref #LOCAL REAL iup #LOCAL REAL ilow iref = $Imax*SIN(TWO_PI*60*TIME) iup = iref + iref*0.1 ilow = iref - iref*0.1 #IF $Ia > iup $gate1 = 0 #ELSE $gate1 = 1 #ENDIF !