You are here

Photovoltaic System Controller Modeling

Summary: 
A project for the Embedded Software Engineering graduate course.
Skills: 
Type: 
Study Project
Scope: 
Class term project
Date: 
April, 2005
Status: 
Completed

There are four key components in a solar power system (1) solar panels (2) solar (charge) controller (3) battery and (4) inverter. The solar panel are photovoltaic cells which are made up of silicon. Silicon becomes electrically charged when exposed to sunlight [1]. Thus, solar panels charge the battery. The charge controller ensures that battery is not overcharged. The inverter converts the DC electrical energy from the battery to AC electrical energy commonly used in the home. The project scope was to develop a hardware software co-description for a solar controller using SystemC.

System Overview

Controller
The controller can be of varying complexity. And, the study focused only a part of the controller: Battery Charger. Please note the above System Overview discussion, and Appendix2 for further discussion. Moreover, the following requirements need be implemented. If BV>PV current/voltage block back current. The battery should be charged at regulated voltage level (PWM method).


C++ and SystemC Review

C++ Concepts
Object oriented programming gained wide acclaim over procedural programming in late 1980s. The main idea is to view the world or the program as objects interacting with each other. The key advantage was that the objects defined once in-term as a class (a blue print for an object) can be reused many times. In order to accommodate the new ideas, the C language evolved into C++.

Traditionally, C uses structures or unions to describe a collection of data. The structures can be referenced and handled collectively; however, they could not do anything. The idea behind object is to include methods or processes that can act or respond to events and conditions. The object contained methods in addition to the collection of data.

SystemC Concepts
The evolution of maturation of hardware software development is well documented. Mechanical to electronic, analog to digital, gate level manual design to computer aided design, the technology has matured in multiple levels. Today, the complexity of hardware (systems on chips, DSP micro-controllers, multi-CPU), and software has increased exponentially and Hardware Software Co Description is an adjustment in the development process to adopt to that complexity.

SystemC is not a new programming language, but a library for C++ that enables hardware software co description. The need for hardware software co description tools has been slow to mature. Embedded industry in particular has struggled to find an effective methodology to co-describe applications. SystemC is a well designed, cost effective, and open tool which provides a valuable aid to the embedded designer. As a result, the industry worldwide is widely adopting SystemC in its design process.

Traditionally, the partition of hardware and software is done early in the development process, and developed separately using HDL for hardware, and C/C++ for software [http://www.cs.ccu.edu.tw/~pahsiung/courses/soc/notes/02_Modeling.pdf]. In case of embedded design, the architecture is first developed, and the software is written specifically in Assembly. The SystemC allows co-description and the modules or process can be partitioned heuristically or automatically into hardware or software.

In SystemC, components are described as modules. Modules consist of processes which perform some action or respond to certain conditions. The intercommunication between modules take place through signals (sub class of channels), and signals are bind at the ports of each modules. The SystemC also provides a clocking mechanism to manage the processing. In addition, events are used similar to interrupts. They are used to respond to wait for and respond to events. SystemC has a kernel, which schedules processes and methods according to the time specification, and generates tracing files and other parameters.

Threads are an important concept to SystemC, and to this project. There are three types of processes: SC_METHOD, SC_THREAD and SC_CTHREAD. Threads are executable portions of code that can be performed independently or can be coordinated for faster performance. Threads can be scheduled concurrently, can be suspended and resumed. SystemC kernel will arbitrarily schedule all threads to run concurrently. Depending to the conditions or instructions contained in each thread, they will be respond. On the other hand, methods have to be executed all at once. Methods can be compared to functions. Note however that methods can generate events.

Implementation Details

The components of the solar system was implemented as modules: Panel.h, Battery.h and Control.h. Each component was interconnected with channels (ports + signals). The actions that each component was to perform (generateCurrent, getCharged, and monitoring and control actions) were implemented using threads. The control depended on the timing mechanism, as well as the events that took place. The time period was set for 1 second, which was the sufficient according to the data reviewed.

Conclusion and Future Work

The project can be considered a basis for not just a controller but the complete modeling and simulation system for a stand along PV solar system. The project established the module, thread based and event responsive design for the stand along PV system. The intercommunication between the modules/threads, and the number of control signals still need to be clearly established and implemented.

Theme by Danetsoft and Danang Probo Sayekti inspired by Maksimer