Tuesday, October 18, 2011

Sensor stack (Thesis)

It's been a while since my last post, not that there hasn't been progress: I've got ahold of the right spacers, so the sensor stack looks neat and ready to be mounted (see photo). Unfortunately I still have to use STK600 to do USART line conertions, because I ordered the wrong footprint regulators (sot89 instead of sot223). I'll soon have that sorted thought.

There is still more work to be done with the ARS algorithm before I can test it against a real system, but I'm confident that I'll have something in time for the test.

I still haven't decided on which CPU to use, but I'm leaning towards a uC.


Wednesday, August 31, 2011

Power & IO PCB for Attitude System (Thesis)

Over the last couple of days I did another module for the attitude system stack. The last one I did was the uC PCB, which won't be used in the final system, due to its low processing power. This  new power and IO will be part of the final system, as it will take care of the external power and interface convertion.

First of all, the PCB takes power and regulates the voltage down to 1.8V, 3.3V, and 5V for all the sensors and uC/FPGA. I was a little unsure of wether I should put in a bridge rectifier on the power input, to make sure the polarity would always be correct. In the end I skipped it. Secondly the PCB has a USART signal converter for external I/O, together with a 9 pin DSUB-F connector. This  is my primary interface.

I also put on a RJ45 socket, in case I also implement an  ethernet interface, but with just a simple 2x4 header.

Finally I have to commend the guys at iTead Studio for their excellent service. I was very pleased with the last batch of PCBs they made for me, at a price you just can't beat. But this time they kindly pointed out to me that I was missing two drill holes for the RJ45 socket (see picture). That is just awesome! Thank you!! The error was due to the way STARCAD was set up not to include non plated drill holes in the drill file. Quickly fixed, and updated files sent away. Now for the waiting part ;-)


Friday, August 26, 2011

Software Decoder for Attitude System (Thesis)

I thought it might be easier to code a program in a computer, rather than in a microcontroller or FPGA. The idea is to transfer the selected algorithm at a later stage, when I have a better understandig of the calculations involved.

At the moment, the program reads the data strings from the serial port and then parses the data. The program then optionally applies bias and converts the raw data to real values. I also quickly threw together a simple PID algorithm to give me an idea of the data I'm getting.

I will later implement proper algorithms, I just need to get my head around some heavy maths first.

I also plan to implement a charting / visualising option, and the ability to log various data to disk.


Thursday, August 11, 2011

Microcontroller PCB for Attitude System (Thesis) - Part V

So I did some changes to the uC firmware, so there is no preformating. I also replaced gcc's dtostr function with my own code, as it was eating up allot of space. All output is now 16 bit signed, and I also saved about 30% program space. I can also shave of some of the RAM, but I'm not using much anyway. I should have put some of my code into procedures, but I'm going to focus on developing the PC side app.

I'm going to use Lazarus IDE, which is based on free-pascal, which is GNU. At the moment I have been using 32 bit XP, but I hope the switch to 64 bit W7 will be painless.

I'm closing this post with a sample of the raw serial output from the uC, as it appears on the PC serial port.


Sunday, August 7, 2011

Microcontroller PCB for Attitude System (Thesis) - IV

Here are all the parts working together. The ISP and USART is connected to the STK600 card, but the new PCB has its own voltage connector, so it can run independently, only I forgot to include the GND pin. Not a problem thought, as there is a spare ground pin.

I'll probably crack on with making a power and interface PCB soon...

I'm happy that both sensors worked fine over the I2C bus, and that the external interrupts worked well. The only issue I had was a stupid naming error declaring the external interrupts as inputs, as the atmega1280 and atmega8 differ slightly.

So next I'll clean up the code slightly, implementing a temperature string among other, and then concentrate on coding a data app in windows.


Friday, July 29, 2011

Microcontroller PCB for Attitude System (Thesis) - III

I've assembeled one of the 10 cards I received, which is prettty straight forward. I had some problems with a batch of LM317 voltage regulators. The pads on the component was oxidised, so I had to sand down the terminals! Better order some new ones, together with some atmega8 chips, as I'm running out fast with all these projects.

By the way, the atmega8 is nowhere near powerfull enough to do the full attitude computations. The atmega8 will do data gathering and send it to the usart port in raw ascii. Incidently, I forgot to include ground on the usart header! I guess I was thinking of the stk500/600 cards.

That's it for now. I will start looking for a programming language that supports usart under w7-64, no easy task...


Wednesday, July 27, 2011

Microcontroller PCB for Attitude System (Thesis) - II

The PCB that I intend to use as a prototype interface board arrived from iTeadStudio today. The quality is quite good, and for only $9.99 + shipping, this service is what I will be using from now on (except for very high tollerance stuff).

Half of the boards have been electricly tested, and are marked in red on one side.

There are a few minor issues, all of which I can live with. The main issue is that the silkscreen was converted to the same font. This caused som silkcreen to get into a few vias, and at one place it was almost completely gone. As long as I'm aware of this in the future, it's not going to be a problem.

Here is the front side of the PCB




And here is the back

Friday, July 22, 2011

New rotary encoders

Just quick update, I've recieved the new rotary encoders. These ones also sport a momentary push switch. I think I'll use that function for starting and stopping the count-down. Perhaps I'll throw in a double-tap to reset to zero. Anyway, they work well, so hopefully I'll find some time soon to finish up the electronics and programming side of the project. If I have the time tomorrow I'll shop around for some  building materials for the enclosure.


Saturday, July 9, 2011

Microcontroller PCB for Attitude System (Thesis)

Didn't feel like coding yesterday, so I decided to make a uC PCB for the attitude sensor stack. I wanted to make the PCB a little more general purpose than just a PCB for interfacing with the sensors, so I've added pin-rows for all I/O-pins with annotation. Other than that, I've added header for USART, two I2C headers, a voltage regulator, and three regulated power headers. As with the other sensor PCBs, I have added 3.5mm mounting holes in the corners so that the cards can be stacked.



I'm trying out yet another PCB fabricator, iTeadStudio, which is by far the cheapest I've seen. For ten 50x50mm two-layered, green solder mask and HASL plated, it cost $14 including shipping! I also added the 'Open PCB' option, which is where they will send you two random PCBs from another order. How cool is that!

I am a little concerned that I've pushed the tolerances a bit, but we'll see when I get the PCBs. ITead specify 6mil a minimum, and recommend 8mil (0.2032 mm), but I think it should be fine.

I'll probably get the boards in a couple of weeks time, until then I will keep program using Atmels STK600 monster of a dev kit. I'll get a ICD debugging header so I don't have to lug it around with me, not to mention that horrible ZIF socket system...

Monday, June 13, 2011

First use of Multi-Purpose PCB (UV timer) - Part 1

This was to be a timer system for UV exposures of DIY PCBs. I have already made up and used the UV board, but it was a bit messy to use (pull the power to turn off).

The idea was to have a button for start/stop, and a rotary encoder for adjusting exposure time. Sadly, the encoder was DOA, so I will order a new one. In the mean time I've coded the display, and found out that the atmega8 doesn't have a PC7 (forgot about that), I had wired it to ground on the PCB. This meant I had to some pair wire instead of the 10-pin header.

The FET works brilliantly, and you can see the UV board hooked up, but not on at the moment. When on, the FET doesn't even get hot to the touch, so no need for a cooling rib.

So before I get a new rotary encoder, all that is left to do is to wire up a start/stop button (reset button is already in place).


Wednesday, June 1, 2011

New PCB service

Made up a sort of prototype PCB in CADStar and sent it away to a new manufacturer I'm trying out. I'm pleased with the quality, two layer eletrical, solderstop, two sided silk screen, and very cheap. Just two minor errors on the PCB on my part: I used 6mm switches instead of 3mm, and there's possibly one air wire, but that could be an auto-router glitch. In the image below, I've mounted the microcontroller, ISP, and a header for unregulated power. This was to test the microcontroller, which worked like a charm.



The board is based around an ATMEGA8, and has most of the standard parts is use: regulator, a few switches, a FET, rotary encoder, USART, I2C, and ISP of course. In addition, all IO ports are fully connected to 2x5 STK500/STK600 type headers with power: Any additional circuitry I can take from the pin headers.

Gerbers, schematics and PCB-file available on request.

Happy hacking!

Combined Accelerometer & Gyroscope

This is from my Master thesis, where I'm building and attitude refference system (ARS) for pitch/roll/heave and vibration compensation for echo location systems.

I've buildt two kinds of accelerometer sensor boards already, based on Freescale and ST-microelectronics chips. The latest addition is the gyroscope board, based on a chip from Invensense. And here they are, finally merged (with the Freescale accelerometer board).



I'll be using Labview and Matlab to implement my ARS algorithm now.

Later I will build a power and interface board, and of course the micro-controller board, making the final system a four stack fully modular design.

Happy Hacking!