Showing posts with label Battery. Show all posts
Showing posts with label Battery. Show all posts

Saturday, 21 September 2013

Ringing in the changes... result?

So it had turned out there were a few issues with the rev00 design for the ring.  This went from very minor stuff, like a power trace not quite reaching the right place due to a software bug, down to some footprints being a little dicey (the ADXL335) to outright wrong (the LT3494).  Then there were the buttons.  I'd chosen some Omron ultra-miniature tactile buttons which while very neat, require a lot of force to activate... particularly when you don't have a firm grip on the device in question.

I also thought the buttons were too close together to make it easy to press individual ones.  It made sense to drop a button and then go with something slightly larger, that didn't require as much force.  I eventually found some ALPS detection switches which while not designed to be pressed by hand (and as a result may need replacement after a while), would probably work fairly well with a roll of a nail.  I also took the opportunity to space out the fourth button to the right so it could have a clear role as a "back" button, to return back to the main menu.

I'd started work a lot more on the software... I used MPLAB X for the development, which is quirky, if generally quite functional.  The framework is a simple bespoke thing which uses a Platform Application Layer (or PAL) to abstract away calls to the hardware - things like graphics, input/output and hardware initialisation... and did a Linux/OpenGL PAL to allow for faster development time (and not wear out the flash on the PIC so much!).  I also wrote a higher level library for graphics functions to sit on top, to handle font drawing... I made up a simple 3x5 font, and then later added a 5x7 font for stuff that needed to be more legible.

The main "app" for the hardware was to be a game called Colour Fill, based on Color Flood, which in turn was based on another game... so a clone of a clone(!).  Anna is familiar with this game on my N900 and it was ideal for the screen as it doesn't require high resolution or fast updates to work.


I was a bit generous with the number of moves that the game starts with, but I have a particular fondness for the number 42, as I'm sure a lot of D.Adams readers do... I'm sure it will be reduced downwards in due course!

A few more applications were planned... in particular, I'd wanted to do a calculator, but the lack of buttons/touchscreen meant it probably would have been very frustrating to use, short of somehow combining the accelerometer to make it easy to use... you'd probably look pretty daft waving your hand in various directions to enter numbers, but it might work... possibly.

So onto rev01...


PCB Pool have changed to an ENIG finish, which I much prefer, as I've had corrosion on chemical silver finishes before, in particular when packaged in paper that presumably wasn't acid-free.  I also think they may have changed their solder mask as traces didn't seem as liable to peel up as they do on the older boards.

This time the free stencil should be a lot more useful!  This is me lining it up for the two awkward leadless parts (middle and top left)...


I squeegee'd on the solder paste as best I could, and then placed the parts with tweezers.  From then it was a trip over to the hot air gun.  It went surprisingly well... the footprints must have been okay as the parts self-adjusted into place and apparently were cleanly soldered.

From here on, the boards were straightforward to build, aside from a new footprint fail with the new ALPS switches... it was only slightly out so I was able to work around it, but it is preferred to have the parts in your hand before having the design fabricated so there's no ambiguity about where the pads should go.  Ah well.

One thing I was noticing about the new board is that it didn't appear as stable as the old one.  I was experiencing occasional CPU resets for no obvious reason.  The amount of trace rerouting on the rev01 board was very small, so it seemed unlikely I'd upset it in some way, but nevertheless when hammered in tight pixel loops it was showing a propensity to lock up.

I looked over the PIC32 documentation and tried relaxing the timings, but it still didn't seem quite right.  So I looked at the parts I was using the rev00 boards vs. the rev01 board.  I wondered if some of the ferrites had been from the wrong application type... meaning it could be a relatively high DCR, low current rated ferrite in a highish current position... nope, they looked okay... DCR of around 0.1 ohms.

Next I looked at the inductors... the core voltage inductor (a Murata) on the original board was too large... I'd made it fit but it was also a bit too tall, raising the thickness of the entire board.  So I'd spotted a Taiyo Yuden which was also 10uH, similar DCR and current handling but much shallower, and put this on the Rev01 board.  Hmm.  I took off the Taiyo Yuden and put on the Murata.  Instantly the board is a lot happier... but still seems to be locking up on more occasions than Rev00.

I also found that when the OLED was drawing a considerable amount of power (worst case is a full white screen), the CPU seemed to stand a higher chance of locking up.  Normally I would say this was down to inadequate decoupling but had followed all the usual guidelines... and unfortunately didn't have much room left to add more.

Giving it a good hammering...

My "solution" in the end was quite brute force.  Raise the core voltage to 3.3V from the original 2.5V, just by dropping in a different converter.  I put in a MCP1603, mainly because they are inexpensive, freely available and do the job... yet another Microchip part.  Once I did this, the board was much happier, although from an engineering standpoint this is clearly a bit of a cop out...

To talk power consumption briefly... welll... it's rather more than I'd like.  At the menu screen, with the 2.5V regulator, it was 26mA for the whole device.  When I puts the 3.3V in, it shot up to 32mA.  The main reason for this is not enough time spent on the software... the device never "sleeps", it's constantly running at 40MHz, churning away.

In truth, there is no good reason to be running it this quick other than making it more responsive... I could halve the system clock and it wouldn't hurt anything, and might even more stable too... should have thought of that a bit earlier.  But the main thing is to read the docs a bit more and learn how to use the idle modes effectively between scheduled events.


This would be particularly useful for one application in particular... a clock.  Now, if you do the sums, with a following wind, at 40MHz constant with minimal screen activity you're looking with this battery of somewhere around 3 hours.  Which for a watch is pretty useless.  If you conserved power appropriately with the CPU, dimmed the OLED, etc, I figure it should be good for >15 hours... which is still not brilliant but a heck of a lot better... long enough to be able to charge up at the end of the day.

An OLED is not an obvious choice for a watch, though - as discussed, a Memory LCD would be a much better choice, or possibly E-ink in combination with a power-sipping processor... but it is still nice to do.  It's all a matter of time constraints, and I really wanted the ring to be ready in time for our anniversary... so on with the assembling... hot glue time!


And in preparation for the final step...


I'd bought a sterling silver ring, and had no idea how difficult it would be to solder to.  Normally jewellers use very high silver content solder (>40%) which has such a high melting point it needs to be brazed - I think the reason for this is so the silver content of the whole item is high enough to be hallmarked.

I was not fussed about such matters, providing it was safe for Anna to wear, so I decided to go the entirely other direction and used a Bismuth-based solder.  Bismuth is interesting stuff... not only does it have (in my opinion) a really beautiful natural formation structure, but it also has a very low melting point.  As lead has been phased out, Bismuth has taken a bigger role in low melting point solders, being commonly alloyed to tin, as it is in this case.

The reason I wanted to use a low melting point solder is that not only would it be easier to attach, but it would be a heck of a lot easier to remove and far less likely to cause the components on the other side of the board to fall off... which would have been very likely with a brazing solder.  And here it is... the "final" end result...



It's pretty chunky (23x30mm), but it works!

Putting all this geekery to one side, the most important thing... Anna said yes!  :-D

As I suspected, it's a bit chunky for her tastes so may turned be into a wristwatch... which will mean the battery life needs to improved somewhat...

In terms of future expansion, the USB is all wired up, so that could potentially be used to upload firmware or other stuff.  I've barely used the accelerometer other than a little app that shows coloured blocks depending on the angle, so lots of room for scope there.  It's quite a nice little compact platform!

To finish up, here's a picture of Anna showing off her (for now) hand accessory... :)




Monday, 8 April 2013

12V Power supply gets a revamp, part 2 - maximum overdrive...

So yes... a bit carried away.  It all starts with buying some large chokes... then a big case... then a big chunky 2x12V 225VA encapsulated toroid.


And before you know it you have a pretty silly brute force unregulated supply that could deliver something like 15A.  Yes, ideally you wouldn't have this iron in such close proximity, but this is all I could do in the case... these chokes are pretty large!

The supply has an off-load voltage of around 19VDC though it doesn't take much to drop it down to 17VDC.   This is much higher than I need plus the off-load losses are significant - I was seeing 4W dissipation with nothing connected.  Ouch... some of that will be in the 17V zeners, but this all seems like gross overkill.

It will make the beginnings of a good audio PSU but this perhaps isn't what I want for a network supply.

Now I had the NAS, I wanted to try running it with the existing 12V PSU I built early last year, but found that it just didn't have the grunt to cope with the spin-up of the HDs in the NAS.  Sticking a big cap on the output only made it hiccup, so figured a better solution would simply be a beefier DC/DC conversion stage.

To keep efficiency, it had to be a synchronous buck topology, and a bit of research suggested that the LM3150 would be a good option.  TI sell evaluation boards for these, so a bit of a play in their Web Bench suggested what parts I'd need to reconfigure the boards to do my bidding - they are made on beefy 2oz copper with wide tracks so should have no problem in delivering >10A of current.

Thankfully pretty much everything was available from Mouser.  To handle the increased current, the N-channel MOSFETs needed to be changed.  As it so happens, TI make some pretty good ones.. the catchily-named CSD16321Q5C is a 25V, 100A (okay, 31A in most real world cases) part which has more than enough current capability, and is also designed to be heatsinkable from the top if you need more current handling!

A literally big component change was replacing the inductor with a much beefier one - a SER2915L-682KL... it barely fitted on the board!


The aim was to try and keep copper losses as low as possible... this inductor is a >=20A part so should have no trouble at all delivering 5A, even in a box with very little ventilation.


To swap over the FETs, I used my new hot air gun, an Atten 858D.  I saw the review on the EEVBlog a while back and it did seem to be the best tool for the job for a fairly small amount of money.  When it comes to 2oz copper board with wide traces, even an 80W soldering iron will struggle to get enough heat in to remove parts - this is where a hot air gun really comes in handy.   I don't think there's any way I would have gotten the solid caps off with my iron.

So I tested up the boards with crocodile clips - success - a clean 12V output!  Although the regulation seemed a little poor... I later found out that the crocodile clips had a whopping 0.2 ohms resistance - horrendous for any kind of significant current testing!  Need to make some fresh ones with thick copper cable...

 The new DC/DC seemed to be working okay, but the existing 50VA transformer in the PSU box just wasn't going to have the oomph required.  Even with a single HD, the cable modem, router and NAS were going to peak at 35W or so consumption when the drive spins up... the 50VA will be well out of its comfort zone.

Fortunately I had an 80VA handy... the catch being that it's a 2x9V rather than a 2x12V.  Standard transformer voltages are a little bit annoying... the standard windings go along the lines of 6V, 9V, 12V, 15V... thing is that no transformer offers perfect regulation so there can be a significant disparity in off-load vs. full-load voltage.  A 12V transformer after rectification and smoothing is likely to be something like 17VDC with only light loading, unless you put a big choke in before the cap.

2x9V would have been perfect for a 12V supply, but I need more than that to charge a battery... ideally between 13.5V and 13.8V for a 12V, depending on temperature.

To handle UPS functionality, I decided to go with a PicoUPS board.



This is quite a neat little board which is based around a couple of ORing controllers that let it use beefy NMOS as diodes, essentially... the controllers have a comparator which decides whether to switch battery or mains sourced DC to the output... when the mains voltage drops below the battery, it should seamlessly switch to the battery.

In order to charge the battery, the board uses a P-channel MOSFET with a little controller IC that appears to provide constant current.  As far as I know, it doesn't apply any continuous voltage limiting, although the board itself should not be run above 17VDC input.

While I had a nice efficient UPS solution now, the transformer was a worry.  9VAC would barely rectify to above 14VDC, even off load... ideally this needs a 10VAC output transformer but such things are custom jobs and as such very expensive.  The fact that the transformer is epoxy-sealed eliminates the possibility of adding extra turns... so let's try to make things as efficient as possible...

After some searching, I found what appear to be the very best diodes you can buy short of doing it all with MOSFETs and a controller.. the "Super Barrier" range from Diodes, Inc.  The forward voltage drop is considerably less than any other diode I encountered, so combined with thick 30A copper cabling, should help to minimise losses.  The particular model is the SBR10U40CT - a 2x5A rectifier in TO220 format.

Technically it is a dual diode, but as far as I can tell, they are fabricated on the same die and thermally connected so providing the resistances are well matched, should be okay to wire in parallel.  I wouldn't recommend running them up to 10A in this configuration but it should be plenty good enough for 5A continuous, I'd imagine.



A simple means of mounting them was to use the mounting hole for the toroid and drill/cut out a piece of stripboard to mount them on.  These things run very cool - not surprising at all given their very high efficiency.  You do have to wonder why they even bothered putting them in a TO220 package as it's kind of self-defeating... the heatsinking is so good that they don't get warm enough to give anywhere near their best voltage drop performance.

The thing about diodes is that the voltage drop tends to decrease as the temperature goes up - so you'll get the worst performance Vf-wise at room temperature or less... at 85C, you'll get a considerably lower drop.  On the minus side, the leakage is much higher and the devices lifespan will be impeded.  Swings and roundabouts.

In any case, when I get around to buying one, cutting off the heatsink tabs with a high speed disc will probably help save a fraction of a volt - before doing this, will need to check the part temperatures in a closed box after sustained use as they may well be getting much warmer now!



Putting it all together... in goes the new DC/DC converter board, face up.  Plenty of mylar tape to prevent shorts with the bottom of the case, lots of insulation on the mains wiring.  There's a switch on the front to give the option of disconnecting the PicoUPS from the DC/DC converter, just for when you *really* want to cut the power.

So does it work?  Indeed, yes!  Voltage to the battery with the NAS powered down is about 13.9V, within acceptable limits.  When the NAS is operational, voltage to the battery decreases to about 13.5V, which should just about enough to float charge it but probably marginal.

Switching off the mains seems to give a seamless switch to the battery, and it seems to be able to power the router, cable modem and NAS with no problems... I think it would have a tougher time starting them from battery, but definitely okay for switchover!


Efficiency seems to be about the same as before.  The new gigabit router uses about a watt more than the old Linksys, so now up to about 8W with the NAS switched off.  Not bad, though, given that now includes trickle charging the battery.

I should note that I haven't put in undervoltage protection - this was present on the old DC/DC converter board but didn't have a chance to figure out a good solution for the LM3150... this essentially means that in an extreme situation, the battery would discharge to the point of damage.  However, this would be a very extended run on the battery (without NAS, I figure at least 4 hours) and the equipment attached is likely to stop drawing much current before things get really bad for the battery.  Hopefully the desulphator won't get called into action too often!

Sunday, 25 November 2012

Toothbrush time...

It's been a while since I've had time to post, in between working on Sunrise and full-time work, but I thought I'd post a few shots from a teardown of my Oral-B toothbrush, as it was badly in need of a new battery.


 The toothbrush in question was the top of the line one - I believe later versions are a bit fancier now, but it was pretty expensive, and after a few years use, the battery life had dropped from 4-5 days or so down to about 1-2 days between charges.

The battery is a NiMH tabbed cell, soldered in.  The choice appeared to be between approx. 55 quid for a refurbished brush, or £8.30 inc. P&P for a new cell.  I decided to take the latter option... despite Braun's warnings that doing it yourself will knacker the water seals.  Frankly, for less than a tenner, you're not going to lose much even if the brush does suffer from water ingress at a later point.

Getting the thing open wasn't too hard - there are tutorials on Youtube, but the internal plastic retaining clips were a little more fiddly than anticipated... thankfully didn't snap the induction coil wire when it gave way!


Under the LCD screen, there was lurking an MSP430, which was slightly surprising, as I'd have thought they'd be using a more cut-down controller for something like this.  Certainly in the lower cost brushes, I seem to recall seeing an unknown uC.

In any case, even an MSP430 cannot run off 1.2V so there must be a boost converter  on there... probably that little SOT package just below, as there's a chunky-ish inductor just above it.  I presume that the motor runs directly off the battery via. a MOSFET under control of the MSP430, as the boost converter is unlikely to be that efficient at this low a voltage.


The charging circuit looks pretty simple.  I haven't traced it out, but noticed that it's a pretty slow charge, so probably nothing exotic.


Here's the old battery in place, with the retaining spring removed between the motor and the battery.  Note that there's actually quite a lot of spare length in the chassis - the original battery is 42mm long, but you could probably fit another 10mm or so in there.  Such a shame that it wasn't ever so slightly longer to take a regular AA.

They've also decided that a 0.1uF cap across the motor terminals was necessary... wonder if this is for RFI or whether it was adversely affecting the microcontroller in some way.



New battery in place.  The cell is rated 2000mAh, and is allegedly a Sanyo, so of decent quality.  The terminal strips were a little wider than the original but are easily cut down with scissors as the metal is so thin.

And then, put it all back together again... still charging, but seems to be fine so far... :)