You are on page 1of 3

mppt.

dwg simulates the solar panel and the


maximum power point tracking, MPPT, algorithm. The battery charger uses one channel of the Solar2TiM board connected as shown in Figure1.
48 volt Battery

polarity reverses at the peak power point, driving the operating point away from the peak power point. To overcome that, the algorithm used here, simply reverses the polarity when the output power decreases. It requires only two lines of code to replace most of the logic used in the simulation. That is: if (power < prevpower) dvref = -dvref; The simulation uses a V element clock, flip-flop and B element to accomplish the same thing; illustrating the simplification achieved using DSP code instead of analog components. The simulation uses an average model of the system so that cylce-by-cycle switching is not required. It runs in 2.3 seconds for 100 seconds of real time, or about 50 times faster than real time. A cycle-by-cycle switching approach would require many hours, perhaps days, to do the same thing.
2 p1 4 p2 6 p3

40 volt Solar Panel + 8 volts -

Battery

Figure 1, Solar panel battery charger The Solar2TiM regulators are synchronous so that power can flow in either direction. That makes it possible to use one channel as the solar panel charger while configuring the second channel as an active load as shown if Figure 2.

Vout-deltaVout Solar Panel Simulator

210

41.7 volts, 210 watts 25 deg C, spec rated 37.8 volts, 189 watts 40 deg C expected performance

Rb
190
Vout

Plot1 power in watts

170
30.5 volts, 147 watts 40 deg C 9.5% shade

Vin

Iload=deltaVout/Rb deltaVout = polyfunc(Vin-Vout)

150

Figure 2, Using Solar2TiM channel 2 as a solar panel simulator The advantage of simulating a solar panel using this method is that power is not returned to the Battery. instead its re-circulated to the battery charger. The Battery only supplies losses, requiring a lower power and less expensive power supply. Efficiency measurements are far more accurate because only the losses need be measured; that is, power delivered from the power supply and power dissipated in Rb, which is the ballast resistor connecting the 2 channel outputs. Solar panel current is calculated in poly6.c using a 4th-order polynomial function to program the channel 2 set point as shown in Figure 2. It can be seen in Figure 3 that the solar panel power varies with voltage, having a maximum value. If the solar panel voltage was controlled in proportion to the applied voltage, the controller

130 25.0 30.0 35.0 40.0 solar panel voltage in volts 45.0 6 4

Figure 3, Solar panel performance for different operating conditions The error signal is a bang-bang signal that is either positive or negative one volt. It is integrated to control the channel 1 output voltage. Inductor current noise is included in the simulation; it makes the primary contribution to controller accuracy and is dominated by Analog to Digital Converter, ADC, noise. There is a DSP/indcurNoise script in the calculator menu that measures the noise using 1024 sample averages. The measured result is on the order of 20ma RMS. The number of samples in 2 seconds is increased to 2/15u=133.3k. That can reduce the noise by up

to sqrt(133.3k/1024)=11.4 times, provided it is normally distributed. The simulation noise has its RMS value set to 5msec for a 2 second period. An RMS value of about 5msec gives the same simulation result as the measured result shown in Figure 4.
2 vrefsim 3 vrefm

Code for MPPT: This is located in ppt2.c. Its activated by


removing the comment in configure.h to define MPPT2. #define MPPT2 Before running the DSP with MPPT2 enabled, you must do the following:

22.0 vrefsim in volts 18.0 14.0 10.0 6.00

14.0 10.0 6.00 2.00 -2.00 10.0

Simulated MPPT

1. 2.

Plot2 vrefm in volts

Perform required calibration found in calibration.pdf Connect the 2 outputs together using a .25 ohm 10 watt resistor

3
Measured MPPT

30.0 50.0 70.0 xmid in seconds

90.0

Alternate algorithms: The most widely used algorithm taken from the analog world is to recognize the maximum, which can be found by differentiating power such that: dP = 0 But, there must be something to differentiate, so that a dither signal that is well below the controller bandwidth. 10 Hz for example, is injected into the solar panel voltage. The resulting small-signal ac signal can be detected by multiplying the generating signal times the dP signal. The result is: error = sum(dP*vac) But vac is a complex number: VAC(cos(wt) + jsin(wt). The differentiation, dP, shifts the signal by 90 degrees so that: error = sum(dP*sin(wt)) is all that is needed. The error signal goes through zero at maximum power. The above equations suggest 2 implementations. The expansion of dP into its IV components is a conventional analog computing approach. But calculating power and previous power to form dP favors a digital approach because there are fewer multiply accumulate operations. Accomplishing this requires a dither generator to create both sine and cosine terms. The cosine term excites the dither voltage and the sine term is used in the error detector. Luckily, the sinegen.c and singen.asm can be used for the sine-cosine generator needed here. Averaging is accomplished using an integrator for the control loop and its gain sets the bandwidth. Mpptdp2.dwg simulates this algorithm, and ppt.c implements it. Use #define MPPT1 to activate this method.

Figure 4, Compares simulation to measured MPPT performance Semiconductor analog components have a noise contribution known as 1/f or popcorn noise. When the 1/f noise becomes significant, further noise reduction by averaging the signals is not possible. Here, we see that the averaging only gets us to 5 ma RMS, where a Gaussian behavior would result in about 2ma RMS. The code implements MPPT in ppt2.c. There is also a solar panel sweep simulation that accounts for shading and temperature, as well as solar insolence. These effects move the peak power point lower by as much as 10 volts when several solar cells are shaded and the temperature is increased to 40 deg C. Solar cell shading can result from dirt, bird droppings, clouds and trees. The 3 curves in Figure 3 illustrate the power as a function of array voltage: 1. 2. 3. The advertised 25 deg C performance Expected temperature of 40 deg C 10% shade at 40 deg C

Without MMPT there would be an unacceptable degradation in performance, especially for the shaded case, for which power would drop to 62 watts from 147 watts if the controller operated at a constant panel voltage of 40 volts. The sweep simulation is also used to make a 4 order polynomial fit to solar array current vs solar panel voltage. Thats used in poly4solp25.DWG to compute the coefficients used in poly6.c for the solar panel simulator. Coefficients are in poly6.h and they are selected using #defines in configure.h.
th

These algorithms give similar results when the pk-pk band-bang controller amplitude is the same as the dither signal generator amplitude. However, the implementation in ppt.c runs the dither generator for a short (16.4 seconds) burst every 4.37 minutes. That removes the power fluctuation. Additional logic resets the burst when a change in battery voltage is detected. The later logic is for testing so that you can change the input power and watch the MPPT algorithm adjust the solar panel voltage. Overall, the later method gives better results. Notes on patents: Many patents have been improperly issued that are based on previously existing technology. We have described 2 MPPT solutions that date back to the 60s studies for the International Space Station, ISS. Sufficient time has passed for these techniques to be free from patent infringement; however, it may be necessary to do some research if someone claims these procedures are covered by their patent!

hardware and software problems by restarting the DSP if the code fails to kick the dog periodically.

Flash Memory: To program the Flash memory so that the DSP runs without being connected to the debugger you need to do the following:
1. 2. 3. 4. Assuming you have been running under the debugger; halt the processor (F5) and reset it (F6) Using the programmer menu, select MPLAB ICD3 as your programmer. Switch to the release build configuration and using the Project menu, select build all. In the programmer menu, select program.

When programming is complete the DSP will start up. You can disconnect the ICD and the program will continue to run, stand-alone. ICD 3 can be used as your programmer by installing a zero insertion force socket on the evaluation board. To return to the debug mode: 1. In the Programmer menu, select hold in reset. 2. Select the MPLAB ICD3 in the Debugger menu. 3. In the Debugger menu select Erase Flash Device 4. Select the Debug build configuration and Project-Build All. 5. In the Debugger menu, select Program 6. Press F9 to run the program in debug mode. You need to add watchdog timer functionality for production. It bails the DSP out of unforeseen

You might also like