def __init__(self, pll=None, pdroop=None, qdroop=None, **kwargs):
        super().__init__(**kwargs)

        pdroop = {**dict(gain=40000.0), **(pdroop or {})}
        qdroop = {**dict(gain=50.0), **(qdroop or {})}
        pll = {**dict(kP=10, kI=200), **(pll or {})}

        # toDo: set time Constant for droop Filter correct
        self.pdroop_ctl = InverseDroopController(
            InverseDroopParams(tau=self.net.ts, nom_value=self.net.freq_nom, **pdroop), self.net.ts)
        self.qdroop_ctl = InverseDroopController(
            InverseDroopParams(tau=self.net.ts, nom_value=self.net.v_nom, **qdroop), self.net.ts)
        # default pll params and new ones
        self.pll = PLL(PLLParams(f_nom=self.net.freq_nom, **pll), self.net.ts)
    qdroop_param = DroopParams(QDroopGain, 0.002, v_nom)
    # Add to dict
    ctrl.append(
        MultiPhaseDQ0PIPIController(voltage_dqp_iparams,
                                    current_dqp_iparams,
                                    droop_param,
                                    qdroop_param,
                                    ts_sim=delta_t,
                                    name='master'))

    #####################################
    # Define the current sourcing inverter as slave
    # Current control PI gain parameters for the current sourcing inverter
    current_dqp_iparams = PI_params(kP=0.005, kI=200, limits=(-1, 1))
    # PI gain parameters for the PLL in the current forming inverter
    pll_params = PLLParams(kP=10, kI=200, limits=None, f_nom=freq_nom)
    # Droop characteristic for the active power Watts/Hz, W.s/Hz
    droop_param = InverseDroopParams(DroopGain,
                                     delta_t,
                                     freq_nom,
                                     tau_filt=0.04)
    # Droop characteristic for the reactive power VAR/Volt Var.s/Volt
    qdroop_param = InverseDroopParams(50, delta_t, v_nom, tau_filt=0.01)
    # Add to dict
    ctrl.append(
        MultiPhaseDQCurrentController(current_dqp_iparams,
                                      pll_params,
                                      i_lim,
                                      droop_param,
                                      qdroop_param,
                                      ts_sim=delta_t,
예제 #3
0
    ###############
    # define Master
    voltage_dqp_iparams = PI_params(kP=0.025, kI=60, limits=(-i_lim, i_lim))
    # Current control PI gain parameters for the voltage sourcing inverter
    current_dqp_iparams = PI_params(kP=0.012, kI=90, limits=(-1, 1))

    # Define a current sourcing inverter as master inverter using the pi and droop parameters from above
    ctrl.append(MultiPhaseDQ0PIPIController(voltage_dqp_iparams, current_dqp_iparams, droop_param_master,
                                            qdroop_param_master, ts_sim=delta_t, ts_ctrl=2 * delta_t, name='master'))

    ###############
    # define slave
    current_dqp_iparams = PI_params(kP=0.005, kI=200, limits=(-1, 1))
    # PI gain parameters for the PLL in the current forming inverter
    pll_params = PLLParams(kP=10, kI=200, limits=(-10000, 10000), f_nom=freq_nom)
    # Droop characteristic for the active power Watts/Hz, W.s/Hz

    # Add to dict
    ctrl.append(MultiPhaseDQCurrentController(current_dqp_iparams, pll_params, i_lim, droop_param_slave,
                                              qdroop_param_slave, ts_sim=delta_t, name='slave'))

    #####################################
    # Definition of the optimization agent
    # The agent is using the SafeOpt algorithm by F. Berkenkamp (https://arxiv.org/abs/1509.01066) in this example
    # Arguments described above
    # History is used to store results
    agent = SafeOptAgent(mutable_params,
                         abort_reward,
                         j_min,
                         kernel,