Andrew Que Sites list Photos
Projects Contact
Main
   I did a poll on a social media network using this picture to see what people thought of me with facial hair.  I've been growing it out for Cinco de Mustache, but I don't really like it all that much.  The poll generated 73 responses, 62 liked it, 4 did not, and 7 were ambiguous.
   Here is the scope trace from yesterday's experiment with making a Arduino controlled buck-converter.  One trace shows the upper trace from channel 2 holding a steady 9.84 volts DC.  The trace just below it is the output of the buck-converter averaging 7.54 volts.  It is slightly wavy, which means the filter capacitor is still not quite large enough.  I don't recall the PWM duty cycle because I forgot to write it down.

April 26, 2015

Playing with a Buck-Converter

   This mess here is my buck-converter experiment.  I am using an Arduino to generate a PWM at 62 kHz.  That drives a FET that switches through an inductor.  A Schottky diode allows the inductor to supply power when the FET is turned off, and a filter capacitor cleans the signal up.  My large 100 watt 10 ohm resister acts as the load for this circuit.
   My setup does function, but it has some problems.  The 62 kHz PWM is too slow to really be useful.  Most buck-converters run at over 100 kHz.  To compensate for this, I had to use a very large inductor and capacitor.  The inductor is actually an old transformer.  I don't know the inductance of this device, but it has a large enough inductance to make my experiment work.
   What I wanted to do with this setup was see if I could use an Arduino to run a buck-converter.  In addition to the setup here I wanted to have the voltage and current feed back into the Arduino so it would act as the control loop.  I don't think this setup is likely to work with the slow PWM.  They make PWM chips that can be controlled over an SPI bus, and these can be clocked up to 1 MHz.  This might work better.  For now this experiment is a successful failure.  I made a buck-converter that did step down voltage, but the system isn't useful.

April 25, 2015

Replacement I/O Shield

   The replacement I/O shield for the Sun Dragon arrived today.  I quickly got it programmed and it is now monitoring voltage from both the battery and solar panel.  Not sure how useful this is as I think all the positives are tied together in the charge controller.  Nonetheless, the setup is functional, calibrated, and logging data.
   The I/O shield basically consists of an Arduino connected to the Odroid by a serial bus.  So I can do development on an Arduino without out worries about hurting the hardware on the I/O shield.  In theory this is what I am suppose to do, but the other day I did development directly on the I/O shield and destroyed it.  Nonetheless I could develop the software side using the Arduino.
   The system right does the averaging and conversions on the Arduino.  All analog inputs are read every 2 ms, and a total of 16,384 samples are averaged together.  This comes out to an average period of about 32.8 seconds, which is all the faster I want data to be logged.  After each averaging period, the results are converted using calibration points and printed on a serial bus.  This allows software on the Odroid to read the data.  Calibration involves hooking a variable power supply to the voltage dividers, along with a multimeter.  Software on the I/O shield prints the raw ADC values.  Two points are selected.  One at a low voltage, and one near the highest voltage.  The two points correlate an ADC value with to a voltage.  So after the 30 second averaging period, the ADC values are translated into voltages and those values are passed on.
   Software on the Odroid simply opens the serial port to the I/O shield, reads the voltage and current data, and logs this to a SQLite database.  This script runs continuously, but spends most of it's time waiting for data from the I/O shield.  Data older than 24-hours is dropped from the database.  In this way, charts can be drawn of the various data points on record.
   Right now the current traces are always zero.  I destroyed the current measuring op amps the other day, and am waiting for replacement parts.  Once the new parts arrive, I should be able to start logging this data as well.  One step at a time.
 

April 24, 2015

Buck-Boost Converter Experiments

   Spent much of the day reading about buck, boost and buck-boost voltage converters.  I started this research because I am unhappy with the charge controller on the Sun Dragon.  I read an article about how someone built an Arduino based solar battery charger.  This included making a buck converter using a PWM channel from the Arduino.  After I started looking into the technique, I wondered if I couldn't do one better. 
   First, buck/boost/buck-boost converters in a nutshell.  A buck converter transforms DC voltage from some higher input voltage down to a lower output voltage.  A boost converter transforms a lower DC voltage to a higher DC voltage.  And a buck-boost combines the two techniques to transform either a higher or lower voltage.  The technique involves using properties of an inductor being switched on and off quickly, and pretty much all modern DC power supplies use this technique.
   The article I read used a buck converter to collect energy from the solar panel at the maximum power using Maximum Power Point Tracking.  This is a very good way to get the most power out of a solar panel, but the setup assumes the solar panel will always have a voltage higher than the battery being charged.  If a buck-boost converter is used, the solar panel can still contribute energy to the system even if the voltage is lower than the battery because the circuit will operate in boost mode.
   After a good deal of reading, I started playing around with a Arduino controlled buck converter.  What I found is that with my small inductor I don't get a great setup.  The Arduino typically operates it's PWM at 1,000 Hz.  Most buck converters I've read about operate between 100 kHz and 1,000 kHz.  At best the Arduino can operate a PWM at just over 60 kHz.  I think this is making my setup less than ideal.  I have some larger inductors on the way so I can continue my testing.  I'm really bad at getting hardware to do what I want, but I might be able to get something working.

April 23, 2015

Better current measurement

Tooling around on the Internet looking for an alternative to my current sense circuit, I came across a module from China based on the TI ADS1115 16-bit analog to digital converter. I had already considered getting a high resolution external A/D because the Arduino only has a 10-bit A/D. When I started reading about the ADS1115, I found I also shouldn't need an op-amp. I should be able to wire the current sense resister directly to the A/D because it has a programmable gain of up to 16x. I ran some calculations and this is looking pretty good.

I would like to be able to monitor current to/from the battery at -1 to +20 amps, with -1 being 12 watts of draw, and +20 being 20 amps of charging at whatever voltage. The A/D has a built-in 4.096 reference voltage, and the programmable gain divides this voltage by powers of 2. So a gain of 1 means the input measure -4.096 volts to +4.096 volts. At 16-bits this means -4.096 volts is -32768, and +4.096 is +32768. A gain of 16 means ±4.096 / 16 = ±0.256 volt range.

What this allows me to do is change the gain as needed. The solar panel output won't jump around too quickly, and even if it does I over sample fast enough I can take care of any saturation by ignoring it until the correct gain is setup. With that in mind, I can use a 0.1 ohm shunt resister and measure the voltage directly across that. With a gain of 16, I can measure up to 2.56 amps, and theoretically down to 78 μA. With a gain of 1, I can measure up to 40.96 amps, and down to 1.25 mA. In reality the bottom end is going to have noise of probably 2 bits. So those low ends are closer to 312.5 μA with a gain of 16, and 5 mA with a gain of 1. That is plenty of resolution.

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.