Andrew Que Sites list Photos
Projects Contact
Main

April 22, 2015

More broken hardware

   Today I got new shunt resisters which were to increase the range of my current measurements.  However, after I wired the first one in, I seemed to inadvertently destroyed every single current sense op amp in the setup.  They are disgustingly sensitive devices and I now hate them.  I've killed two already, and this makes a total of 5.  The thing about them I hate the most is they are surface mount parts on an through-hole adapter board.  Surface mount sucks for bread boarding.  The adapters are expensive and the pads fall off if you try and switch parts.  I'm not happy about this at all.  Clearly, I am not a good electrical engineer.

April 21, 2015

A look at initial chage/discharge data


   The past couple of days have been cloudy, but I have been able to get voltage and current readings for the Sun Dragon.  The data is currently being monitored with an Arduino and logged with the Blue Dragon.  The graph shows several interesting things.  The battery voltage is suppose to hold around 14.5 volts when the sun is up.  This is the charging voltage of the battery.  When the sun sets the voltage drops to just above 13 volts, and then slowly drops over the evening.  The lowest point is right before the sun comes back where the battery voltage is around 12.8 volts.  That's the good news.
   The bad news is that the voltage sometime spikes up well over 15 volts, which is the maximum the sensor can measure.  This shouldn't happen.  It appears the charge controller simply turns off and connects the battery directly to the solar panel.  It also turns off the Sun Dragon.  This seems to happen when there is a great deal of sunlight.  Either something I've wired is upsetting the charge controller, or the charge controller is a piece of junk.  At this point I wouldn't be surprised by either.
   Show today at Elmwood Park.  We had three bands that put preformed in the garage and had a decent turnout for the event.  Concerned about how loud the bands would be I walked around the outside of the house several times throughout the night.  While I could hear the music, it wasn't loud.  No one complained, and I don't think anyone will.  So hopefully this is a first of many.
Ottoman Empire soldger from the Great War

Ottoman Empire soldger from the Great War

The Sun-Dragon has two flash devices for file storage. The operating system is located on an 8 GB eMMC and the data for the website held on a 256 GB micro SD card. The 256 GB drive is mounted to /mnt/sd and contains two directories: lost+found and webpages. The lost+found directory is standard for ext* file systems. I had created a symbolic link in the root directory of the file system called webpages that linked to to the SD card directory. This works fine when all operations are done on the local machine. However, when viewed from a remote system the link wasn't showing up. Presumably the symbolic link was attempting to resolve a path on the non-local system—a path that did not exist.

The solution was to make a special mount point, a bind mount point. I first created an empty directory in the roof file system called webpages, and then mounted it with the bind option:

mount --bind /mnt/sd/webpages /webpages

That did exactly what I desired, allowing remote computers to access to the webpages directory. To get this mount point on system start I added the following line to /etc/fstabs:

/mnt/sd/webpages /webpages none bind

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.