Sunday, April 29, 2018

Actuator Control


   The linear actuator I've installed is working.
   The task now, is to develop the control system for the actuator.
   Long ago, I laid out  the basic plan to include software/Raspberry Pi computer and relaycontrol of the actuator. The relay board consists of eight relays  which can be controlled using the GPIO pins of the RPi (Raspberry Pi). Four of the ralays are setup to switch the power lines for motor reversal. This requires two relays acting as DPDT switched for one motor direction and a similar set for the reverse direction.
I have made wiring modificsations to the relay board and connected the board to the RPi using ribbon cable. I will have installed the library needed to run GPIO control commands from the RPi.
I first examined the PIGPIO library but had some segmentation faults with the daemon. This may be a result of SD card data corruption from an earlier system crash.
   I'm reformatting the SD card to eliminate that possibility. I have tentatively decided to use the RPi.GPIO library which was designed specifically for GPIO control. I may return to PIGPIO since some of the PWM routines I want to use, employ that library.
   I ran across an article on the web discussing the shortcomings of most PWM efforts with the RPi.
The auhtor also presented a solution that represents an improvement on those existing methods.
   I will try to find the saved article or the online webpage.
   The actuator requires a 20:1 rest:run ratio. For each minute of runtime, there needs to be 20 minutes of rest time. PWM will achieve two things. First,I'll be able to reduce the effects of a power surge when turning the actuator by using a vasrying duty cycle PWM wave with the power supply. Seconbd, the rest time can be incorporated into the duty cycle, in part, or in whole, to reduce the rest time, if needed.
   Eventually, I will have a separate battery/panel/inverter/contoller for the RPi's permanent use.
The RPi will run 24 hours per day but be in a sleep mode between 6PM and 6AM.
   Software routines will be written to use data from a calcultion and a sensor,to detrmine states and times for the panels' position. An example is the detection of cloudy and overcast days. The sensor will aid in the detection of fallen snow.
   The sensor can be calibrated and used to validate ephemeris calculations.