Andrew Que Sites list Photos
Projects Contact
Main

April 18, 2015

Step forward, step backward

   I got the Sun Dragon running the code on the I/O shield for monitoring currents and voltages.  I just had battery current and voltage to start with, but that was a good start.  To get this information to the Odroid, I wrote a simple PHP script.  The I/O shield's Atmel chip is setup for serial communications at /dev/ttyACM99.  The Atmel software writes data out once a second, so simply opening this port as a file and reading a line will result in getting the latest data from the device.  Since that worked, I modified some scripts I wrote for logging system statistics for the Blue Dragon.  They use a sqlite database to store data points about the Blue Dragon's CPU load, temperatures, fan speeds, ext.  With just a little tweaking I reused the same system for logging statistics from the Atmel chip.  A shell script calls my PHP script in a continuous loop.  Each time the PHP script runs it reads one sample from the Atmel chip and logs the data to the sqlite database.  On the Sun Dragon page I added graphs for the information I have available to log.
   With that all working perfectly I decided to work on the rest of the circuit.  I blew up two current sense op amps during this project.  Either I killed them during wiring, or static discharge.  (I'm a bad electrical engineer.)  However, I had been smart and ordered backup chips.  So using my microscope and hot air rework station I replaced the dead chips with new ones.  That did the trick and I started wiring the new setup.  Like an idiot, I left this setup plugged into the I/O shield during wiring.  I shorted 12 VDC from the battery to the ground for the I/O shield and promptly blew up the Atmel chip I had already replaced once for doing something similarly stupid.  My working setup is now dead, and I will have to replace the Atmel chip yet again.
   Lesson learned: do the development work on the development board.  When it functions, move it to the production hardware.
   Pictured is the Sun Dragon with the battery current sense and voltage monitoring functioning.
   I've been working on the software for the Atmel ATmega328 chip on the I/O shield of the Odroid—parts of the Sun Dragon.  I've decided the Atmel will do all the power control and simply make that information available to the main processor.  The first step is acquiring the data and filtering it.  In full daylight with the battery charger, the a PWM controls current into the battery.  The current sense op amp is fast enough to see the turn on/off of this switching.  Rather than try and filter this out with hardware, I filter this with software.  One thing about the Atmel compiler I've found is that it doesn't complain when you run out of memory.  My average buffers had grown too large for the device, but rather than print a link error, the software compiled, loaded into the device, and then did nothing.  That surprised me.
   The code I developed is given a couple of calibration points to in order to determine voltage or current.  I use fixed-point math for everything, so the average always collects samples in powers of two.  Taking 1024 (210) samples at one a millisecond results in roughly a 1 second average.  This gives a pretty good indication of what the current or voltage was for that period.  I let this run for the night on the Arduino.  Tomorrow I'll put the code into the Atmel chip on the I/O shield of the Sun Dragon.
   A shot I did of Raven the other day.  She is posing with Matt's harp and I set the shot up rather quickly as I was taking other pictures.  I did a diamond shot and managed to get some nice motion from the bottom left moving up and to the right, and then back to the left again.  For not spending much time with it, I don't think the composition is not too bad.
   The far bench of the lab.  This is where Pluvius (the laptop) usually sits.  Those bench tops are usually fairly clear unless I'm really making a mess with some project I'm working on.  Under the benches are storage for computer parts, and I have far more than I need.
   The Sun Dragon continues to run under solar power.  Today was partly cloudy, but still had a solid amount of daylight.  Because the ammeter was setup with loss wires I took the Sun Dragon down, but I don't believe it had any problems aside from that.  I haven't done too much work on the setup itself other than secure the power cables in the basement.  Still not entirely sure where the served will be permanently located, but until the circuitry is complete I am not going to worry about this too much.  Since the server will no longer live on the roof, I've been rethinking how to do the controls.  For now, I am manually keeping on eye on battery voltage.  In theory if the system is truly able to run off solar power the battery voltage should not drop over time.  If it does, that means the solar panel is not recharging the battery enough to keep the system powered.  If the power is more or less the same, the system is then maintaining itself.  Time will answer this question.

April 11, 2015

The Great War at Midway Village, 2015

   The house took a trip to Midway Village in Rockford, Illinois for their annual Great War event.  I started going to this event 3 years ago and have been trying to learn much more about World War I.  It's interesting the most people I know can only tell you that World War I happened before World War II, but not much else.  So I've made it a point to try and understand the causes of this war, the fighting that took place, and the effects the war had in the years following the conflict.  I think it can be argued that WWI set the stage for the 20th century, and truly closed the 19th.  With the war came the fall of the German, Russian, Austro-Hungarian, and Ottoman empires.  The map of Europe was redrawn, and in the years to come saw the rise of the Fascist Party in Italy, Stalinism in Russia, and the Nazi party in Germany.
   I stuck mostly with the biggest history gugu I know, my good friend Steve.  Together we talked to everyone who had a story to tell and spent the entire day from open to close getting our history on.
   Pictured is the last battle reenactment of the day, and the Germans are not doing well in their charge.

April 10, 2015

Welcome the Sun Dragon

   At long last I now have a computer that is solar powered.  After placing the solar panel and running the solar panel wires on the roof yesterday, I completed running the wire into the house today.  It quickly hooked up to the battery charger and battery.  I then wired Odroid into this setup, and it transformed into the Sun Dragon.
   Almost as soon as I had the setup connected, a storm moved in and the daylight dropped from over 100k lux to 5k lux.  Using an ammeter I was able to see the current going to/from the battery.  This would tell me if the battery was charging or discharging.  If charging, the current would be positive as energy would be flowing from the solar panel into the battery.  That means the Sun Dragon is running purely from solar power.  If the current is negative, that means the solar panel isn't producing enough power to run the Sun Dragon by itself, and the battery is supplementing.  Since a storm was overcasting the sky I was actually able to see this cutoff point.  Right about 6,000 lux there is enough light to idle the Sun Dragon with no current going in or coming out of the battery.  If the Sun Dragon begins do any work, however, this is no longer the case.  Running a heavy CPU load on the Sun Dragon requires about 13k lux.  Everything above that is energy in the bank.
   Right now the Sun Dragon's battery has a full charge.  I am going to allow this setup to run without the switch-over relay circuitry (it isn't finished) just to see how that goes.  There has been plenty of sunlight lately so I shouldn't need it, and this will be a good first test for the system.

April 09, 2015

Solar Panel Goes to Roof

   My power cable for the solar panel come today, but I didn't have a lot of time to work with it as I had a meeting in the evening.  At long last I placed the solar panel on the roof.  It is secured to the chimney but otherwise just lays flat on the roof surface.  Once the solar panel was placed I began to run the 10 awg wire.  It way it was wound made this rather painful as it tangled up pretty bad.  I did better with the second wire than the first.  Once the wire was routed off the roof it began to rain.  By this time it was getting close to when I had to leave, so I called the project a day.