Development and validation of a real-time testbed for renewable energy integration studies: South African grid code case study

Purpose – Despite South Africa ’ s ailing electrical grid, substantial renewable energy (RE) integration is planned for the country. As grid-integrated RE affects all grids differently, this study aims to develop an adaptable grid code-guided renewable power plant (RPP) control real-time simulation testbed, tailored to South African grid code requirements to study grid-integrated RE ’ s behaviour concerning South Africa ’ s unique conditions. Design/methodology/approach – The testbed is designed using MATLAB ’ s Simulink and live script environments, to create an adaptable model where grid, RPP and RPP guiding grid codes are tailorable. This model is integrated with OPAL-RT ’ s RT-LAB and brought to real-time simulation using OPAL-RT ’ s OP4510 simulator. Voltage, frequency and short-circuit event case studies are performed through which the testbed ’ s abilities andperformance areassessed. Findings – Case study results show the following. The testbed accurately represents grid code voltage and frequency requirements. RPP point of connection (POC) conditions are consistently recognized and tracked, according to which the testbed then operates simulated RPPs, validating its design. Short-circuit event simulations show the simulated wind farm supports POC conditions relative to short-circuit intensity by curtailing active power infavourof reactivepower, in line with local grid code requirements. Originality/value – To the best of the authors ’ knowledge, this is the ﬁ rst design of an adaptable grid code-guided RPP control testbed, tailored to South African grid code requirements in line with which RPP behaviouralandgrid integration studies can be performed.


Introduction
Globally, an energy shift is underway where renewable energy (RE) alternatives are increasingly being favoured over their fossil fuel-driven counterparts, in a bid to reduce both harmful emissions, and reliance on exhaustible energy resources.Leading the way for the electrical generation industry is hydropower, wind, biomass and solar technologies, owing to their versatility and widespread application.These applications include small-scale implementation of technologies such as the vertically orientated Savonius-style wind JEDT turbine optimized by Roy et al. (2018) for agricultural, household and rural applications.The study of Goswami and Das (2020) investigates another such implementation of a waste heatdriven biomass engine, capable of charging a 12 V battery, making it a valuable and implementable design for various small-scale applications.RE generation's more significant contribution to the displacement of its fossil fuel-driven counterparts however comes in the form of large-scale grid integration, bringing with it added challenges to existing electrical grids.Li et al. (2017) investigate this, noting the most significant challenges are increased system voltage levels, increased short-circuit currents, deterioration in power supply reliability and power quality, highlighting the importance of a strong stable grid for successful large-scale RE integration.A major contributing factor is noted to be RE's lacking contribution to system inertia, which refers to the loss of conventional generation's spinning reserves.Saha et al. (2023) investigate the impact of this, highlighting the effect loss of system inertia has on grid frequency stability, and the added challenges this poses to system operators in terms of maintaining system frequency within prescribed limits.Concerns surrounding the loss of system inertia are supported by Mararakanye and Bekker (2019), also noting that loss of inertia implications greatly vary between power grids, making it essential to consider the circumstances of a specific region.
This paper focuses on the grid integration of RE in South Africa, which has recently experienced several challenges surrounding supply reliability of the country's energy needs, leading to a decline in the average Energy Availability Factor (EAF) down to only 65% in 2020 (Hanto et al., 2022).This follows years of infrastructure neglect and lack of maintenance leading Eskom, the country's primary energy provider, to battle unplanned breakdowns of its old and poorly maintained power plants to remain below 9,500 MW, at which point planned load shedding is initiated to maintain stability of the country's strained electrical grid (Statistics South Africa, 2018, 2019, 2020;Eskom, 2019bEskom, , 2019a;;Eskom generation division, 2019;Maune, 2019;Creamer, 2021;Ayamolowo et al., 2022).As part of the solution to the ongoing energy crises South Africa is planning to significantly ramp up its use of RE for electricity production, and therefore developed RE specific grid codes to potentially limit added instabilities brought about by its integration.RE integration plans are reflected by initiatives such as the 2030 Integrated Resource Plan (IRP), setting a renewable generation addition target of 14,725 MW by 2030, 6,422 MW of which are already operational and around 4,100 MW of which are already connected and grid integrated (Department of Energy, 2010, 2011;National Energy Regulator of South Africa (NERSA), 2012;Department of Energy and Department of National Treasury, 2018;RSA Department of Energy, 2018;Department of Mineral Resources and Energy, 2019;Statistics South Africa, 2020;Ayamolowo et al., 2022;Hanto et al., 2022).
Considering South Africa's unique implementation of RE as aid for their already struggling electrical grid, and the foreseeable challenges associated with large-scale RE integration, South Africa is set to greatly benefit from tailored RE integration studies.Given the obligation of gridconnected RE to adhere to renewable power plant (RPP)-specific grid code requirements in South Africa, it would be advantageous to the accuracy of RE integration studies to include grid code requirements as part of such simulations.Paquin et al. (2007) developed a MATLABintegrated OPAL-RT real-time simulation model to perform detailed studies of doubly fed induction generator wind farms connected to a 24-bus electrical network, noting the ability of such a platform to study various aspects of RE's performance.Merabet et al. (2014) developed a wind turbine-generator emulating system, implementing a MATLAB-integrated OPAL-RT real-time model to simplify control scheme development of both generator and grid-side converters.Li et al. (2016) developed an analogue digital hybrid MATLAB integrated OPAL-RT real-time simulation platform for single-or multi-generation unit grid connected Renewable energy integration behavioural simulations, noting the feasibility of such platforms for this purpose.Kemal et al. (2017) developed a model using MATLAB/Simulink and OPAL-RT to demonstrate the abilities of these tools to perform hardware-in-the-loop simulations when studying various aspects of the RE integration process.
Although several real-time simulation platforms to study various aspects of the RE integration process have been developed, none presents a tailorable model incorporating grid code requirements against which simulated RPPs can be operated when performing RE grid integration studies.This study, therefore, develops a versatile grid code-guided RPP control testbed tailored to South African grid code requirements for performing RE grid integration studies.
It furthermore became apparent that MATLAB-integrated OPAL-RT models are favoured for their power generation real-time simulation abilities.Noureen et al. (2018) investigate and summarize the strengths and abilities of OPAL-RT's renowned simulators, and the various advantages of implementing MATLAB as front-end software.The validity of this combination for power generation modelling is corroborated by Singh et al. (2015), modelling the New England 39 bus, and WSCC 9 bus systems to assess the performance and limitations of both model and simulator under various test cases.Given this, the testbed of this study will implement MATLAB Simulink for designing the model, which will then be brought to real-time simulation using OPAL-RT's RT-LAB, and OP4510 real-time simulator.The design incorporates grid code requirements against which a simulated RPP connected to a grid representing network is operated, concerning point of connection (POC) conditions.This method of operation then allows the strain placed on RPPs by grid code requirements to be studied, in addition to the simulation abilities offered by other RE grid integration platforms reviewed.
Though tailored to South African specifications for this study, the testbed's design will also allow the user to add MATLAB live script contained grid code requirements, replay any grid representing spreadsheet contained data or insert any type and size of RPP, enabling the testbed's applications to reach well beyond that of South Africa.The option of integrating additional grid code requirements will then allow the testbed to be implemented for studies like that of Al Riyami et al. (2016), simulating a 50 MW Dhofar network integrated wind farm to evaluate new RPP grid code requirements for the region.Studies such as that of Abdalla (2016Abdalla ( , 2018)), in which technical requirements are reviewed for PV systems connected to Egypt's electrical network, can then also benefit from adopting such a testbed to perform grid-connected RPP behavioural studies, implementing the technical specifications it reviewed.
The paper is structured as follows.Section 2 summarizes the relevant South African grid code requirements integrated as part of the testbed's design.Section 3 discusses the model development process, including the circuit sections and their respective inputs and outputs.Case study results and the discussion thereof are covered in Section 4 before Section 5 concludes and offers suggestions for future work.Based on the outcome of this study, its main contribution is an adaptable real-time grid code-guided RPP control testbed, to be used for RE grid integration studies.The testbed may then be tailored and implemented by students and researchers alike to simulate the behaviour of grid connected RPPs at a specific POC, under various replayed or recreated conditions.

A review of testbed integrated South African renewable power plant grid codes
Grid codes are important to the testbed's development as their requirements govern conditions during which RPPs should remain connected, allowing the demands placed on JEDT RPPs by these requirements during disturbances to be studied.As South Africa has already developed RPP-specific grid codes with future stability and reliability in mind, the testbed's development proceeded to incorporate these as what would be required of RPPs to ensure future stability and reliability leading up to the integration of 14,725 MW renewables by 2030.
South Africa's RPP grid code requirements however accommodate different types and sizes of RPPs, an ability that had to be incorporated into the testbed.Determining the requirements of a specific RPP is its category based on size, classified as follows (Yan et al., 2015;National Energy Regulator of South Africa, 2016;Etxegarai et al., 2017;Department of Energy and Department of National Treasury, 2018;RSA Department of Energy, 2018;Mararakanye and Bekker, 2019;Mchunu, NERSA and Eskom Transmission Division, 2019): Category A1: 0 to 13.8 kVA; Category A2: > 13.8 kVA to < 100 kVA; Category A3: 100 kVA to < 1 MVA; Category B: 1 MVA to < 20 MVA; and Category C: 20 MVA or greater.
With an RPP's details known, its grid-connected requirements are identified from the South African RPP grid code document.Although grid codes include a wide range of support and ride-through specifications, the testbed's focus will fall on incorporating grid code voltage and frequency specifications, being fundamental requirements.These are given by grid codes in the form of graphs, such as that in Figure 1, illustrating requirements for nonsynchronous Category C RPPs (Mchunu, NERSA and Eskom Transmission Division, 2019).
Considering Figure 1, the voltage and frequency requirement graphs can essentially be divided into three areas of RPP operation.The first of these is the "Continuous Operating Range" respectively indicated on both graphs.When in this region of operation, it is expected that the RPP remains connected indefinitely and irrespective of the number of fluctuations within this band.The second area falls outside the continuous operating band, but within the outer boundaries of each graph.This area is known as the fault ride-through region of operation, where it is expected that the RPP remains connected, riding through the fault in support of the grid, thereby allowing time for a fault to potentially clear.The final area of operation is the trip region outside the respective graph boundaries, at which point it is expected of an RPP to disconnect from the grid to prevent or limit any potential damage (Mchunu, NERSA and Eskom Transmission Division, 2019).

Model development
The section focuses on the model developed as a real-time testbed, elaborating on the inputs, sections of the main circuit, subcircuits responsible for validating South African RPP grid codes in terms of voltage and frequency and the outputs generated to allow assessment of the studied RPP's performance.As this study develops a real-time testbed using a MATLAB integrated OPAL-RT model, inputs and outputs will need to be split from the main circuit, allowing the model to be excecated in real-time using RT-LAB and the OPAL-RT OP4510 real-time simulator.A TCP/IP cable is used to establish a physical wired connection using the local network between the equipment, while communication is set up and configured using the host computer and RT-LAB software (Buraimoh and Davidson, 2022).The split layout of the model design is given by the diagram in Figure 2, which also includes the respective host computer and OP4510 real-time simulator used in the lab.

Renewable energy integration
Although designed with versatility and adaptability in mind, this study's simulated RPP will be limited to that of a wind farm operated at optimal wind speed for testbed testing purposes.Furthermore, model-integrated grid codes only include voltage and frequency requirements set for RPPs in South Africa, while fabricated data will be replayed during test simulations to achieve desired POC conditions for testing.Results and conclusions drawn are therefore oriented towards testing of the testbed and are less focussed on conducting an RE grid integration study as part of this paper.Figure 3 follows, illustrating the testbed's main circuit and flow diagram.

Data imports
Part of developing the circuit was to make it adaptable, allowing any type and size of RPP to be inserted and studied.As different category RPPs need to adhere to different requirements,

Renewable energy integration
variable inputs had to be obtained based on the simulated RPP, which include the normal upper (Vnu) and lower (Vnl) operating voltage boundaries.For increased versatility, the circuit uses a single source with inputs "Vpu spreadsheet" and "f spreadsheet" to represent the larger grid network, allowing the testbed to replay previously recorded grid conditions accurately and easily as compared to an elaborate static grid representing circuit.All inputs additionally pass through an OpComm block indicated in Figure 3, allowing the input data housed on the host computer to be imported and used on the physically separated real-time simulator.The subsections, inputs and outputs can then further be defined below.
3.1.1Vnu and Vnl.The "normal upper" (Vnu) and "normal lower" (Vnl) voltage boundary inputs represent the continuous operating voltage limits and are specified according to an RPP's class and POC voltage.For the Eskom Sere representing wind farm modelled in the study, these are respectively represented by the upper and lower boundaries of the "Continuous operating range" indicated as Area A in Figure 1, discussed in Section 2. A MATLAB live script is also implemented, requiring the user to select the simulated RPP's category and POC voltage, after which "if" functions select and output the appropriate "Vnu" and "Vnl" values.
3.1.2Vpu spreadsheet and f spreadsheet."Vpu spreadsheet" and "f spreadsheet", respectively, represent the pu voltage and frequency in Hz inputted to the grid representing source as a value concerning time.This data is housed and imported from an Excel document, making it easy to replay past measured grid data and events, or input custom data for testing purposes.As this study aims to demonstrate the abilities and accuracy of the developed testbed, custom data are used to recreate the desired scenarios of the respective case studies.
3.2 Model components 3.2.1 Grid representing source.The "grid representing source" is seen as the first significant component forming part of the grid section labelled in Figure 3 and uses the imported "Vpu spreadsheet" and "f spreadsheet" data to generate a usable three-phase output to the circuit.To achieve this, a base voltage and nominal frequency of 25 kV at 50 Hz is selected, from which this source block then generates the three-phase output according to equation (1), given by Dixon (2019): Consequently, when applied to the grid representing source, Vpu = Vpu spreadsheet, Vbase1 = the transformer's primary side voltage, and Vout = the grid representing source output voltage.Therefore, However, as in the end, the per unit voltage is of interest at the POC, being the primary input to the grid code validation subsystems, it can be stated that the grid representing source output is simply given by equation (3): 3.2.2Transformer.Connected to the source through Bus 1 is an ideal 25 kV/690 V stepdown wye-delta transformer, of which the secondary voltage was chosen to match that of JEDT the simulated RPP.In terms of per unit values, the transformer's circuit impedance (Z Tnew ) can be represented by equation ( 4), as given by Müller et al. (2009): where S B_new and V B_new represent chosen base circuit values, while S B_old , V B_old and Z old , respectively, represent the transformer voltage, power and impedance rating.3.2.3Load.Connected to the transformer through Bus 2 is a 100 MW grounded static local load.This can be modelled concerning per unit values using equation ( 5) as in Müller et al. (2009): where Z B2 is given by equation ( 6): And, V B2 = the secondary transformer voltage chosen as base value, while S B = the base power rating chosen for the circuit.
3.2.4Renewable power plant.Given that the RPP modelled in Figure 3 is based on Eskom's Sere wind farm, it consists of 46 Â 2.3 MW asynchronous wind turbines with an output voltage of 690 V. To maintain consistency in validating the respective model and validation subsystems, wind speed is assumed constant at 8 m/s for this study.Like the grid representing source, the RPP's voltage (V pu(RPP) ) can be represented in terms of the per unit system by equation ( 7), as given in Dixon (2019): where V out(RPP) = generated RPP terminal voltage, and V base2 = the secondary voltage of the transformer chosen as base value.

Point of connection.
The POC labelled in Figure 3 represents the connection point of the studied RPP to the rest of the network and is of particular significance, being that all measurements are obtained from this bus unless specified otherwise.This includes the complex per unit voltage and current measurements used by the voltage and frequency validation subsystems.Consequently, considering Figure 3, power flows through the POC feeding the load and/or grid representing source depending on simulated conditions.POC per unit current (I pu(POC) ) and voltage (V pu(POC) ) can therefore be given by equations ( 8) and ( 9): where I pu(Load) is the current flowing to the load, I pu(Grid) is the current flowing from or to the grid representing source and Z circuit is the impedance of the circuit concerning the POC.

Renewable energy integration
3.2.6Voltage validation subsystem.The voltage validation subsystem labelled in Figure 3 consists of three, respective, parts, namely, "Detect Event", "Measure Event Time" and "Voltage Violation".The first of these, "Detect Event", use "Vnu", "Vnl" and the measured POC bus voltage "V_POC" as inputs to detect when POC conditions deviate outside normal Vnu/Vnl operating boundaries.When a voltage event is present, a "1" is generated at the "LV/HV Event" output and passed on to the adjacent "Measure Event Time" section.Using the "LV/HV Event" output as input to the "Measure Event Time" section, the duration of the event is measured and outputted in seconds at this section's "Event Time" output.Using this as input, the "Voltage Validation" section continually compares the event duration to the grid code voltage requirement graph boundaries of Figure 1 using lookup tables, allowing the maximum (Vu out) and minimum (Vl out) instantaneous POC voltage boundaries to be generated as outputs.
Comparing "Vu out" and "Vl out" to V_POC then allows grid code voltage violations to be identified, at which time a "1" is generated at the section's "V Violation" output.
3.2.7 Frequency validation subsystem.The purpose of the frequency validation subsystem labelled in Figure 3 is to validate compliance set for RPPs by South African grid codes concerning frequency.As frequency requirements remain constant irrespective of RPP class and POC voltage, the frequency validation subsystem does not require external parameters to be imported into the model.Frequency can however not directly be measured at the POC given the type of simulation, and therefore had to be obtained using the complex POC voltage (V_POC), also used as input to the voltage validation subsystem.Considering the tools available in the MATLAB library, POC frequency could be determined using a "frequency (Phasor)" block, if the phase angle in radians "phase(rad)" is known.Using V_POC, this was then determined.First, the complex POC voltage (V_POC) measured at the POC in the format given by equation ( 10) had to be converted to a more appropriate magnitude (juj) angle (u) format, respectively, using equations ( 11) and ( 12), as given by the Centre for Innovation in Mathematics Teaching (2009): The angle (u) in degrees could then be converted to radians using equation ( 13), and used as input to the "frequency (Phasor)" MATLAB library block with output F_POC representing the POC frequency (Centre for Innovation in Mathematics Teaching, 2009): Next, the grid code frequency requirements of Figure 1 were considered, and a circuit was created implementing comparators to compare F_POC to the constant frequency boundaries of Figure 1, also applying the appropriate time delays where necessary.The comparators will consequently output a "1" when their respective frequency boundary is violated, which after having been delayed according to the graph of Figure 1 is passed on using the "F Violation" output of the frequency validation subsystem.JEDT 3.2.8Renewable power plant data acquisition subsystem.The RPP data acquisition subsystem was included to obtain the data needed for RPP short-circuit testing specified by South African grid codes.Active (I_active) and reactive (I_reactive) current consequently had to be obtained using the available complex three-phase per unit voltage "V_POC" and current "I_POC" available.To achieve this active (P) and reactive (Q) power were first determined using a MATLAB library circuit, and the known relation given by equations ( 14) and ( 15), as in Müller et al. (2009): And Using the active (P) and reactive (Q) power outputs, the active (I_active) and reactive (I_reactive) current components were determined by adapting equation ( 16) to find equations ( 17) and ( 18) (All about circuits, 2020):

Circuit outputs
Voltage simulation results and measurements are obtained and logged using the MATLAB scopes displayed in Figure 4.As these measurements are obtained from the SC_Target subsystem, the data of all scopes passes through an OpComm block before entering the respective scope.The scopes and their respective inputs discussed throughout can then further be defined as follows.
3.3.1 Voltage measurements scope.The Voltage measurements scope of Figure 4 is used to output three graphs, the first displaying the imported per unit spreadsheet voltage "Vpu spreadsheet", the second the voltage validation subsystem output "V Violation", while the third gives the per unit POC voltage "V_POC" alongside the respective voltage boundary limits, "Vnu", "Vnl", "Vu out" and "Vl out" given by Figure 1.
3.3.2Frequency measurements scope.The frequency measurements scope of Figure 4 again outputs three graphs, the first displaying the imported spreadsheet frequency "f spreadsheet" in Hz, the second the frequency validation trip signal "F Violation", while the third gives the POC frequency "F_POC" alongside the constant normal, and frequency ride-through boundary limits, "Fnu", "Fnl", "Lower f limits" and "Upper f limits" given by Figure 1.
3.3.3Console subsystem (SC) test scope.The SC Test scope of Figure 4 is used to output four graphs, namely, the active (I_active), reactive (I_reactive) and peak (I_peak) currents, determined by the RPP data acquisition subsystem, in addition to the final graph used for the POC voltage (V_POC), and RPP trip input (Trip in).

Renewable energy integration
3.3.4Wind turbine measurements scope.The final wind turbine measurements scope of Figure 4 is used to display four graphs, indicating the per unit wind turbine voltage (Vabc_wt), current (Iabc_wt), active power generated in MW (P_out), reactive power generated in MVAR (Q_out) and the trip input signal (Trip in).These signals are all obtained or calculated using direct wind turbine measurement outputs, included to illustrate the load put on the simulated RPP under recreated conditions.

Case study results and discussion
Case studies were selected aimed at testing the ability of the model to appropriately respond to voltage and frequency events when feeding test data with a known outcome.This way, the effectiveness and accuracy of the respective circuit sections could be assessed while illustrating their ability to respond to replayed test conditions as expected.

Voltage validation subsystem testing
To test the ability of the voltage validation subsystem to assess and respond in line with RPP grid code voltage requirements, three case studies were carried out mimicking events that would cause POC conditions to operate within the three regions of RPP operation.These include the continuous operating region indicated by the bluedotted boundaries of each graph, the fault ride-through region given by the greendotted boundaries and the trip region outside the green-dotted ride-through boundaries.In Case study 1 to 3, Figures 5 to 7, the various degrees of voltage spikes and dips introduced to assess voltage validation subsystem response is observed.From the results, it is noted that some distortion in V_POC occurs at the initiation and termination of events, as the RPP compensates and adjusts to the abrupt V_POC changes introduced.In terms of the voltage validation subsystem's response, it is observed that while V_POC remain within the blue-dotted continuous operating region, no trip is generated and the green-dotted fault ridethrough boundaries does not respond.A fault ride-through boundary response indicating abnormal V_POC conditions is observed in Case studies 2 and 3, as V_POC exits the bluedotted continuous operating region.The voltage validation subsystem responds by adjusting green HVRT/LVRT boundaries, in line with Figure 1's grid code voltage requirements it represents.For Case study 2 the fault is short lived, and V_POC recovers in time to reset the subsystem and avoid a trip.For Case study 3 the fault persists, violating the green-dotted fault ride-through boundaries, at which point a trip is generated.Based on the voltage validation subsystem's response to Case study 1 to 3's events, it is concluded that POC conditions were effectively assessed, that the subsystem adapted HVRT/LVRT boundaries in line with Figure 1's grid code voltage requirements, and that the subsystem was able to operate the simulated RPP accordingly.

Frequency validation subsystem testing
Like that of voltage, the frequency validation subsystem's ability to respond to the three regions of operation will be assessed through three case studies mimicking events causing conditions to operate the RPP within these regions.These include the continuous operating region indicated by the blue-dotted boundaries of each graph, the fault ride-through region given by the adjusting green dotted boundaries, and the trip region outside the green-dotted ride-through boundaries.Similarly, it is expected of the RPP to remain connected indefinitely whilst within the continuous operating region, ride-through the disturbance while within the green-dotted ride-through boundaries, and trip once these are violated.Figures 8 to 10 illustrate the results obtained from the respective frequency case study simulations.
Like voltage, Case studies 4 to 6, Figures 8 to 10 introduced various degrees of frequency spikes and dips to assess frequency validation subsystem response to F_POC changes.From the results, the frequency validation subsystem is seen not to respond to F_POC variations within the blue-dotted continuous operating region.A fault ride-through response indicating abnormal F_POC conditions is observed for Case studies 5 and 6, as F_POC exits the blue-dotted continuous operating region.This is in the form of adjusting green HFRT/ LFRT boundaries, in line with Figure 1's grid code frequency requirements it represents.For Case study 5, although coming close, F_POC does not violate the green fault ride-through boundaries, recovering in time to reset the subsystem and avoid a trip.In Case study 6, the fault was severe enough to violate green-dotted ride-through boundaries, at which point a trip was generated.Based on the frequency validation subsystem's response to Case study 4 to 6's events, it is concluded that POC conditions were effectively assessed, that the   JEDT subsystem adapted HFRT/LFRT boundaries in line with Figure 1's grid code frequency requirements, and that the subsystem was able to operate the simulated RPP accordingly.

Short-circuit testing
Case study 7 was performed in response to mandatory short-circuit testing requirements of grid connected RPPs in South Africa.Specifications mandate the introduction of short circuits leading up to a 500 millisecond 20%, 30%, 50%, and 80% voltage drop at the POC, monitoring the RPP's current flow.During such a simulation, it is expected to observe a decrease in the active current flow in favour of an increased reactive current, thereby supporting recovery of the POC voltage.Furthermore, it is also expected that this response will become more prominent as short-circuit severity increase from 20% up to 80% voltage drop.Figure 11 follows, respectively showing the RPP's active and reactive current response for the conditions described.
Case study 7, Figure 11 confirms that once the respective short circuits are initiated at t = 0s, the RPP responds by significantly reducing the active current generated, in favour of reactive current, becoming more prominent with short-circuit intensity.For the yellow 80% short-circuit simulation, a trip is also generated as frequency ride-through requirements are violated.Case study 7 then shows the testbed to effectively respond during short circuits in line with what was expected, giving insight into the support demands placed on RPPs during such conditions.

Conclusion
In this paper, a versatile grid code-guided RPP control testbed is developed, tailored to South African grid code requirements for performing RE grid integration studies.The development of such a tool stems from the fact that RE integration affects all networks differently, making tailored simulations essential to the accuracy and quality of results produced.For this reason, the testbed was developed so that grid side, RPP and grid codes guiding RPP operation are tailorable, which in the case of this study, was tailored to South African conditions.Voltage, frequency and short-circuit event case studies were performed, evaluating the testbed's design and abilities.Voltage and frequency case studies aimed at assessing testbed design validated its ability to accurately track POC conditions, allowing RPP operation in the continuous, fault ride-through and trip region to be identified, in line with which the testbed then operated the simulated RPP.Short-circuit case studies aimed at illustrating the testbed's abilities as RE behavioural studies tool showed the testbed to provide valuable insight into grid code imposed demands, and grid integrated RPP behaviour.This includes that the simulated wind farm will adapt its output to provide reactive current support at the POC relative to short-circuit intensity.During the 80% short-circuit simulation, however, a grid code frequency violation causing the testbed to disconnect the RPP was observed, as the simulated wind farm was unable to provide sufficient POC support within prescribed grid code limits at this time.Studying an RPP's support abilities, grid connected behaviour, fault response and the strain placed on RPPs by grid code requirements, is among the intended uses of the developed testbed ultimately forming part of RE grid integration studies to ensure the success of RE integration goals.Future work may then involve tailoring the testbed to the specifications of another country or region, as well as expanding the testbed's grid integrated parameters, thereby allowing it to be implemented for broader RE integration study purposes.
voltage ride-through; MATLAB = programming platform used for designing and analyzing systems; OP4510 = OPAL-RT real-time simulator; OPAL-RT = a leading developer of real-time simulation software and simulators; P = power, W; pu = per unit system, quantities are expressed as a ratio relative to a common base; code boundary value of an RPPs continuous operating range; nl = lower grid code boundary value of an RPP's continuous operating range; out Figure 1.Non-synchronous Category C RPP voltage and frequency ridethrough requirements Figure 4. Testbed measurement scopes

Figure 5 .
Figure 5. Case study 1, normal voltage fluctuations real-time results

Figure 7 .
Figure 7. Case study 3, trip region real-time results

Figure 8 .
Figure 8. Case study 4, normal frequency fluctuations real-time results

Figure 10 .
Figure 10.Case study 6, trip region real-time results

Figure 11 .
Figure 11.Case study 7, RPP active and reactive current response