Menu

battery energy storage

Help
2017-03-22
2024-08-12
  • Thomas Michael

    Thomas Michael - 2017-03-22

    Hi all,
    I am currently undertaking my final year project at university researching battery energy storage for power smoothing and peak shaving using OpenDSS.
    I am currently using the GridPV toolbox and a simple 4 bus network.
    I have added PV as a generator with a loadshape and a storage element set to discharge also.
    Despit this, when running the simulation, the storage element will not discharge as expected, but instead is lowering the kW profile plot of the both the whole circuit and the bus (even when the storage parameters are set to a large value).
    It is my understanding that the storage when discharging, provided the voltage of the storage is greater than the bus voltage, should really be increasing the power of the circuit.

    Any help would be very much appreciated.
    Thank you,
    Tom.

     

    Last edit: Thomas Michael 2017-03-23
  • Davis Montenegro

    Hi,

    We have had this discussion several times in the past and the cases are available in this forum. Please, go to the following link to find some information about it:

    https://sourceforge.net/p/electricdss/discussion/861977/thread/f34a0786/

    I hope this helps

    Best regards

    Davis

     
  • Thomas Michael

    Thomas Michael - 2017-03-23

    Hi,

    Thank you very much for the response.

    I have read through that discussion several times, however I am still unable to find the solution to my problem. My storage element is defined and set to discharge with no errors, however the kW profile of the circuit is constantly lowered when running a simulation with the storage element. What could be the issue that is causing this problem?
    Any help would be greatly appreciated.
    Thank you,
    Tom

     
  • Davis Montenegro

    If you could provide us more information about your script and the way you are making your measurements, we will be able to give you an answer.

    Thanks

    Best regards

    Davis

     
  • Thomas Michael

    Thomas Michael - 2017-03-24

    Thank you very much, below is an example of a part of my script where i have defined a generator as PV and my storage element which i hope to discharge.

    All the code is being run through Matlab using the GridPV toolbox. The code all runs without error, placing the PV in the network, which can be observed when plotting the circuit.

    DSSText.command = 'Set mode=duty number=10080 hour=0 h=60 sec=0';
    DSSText.Command = 'Set Controlmode=TIME';
    DSSText.command = 'solve';
    DSSText.command = ['Compile "' gridpvPath 'ExampleCircuit3\4Bus-GrdYD-Bal.DSS"'];

    DSSText.command = 'New Loadshape.PVl npts=43201 interval=1 mult=(file=1-day-1-s-Solar-2.csv) action=normalize';

    % Add PV in the form of a generator object at chosen bus with chosen parameters
    DSSText.command = 'new generator.PV bus1= n2 phases=3 kv=25 kw=100 pf=1 daily=PVl enabled=true';

    % You can now see the generator that was added
    DSSCircuit.Generators.get;

    % Set it as active element and view its bus information
    DSSCircuit.SetActiveElement('generator.pv');

    %DSSText.command = 'Set mode=duty number=10 hour=100 h=1 sec=1800';
    %DSSText.command = 'Set controlmode = static';
    %DSSText.command = 'solve';

    DSSText.command='New Storage.battery1 Bus1=n2 phases=3 kV=30 kW=20000 kWRated=20000 kWhRated=20000 kWhStored=160000 state=discharging enabled = true';
    DSSText.Command = 'Storage.battery1.state=discharging %discharge=75';
    DSSText.Command='FormEdit "storage.battery1'; %confirms changes to storage element
    DSSText.command = 'solve';
    DSSText.command= 'Visualize powers storage.battery1'; %shows powers on storage element

    DSSText.command='plot storage.battery1';

    figure; plotKWProfile(DSSCircObj,'AveragePhase','addition','BusName','n3');
    figure; plotKWProfile(DSSCircObj,'AveragePhase','on');

    Any help will be greatly appreciated.
    Thanks,
    Tom

     
  • SONU

    SONU - 2020-05-05

    how to model community energy storage and battery energy storage ?

     
  • Mojtaba

    Mojtaba - 2021-07-04

    Hi all,
    I have implemented CVR in a radial distribution network using Matlab-COM-OpenDSS. In the simulation, OLTC and voltage regulators’ tap positions (for a day ahead horizon) are defined using PSO in Matlab. To allow the taps to be adjusted through PSO, I used the following command in Matlab and it works properly:
    DSSText.Command='set Controlmode=ON';

    However, it seems that the "Controlmode" command conflicts with the battery control. I defined a battery as following:

    New Storage.Storage1 phases=3 bus1=890 kv=4.16 kWrated=200 kWhrated=800
    ~%idlingkW=2 dispmode=default model=2 %stored=30 %reserve=30

    New StorageController.SC element=Line.L1 terminal=1
    ~modedischarge=peakShave MonPhase=AVG kwtarget=800 modecharge=Time ~timeChargeTrigger=3 %rateCharge=50

    When the "Controlmode" is either ON or OFF, the battery control is inactive and the battery never gets charged or discharged. However, when the "Controlmode" command is removed, the battery controller works properly and allows the battery to be charged or discharged (but I can not change the tap positions through Matlab as the "Controlmode" is not available). In my simulation, I need "Controlmode=ON" and battery controller work simultaneously.
    I would appreciate if anyone can help with this problem.

     

    Last edit: Mojtaba 2021-07-04
    • Davis Montenegro

      Hello,

      What version are you working with? I'm pretty sure that the problem is in your code since by the symptoms you describe, it seems that you are doing the opposite. Could you provide an example?

      Best regards

      Davis

       
  • Mojtaba

    Mojtaba - 2021-07-05

    Hello Davis,

    Thank you for the reply. I am using version 9.2.0.1. Please find attached the main part of the Matlab codes and the battery outputs. Figure B1 represents the battery outputs when the "Controlmode" command exists in my Matlab codes. Figure B2 shows the battery outputs when the "Controlmode" command is removed (that's the only thing I change in my codes).

    Best regards,
    Mojtaba

     
    • Davis Montenegro

      Hello,

      OK, so there are several issues with your code. there is no 'control mode=ON' in OpenDSS. The control modes can only be OFF (meaning that the control will not operate), STATIC ( Time does not advance), EVENT (solution is event driven) and TIME (solution is time driven).
      By setting controlmode=ON, you are basically turning them OFF, since it is the first letter of the string the one we use to set the controlmode.

      Best regards

      Davis

       
      • Mojtaba

        Mojtaba - 2021-07-08

        Hello Davis,

        So, what solution would you suggest for my case? I intend to define the taps' positions in an iteration-based algorithm which requires "Controlmode=OFF". But, at the same time, I don't want "Controlmode" to affect (inactivate) the battery's control. In other words, I want to control the OLTC and VRs by my algorithm, and simultaneously let OpenDSS control the battery. I hope I have explained my case clearly.

        Best regards,
        Mojtaba

         
        • Davis Montenegro

          Hello,

          Well, very simple, just remove the regcontrols from the transformers you want to control with your algorithm. This way, OpenDSS will take care of the remaining controls in the model while your external code governs the transformer's operation.

          Best regards

          Davis

           
          • Mojtaba

            Mojtaba - 2021-07-12

            Hello Davis,

            Thank you for your reply. I added "enabled=no" in my "regcontrol" and it works. However, it seems "vreg" cannot be changed in this situation ("vreg" is also a decision variable in my simulation). I added the following line in Matlab to get the "vreg" value from OpenDSS:

            DSSCircuit.RegControl.Name=('crega')
            Vreg_value=DSSCircuit.RegControl.vreg

            But Matlab sends the following error message:

            < unrecognized function or variable 'vreg' >

            Could you please let me know if I am using the correct syntax to get the value of "vreg"?
            I should mention that I don't have that problem for "ptratio" or "ctprim" parameters. Matlab just cannot recognize "vreg".

            Best regards,
            Mojtaba

             
            • Davis Montenegro

              Hello,

              First of all, if the element is not enabled, it doesn't make sense to change the regulation voltage. I hope, you are talking about active regcontrols. If that's the case, "vreg" is not a property exposed at the COM interface. Use "ForwardVreg" instead. To check what are the properties/methods at COM, send the command "COMHelp" using the Text interface or using the executable.

              DSSText.Command='COMHelp';
              

              You only need to call it once when having doubts about the COM properties and methods, it also comes with examples. This help is available with OpenDSS v9 and later.

              Best regards

              Davis

               
              • Mojtaba

                Mojtaba - 2021-07-19

                Hello Davis,

                Thank you for the reply. "ForwardVreg" is what I have been looking for.

                Best regards,
                Mojtaba

                 

Log in to post a comment.