The generator, or DG, model within GridLAB-D has never been fully developed. The multitude of control algorithms, different technologies, and implementations available and the various levels of model complexity, make it difficult to fully represent the DG models that are available. Instead, the goal has been to create a very open environment, where users can create their own models, including their own controls and algorithms. Within the auspices of DOE, some models have been created for specific uses ( a simple solar model, a specific wind turbine model, various battery control models ), and should be thought of as examples in how DGs are modeled within GridLAB-D.

Essentially, the DG models can be thought of as negative loads (or in the case of batteries that are charging, normal loads). They are connected to the powerflow solution through triplex meters or meters (or in some cases, in series through an inverter to a meter or triplex meter), and act as a load on the system using components of a ZIP model. The internal DG models are required to calculate their ZIP components as a function of the user's/model's desired inputs - ie solar panels use the system voltage and solar radiation. These components are then posted back to the powerflow solution via the meters as either a pure current injection or as a combinatorial ZIP model. As the generators are a separate module from powerflow, they are required to have the meter interface and must post their load information rather than being calculated directly within the powerflow solution (as would be with a load object).

The following will describe the available models within GridLAB-D and how they interface with the powerflow module. Additionally, it will offer ideas/plans for future development.

# Generators Objects

## Battery Model

The battery object is in a state of flux, containing some legacy models and some new models. In early versions of GridLAB-D (pre-v3.0), it was assumed that the model included both the battery and the inverter; the battery was connected directly to a meter (or triplex_meter) object. Post-v3.0, the inverter model has been separated from the battery object. In this case, the battery is connected as a child of an inverter object and the inverter is then connected to the meter object. This may cause some confusion - development of new models will focus on a full separation of the inverter and battery models, but legacy code still exists for those that are still using it.

The battery model does not explicitly represent a specific battery chemistry, but rather is a generic energy storage device; the parameters can be set to represent a fairly simplistic representation of a wide variety of chemistries and technologies.

### Default Battery

Because of the multiple models and wide variety of parameters, there is no "default" battery.

### Battery Parameters

Property Name Type Unit Description

generator_status

enumeration

N/A

Allows user to define when the generator is in operation or not.

• ONLINE
• OFFLINE

generator_mode

enumeration

N/A

Defines the control mode of the inverter. Only CONSTANT_PF has been validated to any degree and allows the user to adjust the power factor (and therefore the Q output) under the constraints of the rated output. Do not set when using the internal battery model.

• UNKNOWN
• CONSTANT_V
• CONSTANT_PQ
• CONSTANT_PF
• SUPPLY_DRIVEN

use_internal_battery_model

Boolean

N/A

A boolean to use the internal battery model which is used when the battery's parent is an inverter. Default is FALSE.

battery_type

enumeration

N/A

The battery type applies a voltage vs. SOC performance curve for the internal battery model to use. Default is UNKNOWN.

• UNKNOWON
• LI_ION

nominal_voltage

double

V

The nominal open circuit dc voltage for the battery. Used by the internal battery model. Default is blah.

rated_power

double

W

The rated output power of the battery. It is used by the internal battery model. The rated_output is set by the parent inverter's power rating and efficiency. Default is blah.

battery_capacity

double

Wh

The rated capacity of the battery. It is used by the internal battery model. Default is blah.

round_trip_efficiency

double

pu

The round trip efficiency of the battery used by the internal battery model. Defualt is blah.

state_of_charge

double

pu

The state of charge of the battery used by the internal battery model. Default is blah.

reserve_state_of_charge

double

pu

The reserve state of charge that the battery is not allowed to go below. It is used by the internal battery model and is used by the parent inverter. Default is 0.

double

W

The current output power of the battery. It is set by the parent inverter and used in the internal battery model.

rfb_size

enumeration

N/A

Presets for batter ratings and capacity.

• HOUSEHOLD:
• nominal_voltage = 260 V
• rated_power = 3.6 kW
• battery_capacity = 23.4 kWh
• round_trip_efficiency = 0.9
• SMALL:
• nominal_voltage = 75.2 V
• rated_power = 18.8 kW
• battery_capacity = 160 kWh
• round_trip_efficiency = 0.7
• MED_COMMERCIAL:
• nominal_voltage = 115 V
• rated_power = 50 kW
• battery_capacity = 175 kWh
• round_trip_efficiency = 0.8
• MED_HIGH_ENERGY:
• nominal_voltage = 115 V
• rated_power = 50 kW
• battery_capacity = 400 kWh
• round_trip_efficiency = 0.8
• LARGE:
• nominal_voltage = 8 kV
• rated_power = 240 kW
• battery_capacity = 5.76 MWh
• round_trip_efficiency = 0.9

### Battery State of Development

This model has only been tested when using the internal battery model. All other modes are considered experimental and may not work as designed. An example of setting up the inverter and battery for load following is shown below. The load following control mode currently only operates at unit power factor. A similar control mode for reactive load following is slated for 3.2 release in summer of 2015.

object inverter {
parent meter1; //parent must be a triplex_meter or meter object.
sense_object substation_transformer; //the sense_object must be a meter, triplex_meter, or transformer.
rated_power 3000.0; //The per phase power output rating of the inverter in VA.
inverter_efficiency 0.95;
charge_on_threshold 5.0 kW; //when the load at the sense_object drops below this value the inverter starts to charge the battery.
charge_off_threshold 7.0 kW; //when the battery is charging and the load at the sense_object rises above this value the inverter stops charging the battery.
discharge_off_threshold 7.5 kW; //when the battery is discharging and the load at the sense_object drops below this value the inverter stops discharging the battery.
discharge_on_threshold 9.0 kW; //when the load at the sense_object rises above this value the inverter starts to discharge the battery.
max_discharge_rate 1 kW; //The maximum power output to demand from the battery when discharging.
max_charge_rate 1 kW; //The maximum power input to the battery when charging.
}

object battery {
name batt_test;
use_internal_battery_model true;
battery_type LI_ION;
battery_capacity 20.0 kWh;
round_trip_efficiency 1.0;
state_of_charge 0.5;
generator_mode SUPPLY_DRIVEN;
}


## Diesel DG Model

Figure 1 - Generator internal electrical model

The three phase synchronous generator is with classical model for power flow computation. In which, ${\displaystyle {\bar {E}}_{f}}$ is induced voltage of generator; ${\displaystyle {\bar {V}}}$ is terminal bus voltage; ${\displaystyle {\bar {I}}}$ is terminal bus current. ${\displaystyle {\bar {E}}_{f}}$, ${\displaystyle {\bar {V}}}$ and ${\displaystyle {\bar {I}}}$ are denoted as complex numbers. They satisfy:

{\displaystyle {\begin{aligned}{\bar {E}}_{f_{A}}&={\bar {V}}_{A}-\left(R+jX_{S}\right){\bar {I}}_{A}-\left(R_{g}+jX_{g}\right)\left({\bar {I}}_{A}+{\bar {I}}_{B}+{\bar {I}}_{C}\right)\\{\bar {E}}_{f_{B}}&={\bar {V}}_{B}-\left(R+jX_{S}\right){\bar {I}}_{B}-\left(R_{g}+jX_{g}\right)\left({\bar {I}}_{A}+{\bar {I}}_{B}+{\bar {I}}_{C}\right)\\{\bar {E}}_{f_{C}}&={\bar {V}}_{C}-\left(R+jX_{S}\right){\bar {I}}_{C}-\left(R_{g}+jX_{g}\right)\left({\bar {I}}_{A}+{\bar {I}}_{B}+{\bar {I}}_{C}\right)\end{aligned}}}

### Diesel State of Development

This model is considered experimental and may not work as designed.

## Energy Storage Model

### Energy Storage State of Development

This model is considered experimental and may not work as designed.

## Inverter Model

A minimal model could be defined by:

object inverter {
phases AS;
generator_mode CONSTANT_PF;
generator_status ONLINE;
inverter_type PWM;
power_factor 1.0;
parent triplex_meter2;
<< implied child that provides a DC power input >>
}


### Default Inverter

Property Name Type Unit Description

inverter_type

enumeration

N/A

Defines the type of inverter technology and the efficiency of the unit. NOTE: efficiency needs to be made a variable.

• TWO_PULSE
• SIX_PULSE
• TWELVE_PULSE
• PWM

generator_status

enumeration

N/A

Allows user to define when the generator is in operation or not.

• ONLINE
• OFFLINE

generator_mode

enumeration

N/A

Defines the control mode of the inverter. Only CONSTANT_PF has been validated to any degree and allows the user to adjust the power factor (and therefore the Q output) under the constraints of the rated output.

• UNKNOWN
• CONSTANT_V
• CONSTANT_PQ
• CONSTANT_PF
• SUPPLY_DRIVEN

V_In

complex

V

DC voltage passed in by the DC object (e.g. solar panel or battery)

I_In

complex

A

DC current passed in by the DC object (e.g. solar panel or battery)

VA_In

complex

VA

VA_In = V_In * I_In

Vdc

complex

V

Not used at this time.

phaseA_V_Out phaseB_V_Out phaseC_V_Out

complex

V

AC voltage coming from the interconnection point. This is not a user-definable variable, but is assigned by the powerflow node. In the case of a “meter”, this can be 1-, 2-, or 3-phase. In the case of a “triplex_meter”, phaseA_V_Out is used to hold the 240V phase voltage; B & C are not used in this case.

phaseA_I_Out phaseB_I_Out phaseC_I_Out

complex

A

AC current being delivered to the interconnection point. This is not a user-definable variable, but is calculated by the inverter/DC object. In the case of a “meter”, this can be 1-, 2-, or 3-phase. In the case of a “triplex_meter”, phaseA_I_Out is used to hold the 240V phase voltage; B & C are not used in this case.

power_A power_B power_C

complex

VA

Calculation of power delivered to interconnection node (e.g. power_A = phaseA_V_Out * ~phaseA_I_Out).

P_Out

double

VA

Not used as this time.

Q_Out

double

VAr

Not used as this time.

power_factor

double

unit

Defines the desired power factor in CONSTANT_PF mode.

phases

set

N/A

Not used at this time – phases are assumed from the interconnection point.

inherited from power electronics – NOTE: Many of the PE capabilities are not currently fully functional.

Rated_kV

double

kV

Used as the nominal voltage when no interconnection point is designated.

efficiency

double

unit

Efficiency of the inverter. This is assigned by inverter_type and cannot be overridden at this time.

### Inverter State of Development

This model is considered experimental and may not work as designed.

## Microturbine DG Model

### Microturbine State of Development

This model is considered experimental and may not work as designed.

## Power Electronics Model

### Power Electronics State of Development

This model is considered experimental and may not work as designed.

## Rectifier Model

### Rectifier State of Development

This model is considered experimental and may not work as designed.

## Solar DG Model

### Default Solar

A minimal model could be created via:

object solar {
generator_mode SUPPLY_DRIVEN;
generator_status ONLINE;
panel_type SINGLE_CRYSTAL_SILICON;
efficiency 0.2;
parent inverter1;
area 2500 sf;
}


### Solar Parameters

Property Name Type Unit Description

generator_mode

enumeration

N/A

Only operational in SUPPLY_DRIVEN at this time.

• UNKNOWN
• CONSTANT_V
• CONSTANT_PQ
• CONSTANT_PF
• SUPPLY_DRIVEN

generator_status

enumeration

N/A

Default is ONLINE. Allows a user to dropout a generator.

• OFFLINE
• ONLINE

panel_type

enumeration

N/A

Uses pre-defined panel technologies. Defines efficiency, Pmax_temp_coeff, and Voc_temp_coeff.

• SINGLE_CRYSTAL_SILICON (default)
• MULTI_CRYSTAL_SILICON
• AMORPHOUS_SILICON
• THIN_FILM_GA_AS (incomplete)
• CONCENTRATOR (incomplete)

power_type

enumeration

N/A

Defines whether the connection is AC or DC. This variable is not currently used at this time as the connection method is determined from the connection device (meter vs. inverter).

• AC
• DC

INSTALLATION_TYPE

enumeration

N/A

This variable is not currently used.

• ROOF_MOUNTED
• GROUND_MOUNTED

NOCT

double

degF

Nominal operating cell temperature, typically designated by the manufacturer.

Tmodule

double

degF

Calculated internal temperature of the PV module.

Tambient

double

degF

Outside air temperature. Comes from a climate object, if available.

wind_speed

double

mph

Outside wind speed. Comes from a climate object, if available.

Insolation

double

W/sf

Solar radiation incident upon the solar panel. Comes from a climate object, if available.

Rinternal

double

Ohm

Not currently used.

Rated_Insolation

double

W/sf

Insolation level at which the cell is rated for. It is assumed that at rated insolation, power output will be at the rated maximum power output.

Pmax_temp_coeff

double

Coefficient for the effects of temperature changes on the actual power output. This is explained in further documentation.

Voc_temp_coeff

double

Coefficient for the effects of temperature changes on the DC terminal voltage. This is explained in further documentation.

V_Max

complex

V (DC)

Defines the max operating voltage of the PV module. This is used for de-rating purposes and is not currently used as a generator cutoff.

Voc_Max

complex

V (DC)

Not needed and needs to be removed

Voc

complex

V (DC)

Defines the open circuit voltage as specified by the PV manufacturer. It occurs when there is no current flowing throught the PV cell

efficiency

double

unit

Defines the efficiency of power conversion from the solar insolation to DC power. Defines maximum power output.

area

double

sf

Defines the surface area of the solar module. Defines maximum power output.

Rated_kVA

complex

kVA

Not currently used.

P_Out

complex

kW

Not currently used.

V_Out

complex

V

DC voltage passed to the inverter object.

I_Out

complex

A

DC current passed to the inverter object.

VA_Out

complex

VA

Actual power delivered to the inverter.

FF

double

None

The Fill Factor (FF) is essentially a measure of quality of the solar cell. It is calculated by comparing the maximum power to the theoretical power that would be output at both the open circuit voltage and short circuit current together. This variable is currently not implemented.

### Solar State of Development

This model is considered experimental and may not work as designed.

## Wind Turbine DG Model

### Wind Turbine State of Development

This model is considered experimental and may not work as designed.

## Model testing

Figure 2 - Generator testing model
Note
The matlab code ready but is waiting for Generator data.