Smart-grid Interface with Photovoltaic Installation – Phase 2 PP-01 Team members: Matt Koresh Ivan Mills Matt Martin Advisor: Dr. Aliprantis
Problem Statement Our group is tasked with the completion of previous work on a PV panel. The panel must be installed on top of Coover Hall and must incorporate smart grid technology. Our client has expressed a need for a wireless device to send power data between a solar inverter and a computer interface. Our client has expressed using new Zigbee technology to be incorporated in our design.
Solution We built upon small amounts of previous work laid out by the previous group and began a design for the installation We designed a current measuring circuit and incorporated a wireless Zigbee device in order to transmit data to a computer.
Previous Phase Documentation on PV panel PV panel and cables Due to lack of testing and documentation reverse engineering the inverter could prove futile.
System Diagram
Measurements and Data transfer Current will be measured from Inverter output Power will be calculated from known grid Voltage and Current measurements Data measurements will be sent over Zigbee network to computer with Software interface to display results
Schematic of Final Board
Microcontroller: PIC18F Bit A/D Converter (up to 13 channels) -Internal Oscillator -USART interface -ICSP (In-Circuit Serial Program) -ICD (In-Circuit Debug)
PIC Programming MPLAB from Microchip used to program Assembly Code Utilized ◦3 basic functions: Analog to Digital Conversion of input voltage signal Serial Communication Interface 30 second timer to repeat main functions
PIC Programming ListP = PIC18F4620 #include ; ; ; This program is implementing USART on a PIC18F ; ; OSC = INT RC-Port on RA6, Port on RA ; ; Fosc = 8MHz (internal) ; ;------Initialization Routine ; Init: ; Set Oscillator ; banksel OSCCON movlw b' ';set frequency to 8MHz movwfOSCCON ;------Configure Input/Output------; ;Clear PORTA banksel PORTA;Select the bank that PORTA is located clrf PORTA;Clear the Port just in case erroneous ;Configures Pin AN0 as an A/D input bankselTRISA;Select the bank that TRISA is located MOVLWb' ';move binery number to w-register MOVWFTRISA;move value from w-reg to TRISA - this makes pin AN0 an input for ADC later ;------ADC Init------; ;ADCON0: Controls operation of A/D module bankselADCON0;Select the bank that ADCON0 is located movlw b' ' ;bit selects AN0 as A/D channel, A/D module enabled, A/D conversion to idle movwf ADCON0 ;ADCON1: Configures functions of port pins banksel ADCON1;Select the bank that ADCON1 is located movlw b' ';sets Vref- to Vss, Vref+ to Vdd and AN0 as analog input movwf ADCON1 ;ADCON2: Configures A/D clock source, programmed acquisition time and justification banksel ADCON2;Select the bank that ADCON2 is located movlw b' ' ;A/D Result right-justified movwf ADCON2 ;------Configure USART Communication------; banksel TRISC;select bank holding TRISC movlwb' ';Program RC7/RX pin and RC6/TX pin as directed by datasheet (pg 201) movwfTRISC; bankselSPBRG;Select bank holding SPBRG movlwb' ';decimal value of 12 (binary ) is required value for 9600 baud rate movwfSPBRG;
PIC Programming (cont) banksel RCSTA;select bank holding RCSTA movlwb' ';Enabled transmission, 8 data bits. SPEN bit (RCSTA =1) movwfRCSTA;USART ready to transmit and recieve data banksel TXSTA;select bank holding TXSTA movlw b' ';Transmit enabeled bit TXEN(TXSTA ) set low(disabled) for now, Asynchronous mode low speed(BRGH=0) movwf TXSTA; goto Main;force program to go to Main loop after initialization ; ; ; ; ; ;------Main Routine ; Main: ;------ADC------;\ ;Clear ADC Output registers first to ensure correct measurement banksel ADRESH;Select the bank that ADRESH is located clrf ADRESH ;clear output high banksel ADRESL;Select the bank that ADRESL is located clrf ADRESL;clear output low ;Actually Perform ADC banksel ADCON0;Select the bank that ADCON0 is located bsf ADCON0, GO_DONE;sets GO_DONE bit high enabling ADC btfsc ADCON0, GO_DONE;checks GO_DONE, if low the next line is skipped goto $-1;this is a loop, if GO_DONE is low (ie. ADC is complete) program returns to previous line ;------Send data in A/D registers to Serial------; ;---Note:Data to transmit must be in W register--; TXDATA: ;---Send ADRESH-----; banksel TXSTA bsfTXSTA,TXEN;Transmit enabled bit TXEN(TXSTA ) set, this enables transmission banksel ADRESH movfADRESH, W;put data located in ADRESH into working registry bankselTXREG movwfTXREG;Store ADRESH data in TXREG initializing transmission
PIC Programming (cont) movlwb' ';waste time in order to allow TRMT (status bit) to change so we can pole it movlw b' ';waste more time WaitHerebtfssTXSTA,TRMT;transmit complete if bit TRMT(TXSTA ) is high goto WaitHere;sending not done, go back through loop banksel TXSTA bcfTXSTA,TXEN;clear transmit enabled bit when finished ;---Send ADRESL-----; banksel TXSTA bsfTXSTA,TXEN;Transmit enabled bit TXEN(TXSTA ) set, this enables transmission banksel ADRESL movfADRESL, W;put data located in ADRESL into working registry bankselTXREG movwfTXREG;Store ADRESL data in TXREG initializing transmission movlwb' ';waste time in order to allow TRMT (status bit) to change so we can pole it movlw b' ';waste more time WaitHere2btfssTXSTA,TRMT;transmit complete if bit TRMT(TXSTA ) is high goto WaitHere2;sending not done, go back through loop banksel TXSTA bcfTXSTA,TXEN;clear transmit enabled bit when finished ;------Wait 30's to take another measurement and send data------; ; Delay Loop ; ; Instructions occure every 1/f ; ;This code segment defines how many times to run the delay loop movlw 0xFF;Put the value of 85h in the working register (85h is a value) movwf 09h;Move this value to the 09h register (09h is a register) COUNT2 equ 09h;09h defines how many times to run COUNT1 delay loop movlw 0xFF;Put the value of 85h in the working register (85h is a value) movwf 07h;Move this value to the 09h register (09h is a register) COUNT3 equ 07h;09h defines how many times to run COUNT1 delay loop
PIC Programming (cont) LABEL3: movlw 0xFF;Put the value of FFh (255) in the working register (FFh is a value) movwf 08h;Move this value to the 08h register (08h is a register) COUNT1 equ 08h ;Now COUNT will equal the value 85h LABELDECFSZCOUNT1,1;Decrease COUNT1 by 1 from 255, if COUNT1=0 skip next line and continue goto LABEL;COUNT1 is not 1 therefore go to LABEL DECFSZ COUNT2,1;Decrease COUNT2 by 1 from 09h, if COUNT2=0 skip next line and continue goto LABEL3;if COUNT2 is not 0 therefore re-run delay loop another time DECFSZ COUNT3,1;Decrease COUNT2 by 1 from 09h, if COUNT2=0 skip next line and continue goto LABEL3;if COUNT2 is not 0 therefore re-run delay loop another time goto Main ; ; end
Wireless Communication Wireless communication utilizes Zigbee protocol Zigbee: a) Was a design requirement b) Requires minimal power c) Easy to use d) Is becoming a standard
Zigbee Module Includes MAC address Straight-forward interface More standardized than other modules
Network Topology Due to low power of Zigbee modules a mesh network is utilized to increase reach of our network We are planning ahead for an increased number of devices in the future Zigbee modules work with other device brands
Installation Location
Installation (cont) Equipment Standards Expandability
Serial Communications Built in Java Event Driven USB to Serial
Testing Communications PC Settings Communications Check Modem Configuration
Data Storage Relay data to a MySQL database Programs Needed PHP/Script Interaction Expandability
Visualization Google API Select and Zoom Feature
Project Evolution PrototypeFinal Product
Project Evolution PrototypeFinal Product
Sources
Questions?