Keywords

1 Introduction

The need for energy is continuously increasing owing to the lifestyle of the millennium and growing population. Exploring an alternative source of energy is the urgent demand of the hour for a sustainable future. The solar PV source is seen as one of the potential alternatives to meet the gap between energy demand and generation. India is bestowed with solar radiation capable of generating 5000 trillion kWh/year [1].

Several papers have discussed various MPPT algorithms with the aid of simulation results; however, developing code for a digital computer is still a challenge for many core engineers. MBD, a new approach for embedded development, is fast emerging as alternative for code development. MBD is a model-centric approach to the development of controls for a dynamic system. It facilitates system-level design, RCP, automatic code generation and accelerated testing and verification [2]. Given preliminary simulation studies and design specifications, RCP and HIL testing can be performed on the system under test. If the simulation studies reveal substantial details about the system, then the model can be directly used for production code generation [3].

The rapid growth in MBD and rapid prototyping technology over the last few decades has motivated core designers to adapt MBD to develop code for their algorithms. Also, new MBD platforms like dSPACE, OPAL-RT are fast emerging to promote MBD and RCP to reduce the time for product development. MBD requires a hardware platform and dedicated software for performing necessary functions. The work of selected research articles using MBD for power electronics and MPPT is consolidated in Table 1. MATLAB-Simulink with embedded coder toolbox is the most commonly used host PC software with a wide variety of supporting hardware platforms like OPAL-RT, FPGA, DSP and microcontroller [4,5,6,7,8,9,10]. Few researchers have also explored LabVIEW for the implementation of MPPT algorithms using different compatible hardware platforms [11,12,13]. It is to be noted that backend software compatible with the chosen hardware platform is required to compile c-code generated by the embedded coder. In addition to automatic code generation, both MATLAB-Simulink and LabVIEW facilitate HIL simulation. However, only LabVIEW supports interactive HIL simulation. The development using LabVIEW is not viable for commercial application as the code generation is not available for low-cost microcontrollers.

Table 1 Summary of software and hardware platform used for embedded controller development employing MBD

Applications like MPPT requires real-time tuning of parameters like sampling time and perturbation step size for optimal performance. This paper presents a simple approach for RCP of perturbation-based MPPT algorithms. The proposed method uses a Altair Embed software, TI TMS320F28027 controller and Code Composer Studio for the execution of MBD, automatic ‘C’-code generation and interactive HIL simulation for controller tuning and development. Blocks like PWM, ADC, unit delay, sample and hold, and digital filter required for the implementation of classic perturbation algorithms are discussed in detail. Further, the interactive HIL simulation feature of Altair Embed is explored to demonstrate live tuning of sample time and perturbation step size for opt mal performance of MPPT algorithm.

2 Model-Based Design Framework

In this section, the system considered for the test using MBD is discussed. Also, the framework of the MBD using Altair Embed for ‘C’-code generation, interactive HIL simulation and data acquisition and monitoring is presented in detail.

2.1 System Description

The details of system implementation are shown in Fig. 1. The system consists of the solar PV source, DC-DC boost converter feeding resistive load, a TI TMS320F28027 controller and Altair Embed software. The communication link is established between the host computer and the controller using JTAG link at the rate of 100 Hz to facilitate RCP. System variables namely PV voltage (Vpv) and current (Ipv) are sensed and instantaneous power is calculated. The MPPT algorithm is processed to generate appropriate duty ratio (D) to ensure maximum power extraction from solar PV source.

Fig. 1
figure 1

Block diagram representation of the system under test

2.2 MBD Using Altair Embed

The framework of MBD for controller design using Altair Embed is shown in Fig. 2. The MBD software and the backend software (Code Composer Studio) are installed on Host PC. A communication link is established between the target hardware (TMS320F28027) and Altair Embed using the JTAG communication protocol. The controller design and specifications are finalized before deployment using preliminary simulation studies. The MBD approach for controller design using Altair Embed involves following steps:

Fig. 2
figure 2

Model based design framework for rapid prototyping with interacting HIL simulation

  1. 1.

    The designed controller is drawn as model using fixed point blocks in Altair Embed and is checked for logical, syntax error or any overflows.

  2. 2.

    The Altair Embed tool generates the c-code compatible with chosen target hardware.

  3. 3.

    The generated c-code is compiled using Code Composer Studio to generate .out file.

  4. 4.

    The .out file can either be used for interactive HIL simulation or can be burnt into flash of the target hardware for final deployment.

3 Rapid Control Prototyping

The classic P&O algorithm is presented in this section along with its Simulink and fixed point Altair Embed implementation. Also, the interactive HIL simulation using Altair Embed and TMS320F28027 is discussed in this section.

3.1 Perturbation-Based MPPT Techniques

Figure 3 shows the implantation details of P&O algorithm for Boost DC-DC converter. Direct duty ratio implementation is chosen for improved stability [14]. The Simulink implementation of the algorithm reveals the requirement of sample and hold, multiplier, unit delay, sign detector and saturation blocks for implementation of the algorithm. All the aforementioned blocks are available in fixed point block-set of Embed tool for implementation of the algorithm. The implementation of the model using fixed point blocks facilitates code generation for fixed point DSP/microcontrollers and reduced the memory utilization of the controller. The fixed point model developed using Altair Embed tool for TMS320F28027 is as shown in Fig. 4.

Fig. 3
figure 3

Direct duty ratio based P&O algorithm and its Simulink implementation

Fig. 4
figure 4

Model based implementation of P&O algorithm using Altair Embed for TMS320F28027

3.2 Hardware-in-Loop Simulation for RCP

Altair Embed is a user-friendly tool for developing embedded systems. It automatically generates a ANCI ‘C’-code compatible with the low-cost controller [15]. In addition to the code generation, interactive HIL simulation facilitates live parameter tuning and real-time data monitoring without data acquisition system. The software supports wide variety of low-cost controllers [16]. TI TMS320F28027 controller is chosen for study in this paper.

Figure 5 shows two files namely source file and the debug file. The source file consists of the detailed block-level implementation of the algorithm shown in Fig. 4. The source file is designed to facilitate interactive HIL simulation with real-time live data monitoring. The Ts and ∆D are chosen as two interactive inputs while D, Vpv and Ipv acquired in real-time for data monitoring. The ANCI ‘C’-code is generated using source file and compiled at the backend using Code Composer Studio software to generate an executable .out file. A separate debug file is created consisting of target interface block, interactive gains and display units for real-time data monitoring. The debug file allows execution of the .out in real-time and displays the selected data for monitoring in real-time at the rate of 100 Hz. The value of interactive gains can be changed using the slider and the impact of the gains on the system under test is monitored in the display units connected to the output of the debug file.

Fig. 5
figure 5

Interactive HIL simulation setup in Altair Embed using TMS320F28027

4 Results and Discussions

The details of the laboratory prototype developed for conceptual verification are discussed in this section. Also, the experimental results of the interactive HIL simulation studies are presented in detail to highlight the significance of the MBD approach and RCP in the implementation of the MPPT algorithms. Further, the pointers are given to the readers for the implementation of the other perturbation-based MPPT techniques.

4.1 Experimental Setup

The laboratory prototype developed for conceptual validation is shown in Fig. 6. The setup consists of a 1.5 kW Magna solar emulator, boost converter feeding a resistive load, hall effect-based current and voltage sensors, TMS320F28027 controller and host PC with Altair Embed for HIL simulation. The PV current and voltage are sensed using LEM sensors and inbuilt ADC module of TMS320F28027 for processing of MPPT algorithm. The PV current, voltage and duty ratio are acquired using the Embed tool employing HIL simulation.

Fig. 6
figure 6

Snapshot of laboratory prototype developed for conceptual validation

4.2 Results

Figure 7 shows the results obtained during the appropriate selection of Ts. Initially, the value of Ts = 1 s larger than system time constant is selected to obtain stable three-step output for the duty ratio around the maximum power point. Larger Ts increases the system response time, hence the value of Ts is reduced in steps of 0.1. It is observed that, stable output for the algorithm persists only up to value of Ts = 0.5. The D, Vpv, Ipv start to exhibit larger perturbations leading to instability for value of Ts < 0.5 s.

Fig. 7
figure 7

Experimental results of a duty ratio (D), b PV voltage (Vpv), c PV current (Ipv) and d PV power (Ppv) for varying sampling time (1–0.1 s)

The value of Ts is chosen to be 0.5 s for the system under test. Another parameter, which mainly decides the efficiency of the P&O algorithm, is the ∆D. Figure 8 captures the response of the system for different values of ∆D. Initially, the value of ∆D is chosen as 0.1. Further, the value of ∆D is reduced in steps of 0.01 and the response is captured in Fig. 8. For larger values of ∆D, the perturbations in Vpv and Ipv are larger leading to reduced power utilization. It is observed that the system exhibits a stable three-step waveform for the value of ∆D = 0.04, beyond which the system tends to move towards instability, exhibiting random perturbations.

Fig. 8
figure 8

Experimental results of a duty ratio (D), b PV voltage (Vpv), c PV current (Ipv) and d PV power (Ppv) for varying perturbation step (0.1–0.03)

The values of two significant parameters of the P&O algorithm namely Ts and ∆D are chosen with the aid of interactive HIL simulation. For these optimal parameter values (Ts = 0.5 s and ∆D = 0.04), the response of the system for the varying load is captured in Fig. 9. The system exhibits satisfactory performance for three different values of the load hence proving the validity of the controller and chosen parameter values.

Fig. 9
figure 9

Experimental results of a duty ratio (D), b PV voltage (Vpv), c PV current (Ipv) and d PV power (Ppv) for varying load resistor

4.3 Scope of the Study

In this paper, detailed implementation of the classic P&O algorithm for low-cost controller is presented in detail using Altair Embed. Block-level requirement and its fixed point implementation is conferred to the readers. The study can be further extended to other perturbation-based MPPT algorithms with minimal modifications [17,18,19,20,21]. Also, the impact of various parameters influencing the performance of the algorithm can be easily analysed using the concept of interactive HIL simulation.

5 Conclusions

This paper has presented a simple approach for real-time implementation of the P&O algorithm for low-cost controller TMS320F2027 using the concept of MBD and RCP. The usage of the Altair Embed tool for MBD, RCP and HIL simulation with interactive gains have been presented in detail. Results of the laboratory prototype have been presented with the live tuning of sampling time and perturbation step size, demonstrating the significance of interactive gains for RCP. Sufficient details of fundamental fixed point blocks have been discussed for implementation of other perturbation-based MPPT algorithms with minimal modifications to the model discussed in this paper.