Embedded Real-Time Implementation of a Two-Diode Model Photovoltaic Emulator Using dSPACE for Hardware Validation
Abstract
1. Introduction
- −
- Development of a real-time embedded photovoltaic emulator based on the two-diode model using a dSPACE platform;
- −
- Implementation of an LUT-based approach to ensure fast and deterministic execution suitable for real-time applications;
- −
- Experimental characterization of the programmable DC source dynamics and communication constraints;
- −
- Identification of optimal update rates considering serial interface limitations and system stability;
- −
- Validation of the emulator under different load conditions and discretization steps, demonstrating accurate and stable operation for hardware testing of MPPT and power converters.
2. Related Work on PV Emulators and Real-Time Implementations
2.1. PV Emulator Topologies and Architectures
2.2. PV Modeling Approaches for Emulation
2.3. Real-Time and Embedded Implementations
2.4. Research Gaps and Motivation
3. Proposed Embedded PV Emulator Architecture and Modelling Methodology
3.1. PV Panel Modelling
3.1.1. Single-Diode Model (SDM)
3.1.2. Two-Diode Model (TDM)
3.1.3. Three-Diode Model (ThDM)
3.2. Emulator Hardware Design
- Power Stage: A programmable DC source capable of operating over a wide voltage and current range, covering typical PV module operating conditions. Such solutions are widely adopted in PV emulation systems, although their dynamic response is inherently limited by internal control loops and communication delays [9,18].
- Control and Processing Unit: A real-time embedded platform (dSPACE DS1103) is used to execute the PV model and generate control commands. Real-time platforms such as dSPACE enable rapid prototyping and deterministic execution, being widely employed in hardware-in-the-loop (HIL) testing and embedded system validation [19,24]. Alternative implementations based on FPGA or DSP platforms have also been reported, offering higher computational performance at the cost of increased development complexity [33].
- Sensing and Feedback: Voltage and current sensors provide continuous feedback, ensuring that the emulator output matches the theoretical model and measurements are used to continuously update the emulator operating point. Accurate sensing and feedback are essential for ensuring consistency between the theoretical PV model and the physical output [16,37].
- Communication Interface: The programmable power source is controlled via a serial communication interface (RS232), which introduces limitations in terms of command update rate and latency. These constraints must be explicitly considered in the design of the real-time control loop, as they directly affect the achievable dynamic performance of the emulator.
- User Interface and Data Logging: A host computer allows parameter tuning, environmental condition emulation (irradiance and temperature), and recording of experimental data for validation.
3.3. Control Algorithms
- Inner Loop Control: Responsible for fast regulation of the emulator output, ensuring stability and dynamic response. Typically, current-mode or voltage-mode control strategies are employed to regulate the power stage and maintain the desired operating point. These control techniques are extensively used in power electronic converters and PV systems to improve transient response and robustness under load variations [16,38,40]. In hardware-based PV emulators, similar control structures are implemented to ensure that the generated voltage and current follow the reference characteristics with minimal error [9,18,32,34].
- Outer Loop Modelling Control: Responsible for generating the reference voltage or current based on the photovoltaic model. The reference is computed using environmental inputs such as irradiance and temperature, allowing the emulator to reproduce realistic PV operating conditions. Model-based control approaches are commonly used in PV system simulation and emulator design, where accurate representation of environmental effects is required [2,3,4,5,17,19,23]. This separation between modelling and regulation improves modularity and enables efficient real-time implementation.
- Parameter Identification and Adaptation: Accurate parameter identification is essential for ensuring that the emulator reproduces the behavior of real PV modules. Optimization techniques, particularly genetic algorithms, are widely used due to their robustness in solving nonlinear parameter estimation problems [25,35,36]. These methods allow the model to adapt to different PV technologies and operating conditions. Moreover, when combined with lookup-table (LUT) implementations, they significantly reduce computational complexity and enable fast real-time execution, which is critical for embedded systems [26,36].
- Environmental Conditions Simulation: The control framework allows dynamic variation of environmental parameters, such as irradiance and temperature, enabling the emulation of realistic scenarios including partial shading and rapid environmental changes. Such conditions have a significant impact on PV system performance and are widely studied in the literature, particularly in the context of MPPT algorithm evaluation and system reliability [5,6,7,8,9,10,11,12,13,14,15,24,33,35]. The ability to reproduce these scenarios in a controlled environment is essential for validating advanced control strategies.
3.4. Embedded Implementation Using dSPACE
4. Experimental Results and Validation of the Proposed PV Emulator
- (i)
- the maximum permissible current and voltage values at its output terminals, and
- (ii)
- the fact that control commands can be applied through the serial interface at discrete time intervals of .
- Serial Setup—configures the serial communication according to the source communication protocol [27]. Settings: Baud rate 9600, Parity none, Data bits 8, Stop bits 1, Flow control none.
- Transform to string—converts the control voltage value into the character string required by the source command. For example, for 3.45 V the string sent is: “V 03.450 <cr>”, where “V” is the voltage programming code and <cr> (Carriage Return, ASCII code 13) is the command terminator.
- Convert—transforms the numerical representation from double (64-bit) to 8-bit unsigned integer.
- Limiter—constrains the voltage command to the range [0 V, 25 V] to avoid programming the source with out-of-range values.
- Voltage_Adapt—scales the measured ADC voltage to the actual load voltage , by multiplying with the factor corresponding to the dSPACE board scaling and the divider ratio .
- Sampler—samples the signals with period Δt.

5. Experimental Results with the Proposed PV Emulator
5.1. Summary of Experimental Findings
- The relationship between the signals and is inertial, and it is not influenced by the load resistance . It is characterized by both a time delay (a time constant, ) and a dead time , having the form:
- The time constant does not depend on or the sampling step and is a practical invariant of . When two programmable voltage sources are commanded synchronously and connected in series to create emulators for panels with higher terminal voltages, the time constant is observed to double (see Figure 10 and Figure 11).
- The dead time is a random variable of the programmable source, taking values in the interval [0, 0.1] s. Based on this, as a first approximation, one can consider = 0 s and operate with the following model:and in a second approximation, one can consider s, operating with the model:
- Given that the load circuit is resistive and therefore non-inertial, under the assumption that , Vs, we can consider that:with = 0.5 s, in the first approximation and with = 0.5 s, in a second approximation.
5.2. Dynamic Behavior Under Load Variations
5.3. Stability Analysis
5.4. Comparative Analysis and Experimental Performance
5.5. Final Remarks and Future Work
6. Conclusions
Author Contributions
Funding
Data Availability Statement
Conflicts of Interest
Abbreviations
| ADC | Analogue-to-Digital Converter |
| cr | Carriage Return |
| DSP | Digital Signal Processor |
| I–V | Current–Voltage |
| The reverse saturation current | |
| The reverse saturation current diode 1 | |
| The reverse saturation current diode 2 | |
| The reverse saturation current diode 3 | |
| Photocurrent | |
| Current of Photovoltaic Panel | |
| FPGA | Field-Programmable Gate Array |
| G | Sun radiation |
| GA | Genetic Algorithm |
| HIL | Hardware-In-the-Loop |
| Discretization step | |
| MPPT | Maximum Power Point Tracking |
| The diode ideal factor | |
| The diode 1 ideal factor | |
| The diode 2 ideal factor | |
| The diode 3 ideal factor | |
| PC | Personal Computer |
| PV | Photovoltaic |
| P–V | Power–Voltage |
| Voltage divider consisting of resistors | |
| Voltage divider consisting of resistors | |
| Resistive Load | |
| The shunt resistances (or parallel resistance) | |
| The Series Resistance | |
| SDM | Single-Diode Model |
| sec | Seconds |
| TDM | Two-Diode Model |
| ThDM | Three-Diode Model |
| U | The ramp signal to a zero-order hold element |
| V | The voltage programming code |
| Actual load voltage | |
| Voltage of Photovoltaic Panel | |
| Board using the Voltage control signal | |
| DC voltage | |
| The thermal voltage | |
| θ | Temperature |
References
- International Energy Agency Photovoltaic Power Systems Programme (IEA-PVPS). Snapshot of Global PV Markets 2025; IEA-PVPS: Paris, France, 2025; Available online: https://iea-pvps.org/wp-content/uploads/2025/04/Snapshot-of-Global-PV-Markets_2025.pdf (accessed on 20 September 2025).
- Pytel, K. Evaluation of Environmental Factors Influencing Photovoltaic Power. Energies 2025, 18, 2113. [Google Scholar] [CrossRef]
- Al Humairi, A.; El Asri, H.; Al Hemyari, Z.A.; Jung, P. A Robust Modeling Analysis of Environmental Factors Influencing the Direct Current, Power, and Voltage of Photovoltaic Systems. Electronics 2025, 14, 2647. [Google Scholar] [CrossRef]
- Baxevanaki, E.; Tzoumanikas, P.; Kazadzis, S. Effects of Aerosols and Clouds on Solar Energy Production. Remote Sens. 2025, 17, 3201. [Google Scholar] [CrossRef]
- Raza, M.A.; Rehman, S.; Ahmad, S.; Sajjad, I.A.; Bhatti, M.A. Mitigating the Impact of Partial Shading Conditions on Photovoltaic Systems. Sustainability 2025, 17, 1263. [Google Scholar] [CrossRef]
- Sezgin-Ugranlı, H.G. Photovoltaic System Performance Under Partial Shading Conditions: Insight into the Roles of Bypass Diode Numbers and Inverter Efficiency Curve. Sustainability 2025, 17, 4626. [Google Scholar] [CrossRef]
- Petcut-Lasc, A.-A.; Balas, V.E.; Petcut, F.-M. A Survey of MPPT Techniques Under Partial Shading Conditions: Evaluating the Firefly Algorithm’s Performance. In Proceedings of the 18th International Conference on Engineering of Modern Electric Systems (EMES 2025), Oradea, Romania, 29–30 May 2025; IEEE: New York, NY, USA, 2025; pp. 1–6. [Google Scholar] [CrossRef]
- Tahir, Z.; Ghafoor, A.; Saqib, M.A.; Khan, A.A.; Tariq, M.; Arif, S.M. A Comprehensive Review on Recent Developments in PV Emulators: Topologies, Control, and Applications. Sol. Energy 2021, 220, 102–129. [Google Scholar] [CrossRef]
- Ayop, R.; Tan, C.W. A Comprehensive Review on Photovoltaic Emulator. Renew. Sustain. Energy Rev. 2017, 80, 430–452. [Google Scholar] [CrossRef]
- Krismadinata; Anggraini, S.; Asnil; Mulya, R.; Syafii; Fahmi. Design and Implementation of Photovoltaic Emulator for Testing of Photovoltaic Energy Conversion System. Int. J. Electr. Electron. Eng. 2025, 12, 191–200. [Google Scholar] [CrossRef]
- Villalva, M.G.; Gazoli, J.R.; Filho, E.R. Comprehensive Approach to Modeling and Simulation of Photovoltaic Arrays. IEEE Trans. Power Electron. 2009, 24, 1198–1208. [Google Scholar] [CrossRef]
- Ishaque, K.; Salam, Z.; Taheri, H. Simple, Fast and Accurate Two-Diode Model for Photovoltaic Modules. Sol. Energy 2011, 85, 1938–1949. [Google Scholar] [CrossRef]
- Cubas, J.; Pindado, S.; De Manuel, C. Explicit Expressions for Solar Panel Equivalent Circuit Parameters Based on Analytical Formulation and the Lambert W-Function. Energies 2014, 7, 4098–4115. [Google Scholar] [CrossRef]
- Nguyen, X.H.; Nguyen, M.P. Mathematical Modeling of Photovoltaic Cell/Module/Arrays with Tags in MATLAB/Simulink. Energies 2015, 8, 12264–12284. [Google Scholar] [CrossRef]
- Mellit, A.; Kalogirou, S.A. Artificial Intelligence Techniques for Photovoltaic Applications: A Review. Prog. Energy Combust. Sci. 2008, 34, 574–632. [Google Scholar] [CrossRef]
- Blaabjerg, F.; Teodorescu, R.; Liserre, M.; Timbus, A.V. Overview of Control and Grid Synchronization for Distributed Power Generation Systems. IEEE Trans. Ind. Electron. 2006, 53, 1398–1409. [Google Scholar] [CrossRef]
- Rotar, R.; Petcut-Lasc, A.-A.; Petcut, F.-M.; Opritoiu, F.; Vladutiu, M. Failure Mode and Effects Analysis of a Microcontroller-Based Dual-Axis Solar Tracking System with Testing Capabilities. Appl. Syst. Innov. 2025, 8, 159. [Google Scholar] [CrossRef]
- Chouder, A.; Silvestre, S. Analysis Model of Photovoltaic Emulator Based on DC Power Supply. Renew. Energy 2010, 35, 2414–2420. [Google Scholar] [CrossRef]
- OPAL-RT Technologies. Real-Time Simulation for Power Electronics and Smart Grid; White Paper; OPAL-RT: Montreal, QC, Canada, 2019. [Google Scholar]
- Chroma ATE Inc. 62000H-S Series Solar Array Simulator. Available online: https://www.chromaate.com/eu/product/solar_array_simulator_62000h_s_series_205 (accessed on 5 April 2026).
- Keysight Technologies. PV8900 Series Photovoltaic Array Simulator. Available online: https://www.keysight.com/us/en/products/dc-power-supplies/dc-power-solutions/pv8900-photovoltaic-simulator.html (accessed on 5 April 2026).
- dSPACE GmbH. ACE Kit Pricing Sheet for Universities; dSPACE GmbH: Paderborn, Germany, 2022; Available online: https://acc2022.a2c2.org/wp-content/uploads/sites/45/2022/02/ACE_Kit_Pricing_Sheet_2022.pdf (accessed on 5 April 2026).
- dSPACE GmbH. Hardware-in-the-Loop Simulation for Power Electronics; Application Note; dSPACE GmbH: Paderborn, Germany, 2020; Available online: https://www.mathworks.com/products/connections/product_detail/dspace-hil-test.html (accessed on 22 March 2026).
- Test Equipment Depot. Extech 382280 Triple Output Programmable DC Power Supply, 40V/5A, 200W-Product Listing. Available online: https://www.testequipmentdepot.com/extech-382280-triple-output-programmable-dc-power-supply-40v5a-adj-5v2a-and-33v3a-fixed-200w.html (accessed on 5 April 2026).
- National Instruments. LabVIEW System Design Software; National Instruments: Austin, TX, USA, 2016. [Google Scholar]
- Walker, G. Evaluating MPPT Converter Topologies Using a MATLAB PV Model. J. Electr. Electron. Eng. Aust. 2001, 21, 49–55. [Google Scholar]
- Hohm, D.P.; Ropp, M.E. Comparative Study of Maximum Power Point Tracking Algorithms. Prog. Photovolt. Res. Appl. 2003, 11, 47–62. [Google Scholar] [CrossRef]
- Esram, T.; Chapman, P.L. Comparison of Photovoltaic Array Maximum Power Point Tracking Techniques. IEEE Trans. Energy Convers. 2007, 22, 439–449. [Google Scholar] [CrossRef]
- Merenda, M.; Iero, D.; Carotenuto, R.; Della Corte, F.G. Simple and Low-Cost Photovoltaic Module Emulator. Electronics 2019, 8, 1445. [Google Scholar] [CrossRef]
- Moussa, I.; Khedher, A.; Bouallegue, A. Design of a Low-Cost PV Emulator Applied for PVECS. Electronics 2019, 8, 232. [Google Scholar] [CrossRef]
- Harrison, A.; Alombah, N.H.; Kamel, S.; Ghoneim, S.S.M.; El Myasse, I.; Kotb, H. Towards a Simple and Efficient Implementation of Solar Photovoltaic Emulator. Eng. Proc. 2023, 56, 261. [Google Scholar] [CrossRef]
- El-Hameed, A.A.; Mahmoud, M.S.; Mohamed, A.H. Development of a Software-Based PV Emulator for Educational and Research Applications. Appl. Sci. 2025, 15, 2457. [Google Scholar] [CrossRef]
- Mekki, H.; Mellit, A.; Kalogirou, S.A.; Messai, A.; Furlan, G. FPGA-Based Implementation of a Real Time Photovoltaic Module Simulator. Prog. Photovolt. Res. Appl. 2010, 18, 115–127. [Google Scholar] [CrossRef]
- Panuya, P.S.; Salkuti, S.R.; Mandal, K.; Roy, M.; Kim, S.C. Design and Analysis of Digitally Operated PV Emulator Using Newton–Raphson Method. In Energy and Environmental Aspects of Emerging Technologies for Smart Grid; Springer: Cham, Switzerland, 2024; pp. 497–514. [Google Scholar] [CrossRef]
- Petcut-Lasc, A.-A.; Balas, V.E.; Petcut, F.-M.; Barna, C. Modelling and Identification of Two Genetic Algorithms Used for Solar Cell Parameter Extraction. In Proceedings of the 29th International Conference on Intelligent Engineering Systems (INES 2025), Palermo, Italy, 11–13 June 2025; IEEE: New York, NY, USA, 2025; pp. 21–26. [Google Scholar] [CrossRef]
- Petcut, F.M. Solar Cell Parameter Identification Using Genetic Algorithms. J. Control Eng. Appl. Inform. 2010, 12, 30–37. [Google Scholar]
- Sun, J. Small-Signal Methods for AC Distributed Power Systems—A Review. IEEE Trans. Power Electron. 2009, 24, 2545–2554. [Google Scholar] [CrossRef]
- Petcut-Lasc, A.-A.; Balas, V.E.; Petcut, F.-M. Real-Time Performance Evaluation of a MATLAB/Simulink-Based Residential PV System. In Proceedings of the ICCSC 2025, Fez, Morocco, 19–20 June 2025. [Google Scholar] [CrossRef]
- Petcut, F.M. Advanced Lookup Table for Enhanced Maximum Power Point Tracking Accuracy in Photovoltaic Systems. J. Control Eng. Appl. Inform. 2025, 27, 102–109. [Google Scholar] [CrossRef]
- Prakash, S.B.S.; Singh, G.S.; Singh, S.S. Modeling and Performance Analysis of Simplified Two-Diode Model of Photovoltaic Cells. Front. Phys. 2021, 9, 690588. [Google Scholar] [CrossRef]
- Qais, M.H.; Hasanien, H.M.; Alghuwainem, S.; Loo, K.H.; Elgendy, M.A.; Turky, R.A. Accurate Three-Diode Model Estimation of Photovoltaic Modules Using a Novel Circle Search Algorithm. Ain Shams Eng. J. 2022, 13, 101824. [Google Scholar] [CrossRef]
- Dolara, A.; Faranda, R.; Leva, S. Physical Modeling of Photovoltaic Arrays for Emulator Applications. Energy Convers. Manag. 2012, 59, 144–152. [Google Scholar] [CrossRef]
- Koran, A.; Sera, D.; Teodorescu, R. PV Emulator for Real-Time Simulation of PV Systems. In Proceedings of the IEEE ISIE, Gdansk, Poland, 27–30 June 2011. [Google Scholar] [CrossRef]
- Extech Instruments. Power Supply Used: EXTECH 382280; Extech Instruments: Nashua, NH, USA, 2013; Available online: https://assets.testequity.com/te1/Documents/pdf/extech/manuals/382280_UM.pdf (accessed on 10 September 2025).












| Emulator Type | Implementation Example | Key Characteristics | Limitations | Typical Application |
|---|---|---|---|---|
| Software-Based [25,26,27,28] | MATLAB/Simulink PV models [26]; LabVIEW-based implementations [25] | High flexibility; low cost; easy model modification; suitable for rapid prototyping and algorithm testing | Cannot supply real current/voltage; limited to offline simulations | Algorithm development; theoretical MPPT analysis [27,28] |
| Hardware-Based [29,30,31,32] | Programmable DC power supplies [29]; DC–DC converter-based emulators [30,31]; software-driven PV emulators [32] | Real-time current and voltage output; direct interface with physical loads; suitable for experimental validation | Limited bandwidth and dynamic response; high cost of high-performance equipment | MPPT validation; inverter and power converter testing |
| Hybrid (HIL) [19,24,33,34] | dSPACE-based systems [24]; OPAL-RT platforms [19]; FPGA-based simulators [33]; digitally controlled emulators [34] | Combines real-time simulation with hardware; high fidelity; supports hardware-in-the-loop testing | High complexity; expensive; requires specialized expertise | Research laboratories; industrial prototyping; embedded control validation |
| Approach | Advantages | Limitations |
Typical Application | Reference |
|---|---|---|---|---|
| Software-based emulator (MATLAB/Simulink, LabVIEW) | Flexible, low cost, easy to modify; suitable for fast prototyping and algorithm testing | Limited accuracy at low irradiance; cannot supply real current/voltage; restricted to simulation environments | Algorithm development, theoretical MPPT studies | [19,25,26] |
| Hardware emulator, using DC–DC converter | Fast response, suitable for MPPT testing; direct interaction with loads | Increased system complexity; higher implementation cost; design effort required | MPPT validation, inverter testing | [18,29,32] |
| FPGA-based real-time emulator | High accuracy, parallel processing capability; very fast response | Requires FPGA expertise, high development cost | Inverter evaluation, PV system testing | [33] |
| DSP-based hardware emulator | Accurate real-time reproduction, modularity; good compromise between performance and flexibility | DSP programming complexity; limited scalability for complex models | Inverter evaluation, PV system testing | [18,34] |
| Microcontroller-based emulator | Low cost, easy to implement; good compromise between performance and flexibility | Limited computational capability; reduced accuracy for complex models | Educational setups, low-power PV tests | [10,32] |
| Hybrid HIL (dSPACE/OPAL-RT) | Combines real-time simulation with hardware; high fidelity; suitable for embedded validation | High complexity, expensive, requires specialized tools and expertise | Research laboratories, industrial prototyping | [19,24] |
| Comparative studies (software, hardware, hybrid) | Comprehensive evaluation of emulator architectures; benchmarking capabilities | Not focused on a specific implementation; limited experimental validation | Benchmarking architectures | [8,9] |
| Model | Accuracy | Computational Complexity | Suitability for Real-Time | Reference |
|---|---|---|---|---|
| Single-Diode | Moderate (error ~5%); suitable under standard conditions; reduced accuracy under low irradiance and partial shading | Low | High | [11,13,14] |
| Two-Diode | High (error ~1.2%); improved accuracy due to inclusion of recombination effects | Moderate | Optimal trade-off between accuracy and complexity | [12,35,36] |
| Three-Diode | Very High (error ~0.8%); improved accuracy due to inclusion of recombination effects | High | Limited; constrained by higher computational requirements | [12,35,40,41] |
| Experiment | Sampling Step (s) | Load (Ω) | Time Constant (s) | Error (%) | Stability |
|---|---|---|---|---|---|
| 1 | 1 | 8 | 0.5 | 1.8 | Stable |
| 2 | 3 | 8 | 0.5 | 1.5 | Stable |
| 3 | 5 | 8 | 0.5 | 1.2 | Stable |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2026 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license.
Share and Cite
Petcut, F.-M.; Petcut-Lasc, A.-A.; Balas, V.E. Embedded Real-Time Implementation of a Two-Diode Model Photovoltaic Emulator Using dSPACE for Hardware Validation. Electronics 2026, 15, 1765. https://doi.org/10.3390/electronics15081765
Petcut F-M, Petcut-Lasc A-A, Balas VE. Embedded Real-Time Implementation of a Two-Diode Model Photovoltaic Emulator Using dSPACE for Hardware Validation. Electronics. 2026; 15(8):1765. https://doi.org/10.3390/electronics15081765
Chicago/Turabian StylePetcut, Flavius-Maxim, Anca-Adriana Petcut-Lasc, and Valentina Emilia Balas. 2026. "Embedded Real-Time Implementation of a Two-Diode Model Photovoltaic Emulator Using dSPACE for Hardware Validation" Electronics 15, no. 8: 1765. https://doi.org/10.3390/electronics15081765
APA StylePetcut, F.-M., Petcut-Lasc, A.-A., & Balas, V. E. (2026). Embedded Real-Time Implementation of a Two-Diode Model Photovoltaic Emulator Using dSPACE for Hardware Validation. Electronics, 15(8), 1765. https://doi.org/10.3390/electronics15081765

