Friday, July 27, 2018

July 27 update - actuator service installed and running as is sensor service


   Much has been done.
   The power supply booster arrived and has been adjusted and connected.
The script to operate the actuator is finished and runs as a service. The length of day to run, eight hours in summer, was programmed into the operation. The array is now repositioned every 28.4 minutes, throughout the day.
   The script takes into account the start up of the RPi at other than the 'official' start time, 10AM. If early, a wait time is calculated and run as a wait state. If late, the number of missed cycles is calulated and the array repositioned before entering the main routine.
   I replaced the four inch bolt, on the actuator mount, with an eight inch bolt that acts as a rail on which the actuator base can slide. This will eliminate the possibility of the actuator base binding.
   The sensor script is recording data daily, as a service. Some night samples were taken to test the small panels. Two of the panels began low frequency, amplitude modulated oscillation. The panels drop to zero volts in the dark. That test is done. The oscillations may be due to the 'dupont' connectors used.
   A semi-permanent form of wiring connection needs to be implemented. The existing connectors are for prototyping and aren't much good, even for that.
   Currently, I'm examining the installation of suspend and resume/reboot services for use in twenty-four hour system operation. Some operations are initialized every time the system boots and, therefore, need to be accommodated.
   The I2C expander arrived but the design has not been determined yet.
   The actuator power supply has been mounted on a section of vinyl gutter downspout. The fix is temporary but is neccessary to maintain front access at the same time as free air circulation, around the large heatsink on the back of the board.
   The following photos help depict the situation:



Saturday, July 14, 2018

relay safety, sensor, and I2C

I recently wrote and installed a service to initialize actuator power relays to a zero state. This will avoid any potential startup randomization of GPIO signals that may inadvertantly turn the relays on.

A power supply for actuator control, used in conjunction with the relay card, is on the way.
The p/s is a boost converter that will convert the battery bank's 24VDC to the 36VDC needed to run the actuator that positions the solar array.

The sensor output is recorded by a service, I've written, that records the values of A0,A1,A2,A3 and the date-time. The sensor output is sampled every 30 seconds. The functions for the sensor panels' voltages converge and diverge depending on the position of the sun and the degree of cloudiness.

A I2C multiplexor is en route from China. The device is, like most of the units I use, a breakout module. This one allows several I2C devices to communicate with the Raspberry Pi. This device elimnates the dependence on the number of access points to the I2C signal pins.
Previously, there was one set of I2C pins available on the GPIO connecot. This set was used by the RTC clock. I added a GPIO expansion module that sits on top of the Raspberry Pi. This gave me three GPIO headers to use. All I2C pins have been used. If I want to access more devices, such as sensors, I'll need to find away to expand the I2C access. This is what the I2C expander accomplishes.
The unit has connection points for several devices, each of which is selectable using address pins that can be addressed by GPIO signals.The unit can accomodate 8 devices. The units may be capable of daisychaining.

Sunday, June 17, 2018

Updates and future plans.


Prototyping board update:

   The 2.54mm pitch screw terminal block connectors arrived, as have the 12" 2x20 ribbon cable and new 5vdc relay card. re-wiring the relay card is done. F-F and F-M jumpers are on order as is a GPIO HAT for the Raspberry Pi. The screw terminals fit the header profile of the breakout modules and two standard headers for the ADS1115s remain.

A power connection has to be run from the array power lines (36vdc) to the relay card, to power the linear actuator (36vdc). I have been using the battery bank's 24vdc supply, however, that slows down the actuator's speed.

Connections between the Raspberry Pi's GPIO header and the breakout modules will be from the GPIO HAT using jumpers, screw terminals, wire and ribbon cable.

Current list of modules:
real time clock
8-channel multiplexor
analog to digital converters (ADS1115, PCF8591 multi-function)

Photo of the current state of the prototyping board:


The 5vdc relay card is on the left.
The buck converter is next to the relay card and will replace the Apple iPad power block as power supply.
The Raspberry Pi SoC (System on a Card) is in the middle. The RPi is a full fledged computer.
The PCF8591 is on the right.
Multiple ADS1115s will be placed on the far right.
The 8-channel multiplexor will be placed aboce the relay card, on top.
There is a temperature controlled relay, 20A, module that may be on the right.

The Temperature controlled relay module could be placed above the relay card and in the same  orientation. The multiplexor could be placed on the right and replace some of the ADS1115s.
There is no designated use for the temperature controlled relay card or the multiplexor.
They may be added later on, or left out.
The LCD panel voltmeter needs to be moved up to the prototyping board.

A 12vdc relay card arrived and will be kept for possible future use or resale.
Some consideration has to be made to implementing the plans for a dual-axis tracker and re-mounting of the array on an improved frame.

I need to double the number of batteries in the battery bank to optimize the MPPT controller's function. The controller limits current to 2A for each battery in the bank. This results in a mximum of 250w being drawn from the array. The array is capable of generating 580w.


Saturday, May 26, 2018

more system script work

System scripts have been installed, some with timers. A new script, actuator.py, has been written along with a service and timer. These combined with data collector script edits, plpace operation between 6:00AM and 6:00PM, daily, The edits in conjunction with the actuator script run the linear actuator three times each day. Two extensions, one at noon and one at 3:00PM, follow the position of the sun. The third is a retraction that restores the array to the sunrise position for the next day.

The script for the sensor needs to be written. The sensor needs to be accompanied by another, stationary sensor. The stationary sensor can be used as a reference for the sun path.

System Prototype PCB

Included here is an image of  the system's one pcb, a prototyping board used to mount several; components in one convenient place. The image is self-explanatory.




Sunday, May 13, 2018

more modifications to the system scripts


The data collection script needs to be modified to run between 6:00 AM and 6:00 PM.

The script that writes the header has been modified to skip if the header has been written already for a given day.

Sensor scripts need to be written.
Sensor data collection/storage, and condtion determination contingencies scripts are needed.
Cloudy days, overcast days, and changes in season.
Cross-validation with calculations will be simple.

s-retract.py actuator script


import RPi.GPIO as GPIO
import time
# CHECK wires at RPi header for loose connections when problems occur
# HIGH is low and LOW is high in GPIO using the RPi.GPIO library

# ADD PWM
# 35 seconds is the actuator run time from beginning to end.

# Initialize software and hardware
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
GPIO.setup(26,GPIO.OUT)
GPIO.setup(19,GPIO.OUT)
GPIO.setup(13,GPIO.OUT)
GPIO.setup(6,GPIO.OUT)
# Shut all relays off. Relays are usually off on power up.
GPIO.output(26,GPIO.HIGH)
GPIO.output(19,GPIO.HIGH)
GPIO.output(13,GPIO.HIGH)
GPIO.output(6,GPIO.HIGH)
print('Initialized.')


#####################
# Do this at the end of the day, at 6:00 PM

#Retract on
GPIO.output(26,GPIO.LOW)
GPIO.output(19,GPIO.LOW)
print('Retracting...')
time.sleep(32)
#Retract off
GPIO.output(26,GPIO.HIGH)
GPIO.output(19,GPIO.HIGH)
print('Retraction done.')


Battery bank wiring modification

  The battery bank has been wired in parallel with system connections at the closest battery. This creates an unbalanced load on the bank.  ...