Tag Archives: Over Sampling

C2000 Solar MPPT Tutorial 4

C2000 Solar MPPT Tutorial Pt/4

 

In this fourth and final part of the C2000 Solar MPPT Tutorial, the system set-up and testing will be looked at.  This will involve the overall hardware set-up for testing, ADC calibration, reduction of noise on the ADC sampling, efficiency test and some improvements for future iterations.  The final C2000 solar MPPT tutorial C code is also downloadable at the bottom of the page.

System Testing

Once the hardware was calculated and designed, the PCB was laid out and then printed using the freeware version of EagleCad.  The PCB was then printed on a LPKF milling machine, the finished component side of the PCB can be seen in the image below.

C2000 Solar MPPT Tutorial PCBThe board was given a thorough visual check, it was noted some of the drill holes on the component side were marginally out of alignment.  This is due to a slight misaligned of the milling machine alignment pins, the bottom of the PCB is milled first and then flipped so the component side can be milled.  When the board is flipped the minor misaligned becomes apparent, it is not enough to cause an issue, but I manually make all my own footprints allowing for the small idiosyncrasies and tolerances of the milling machine.

The components used for the design were mainly sourced from the education institution stock, with only the INA138 being ordered in.  This reduced any unwanted lead times and also keeps costs down.  There are down sides to this which were found with the IRFI640G MOSFETs.  The mistake was made of soldering these directly onto the PCB without checking the MOSFETs first, they were sourced from a large bag of perhaps 500 or more IRFI640G, all previously reclaimed from other boards.  Once the board was constructed it was noted the power supply was going straight into over current protection, this was narrowed down to two faulty MOSFETs that were short circuit, between Drain and Source.  A quick on the fly test I used to check the MOSFETs can be seen in the image below.

C2000 Solar MPPT Tutorial MOSFET Testing

System Calibration

Once the board was working, the next step was to test the buck circuits under controlled conditions,  The test involved the C2000 being set-up to supply a fixed PWM output of 50% duty cycle on PWM1, with PWM2 180o out of phase.  A dummy load in the shape of a 100W potentiometer set to 50Ω was connected to the output terminal, with a 20V supply applied to the solar panel input pins.  A multimeter was used to then measure the output DC voltage, which was observed to be 10V, this confirmed the buck circuit was operating correctly, the 20V was adjusted down to approximately 15V and the voltage was observed to half on the output.

After this initial test the ADC values being sampled needed to be calibrated, this would involve measuring the input voltage and current as well as the output voltage and current.  To achieve this to a good accuracy the same test conditions were used and two Hewlett Packard 34401A multimeter’s.  Some constant values were calculated from the signal conditioning circuitry (see the second part of this tutorial here) used to sample the ADC values, these were calculated as follows.

C2000 solar MPPT Tutorial ADC Constant Equations

These values would then need to be adjusted to meet the tolerances of the circuit.  A laptop was also set-up running Code Composer Studio (CCS) and the calculated ADC variables were viewed, and then the constant calculations values altered until the accuracy was satisfactory. The actual ADC constant values used can be seen in the below code snippet

Various test were carried out at this point to see how the ADC calibration and sampling was working, experimenting with sample and hold times, over sampling.  A useful tool is the graphing feature in CCS this allows trends to be observed in variables.  The original set-up used a timer to trigger the ADC sampling, however this generated more noise due to the MOSFET switching, so the PWM was used to trigger the ADC SOC.

 

The next image shows a screen capture from CCS, with the debug mode in operation.  The MPPT circuit was supplied with 17.5V from a regulated power supply, the load potentiometer was set to 40Ω, a PWM frequency of 25kHz (not 15kHz) with a 50% duty cycle was used in an open loop configuration.

C2000 Solar MPPT Tutorial 25kHz_25SH

What this graphed data shows is a 2 minute sample window (click the image to expand), the top graph is the input current with a variation of 2.4mA, and the bottom graph input volts with a variation of 10mV.  At the top right of the graph the ADC input variable values can also be seen, the two highlighted in yellow just indicates the value has just changed.

Efficiency Test

This basic efficiency calculation test was made by graphing the the input and output power under different power conditions.  The power efficiency fluctuated between 85~93%, with the greatest efficiency being achieved towards mid-range power.  The graphed data can be seen below with the input power at the top and the output power at the bottom.

C2000 solar MPPT Tutorial Power Efficiency Graph

Improvements

This was a prototype design and the first attempt at a solar MPPT, as such there are some improvements that can be made for future iterations.

On the software side, the clock speed for the C2000 could be reduced as there is plenty of idle time, the processor could also be placed into a low power mode between timer interrupts, this would bring an overall reduction in power dissipation.  Additionally a battery charging statement machine could be easily added, with a further form of regulation to switch between full charge and float charge.  If the circuit did not require an interleaved design, the code structure and algorithm could be easily ported across to a lower power and less expensive microcontroller like an MSP430G series.

On the hardware, the MOSFETs are key components that could be changed making the system more efficient.  Greater use of surface mount devices would reduce the circuit trace lengths and noise.  An improved ground plan design would also help reduce noise.  The trace lengths for each circuit phase ideally need to be identical, this will help to balance the phases.  It is possible to sample the current in each phase, then use software to adjust the duty cycle to correct any imbalances, however this increases the overall systems complexity particularly the software.

C2000 Solar MPPT Tutorial C Code Download

The link below contains the zip file with the complete C code, there is a small advert page first via Adfly, which can be skipped and just takes a few seconds, but helps me to pay towards the hosting of the website.

C2000 Solar MPPT Tutorial Full C Code

I take great care when writing all the tutorials and articles, ensuring all the code is fully tested to avoid issues for my readers.  All this takes time and a great deal of work, so please support the site by using the Adfly links etc.  If you have found this useful or have any problems implementing, please feel free to leave a comment and I will do my best to help.