1

communication between geenric electric model and UDM PPC

  • retag add tags

I have a question in regard to writing a script for a UDM PPC in PSSE.
I am trying to establish a communication between a UDM PCC that I am modeling as a renewable machine plant control and a generic electric model in PSSE by using a REECCU1 and REGCA1. I am using the following in Fortran for PSSE35: In mode 3:

        CALL WINDMIND(NUMBUS(IB),'1','WELEC','VAR',LREEC,IERR) !WINDMIND
        MC = WNDNUM(I)
        WQCMND(MC) = VOUTQ
        WPCMND(MC) = VOUTP

and in mode 1: CALL WINDMIND(NUMBUS(IB),'1','WELEC','VAR',LREEC,IERR) !WINDMIND MC = WNDNUM(I) VOUTQ = WQCMND(MC) VOUTP = WPCMND(MC)

i am getting initial conditions dstate suspect from the generator and electric model. Parameters are not transferred to the electric model still. So I have my VARs in my PCC stay zero after a dynamic simulation. I think the syntax is wrong, and the PSSE manual was not clear in this regard. thanks!

sara's avatar
11
sara
asked 2025-08-18 06:20:59 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

2 Answers

1

You need to use the GENCHK function to find the machine index and then send the P,Q commands to the WPCMND, WQCMND arrays.

In your description, it only finds the starting VAR location. This isn't needed. Use this:

CALL GENCHK(ICON(M),ID,MC,'GEN NOT FOUND)

Icon (m) is the bus where your machine is located, ID is machine id to which the wind gen is connected.

MC gets the machine index, now get the wind machine index WMC = WNDNUM(MC)

WPCMND(WMC) = VOUTP, WQCMND(WMC) = VOUTQ

Hope this helps.

pk123's avatar
11
pk123
answered 2025-08-18 08:25:53 -0500, updated 2025-08-18 08:26:11 -0500
edit flag offensive 0 remove flag delete link

Comments

Thanks for the reply. I am still getting the same results. This is how I am implementing it: In mode 1 CALL GENCHK(NUMBUS(IB),'1',MC,'GEN NOT FOUND') WMC = WNDNUM(MC) VOUTP = WPCMND(WMC) VOUTQ = WQCMND(WMC) In mode 3: CALL GENCHK(NUMBUS(IB),'1',MC,'GEN NOT FOUND') WMC = WNDNUM(MC) WQCMND(WMC) = VOU

sara's avatar sara (2025-08-18 10:06:59 -0500) edit

When you call GENCHK inside MODE 1, MC becomes a local integer confined to MODE 1. You need to call GENCHK and obtain WMC before entering the MODEs.

psys's avatar psys (2025-08-19 04:47:36 -0500) edit
add a comment see more comments
0

Thank you very much Abdul for your explanations. I am facing a similar problem, as I am trying to implement a proprietary electric control for the WTG1. Based on the example in the POM (which I tested successfully for an exciter model), I tried to test a basic model (with constant states) for the renewable machine. However, neither the states of the model are initialized properly, nor the WP/WQ commands are set correctly.

The code of the UDM is:

C
  SUBROUTINE ELECCON(I,ISLOT)

  INCLUDE'COMON4.INS'
  INTEGER I,ISLOT,WMI

  EXTERNAL BADMID,DOCUHD
  INTEGER IB, J, K, L, IBUS, JJ
  LOGICAL NEW
  CHARACTER IM*2

  IF (MODE.EQ.8)
  .  CON_DSCRPT(1) ='Tr'
  .  CON_DSCRPT(2) ='K'
  .  CON_DSCRPT(3) ='Te'
  .  RETURN
  ...FIN

  J=WSTRTIN(1,ISLOT) 
  K=WSTRTIN(2,ISLOT) 
  L=WSTRTIN(3,ISLOT)

  CALL GENCHK(1,'1',MC,'GEN NOT FOUND')
  WMI = WNDNUM(MC)

  IB=NUMTRM(I) 
  IF (IB.LE.0) RETURN 
  IF (MIDTERM)
  .  CALL BADMID(I, IB, 'ELECCON')
  .  RETURN
  ...FIN

  IF (MODE.GT.4)
  .  IM=MACHID(I)
  .  IB=ABS(NUMTRM(I))
  .  IBUS=NUMBUS(IB)

  .  IF (MODE.EQ.6)
  .  .  WRITE(IPRT,507) IBUS,IM, (CON(K) , K=J, J+2)
  .  .  RETURN
  .  ...FIN

  .  IF (MODE.EQ.5)
  .  .  CALL DOCUHD(*1900)
  .  .  JJ=J+2
  .  .  WRITE(IPRT,17)  IBUS,IM,J,JJ,K,K+1
  .  .  WRITE(IPRT,27)  (CON(K) ,K=J,JJ)
  .  ...FIN

  .  NEW=.FALSE.
  .  UNLESS (CON(J).GT.2.*DELT .AND. CON(J) .LT.0.2)
  .  .  PRINT-HEADING
  .  .  WRITE(IPRT,107) CON(J)
  .  ...FIN
  .  UNLESS (NEW) RETURN
  ...FIN   

  IF (MODE.EQ.1)
  .  STATE(K) = 1.0
  .  STATE(K+1) = 1.0
  .  RETURN
  ...FIN

  IF (MODE.EQ.2)
  .  DSTATE(K) = 0
  .  DSTATE(K+1) = 0
  .  RETURN
  ...FIN

  IF (MODE.EQ.3)
  .  WPCMND(WMI) = STATE(K)
  .  WQCMND(WMI) = STATE(K+1)
  .  RETURN
  ...FIN

  IF (MODE.EQ.4)
  .  NINTEG=MAX(NINTEG,K+1)
  .  RETURN
  ...FIN  

17   FORMAT(//6X,'** ELECCON',' **  BUS   NAME   BSKV MACH',
 *       '    C O N S     S T A T E S'/,
 *       I23,3X,A2,3X,2(I7,'-',A6))
27   FORMAT(/21X,'TR K TE'/F24.3,F8.1,F8.3)
97   FORMAT(//' BUS',I7,'  MACHINE ',A,':')
107  FORMAT(' TR=',F10.4)
507  FORMAT(I6,' ''USRMDL''',2X,A2,' ''DEMOEX''',1X,4G13.5,/7X,5G13.5,'/')

1900 RETURN

  TO PRINT-HEADING
  .  UNLESS (NEW)
  .  .  NEW=.TRUE.
  .  .  CALL DOCUHD(*1900)
  .  .  WRITE(IPRT,97) IBUS,IM
  .  ...FIN
  ...FIN

  END

And the corresponding .dyr (with the test-generator at bus 1 and the equivalent source at bus 3) is:

   1    'WT3G1'  1     1           0.18          30.0          0.0      
         0.1000        450    /
   1    'USRMDL' 1 'ELECCON' 102  0  0 3 2 0 0.05 100. 0.4 /
   3    'GENCLS' 1     0.0         0.0    /

With your experience, can you tell where exactly there is an error? I spent the last days looking for it...

Thanking you in advance

cBal's avatar
1
cBal
answered 2025-08-27 16:54:09 -0500
edit flag offensive 0 remove flag delete link

Comments

PS: The later model should have three Cons, therefore these dummy-values exist....

cBal's avatar cBal (2025-08-27 16:55:19 -0500) edit
add a comment see more comments

Your Answer

Login/Signup to Answer