Theory of Operations - University of Portland

advertisement

University of Portland

School of Engineering

5000 N. Willamette Blvd.

Portland, OR 97203-5798

Phone 503 943 7314

Fax 503 943 7316

Theory of Operations

Project Metolius: Solar Power Meter

Contributors:

Chrissy Rasmussen

David Simon

Jesse Olsen

Approvals

Name

Dr. Hoffbeck

Date Name

Dr. Lillevik

Date

UNIVERSITY OF PORTLAND SCHOOL OF ENGINEERING CONTACT: JESSE OLSEN

THEORY OF OPERATIONS

PROJECT METOLIUS .

.

Rev.

.

.

.

.

.

.

.

0.9 02/10/06

0.91 02/10/06

Date

REV. 0.9 PAGE II

Author Reason for

Changes

Chrissy Rasmussen Initial draft

Jesse Olsen Slight reviion

UNIVERSITY OF PORTLAND SCHOOL OF ENGINEERING CONTACT: JESSE OLSEN

THEORY OF OPERATIONS

PROJECT METOLIUS .

.

.

.

REV. 0.9 PAGE III

.

.

Summary ....................................................................................................................... 1

.

.

Introduction .................................................................................................................. 2

.

Background .................................................................................................................. 3

Architecture .................................................................................................................. 4

Design Overview .......................................................................................................... 5

System Block Diagram............................................................................................................................ 5

Power Supply Unit Design ...................................................................................................................... 6

Solar Panel System ................................................................................................................................. 6

Power Supply Schematic ........................................................................................................................ 6

Worst Case Power Supply Characteristics ............................................................................................ 8

Electronics Design ................................................................................................................................... 9

User Interface Peripherals ...................................................................................................................... 9

Solar Intensity Sensor ............................................................................................................................. 9

Hardware Schematic ............................................................................................................................ 10

Software Architecture ............................................................................................... 12

Software Design ................................................................................................................................... 12

Keypad Design ..................................................................................................................................... 13

LCD Screen Design ............................................................................................................................. 14

Power Control System Design ............................................................................................................ 15

Calculations .......................................................................................................................................... 16

User Interface Design .......................................................................................................................... 18

Conclusions ............................................................................................................... 19

UNIVERSITY OF PORTLAND SCHOOL OF ENGINEERING CONTACT: JESSE OLSEN

THEORY OF OPERATIONS

PROJECT METOLIUS

List of Figures

.

.

.

.

REV. 0.9 PAGE IV

.

.

.

.

.

Figure 1. Block Diagram of Project Metolius ............................................................ 4

Figure 2. Hardware architecture of networked system. .......................................... 5

Figure 3. Power Supply Schematic. .......................................................................... 7

Figure 4. Hardware Schematic. ................................................................................ 11

Figure 5. Software Design. ....................................................................................... 12

Figure 6. Keyboard Design. ...................................................................................... 13

Figure 7. Power Control System. ............................................................................. 15

Figure 8. Interface Routine. ...................................................................................... 16

Figure 9. Max Power Graph. ..................................................................................... 17

Figure 10. User Interface Flow Chart. ...................................................................... 18

UNIVERSITY OF PORTLAND SCHOOL OF ENGINEERING CONTACT: JESSE OLSEN

THEORY OF OPERATIONS

PROJECT METOLIUS

List of Tables

.

.

.

.

.

.

.

.

.

REV. 0.9 PAGE V

Table 1. Max Power Case ............................................................................................ 8

Table 2. Low Power Mode Case (Typical Situation) ................................................ 8

Table 3. Power Supply Unit ........................................................................................ 9

UNIVERSITY OF PORTLAND SCHOOL OF ENGINEERING CONTACT: JESSE OLSEN

THEORY OF OPERATIONS

PROJECT METOLIUS

Chapter

1

.

.

.

.

.

.

.

.

.

REV. 0.9

Summary

PAGE 1

Project Metolius’ Theory of Operations document describes the project, including hardware and software.

A solar-powered device will detects light levels in an outdoor setting. Using the information collected from the photovoltaic cells, the device will calculate the amount of power that could be generated by adding solar power to the building’s infrastructure. It will allow users to change the variables that the device uses to calculate the power.

The hardware section of this document describes the interfacing between the microcontroller, LCD, and power supply. The software section describes the flow of execution and details on the algorithms necessary to complete the calculations for the solar efficiency factor.

The device will rely primarily on the capabilities of a PIC18LF452 microcontroller.

Assembly code will be programmed into the PIC to interface with the I/O and calculate the necessary data. Solar cells will be used in conjunction with a battery buffer to power the device. It will enter sleep mode to save power when solar intensity drops below measurable levels (and thus is unable to power the device).

In theory, the device will be able to run continuously for any length of time, provided that there are a sufficient number of sufficiently sunny days spread throughout that can successfully charge the batteries while charging the PIC.

All user interface components are designed to be simple and straightforward for a trained technician to operate. The data is accessible through the user interface or through a

USB/RS232 connection using a Microchip ICD2 programming interface as a bridge.

UNIVERSITY OF PORTLAND SCHOOL OF ENGINEERING CONTACT: JESSE OLSEN

THEORY OF OPERATIONS

PROJECT METOLIUS

Chapter

2

.

.

.

.

.

.

.

.

.

REV. 0.9

Introduction

PAGE 2

The information is a technical description of our current product. It has been divided into four major sections as follows:

- The Background describes the uses for the finished product.

- The Architecture section describes both the embedded system and the software architecture with diagrams.

The Conclusions section gives a short recap of the entire project and references the other three sections in stating the conclusions drawn by Project Metolius.

.

- The Design Overview gives detailed technical descriptions of the manner in which the architecture is implemented.

UNIVERSITY OF PORTLAND SCHOOL OF ENGINEERING CONTACT: JESSE OLSEN

THEORY OF OPERATIONS

PROJECT METOLIUS

Chapter

3

.

.

.

.

.

.

.

.

.

REV. 0.9

Background

PAGE 3

Solar powered devices have become increasingly popular as alternate means of energy.

Project Metolius aims to create a solar-powered device that detects light levels in an outdoor setting (a roof, for example), and calculates the amount of power that could be generated by adding solar power to the building’s infrastructure, based on existing solar technology. It provides user configuration options to change the variables that the device uses to calculate the power, and will be easily movable from location to location. The intended purpose of the device is to help determine whether or not solar power would be economical in a particular area.

Project Metolius will be based on a Microchip PIC device. The microcontroller will serve as the hub for all peripheral input and output devices, as well as provide the logical structure to compute the appropriate values required for our design.

UNIVERSITY OF PORTLAND SCHOOL OF ENGINEERING CONTACT: JESSE OLSEN

THEORY OF OPERATIONS

PROJECT METOLIUS

Chapter

4

.

.

.

.

.

.

.

.

.

REV. 0.9

Architecture

The following block diagram represents a basic overview of the system’s structure:

PAGE 4

Power

System

Solar Cells

PIC Microcontroller

Key pad

LCD

DISPLAY

Figure 1. Block Diagram of Project Metolius

The keypad will be used as a method to input variable data into the device, and the LCD screen will be used to display user interface components and collected data to the user.

The device is powered by an array of photovoltaic cells in conjunction with a battery buffer and a voltage regulating circuit. The solar intensity is measured with a separate photovoltaic cell and connected into the PIC for polling.

A ll data is stored in the PIC’s built in memory, and will be accessible to a technician via the user interface. The software provides for data entry and extraction with minimal frills, focusing primarily on the collection and calculation of data from the photovoltaic inputs.

UNIVERSITY OF PORTLAND SCHOOL OF ENGINEERING CONTACT: JESSE OLSEN

THEORY OF OPERATIONS

PROJECT METOLIUS

Chapter

5

.

.

.

.

.

.

.

.

.

REV. 0.9

Design Overview

System Block Diagram

Figure 1 illustrates the general architecture of the project: hardware architecture of networked system.

Figure 1. Power Supply Flow Chart

PAGE 5

DC Power Supply

Solar Panel/

Battery Charger

Voltage Regulator

LM7805

LCD Microcontroller PIC

Figure 2. Hardware architecture of networked system.

The power supply portion of the design includes the photovoltaic cells, the batteries, and the voltage regulator circuitry. Its purpose is to ensure that the microcontroller and LCD get sufficient power to perform their intended functions.

UNIVERSITY OF PORTLAND SCHOOL OF ENGINEERING CONTACT: JESSE OLSEN

THEORY OF OPERATIONS

PROJECT METOLIUS

.

.

.

.

.

.

REV. 0.9 PAGE 6

.

.

.

The purpose of the Power Supply Unit is to recharge the batteries during the day. This unit must supply enough energy to the batteries to make up for the power lost during the night as well as the energy being lost during the day. The power supply is made up of two main systems, the DC unregulated power supply and the voltage regulator as shown in

Figure 1. The Voltage Solar Panel, with built in “AA Battery Charger, is a pre-existing unit implemented for charging the partially discharged batteries during the day. The Ni-cad batteries will initially be fully charged before use. The 6 “AA Ni-cad batteries supply a +5V source to the PIC and LCD VDD units through a voltage regulator.

Solar Panel System

The solar panel consists of 24 single crystal silicon solar cells wired in series with a built-in blocking diode. The blocking diode is to prevent the reverse flow of electricity to the solar panel (from the rechargeable battery or appliance) when the solar contribution is insufficient. The unit has a 4 position variable voltage selector switch to maximize charging times. This project implements Position #3 which provides 9 volts at 50 mA. The

6 AA size Ni-Cad rechargeable batteries are placed in the battery compartment and an

LED charge indicator serves to indicate that the charging process is taking place.

The power supply voltage was determined by dividing the voltage needed for the voltage regulator to supply +5V by the specified voltage of the batteries.

Ex: 9 volts / 1.5 volts = 6 AA batteries

Power Supply Schematic

As discussed earlier the solar panel device will house the 6 “AA” Ni-cad batteries. The positive terminals from the batteries will input to PIN1 of the voltage regulator LM7805 to supply +9V as shown in Figure 2. A 1000uF capacitor will be connected in parallel to help maintain a constant input into the regulator. PIN 3 of LM7805 is grounded and PIN 2 is connected to the VDD of the LCD (PIN 1)and PIC (PINS 1 & 3) as shown in Figure 2. A

220uF capacitor is implemented in parallel with the voltage regulator to smooth out the noise on the +5V output line.

UNIVERSITY OF PORTLAND SCHOOL OF ENGINEERING CONTACT: JESSE OLSEN

THEORY OF OPERATIONS

PROJECT METOLIUS

.

.

.

.

.

.

.

REV. 0.9

.

.

Figure 2. Power Supply Schematic

Sun, Solar

Energy

PAGE 7

Positive Terminal

Solar Panel Input

Solar Panel /

Charger

6 AA NiCad Batteries Negative Terminal

+9V PIN 1

Voltage Regulator

‘LM7805

1000uF

PIN 3

PIN 2

220uF

UNIVERSITY OF PORTLAND

LCD

+5V

VDD

Figure 3. Power Supply Schematic.

+5V

VDD

PIC

SCHOOL OF ENGINEERING CONTACT: JESSE OLSEN

THEORY OF OPERATIONS

PROJECT METOLIUS

Worst Case Power Supply Characteristics

.

.

.

.

.

.

.

.

.

REV. 0.9 PAGE 8 maximum power supplied by the Power Supply Unit. This table shows that with the PIC running at full power, the Power Supply Unit would not be able to fully recharge the battery.

Table 1. Max Power Case

Part Description

18LF452 8-bit MCU’s

DM16433 6 x 4 LCD Parallel

Max Voltage Max Current Max Power

Dissipation

N/A

5.5VDC

Display

Power Supply Unit 5V

N/A

4mA

50mA

1W

22mW

250mW

The PIC will be run in a Low Power Mode to reduce power consumption. This decision allows the Power Supply Unit to fully recharge the batteries during the day and run the PIC and LCD. The power dissipation during the night was so small it was considered negligible and not included in Table 2. During the night the LCD will be off, therefore no power consumption, and the PIC will be in sleep mode using .6uW of power.

Part

Table 2. Low Power Mode Case (Typical Situation)

Description Max Voltage Max Current Max Power

Dissipation

18LF452 8-bit MCU’s

DM16433 6 x 4 LCD Parallel

Display

Solar Panel/Battery

(70% full sunlight)

3V

5.5

3.5V

25uA

4mA

35mA

75uW

22mW

122.5mW

Due to the undeterminable amount of constant and direct sunlight on the solar panel system, Table 3. shows the efficiency levels of the Power Supply Unit based on different percentages of direct sunlight hitting the solar panel. The highlighted row in Table 2 shows the threshold at which the Solar Panel will not receive enough sunlight to provide efficient power to recharge the battery and run the PIC and LCD.

UNIVERSITY OF PORTLAND SCHOOL OF ENGINEERING CONTACT: JESSE OLSEN

THEORY OF OPERATIONS

PROJECT METOLIUS

40

30

20

10

80

70

60

50

Efficiency (% of

Direct Sunlight)

100

90

5V

4.5

4

3.5

3

2.5

2

1.5

1

0.5

.

.

.

.

.

.

.

.

.

Table 3. Power Supply Unit

Max Voltage

(V)

REV. 0.9

(mW)

PAGE 9

Max Current (mA) Max Power Supplied

30

25

20

15

50

45

40

35

10

5

250

202.5

160

122.5

90

62.5

40

22.5

10

2.5

Electronics Design

This section shows the schematic for the interface between the PIC microcontroller, the power supply, and peripherals.

User Interface Peripherals

The two user interface peripherals – the keypad and the LCD – are attached to the device through the digital I/O ports on the PIC as shown in the schematic. Some of the wires are shared because they will never be needed simultaneously and will not cause a conflict.

These peripherals will use all 8 bits of PORTD and the first 4 bits of PORTB.

See software section for further details on UI peripheral control.

Solar Intensity Sensor

A third peripheral – the solar intensity meter – will be interfaced to the first bit of PORTA, which is available for direct A/D conversion.

UNIVERSITY OF PORTLAND SCHOOL OF ENGINEERING CONTACT: JESSE OLSEN

THEORY OF OPERATIONS

PROJECT METOLIUS

.

.

.

.

.

.

REV. 0.9 PAGE 10

.

. measurements. See software section for details on converting this into a voltage.

.

Alternate Design Option: interface photovoltaic cell with a current sensor proves

(LM3813) , producing an output that connects to the A/D converter (PORTA) of the PIC.

This will be used if it proves inefficient or inaccurate to measure the current as described above.

Current must be measured in this way because photovoltaic cells produce a current that has a linear relationship with the solar intensity at any given time. The voltage produced by a photovoltaic cell has a logarithmic relationship with solar intensity.

Hardware Schematic

The following schematic details the interface connections between the PIC microcontroller and the peripherals. Resistor and capacitor values have not yet been determined.

The oscillator implemented is P/N LN8441, to oscillate at 8MHz.

UNIVERSITY OF PORTLAND SCHOOL OF ENGINEERING CONTACT: JESSE OLSEN

THEORY OF OPERATIONS

PROJECT METOLIUS

.

.

.

.

.

.

.

.

.

REV. 0.9 PAGE 11

UNIVERSITY OF PORTLAND

Figure 4. Hardware Schematic.

SCHOOL OF ENGINEERING CONTACT: JESSE OLSEN

THEORY OF OPERATIONS

PROJECT METOLIUS

Chapter

6

.

.

.

.

.

REV. 0.9

Software Architecture

.

PAGE 12

Software Design

The code will first go through an initialization subroutine which sets initial values that are necessary in order to define the input and output pins, initialize timers, and perform other critical functions.

Following initialization, the code will lead the PIC into an infinite loop of NOOP commands.

It will sit in this state until interrupted by either the Low Voltage Detector built into the PIC or by a timed interrupt designed to service the keypad and solar intensity inputs.

RESET / POWER ON

Every 10ms, interrupt calls keyscan subroutine uC and LCD

Initialization routine

Every 1000ms, interrupt calls data subroutine

Infinite loop interrupted by timers and voltage detector.

Every minute, interrupt calls

SleepCheck service routine

If voltage ever drops below

3V, brownout service routine is called

Figure 5. Software Design.

SCHOOL OF ENGINEERING UNIVERSITY OF PORTLAND CONTACT: JESSE OLSEN

THEORY OF OPERATIONS

PROJECT METOLIUS

.

.

.

.

Keypad Design

.

.

.

.

Input/Output Ports Needed: 8

.

REV. 0.9 PAGE 13

In order to service the keypad, an interrupt will be generated every 10ms to check to see if a key is pressed. This involved sending out a single test vector and collecting the corresponding inputs, XORing the two together, and checking for 0. If a keypress is detected, the full keyscan routine is called to detect which key was pressed and act accordingly.

The keyscanning subroutine sends a test vector (all low with a traveling high bit) down the four output ports to the keypad. The input ports are checked, and their corresponding values localize the key on the grid which generated the interrupt. Error checking is done by completing the entire test vector even after a positive identification has been made and by repeating the task after a specified interval to effectively handle debouncing in software.

The following diagram illustrated the keypad interface and software keyscanning routine.

1 0 0 0

0 1 0 0

0 0 1 0

0 0 0 1

PIC

μC

18

LF

452

7 8 9 A

4 5 6 B

1 2 3 C

* 0 # D

Connective wires cross beneath keypad

Figure 6. Keyboard Design.

UNIVERSITY OF PORTLAND SCHOOL OF ENGINEERING CONTACT: JESSE OLSEN

THEORY OF OPERATIONS

PROJECT METOLIUS

.

.

.

.

.

.

.

.

.

Input/Output Ports Needed: 4

REV. 0.9 PAGE 14

The LCD screen in use in the device is a parallel LCD. In order to pass values to the screen, and enable port will first be set high. To display letters and numbers, values will be passed via the connective wires from the microcontroller which essentially amount to

ASCII codes that are interpreted by the LCD screen’s logic.

The screen is capable of displaying text or numbers in a grid that is 16 characters wide and four characters high. Its purpose is to display useful information to the technician while inputting or retrieving data from the device. The specific values that are displayed are dependent upon the input from the keypad, and are described in detail under the User

Interface section of this document.

All numeric values are converted to their ASCII equivalents before being sent to the LCD for display.

During the initiation process, 40ms must pass between activating the LCD input and sending data. This timing will calculated with the built in timers in the PIC.

In order to provide visual feedback for inputted data values from the technician, digits will be displayed on the LCD screen as they are typed into the keypad while in data input mode. This will be accomplished by building the ASCII code into the keyscan routine and passing the necessary values to the write buffer that is part of the Hitachi LCD chipset.

The target character on the display will be advanced automatically as part of the KeyChar subroutine.

The LCD will be turned off when not used for a period of more than a minute, as indicated by the flowchart in the user interface section.

UNIVERSITY OF PORTLAND SCHOOL OF ENGINEERING CONTACT: JESSE OLSEN

THEORY OF OPERATIONS

PROJECT METOLIUS

.

.

.

.

.

.

.

.

.

REV. 0.9 PAGE 15

In order to minimize the power consumption of the device and make it better able to operate for long periods of time without intervention, the PIC will be programmed to enter a power-saving standby mode when not needed.

Each minute, the SleepCheck subrouting will be called to check the value from the A/D converter (connected to the variable-voltage photovoltaic input). If the value is below 1.2V

[subject to change] (caused by it being dark outside and low power production on the part of the photovoltaics), a flag will be set. Once the value is below a threshold twice in a row, the device will go into standby.

As part of the initialization routing, a separate threshold will be set for the A/D value which will being the microcontroller out of standby and into normal operation. This threshold will be calibrated once built and will theoretically respond to the sunrise.

Interrupt generated every minute

Fetch

A/D

Value

Clear Flag

Below

Threshold

?

NO

YES

Set Flag

NO

Flag

Set?

YES

Clear Flag

Voltage goes above

1.3V on A/D,

“waking” PIC

Enter

Standby

Figure 7. Power Control System.

UNIVERSITY OF PORTLAND SCHOOL OF ENGINEERING CONTACT: JESSE OLSEN

THEORY OF OPERATIONS

PROJECT METOLIUS .

.

.

.

REV. 0.9

.

. the device. A/D is capable of waking the PIC if a threshold is passed.

.

.

.

Calculations

PAGE 16

An interrupt signal will be generated at a specified time interval (likely every second). The interrupt will call a subroutine which fetches the value from the A/D converter and performs calculations on it to produce the output value of power generated in Watts.

In order to calculate the power, certain variables will be used which represent the square footage of the desired solar cell array and a value related to the efficiency of photovoltaic cells. These variables will be given to the device by the technician through the user interface as described in the next section.

Interrupt generated each second

Value from A/D

Converter

(Voltage) ^2

Divided by resistance

Add to aggregate value

Multiply by size factor

(sq. footage)

Multiplied by efficiency factor

Figure 8. Interface Routine.

Power = (current through resistor)^2 * (voltage across resistor)

A note on calculating solar power:

This value will be calculated every second and aggregated. Therefore, the value produced will be in units of Watt-seconds. This can easily be converted to more relevant units, such as kWatt-hours. The user interface module of the code will convert this value to kW-h before displaying the aggregate value on the LCD.

This device assumes that potential power generation increases linearly with an increase in total exposed area of photovoltaic cells. According to available data, this is accurate with a +/- 0.5% margin of error.

UNIVERSITY OF PORTLAND SCHOOL OF ENGINEERING CONTACT: JESSE OLSEN

THEORY OF OPERATIONS

PROJECT METOLIUS .

.

.

.

.

.

REV. 0.9 PAGE 17 normal applications of photovoltaics, a dynamic load resistance is not a realistic option.

.

.

.

As shown in the graph below, there is a particular voltage (Vmp) and current (Imp) which will result in the maximum power. The 470ohm resistor approximates this optimal voltage for the broadest range of output currents.

Figure 9. Max Power Graph.

A note on the efficiency factor:

The efficiency factor is an input provided by the operating technician. This value can be assumed to be 1 for standard photovoltaics, but allows for power calculation to remain accurate as photovoltaic efficiency increases in newer generations.

UNIVERSITY OF PORTLAND SCHOOL OF ENGINEERING CONTACT: JESSE OLSEN

THEORY OF OPERATIONS

PROJECT METOLIUS

.

.

.

.

User Interface Design

.

.

.

REV. 0.9 PAGE 18 displayed, hitting the corresponding digit will select the option. When entering values, the digits will be displayed on the screen as typed. The process that will be followed is outlined below:

Any key touched

Interrupt generated

LCD turned on

Menu

1.

display data

2.

enter variables

3.

reset data

Menu 2

1.

enter size

2.

enter efficiency

Fetch data from vars

Display data on screen

Refresh data

Reset aggregate power data

Reset all variables

Take input and store to memory

10 second timeout

LCD off

UNIVERSITY OF PORTLAND

Figure 10. User Interface Flow Chart.

SCHOOL OF ENGINEERING CONTACT: JESSE OLSEN

THEORY OF OPERATIONS

PROJECT METOLIUS

Chapter

7

.

.

.

.

.

.

.

.

.

REV. 0.9

Conclusions

PAGE 19

Project Metolius will provide a solar power meter through I/O factors from user and solar voltaic cells. The data will be collected for analysis through the PIC.

The software interface provides the user the ability to see the results of the analyzed data through numerical format. The softwar e and hardware of Metolius’ systems are closely interrelated.

UNIVERSITY OF PORTLAND SCHOOL OF ENGINEERING CONTACT: JESSE OLSEN

Download