May 052013
 

So, I promised lots of updates, but so far, I haven’t delivered! I’ve had some setbacks, as expected, but I’ve made incredible progress on so many fronts. Btw, if you’re not the geeky type, this post may not be for you, but just so you know: things are looking awesome!

But first, let me show you what my board currently looks like:

Current state of the kuroBox layout.

Current state of the kuroBox layout.

Yep, it looks like an absolute mess! But there are lots of very good reasons for this. I’ve abandoned a poor design choice I made early on. I was hoping to be able to use a SoC (System On a Chip) to offload writing to SD card. My idea was to buy a chip that would do the hard work of writing reliably to an SD card for me, so I wouldn’t have to learn about all that stuff, and could concentrate on the important things. It turns out that the datasheet for the SoC was … incomplete, and that it was actually quite crap. But it’s totally my fault, I didn’t do complete due diligence and I suffered a setback. That’s what all those red wires are for – I’m bypassing that SoC and going to the SD card directly. Good news is that I now have 4x more bandwidth to burn through, my board is cheaper to make (because of a lot less components), and I’ve learnt a lot!

Along the way, I’ve proven many of the independent systems, LTC, the graphics, RTC time keeping, RS232 interface, overcurrent protection, etc.

And this is what my current design looks like:

kuroBox_v11

kuroBox_v11

It kinda looks messier than before, but there’s only one main chip in there (a mighty 32bit, 168MHz processor with FPU), and wiring it up is a lot better. There’s also much more space for expansion for future projects. It’s currently at the fab house.

On another front, I think I’ve finalised the design for the enclosure:

Exploded view of boards, enclosure and connectors.

Exploded view of boards, enclosure and connectors.

It’s quite simple, just the lid with windows for the screen and buttons, and 4 LEMO connectors on the side, for power, LTC and 2 external serial ports. Once I get the PCB’s back from the fab house, I’ll do a 3d printed fitting and form test of the enclosure, and, once happy, I’ll send them off to get machined out of aluminium, and then black anodised. It’s going to look amazing!

So yes, stay tuned!

Nov 062012
 

Now, at the end of the year, looking back, how did the Aronia turn out? What worked, what didn’t, what did I learn and what would I do next time?

 

 

What Did Work

The TS7500 worked quite well, very easy to program (it’s basically straight C/C++ for linux), enough example code to get you into trouble and back out of it and the tech support people are very friendly, fast and helpful.

In the past, I had tried running a RS232 through the XUARTS at very high speeds (921600 baud) for continuous streaming (not burst transfers) and it had ended up giving me grief. The TS7500 locks the SPI bus every second for something, and that was enough for me to lose packets of data. But now, I decided to go through the USB port, through an FTDI USB serial port chip (more on this in another post), and not a single lost packet in 6 months of operation. I you don’t even have to boot all the way into linux – the image on the sdcard loads USB drive drivers, checks for a script called “tsinit” on the USB drive (if present) and executes it. I put all my code in that tsinit script (loading USB serial / ftdi drivers, making folders, setting up UARTS) and walked away!

The serial-enabled LCD from Seeedstudios was dead easy to use, you just have to make sure to flush commands before issuing more, since the UART driver on linux is buffered, and if you try to do packet-wait-packet type transfers, it won’t work as expected.

The Aronia PCB itself was designed with enough flexibility to change the way it was put together quite easily. I was using Molex Picoblades for my main connectors, but had also put in through-holes just in case. In the end, I ended up replacing some Picoblade connectors for direct soldering – much faster and easier, and I didn’t not require that particular part to be removable.

What Did Not Work

Well… the TS7500 also gave me its fair share of grief. Well, it’s mainly that I was trying to use the TS7500 as a pure embedded, real-time platform, which its not, so it’s my fault really. I was reading data off 3 serial ports, at different baud rates, with varying amount of data coming through. In theory, I should be getting packets like this: A, A, A, B, B, C, A, A, A, B, C, A, A, A, B, B, C, … (imagine I send 3x A packets, then 2x B packets, 1x C packet, etc…), but in reality, since the linux USB drivers would be “helping me” by buffering, I would read 20x A packets, then 10x C, then 5x B… etc,  so not really as interleaved at I had hoped. In the end, it didn’t matter as much, since the A packet is the “master” one, and the others don’t really change that much. In hindsight, I need a proper embedded system, with proper low-latency interrupts and where I have control at the end of each byte read.

We also blew up about 4 of these TS7500 boxes, kinda. We don’t actually know what’s going on with them. But they boot, get to the prompt screen, then reboot. Forever… We are abusing them quite a bit, so it’s quite a surprise that they are surviving this well though.

I had a couple of design flaws in the Aronia PCB. First and most important: I knew nothing about thermal design (operative word: knew, past tense). I now know a lot more! We were plugging these guys into 14v, I was then regulating to 5V with about 0.7A current usage. On a linear regulator – that’s a LOT of wattage coming off it. with only 2.5cm^2 of radiating copper thermal pad, in an airtight polycarbonate box. Yes, these linear regulators got so incredibly hot that they actually discoloured the PCB! I tried adding a 2x10cm aluminium plate, but that was also getting into the 90ºC+ range after 5 minutes. I ended up getting some SMPS from Recom, some 1A 34v-in, 5v-out ones and reworking them onto the board.

I also added, on the wires supplying the current, some diodes and fused to make sure that nothing blows up (except the fuse). All this should have been on the board, not added as an afterthought…

Another thing I would change with the PCB is to put the connectors at the very edge of the board instead of the middle. In its current form, I have to remove the TS7500 from on top so I can plug a connector in, which is very annoying when in the field. And of course, adding a console header to the board helps!

A massive let-down for me was my “brilliant” “UPS” “solution” that I had “envisioned”! Here’s my theory: 12V -> 5V regulator -> LiPo Rider Pro -> Aronia. The LiPo Rider Pro takes 5V in and outputs 5V. It also has a connector for a single-cell LiPo battery. When running off its input, it will charge the LiPo, when the input is disconnected, it will seamlessly switch to LiPo and boost it to 5V – exactly as what I want! The only problem is that the LiPo Rider does not care about the minimum voltage of the cell, so it will squeeze it for all the juice it has, even if it means over-discharging the cell. The cell has a built-in over-discharge protection circuit, where it stops giving anything if the voltage falls below 3.4V (or 3.3V, I forget). This, for the moment, sounds good. Except that the LiPo Rider will not supply anything on its output if a battery is not connected, even if it has a perfectly good 5V input. And this condition is exactly what happens when the battery is over-discharged, that it looks like no battery is there!

In the end, I just got rid of that whole thing and if power goes down, then power goes down. In practice, it didn’t really affect us much, but it did leaving me scratching my head for a few afternoons.

Jan 222012
 

So, I got my boards back, got the components ordered in, and I’ve assembled a couple of them.

They don’t work.

Kinda. The micro runs whatever code I put on there, the LED’s blink if I tell them to, but it doesn’t like the USB part. I plug it in, and my computer chucks a dummy spit saying that the “USB device is not recognised, bro”.

I got it working on the breadboard, the exact same code. And apart from a few extra LED’s (that aren’t currently turned on), there’s not much more to the circuit. I have verified all traces, all paths, checked for any bridges, etc. I just don’t know what’s going on.

I’m posting this up to see if anyone can help me debug the sucker and maybe tell me what’s going on. I’m including the schematic, the board layout, the eagle files and a high-rez photo of the current state of the board.

Note, since this board is Rev1, I know I screwed up a couple of things. Most importantly, the 1.5k resistor, R5, should have been connected to the D- instead of D+, that’s been fixed by soldering R5 directly to the “correct” place. Also, the ISCP header, I’ve mislabelled GND/VCC (I know, I know!), so on the board it’s crossed out (but the pins are in the correct spot). I’ve put 22pF capacitors for the crystal instead of 18pF as a different test (this is the second board I assembled to rule out “burnt component” issues).

Here’s the deal. If you are able to point out what I’ve done wrong, I’ll send you one of my blank PCB’s.

Schematic:

Board layout:

Populated board (no switches):

Eagle Files:

uKb_v1.1

Jan 082012
 

I’ve been thinking about creating my own LiPo charger for a while now. Something that will allow me to charge a large array of LiPos in the field without it been fiddly or annoying.

Since I now know a bit about electronics, I set out to see what it would take to make a simple and modular single-cell LiPo charger. Something based around the MAX1555 or the MCP73831. I chose the Microchip one because I liked the fact that the datasheet had a recommended layout for the PCB tracks to improve the thermal properties.

For the daisy-chaining, I’m using these cool hermaphroditic connectors from TE. They handle up to 6A, so it should be good for a few chargers in one chain. And they’re only 79c!

For regulation, I’m using a Murata switching regulator to get from Xvolts (where X can be a car battery) to the 5V the lipo charger chip likes (thanks Kean for the suggestion!). They’re not terribly cheap, but they’re efficient and kinda small.

I’ve also put on one end a USB socket to allow charging of a single battery off USB. There a lot to be improved in that corner, and I don’t think it’ll be the primary usage, but in a pinch it could be very handy. Since USB only allows 100mA draw without negotiation, I’ve laid out an ATTINY there to act as a USB device that wants more power. There’s a lots of suggestions flying around, like, put a fuse there (Madox, Jaye), and they’re all good ideas, but I haven’t gotten around to implementing that yet.

All of this experimental, of course, but this is the fun part!

Schematic:

Board Layout:

Download the EagleCAD files here: MCP7383_v1