Menu

Voltage source in Microgrid

2023-04-13
2024-01-29
  • Alejandro Escallon

    Greetings to all,

    I have been studying the example of a microgrid in the YouTube video “Co-Simulation with OpenDSS-G,” specifically the Alfredo example. Every microgrid presented in the circuit has a voltage source, but it is never explained its purpose or why it's necessary to include it. When I simulate a similar system with only one microgrid, without this voltage source, there is a problem in the simulation. I think that it is needed when there is a disconnection of the grid and the system needs a reference node for solving the equations. I am curious as to how to obtain the ratings for this voltage source correctly so that I can include them in my circuit.

    Thank you for your attention.

    Sincerely,
    Alejandro Escallón

     
  • Alejandro Escallon

    Hello Davis,

    I associated the Inverter control and program the DER to a GFM when activating the islanding mode. However, there is a problem in the simulation. An error message stating that 'Max Control Iterations Exceeded in actor 1' appears. I tried to increase the Max iterations, but this message still appears. This leads to an incorrect behaviour of the microgrid. I am controlling this through Python using the DSTCP protocol, and the GFM mode will activate when the production of the PV array exceeds the load consumption.

    Thank you for your attention.

    Sincerely,
    Alejandro

     
    • Davis Montenegro

      Hello,

      Is the InvControl working in GFM mode as well? you see, the InvControl works as a current limiter and protection for the IBRs working in GFM control mode. If your InvControl operates in a different mode, then that is probably the issue.
      Also, how are you bringing in the PV? Does it include energy storage? This error sounds more like an implementation issue.

      Best regards

      Davis

       
  • Alejandro Escallon

    Hello,

    Yes, the InvControl is programmed as GFM as well. The system is very simple, I attach an image of the schematic. I have connected the source, a Pv array, a battery and a load but on different nodes.

    Thank you for your attention.

    Alejandro

     
    • Davis Montenegro

      Hi,

      It is the logic then, how are you controlling the GFM and GFL modes for these elements? What's the purpose and control strategy you are implementing?

      Best regards

      Davis

       
  • Alejandro Escallon

    Hello,

    it's actually pretty simple.

    Whenever the production of the PV array is higher than the power consumed by the load, we enter in an islanding mode (by operating a switch) where the battery or the PV array of the MG will change the control mode from GFL to GFM.

    That's basically it. Of course the battery will charge or discharge depending on the hour of the day and if it has enough energy stored. I based most of the control in Alfredo's example.

    Thank you for your attention.

    Sincerely,

    Alejandro Escallón.

     
    • Davis Montenegro

      Hi,

      Ok, that operational principle doesn't make sense. If you have a battery nearby, why don't you make the battery the GFM for the system? PV's are highly variable and I haven't seen any application in which PV is considered as reference for the system. Even though, it is possible in the program, the errors you are getting reveal how challenging it is. Instead, I would setup the battery as GFM, when the PV generation exceeds the load values you'll see that the storage will recharge automatically even in GFM mode.
      Some tips for you to consider:

      1. For setting an IBR in GFM mode it has to be disconnected from the grid, otherwise, it is likely you'll create a short circuit given that the phase angle of the GFM IBR doesn't sync with the grid.
      2. Try to use storage as the reference for the model instead of PV (variable).
      3. After commanding a disconnection using the Open/Close command, it is always good to run a "calcv" command immediately after to setup the voltage bases of the microgrid again.

      Best regards

      Davis

       
  • Alejandro Escallon

    Hello,

    I tried to do the steps that were suggested. Here is the logical part that controls these actions:

    if PVkW[x] >= EVkW[x]: 
            ODGTCP.sendCommand('SwtControl.sw_0.Action=Open')
            ODGTCP.sendCommand('edit storage.sto_0 ControlMode = GFM')
            ODGTCP.sendCommand('calcv')
    
    else:
            ODGTCP.sendCommand('SwtControl.sw_0.Action=Close')
            ODGTCP.sendCommand('edit storage.sto_0 ControlMode = GFL')
            ODGTCP.sendCommand('calcv')
    

    This is what I understand to do with the suggestion. However, as soon as the pVkW is greater than EVkW every value from the simulation goes to 0.

    I don't know if there is an additional step to it.

    Thank you for your attention.

    Alejandro

     
    • Davis Montenegro

      Hello,

      Please provide more background on your issue, I don't know what PVkW, EVkW are. Another alternative is for you to provide a script/model reproducing this issue, so we can give it a look and figure out where is the problem.

      Best regards

      Davis

       
  • Alejandro Escallon

    Hello,

    Here there is attached the OpenDSS-g model and the python script. Thank you very much for taaking the time to take a look.

    PVkW is the power provided by the photovoltaic array and EVkW is the power consumed by the Load.

    Sincerely,
    Alejandro

     
    • Davis Montenegro

      Hi,

      Finally found time to play with this. Had to correct multiple parts of the model, the lines, the invcontrol, anyway. Check the attachment to see how it works. I had to replace the load shapes since you didn't give me any, to match with your simulation remember to change the load shape values for its CSV containers in the file called loadshapes.dss.

      Best regards

      Davis

       
  • Alejandro Escallon

    Hello Davis,

    thank you for taking the time to check my files. I am curious of one specific thing and is regarding the Python file. When we say that the PV production is greater than the Load consumption, we open the switch and after that the ControlMode of the battery will turn into GFM. However I noticed that the state of the battey will be in discharge mode. Is this necesary when changing the controlMode of the battery? I ask this because we want to prioritize the charge of the battery when there is PV production.

    Thank you for your help.

    Sincerely,
    Alejandro

     
    • Davis Montenegro

      Hi,

      Yes, the discharging state is an enabling flag when using storage as GFM. When operating in this mode, there is no need to change the state of the storage and it will be set accordingly to the power seen at the inverter terminals. A GFM works as a reference mimicking what a connection to a larger grid will do, providing a stable point of operation for other GFL devices to follow. The power flow through the terminals of the GFM device can be negative (delivers power) or positive (absorbing excess for voltage regulation). When absorbing, the storage can use part of that energy to recharge automatically and don't require intervention.
      Of course, the amount of energy that the GFM device can absorb depends on the inverter's size and technical features, just like the power delivery does.
      With this, yes, for using storage as GFM it has to be in Discharging state.

      Best regards

      Davis

       
  • Alejandro Escallon

    Hello Davis,

    Perfect, completely clear. Thank you very much for the help.

    Alejandro

     
  • Alejandro Escallon

    Hello Davis,

    During these days I noticed something particular. Exactly when there is change in the Switch state (opens or closes) and the control mode of the battery changes to GFM or GFL , the power, current and voltage of every node of the microgrid goes to 0 and then goes back to the normal state (see the image attached in t=8 and t=17). I think some sort of delay is needed so there is a synchronization of the network but i'm not sure how to implement it.

    Thank you for your attention.
    Alejandro

     

    Last edit: Alejandro Escallon 2023-07-07
    • Alejandro Escallon

      Hello Davis,

      I tried to use te new version that was releases a week ago and I keep finding the same problem. Is there something else I need to take into account for making this simulation?

      Thank you for your attention,
      Alejandro

       
      • Davis Montenegro

        Hello,

        Sorry for my late reply. The problem is not in DSS, The issue has actually to do with the way the commands are sent. The problem you are seeing is because the switch opening happens after re configuring the storage device as GFM, even though the opening command happens before. You see, in OpenDSS, the YBus matrix is built once a change has been detected like the GFM for storage, then solves and applies the control actions, like opening the swtcontrol, this produces a short circuit and turns OFF the storage device.
        The solution is simple, first, configure your storage device in delta, if you want a ground connection, use a transformer between the storage and the grid (delta-wye).
        Also, add a line open command right after changing the control action for the swtcontrol, like this:

                ...
                ODGTCP.sendCommand('SwtControl.sw_0.Action=Open')
                ODGTCP.sendCommand('Open line.line_0 1')
                ODGTCP.sendCommand('edit storage.sto_0 state = discharging ControlMode = GFM ')
                ...
        

        This will force DSS to open the line before changing the storage into GFM, then, for closing the switch do:

              ...
              ODGTCP.sendCommand('SwtControl.sw_0.Action=Close')
            ODGTCP.sendCommand('Close line.line_0 1')
            ODGTCP.sendCommand('storage.sto_0.ControlMode = GFL')
            ...
        

        This will help coordinating the device with the control mode of the storage without having to wait for the control actions occurrence.

        Give it a try and let us know how it goes.

        Best regards

        Davis

         
  • Alejandro Escallon

    Hello Davis,

    Thank you for the clarification. I have made some advances and adjustments to the model. The idea specifically is to simulate the behavior of electric vehicle chargers using renewable energies. In this idea, we have some PV production, a battery, and the load which would be the EV chargers. The goal is to create a local microgrid with this system, where the battery and PV production will support the EV chargers' consumption. With that in mind, I tried to do everything we talked about in this thread so far. However, I have noticed that there are some problems in the implementation.

    As you previously said, when using the GFM in a battery, it must be in discharging and consequently, when it is in GFL it would be in charging mode, but this would be depending on the power seen by the terminals of the inverter. If this is the mode that we want it to work, it's fine. Nevertheless, examining the various modes of operation that actual inverters employ, I've discovered that even without solar power being generated, the battery can still be discharged, supplying power to the load. For how the simulation is configured today, it is not possible to do that (See the image attached). So I wanted to know if there is a way in which the control of the battery can be programmed arbitrary, considering the PV production and consumption of the load with the inverter control as presented throughout this thread.

    I hope it is clear the idea we want to execute.

    Thank you for your attention.

    Sincerely,
    Alejandro Escallón

     
    • Davis Montenegro

      Hello,
      Well, I don't understand the problem. I mean, if you change the control mode from GFM to GFL and still have SoC withing discharge range, you can keep discharging. I don't understand why you say you can't, I mean, that's the standard operation of the BESS (discharging in GFL). Would you mind to elaborate on what's the challenge here? You can select if you want to discharge/charge/idle in GFL as required.
      In GFM mode the BESS is discharging, so no matter if the PV is or not available, if the load can be supplied by the BESS it will, otherwise, if the load exceeds the BESS capacity there are 2 possibilities:

      1. The BESS will turn OFF since it cannot keep up with the load.
      2. You can force the BESS to remain ON by defining the current limits (See AmpLimit and AmpLimitGain properties). This may affect the voltage level at the terminals of the BESS since the purpose of these properties is to support fault studies.

      Best regards,

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.