New Product Development
A lot has changed since the last report – and I’m sorry I didn't post something sooner! While we learned a massive amount with the project we were working on, it was fairly evident a few months ago that it wasn't going converge in a predictable way. Just too large of a project for the current team, and too unpredictable to be running cash flow negative on. So world dominance will have to wait I'm afraid.
Instead we choose to shift of focus to something more short-time-horizon-realistic – and still totally awesome, but not as crazy. Something we had planned on doing anyway, after the launch of the now-postponed project. The intention is that as soon as we launch this new offering (and ramp manufacturing – and make sure it’s 100% solid) we get back to the older project, a little wiser and with more experience under our belts. I do expect to be working on that later this year.
I am personally SUPER excited about this next product offering. I think our current customers (and some new ones too) are going to love it. And it helps my excitement that this one is comparatively doable and the ‘light and the end of the tunnel’ is firmly in view. And we can do it really well I think, which is critical.
New Product Development – Target launch date of September 1.
Last time we talked about this we said April 1, which obviously now seems quite naive; I’m extremely frustrated we haven’t made faster progress. It’s my fault as I generally am the primary bottleneck and I have yet to figure out a way to prevent that from being the case. It would help to have an extremely good electrical engineer, ideally an RF engineer – flat out hard core ADS junky. Not that they would be doing RF per say, but they would have the ideal background I think. We’re making progress on the software end with our new hires, but it will take some time for those folks to come up to speed and Mark’s productivity will certainly go down as he trains and works closely with them. More engineers also potentially means less technical support time for Mark which is good. Meanwhile we could really use an executive level marketing person, and a handful of others…; That will all come if we can deliver a brilliant next product roll-out.
As an aside I would mention that if we wanted to roll out something quick just to make a buck, it would be fairly easy. Obviously we could slap a USB 3.0 chip in there (or something similar) and jack up the price. But that’s not what we’re going to do, it’s going to be awesome or we should just do something else.
So as for when, the target date is currently September 1. Actually I’m padding that somewhat in the hopes we’ll hit that for you guys.
We made a few hires over the past months but none of them are really starting until the end of this month. Then it’s like one is starting every week! Two interns and two full time developers, all software.
The addition of these new heroes means we really need to get a larger office. We were planning on moving to some sort if epic San Francisco office at the end of the year, but if we can get away with it I’d like to move to another office in this same building, while only extending our lease essentially 6 months into 2014. This office location is much more affordable than this perfect San Francisco dream office anyway, which is much more appropriate for where we are as a company.
We've been using this service called “The Resumator” for applicant signup and tracking – it’s really good and I recommend it highly over the normal mess that is hiring. http://www.theresumator.com/ I personally think resumes are largely useless, and sifting through them is painful. What I really want to use is something called “Hire Vue” which is awesome and kindof a game changer for hiring. But they want $10K annually and we’re just not doing enough hiring to justify that. http://hirevue.com/ I’m annoyed they don’t have an offering for smaller companies, seems like that leaves them open to competition from the low end anyway.
So it’s that time of the year again and Allison asks me if we should do Maker Faire this year with us being behind on product development and all – and ultimately we decided to do it. And of course I want to do it right, or at least closer to right then last time, so for better or worse (probably worse) we've now constructed a booth out of lumber for Lowes and a handful of new woodworking tools. This booth is now sitting in our already-too-small office and for a few days there was a thin coating of sawdust on everything. In addition we need to have some neat interactive thing to do and all that, and have new signage… Anyway it’s going to be a fun maker faire weekend, even if getting there wasn’t always fun or necessarily the most savvy thing to do.
The sailboat gets somewhere between 5 and 20 hours per week of attention. We submitted all the PCBs and have assembled them, and Mark cranked out some firmware and software for one of them. I had zero time this weekend with the Maker Faire prep to doing anything with it but it was fun to see what Mark was doing, and to help debug the board – which had about 3 issues in total I think, none of them fatal.
We’re starting to implement unit tests for everything, and we’re trying out some cross-platform automated GUI testing software as well. When that’s in place hopefully we can reduce the number of errors that make it through QA.
I had some fun doing assembly language for PIC the other week – something timing critical. It was fun to pick that up again, I programmed by first “product” right out of school entirely in PIC assembly language. I don’t think at the time I knew a C compiler was a realistic option.
Building in the US
These days we've actually “on shored” quite a few things. Both of our PCBs are now assembled locally, and we source ourselves via Avnet. I really like that because we actually get to work directly with the manufacturers and negotiate pricing, etc. When it goes to a CM generally you can lose visibility into that. By the way, we’re using Aligni http://www.aligni.com/ for component tracking which we’re quite happy with. Our CM can do part audits inexpensively so we don’t need to be in the loop, we can ship directly to them. Avnet has a bonded inventory program that we’re going to be using to improve our cash flow gap – which was one of the primary reasons we wanted to on-shore: good old NET 30 terms. Sourcing from Asia in our experience means paying up front, and long lead times.
That said, I still think Asia is hard to beat, but I’m convinced you need someone at least periodically on the ground over there to stay out of trouble – and to select new suppliers.
We’re currently selecting an injection molding partner locally. It is more costly, but not that much more and I really, really want transparency. Plus at some point it might make sense to vertically integrate and that’s much easier to do with local resources to draw on. Still, vertical integration, as cool as it is, makes about zero sense right now. As if we didn't have enough things to worry about.
We do still do finally assembly in-house, and I really don’t see that changing. I really want to move to something closer to just-in-time manufacturing anyway, and potentially product variations/configurations, and in-house assembly will be important for that.
New Carry Case Design
We've been working with a Soft Goods industrial designer on a new case design for Logic and Logic16 – because we don’t really love the current one, and more importantly we’re not huge fans of the supplier. But this has taken much longer than I had hoped – we’re trying to find a manufacturer now but I still don’t have a good algorithm for it. There’s limited options in the US (If you have any let me know) and it’s a bit of a gamble oversees. There’s not “yelp” for manufacturers, which is terrible, and I think unacceptable; What I really want is a great reference, like “yah we run 10K pcs a month though them and they are always superb quality and really great to work with and fair prices, etc” that’s all I want. So annoying that it’s a closed off world where a good manufacturer is guarded like a trade secret (I don’t blame people for keeping it a secret – good sourcing in Asia is real competitive advantage, especially where not everyone is an A player in that field). I know that if I was just on the ground in Asia I could get a good feel for different places, but on this side of the divide you just have no idea. I've thought about just picking the top 5 and sourcing though all of them, and just cutting the ones who aren't that great. Kind-of an expensive experiment, but might be a reasonable way to go. I have a real aversion to “trading companies” or people in the middle deal with the manufacturer on your behalf – typically while hiding the identity of that manufacture. Maybe it’s a good idea but I really want to deal right with the factory. That’s the other thing about an Asian supplier – they can easily outsource to someone else, who can outsource to someone else, and then you have no insight at all into possible process improvements, etc. I just need to go there 4 times a year I guess. I’m nervous to do that, not sure that’s the reason I haven’t yet or if I legitimately am flat out too busy. Luckily I think Jonathan would be an ideal person to send, and I think he would love to.
Random Photos to Follow:
This weekend the Saleae team took a break from San Francisco and escaped to the greater Lake Tahoe area for some skiing. The ski-cation was a great chance for all of us to unwind and relax. We learned that we’re not that great of skiers and that falling in snow still hurts.
We reached our cabin late Friday night, relaxed and enjoyed the hot tub (which Mark’s only request for the cabin). Saturday morning we hit the slopes and skied until the lifts closed at 4:00. No night skiing, but I don’t think my body could have handled it anyway.
Saturday night we played the now infamous Settlers of Catan. A word to the wise: this game can cause passionate and intense debates. Be warned.
On Sunday, Joe, Jonathan and James went to Sugar Bowl while Mark, Allison and I explored downtown Truckee. It was a great change of pace for the whole team. Tahoe, we will be back.
Jonathan after two days of intense skiing.
The second floor of our cabin was primarily used as Allison's bedroom and and for our renditions of pop songs on the piano (pictured left).
Sunday morning omelettes.
Mark relaxing. You may also notice the case of one of our GoPros, which we made great use of from the slopes.
Quick update: last weekend I was trying to design up a current sense amplifier design for our boat's new electrical system, which needs to sense from -40A to 200A.
16-Bit Delta-Sigma ADCs
After the post last weekend I started looking at 16-bit delta-sigma ADCs, and decided that was a great way to get the absurdly-accurate mA-level fidelity I was after. (that's assuming noise doesn't kill it). Those devices generally have differential inputs, so I was thinking about this a little bit and finished up a new amplifier design today (Sunday).
Since ultimately we need to measure the difference between the two input voltages, a differential ADC is actually perfect, and saves us needing to compute the difference with an op-amp. Our main job is to make sure the common-mode voltages (i.e. each voltage with respect to ground) do not exceed the range allowed for the ADC. In this case, anything inside the ADC's rail will be fine. I selected the LTC2472 from Linear because it looks like it'll get us the 100Hz of bandwidth we want.
TI Filter Pro - Highly Recommended
I also noticed that we we're under-utilizing the op-amps we did need -- why not use a 2nd order filter and get some better filtering (specifically -40dB/decade rather than -20dB/decade)? Big shout out to TI's awesome Filter Pro software! This program is absolutely awesome for active filter design -- both because the program is super clean and simple, plus it helps you to select optimal real-world resistor and capacitor values. Active filters are great, but as you may know the op-amp bandwidth required is always many times the filter cutoff frequency. This means you'll need to use some pretty fancy op-amps if you want have pass-bands that are high frequency (in many cases passive filters are the only choice because of this). TI Filter Pro reports that we need an OpAmp with a minimum gain-bandwidth-product of 185 kHz. Note that we're applying a gain of x25 so that our maximum 50mV current shunt voltages scales to 1.25V, the maximum differential input voltage.
I'm trying to finish up the PCBs for the boat this weekend and thought I'd share this little solution I thought was kind of neat.
Among other things, we need to measure the battery pack current, and fairly accurately This is mainly so the BMS can keep track of the approximate battery state of charge -- i.e. percent charge remaining. To do this we need to measure the load current and the charger current all the time, and basically count coulombs in and out. ( There are some more sophisticated things you can do by doing calibration, tracking impedance and temperature but I don't plan on doing any of that craziness for something like this. There are some cool state of charge ICs out there as well, and you actually calibrate them with the cell you'll be using. Pretty cool. )
How to Measure Current
Anyway the basic idea is that you place a shunt resistor in the current path -- this resistor will develop a little voltage across it in accordance with ohm's law, and you can measure that voltage to get the current. You can use precision components for this, or you can always calibrate it. In my case I'll be using precision stuff, mainly because I don't want to have to worry about calibration.
Marine Grade Current Shunt
One thought I had was that I would simply measure the voltage drop across a couple large cables, and calibrate with a amp meter -- more recently I discovered you can get a precision marine grade current shunt and I've opted to go with that.
If you run 200A though this bad boy you'll get 50mV across the shunt, a whopping .25 mOhm of resistance. I don't expect that much current typically but I that is the peak level I'd like to support. Btw, 48V * 200A is just about 10,000W, holy crap.
High Side or Low Side Current Measurement
The next choice you have is if you want to do "low side" or "high side" current measurement. If you do low side, that means the shunt resistor goes between ground and the load. This is generally easier to deal with because one side if the resistor is ground, and the other side of the resistor is a small voltage, which you can directly amplify with an om-amp and measure (with an ADC in my case).
However, having a resistor in the ground path can be undesirable for other reasons; so the other choose we have is is high side. With high side current measurement, the shunt resistor goes between the power (+V) and the load. One side of the shunt resistor therefore is the supply voltage (+V) and the other side is a little lower (V - I*Rshunt). You want to take the difference between these two voltages with an op-amp. The trouble is, typically these voltages are right at the same voltage as the op-amp, which probably isn't going to work too well without a little thought. There are a number of ways to deal with this but the easy way is just to use a dedicated Current Amplifier IC. High Side current amplifiers generally let you measure shunt resistor voltages that are higher than the power supply you provide the IC.
I choose low side for a few reasons, but the main reason is that 48V is a pretty high voltage to try and connect to. It's doable with some resistor dividers but let's just say we don't want to do that for now.
Measuring Current Direction
Another challenge with current sensing is that your application might allow the current to flow in both directions. In my case, the current can change direction as the load current goes above and below the charge current. (you could avoid this buy measuring each current individually, but let's say we didn't want to do this). This means that the voltage difference can swing negative.
Since we almost certainly aren't running our op-amp (or ADC) with split rails (both positive voltage and negative voltage) we'll need to add an voltage offset -- such that the output voltage goes above or below the offset voltage depending in the current direction.
Negative Voltages at the Op-Amp Inputs
Another issue we'll have to deal with is that depending on the current direction, the voltages coming in from the shunt will be negative with respect to our ground on the PCB. The way we'll deal with this is to use an inverting op-amp configuration and force it to drive the inverting input to a positive voltage, or zero. In fact we can provide different offset voltages to each of the two inverting op-amps, thus introducing an offset in our output so we can support both positive and negative currents.
When running negative voltage into op-amps it's important to make sure the op-amp inputs have clamping diodes so they don't blow up between the time the negative voltage is applied and when it's able to drive its input back positive. In addition there should be sufficient resistance in between the negative voltage source and the input, to keep the clamping current low. In our case it's not a huge concern since the negative voltages are so small (~ -50mV).
I'd like to support a negative (charge) current of 40A -- so when if/when I get more batteries (placed in parallel at the cell level) I can support the maximum charge rate the pack will accept.
So, when the current is zero, I want it to look like the current is 40A. The differential voltage from the current shunt goes between -10mV @ -40A to +50mV @ 200A, and this should result in an output voltage of 0V @ -40A and 1.2V @ 200A. Let's see if we can't figure this out without too much pain.
First of all, the gain. Basically we want 60mV full scale to become 1.235V full scale (I'm using a 1.235V ADC precision voltage reference), so the gain is about ~20.58. We'll use a gain of 20.5 since we can get resistors for this.
One of the two inputs we'll want to level shift up by 10mV so we get the full -40V (-10mV) to +200A (+50mV) range. We can use our 1.235V precision reference to create this tiny voltage, but note that in this configuration the op-amp is actually gaining our offset by two, so we'll need to place 5mV at the non-inverting input.
Converting the ADC value to the current
Rather than to take great pains to make 1 bit equal to some perfectly round number of mA, I recommend just computing the overall gain/offset from the nominal values of the actual resistors used. Come up with a multiplier, a divider, and an offset. Assuming this is fairly high precision, it won't fit in a 16-bit number, so opt for a 32-bit variable and burn some cpu cycles. Then you can have the result in exactly the unit you want.
Measuring Low Current at Higher Resolution
I was originally planning to use a 12-bit ADC built into a MSP430. With a 200A maximum current, that's a resolution of about 50mA/bit. Not terrible, but not as precise as I would really like, since most of the time the system will be at far lower currents than 200A -- it better be!
Since the bandwidth of this application is only ~100Hz, you could easily use a digital potentiometer or analog switches to change the resistor ratios for the gain. Analog switches would probably be better since you can use precision resistors. The parasitic capacitance of these parts typically makes them useless above, I don't know -- certainly 1 MHz generally speaking -- but 100Hz is a great use case for them. Note that analog switches typically have on resistances that vary with the voltage at the switch; for something like this I would recommend avoiding that and using a maximally low R-ON part). Also note that you may need to use smaller value feedback resistors to prevent premature roll-off from the switch parasitics.
You could also use another op-amp to gain the signal even more, and use two different ADC inputs, switching to the most precise one that isn't maxed out -- of course check that the ADC will tolerate this. You could even control the ADC reference with a DAC, depending on how flexible the ADC's reference range is. But that's getting silly, in this application it would be more straightforward just to use a 16-bit ADC.
Maybe I'll just use a 16-bit external ADC. I'm looking forward to seeing how that goes -- I've never used anything that high resolution.
Quick Note on Resistor Thermal Noise
Since we might be going to a 16-bit ADC we might as well take a look at our thermal noise. To keep power consumption super low I generally like to use fairly large resistors for this low bandwidth stuff, on the order of 100K.
The voltage noise generated by each resistor is about .13 SQRT(R) at room temperature, in units of nV/SQRT(Hz). Without going into it, basically this describes the typical peak-to-peak voltage noise as a function of how much bandwidth we actually let though. The more bandwidth, the higher the typical voltage noise. In our case we're only letting though 100Hz of bandwidth so we're talking noise on the order of .13 * SQRT(100K) * SQRT(100) =411nV. 1.235V (our ADC reference) divided into 2^16-1 is 18.8uV/bit, or about 45x greater than the typical voltage noise on a 100K resistor. Moving down to a 10K resistor brings the ratio to 156x -- I'll do that since this isn't exactly running from a watch battery :)
Quick Note on Op-Amp Input Offset Voltage
In the typical Op-Amp topology the output will drive the two inputs to be nearly the same voltage. However, due to how Op-Amps area actually implemented, the inputs will actually have a small amount of voltage error relative to each other -- meaning that the Op-Amp may think the two voltages are the same but in reality they are off by a few mV. The difference between the voltage the Op-Amp sees on an input, and the actual voltage, is called the input offset voltage. The amount of this voltage error is bounded, but otherwise not predictable -- it could be 0mV, -2mV, or 3mV for example - it has to do with the input transistors not quite matching or something like that. Anyway this is introduces a small amount of DC error into your signal path, and if the gain is high, the error could be fairly significant. In addition, the input offset voltage typically moves with temperature, so even if you calibrate the design it can easily drift if used at anything other than room temperature. Luckily, if this matters to you, they do make Op-Amps with extremely small input offset voltage errors -- you'll just pay more for them and it'll limit which Op-Amps you can use.
I believe off-the-self current amplifiers typically have done something about the input offset voltage so you don't have to worry about it.
In my case I'm using the extremely low input offset voltage Op-Amps such as OPA2188 or OPA376.
All for now. Thanks!
Update -- Whoops!
One of the many consequences of not bothering to use the proper op-amp models is that it doesn't care if it drives the output above or below the rail, or if the inputs go above or below the rail for that matter.
It just occurred to me that this inverting op-amps were going to try to output a negative voltage when the shunt inputs went positive, which they do when charging. The solution is simply to add an offset voltage to each one of the offsets to keep the outputs nice and positive. We can even use one three-resistor ladder to ensure that the offsets are 5mV off from each other.
Also, I should point out that this design pretty much requires precision resistors and super low input offset voltage op-amps.
Check out Nate's first video production, our new hiring video!
Right now we’re evaluating the switching power supplies for the new product and we’re going to have to use a higher-order passive filter on the output than the switchers are designed for (compensated for).
The switcher’s we’ll be using have a COMP pin, which allows you to add a network to move some poles/zeros around to adjust the stability. It was fairly clear that I couldn’t calculate directly the required values, or simulate it, so we’re going to have to build it and tweak it by hand.
Signal-generator controlled dynamic load
In order to properly tweak the stability (as well as test the stability overall) I really need to step the input supply voltage, and ideally also control the load. In an ideal world both of these could be controlled with a signal generator at high bandwidth.
Below is the little circuit I came up with today to control the load current from the signal generator. It has a bandwidth of about 100KHz (full 4A swing). The mosfet is IRLR8729PbF. The current sense resistor (also part load resistor, part current-limit resistor) will be lots of surface mount resistors in parallel to assure low inductance.
The lower op-amp just gains the current measurement slightly so that there’s a 1:1 correspondence between the signal generator (Volts) and the current (Amps) – i.e. 1V = 1A.
The top op-amp subtracts the real current from the desired current to create an error signal, then multiples this by 100. I tweaked the bandwidth-limiting capacitors to give the best step response.
Signal-generator controlled power supply voltage
For actual power supply test I’m thinking of using a high-current linear regulator and tie the low end of the resistor divider to an opamp, which will just adjust the signal generator voltage to provide a 1:1 correspondence between signal generator voltage and power supply voltage (within the operating range).
Also – thanks to everyone who came out Thursday night for our open house, it was a great time! I’m sure Nate will have pics later this week.
[scroll down for pictures]
Hi everyone, it’s Joe. I’m overdue for an update on how things are going at Saleae with regards to the new product and all that. However before I do that I thought it would be fun to bring people up to speed on the boat.
The boat is a 30-foot, 1983 Catalina 30 named Kathleen. We got a good survey and learned all about the boat and created a very long list of things to fix or bring up to code, etc. Most of the items are now complete. There are still a few significant ones that will get done later this year, such as replacing the lifelines and lightning protection.
Old Atomic 4 Gas Engine
A few weeks ago we took our perfectly functioning gasoline engine out of the boat and sold it for a song on craigslist. So this is a bit reckless, or foolhardy or in any event risky – now we have a non-useable project boat sitting in the marina. Why ever would someone do this?
Do not fear we are replacing that ancient, corroding, pollution spewing dinosaur with a nice quiet and clean electric system. A few things of note: this carbureted engine (Atomic 4) has no pollution controls whatsoever. The engine sucks up seawater, mixes it with the exhaust, and spews this into the bay. Any oil or other muck that comes off the engine winds up in the bilge and gets pumped overboard – although to be fair the oil-absorbing pads you put down there do help somewhat. You are supposed to carry all sorts of spare parts because at any time the engine could break down. To top it off, gasoline fumes are heavier than air and you can actually blow up the boat if you have a gas leak and start up the boat without sniffing first. Apparently, fiberglass is actually a fuel at high temperatures and if ignited the entire boat can burn to the waterline in under a minute. Honestly I’m not really THAT against gas motors in boats, but this particular one had to go.
New Electric Motor
The new electric motor is the ME0201014201 from Motenergy. [From the manufacturer] “This is a 3-phase, Y-connected Permanent Magnet Synchronous Motor with an axial air gap.” I’m not all that up to speed on how AC brushless motors work but apparently they are pretty cool. It weights 22lbs.
I’m not sure how heavy the old one was, but something on the order of 400 or 500 lbs. Removing it was quite the undertaking as you might imagine – involved removing several parts of the boat, and rigging up the boom as a crane, and lots of pulleys for mechanical advantage. Mark, James and I were able to get it without harming it or the boat, but it wasn’t easy or without risk. I have a feeling if we had managed to drop the motor from say 10 feet up or so it would have punched a hole in the boat and it would have sunk right there in the slip, haha.
CAD & Motor Mount
Mark and I did our best to CAD up the inside of the motor compartment so that we could design up a new motor mount. Unfortunately the geometry down there is all curved and irregular so there’s really no getting much better than an inch or two of precision. So when I designed the motor mount I decided to laser cut it out to fit check first – which my friend Jason kindly did for me.
Just last week I sent in the final (for now) version which was water jetted out of ¼” aluminum plate by http://www.bigbluesaw.com/.
We also got a Sevcon Gen4 motor controller for the motor. This is a very professional controller. The downside is that it’s complicated as hell. Every last thing can be configured over CAN – it’s more of a business-to-business product. Nevertheless the resellers will program up the basic profile for your motor and you can control it with an analog input and two digital inputs. Mark and I really wanted to control it strictly over CAN but it’s looking like that will take more effort than it’s worth at this point. We did get a USB-to-CAN (VScom USB-CAN) dongle and got it working – although the existing SDKs, etc. were pretty useless, at least for C# development so we ended up rolling our own interface layers for it. In fact according to mark that USB can controller just uses an off-the-shelf CAN IC from Phillips.
For cost per kWH at first it looked like lead acid was really the only contender. But it’s pretty terrible – the internal resistance just kills the performance and you have to seriously downgrade the amp hour rating to accommodate this. Lithium ion of course does not have this issue. There are several companies that make lithium ion batteries that are literally drop in replacement for lead acid – really awesome stuff, like http://www.mastervolt.us/marine/products/li-ion/mli-24-160/ This battery is 4.3kHh – about what I’m looking for – and is super easy to use – but tragically costs well over $5,000. This is many times the cost of lead acid. However, I hated the idea of going lead acid so I kept looking around and started finding some extremely good deals on lithium ion, in particular ones from Sinopoly. What’s really cool about these things is that no matter what size you get, you get the same cost per Wh. That means you can start with a small pack, and then grow the pack over time by adding more cells in parallel. So I got x15 40Ah cells at 3.2V nominal – 48V and about 1.9kWh – for about $700. http://evolveelectrics.com/Sinopoly.html -- these guys were quite helpful.
Now, the down side of these cells is that you’re totally on your own managing them. You need a charger and a battery management system (BMS). And everything out there in this category is pretty mom and pop – not a lot of stuff that I was excited about. I did end up getting a massive charger from Elcon (the 1500) which I’m not exactly thrilled about (I really want a way to set up the charge profiles myself because I’ll be changing the battery capacity in the future). In addition I got what seems to be a pretty cool solar charger from Genasun called GV-Boostlithium. Haven’t tried that out either. In fact, what I have done is individually charged each of the batteries with one of those awesome hobby chargers that Sparkfun sells -- https://www.sparkfun.com/products/10473. If only there was a charger/balancer that good that could charge a 15-cell system at 40A…
The other thing you need besides a charger is a battery management system. This does a couple things – if anything goes haywire, it disconnects stuff so you don’t blow anything up. This includes master control over whether or not the charger is connected, and if any loads are connected. It also keeps tabs on the “state of charge” – monitoring the energy in and out of the pack so you have some idea of how much juice is left. Perhaps most importantly it balances the pack. Here’s how that works:
Battery balancing 101
The cheap way to charge lots of batteries at the same time – assuming those batteries are in series – is to just put a big voltage across the entire set and start pumping in coulombs. There’s two basic steps: first control the voltage such that you get a specific current (current control) – typically .3C (30% of the amh-hour rating per hour). For a 40Ah that means 12A. You do this until the voltage rises to some threshold, such as 3.6V per cell, but it depends on the battery chemistry. My 48V nominal pack would be at a voltage of 54V for instance. Then the charger goes two mode two: Maintain exactly that voltage per cell – reduce the current slowly so that the voltage does not rise. Eventually the current reaches zero (or near enough) and charging is done. This is why the first part of charging is much faster than the last 20% or so.
Here’s the problem: the cheap charger can’t actually control the voltage across each cell. It can only control the voltage across the entire pack. That’s where the “balancer” comes in. (Typically the balancer is a function of the BMS).
Each cell has a slightly different impedance, and over time will become more or less charged than other cells in the string. This is a problem because more charged cells will have higher voltages when being charged – so the charger may think all cells are getting exactly 3.6V, but in reality some cells are lower than that, and some cells are higher; the more unbalanced the pack becomes, the more likely it is that the highest voltage cells will be over-charged and ultimately blow up.
The balancer typically discharges over-charged cells. Literally, it switches in a power resistor and bleeds off power. There are a number of strategies to do this, and generally speaking it’s all fairly inelegant and inefficient. What I have in mind is to dynamically control the impedance of individual cells using a mosfet and power resistor – I think this could work fairly seamlessly without needing to stop charging to do the balancing (this would assume the pack was already fairly balanced). With unlimited money, the best way would be to have a dedicated, electrically isolated charger for each cell. Honestly, the cheapest way is to undercharge the pack (to be safe), then manually go around with a volt meter, power resistor, and kitchen timer and discharge cells that were getting overcharged. Once the pack was nice and balanced, you could charge it all the way up. The pack only slowly becomes unbalanced, so I think you technically could get away with this.
Of course I just had to roll my own BMS. Which explains why it is not done yet. I did design one up and got it built but it’s just a proof of concept at the moment, and I’ll need to spin at least one more board.
2400W AC Inverter
The boat will also have AC power of course, enough AC power in fact to run a microwave, or pressure washer, or on-demand hot water heater, or whatever else you might think up. To provide this I got a really inexpensive 2400W 48V DC to AC Inverter on Amazon for ~$210. The one I really would have trusted was this unit from Tripp Lite but as it costs a hefty $690 it seemed worth it to give the cheaper one a shot. I opened it up, and actually I’m impressed with it. They got all the cost out of it and yet it seems pretty efficient and the quiescent draw is very low. We’ll see how long it is until it blows up. It certainly won’t stand the marine environment, but that’s another blog post.
The boat naturally also needs a computer, and I just so happened to have an incredibly slow and all-around terrible netbook which was donated to me from a friend. I maxed out the ram to a whopping 2GB, and removed every last background application and it actually works rather well – assuming you only open one thing at once. It’ll run C# nicely.
When all this is done, we’re talking autonomous waypoint navigation, and drive-by-Wii-nun-chunk, among much else. Stay tuned.
Not your average LED control
This post is more about the boat project than the company, but like any good project here at Saleae, there is always some quality overlap :)
A few months back we bought up a few LED strips from AliExpress for the boat. Joe and I have some grand plans of lighting it up like Times Square, and we wanted to make sure we did a really good job. This of course calls for individually addressable RGB LEDs with a high refresh rate. We found just the ones, 5 meter strips with 30 LEDs per meter using the WS2811 module. We bought 5 strips, totaling 25 meters and 750 LEDs. (We're going back for more later)
Now there are a lot of different LED strips out there, with a handful of different interface solutions. SPI controlled LED strips are probably the most popular right now. However, these weren't. Instead, these LED strips have the controller integrated into the LED die, and use a custom control protocol. It's simple, but it can't be accelerated with your typical microcontroller peripheral.
What I wanted was an easy way to control a boat-load of LEDs with a minimum framerate of 30Hz. Once I finally found the poorly translated datasheet for the WS2811 module, I was happy to learn that the modules had a high speed mode that could drive 1024 LEDs at 30fps or 512 at 60fps – good enough for me! (We've designed the LED layout of the boat to avoid single strings over 512 LEDs)
The control problem
I think everyone playing with a lot of RGB LEDs does the math on this pretty early on. If every LED takes 3 bytes per color, I want to update then at 30Hz, and I have 750 of them, that's a whopping 67KB/s! (More when we add more LEDs) Oh, and since these LEDs use a specialized protocol, we can't use a hardware peripheral* like SPI, which means any microcontroller would have to bit-bang this protocol continuously.
*I'll wager you could use serial to drive these LEDs, if you were clever about it.
Let's take a moment to think about a few possible solutions.
Microcontroller with tight C/assembly loop. Ouch. If the CPU is writing to the output the whole time, who updates the animation? Not to mention there is barely enough RAM for a few frames at the most.
CPLD – well, we still need to get the pattern from somewhere. We could generate it from the HDL, but that's pretty close to the exact opposite of fun. Turns out streaming the animation over serial from the PC worked out great. This is the solution we're using now.
Use another handy USB attached output device. If only we had one… Oh wait! Logic supports output mode! That's right, in case you didn't already know; we have output mode support for Logic in our device SDK, with a C++ and a C# interface. Within 10 minutes of working on this, I had LEDs blinking, and within an hour, I had hacked together a sweet animation controller. Unfortunately, we dropped this solution as the netbook we wanted to use (and my laptop) have some serious performance limitations.
So, what did we do? We spun a PCB of course! We decided to go with a FTDI+CPLD solution.
Here are the specs. Overboard a little? (get it? overboard?)
- Drives 6 LED chains, 512 LEDs each, 30Hz. All individually controlled from the PC. That's a 3000 LED capability!
- Coolrunner II CPLD from Xilinx – 16MHz clock, 256 macro cell.
- FTDI basic clocked at 3m baud.
- Level shifter to take output pins from 1.8 volts to 5 volts.
- RJ-11 jacks for LED strips.
I wrote the VHDL and the C# desktop software. Once we proved out the design with a dev kit we had lying around, Joe designed and ordered the PCB, which James assembled. The VHDL took an entire night, not surprisingly. Everything else was pretty easy.
We power the LEDs with a 60 amp DC-DC switching power supply from the boat battery bank, which is a 48 volt lithium iron phosphate pack that's just under 2 KWh. The voltage drop across the strip is pretty bad, but OK for now.
We're going to run LEDs all the way around the perimeter of the boat, and then from the bow to the top of the mast to the stern. We're also going to run them inside for interior lighting.
Stay tuned for Joe's post about the electric propulsion conversion! We just got the motor spinning today, and test fit the assembly in the boat. It's getting pretty close!
Oh, and I fully intend to post all of the source code and board designs. I'll also post more photos and video once we have this on the boat too.
Also, we will be featuring these boat lights and the electric propulsion system at our open house this Thursday! If you're in the bay area, check it out: