Saturday, July 15, 2006

Almost yet another week

Sigh. I was supposed to update daily for this term, but so far, its more like weekly. I guess it takes time and effort I don't seem to be able to conjure up.

So what have I done this week? Fourth Year Design Project. If you didn't know already, our group is trying to create a portable wireless 'child leash'. In otherwords, it is something you put on your kid and as soon as he/she wanders out of range, it will start to beep.

The problem comes from the fact that our idea has been changed several times. Last term, when we first thought of this idea, it was supposed to use timestamping to find the distance. Ie, a wireless signal with time information would be sent back and forth. The difference in the timestamp and the time it was received would be the 'distance' given that the EM wave travels at the speed of light. The problem with this? One, the two devices (the parent and child devices) needed to time-sync with each other first. Second, we forgot how fast the speed of light travels. Because it travels so fast, the microcontroller must also be very fast in order to have a low quantization error. When calculated, a 300MHz microcontroller was neccessary to generate a 1m quantization error. There is no way you can get a 300MHz low power MCU. It just isn't possible.

So being the smart people we are, we decided to go for phase. The problem now is that we couldn't find out where the Phase comparator output was. The phase comparator is in the PLL of the board. What it does is that it compares phase by generating an error signal proportional to the phase difference and mixes that with the input signal until it matches the exact phase. When the PLL error goes to zero, the signal is considered "locked". The problem is that the phase comparator was not accessible by a pinout. Not that we could see anyways. So instead, we looked at a schematic of the board and found a CP_OUT. Charge pump out. It looked similar to the part of the PLL where it was generating an error signal. So we used it. However, we had no idea how to get the phase information. So we used an oscillascope to test it. Found a waveform that we suspected that we can use. Then we try to capture it with our board. The board had an integrated ADC (analog to digital convertor). What happened is that for the past week and a half we have tried to get the thing working. It just doesn't see it properly. That, or the ADC gets stuck or the transceiver gets stuck on code. I finally find out that we are looking at the right place. The CP_OUT was the chargepump out of the PLL. The difference is that in recent times, most PLLs have been converted from the active PLLs we learned in ECE318 and replaced with passive PLLs. Active PLLs require more power. Passive PLL uses a current source and a passive RC circuit to generate a feedback loop with a transfer function a la ECE380. But we still couldn't figure out how to use it. After investigating it for a long time, we decided to take the average of 100 samples of the minimum of the waveforms formed when the chip was transmitting or receiving. The problem was that the ADC still didn't detect it. It seemed to only find the steady state value.

So two days ago, I got the bright idea of using a 3 board solution. 2 boards will be constantly sending and receiving, while the last board would be used as an ADC. While this solved the problem of getting infinite loops within thecode. It seemed that the ADC itself was interfering with the transmission. What was happening was that the RC circuit of the sample and hold circuit of the ADC was interfering with the passive RC circuit of the chargepump/PLL. I could finally see the effect after running the ADC like such because of running the two boards seperately. All was in despair until we were going to our lab this afternoon. After the 471 mandatory lab, Roma, Vani and I caught up to Cutberto. Lan had asked him just before, but Cutberto only asked her to send him the documents (datasheets and the like). However, we had our boards and datsheets ready when Roma, Vani and I caught up. So we looked at it. And he asked a bunch of technical questions that I kind of had the answer for, but I wasn't sure. He gave us a suggestion on how he would do it. Instead of taking the CP_OUT, he would take the mixer signal and run his own PLL on it. For that to work, that would mean we would not make the checklist for sure. However, he noticed RSSI which we had dismissed earlier because it was the signal strength indicator. He told us that it would work. After looking at it, I did agree. It was acutally using phase through a limiter to determine the relative signal strength. In that case, all we had to do was use it. It was true that the RSSI did decrease with people in the way, but that can be just called a 'feature'. But we have 2 communicators that were able to determine the distance apart.

Just now, I have put the finishing touches on the state machine code that would make it autonomous. Hopefully it will work! It features a variety of features, including an alarm, panic button, on/off switch and 4 selectable distance ranges. Com'on. Work damn it! Hopefully we can get the buzzer working too!

Not much else. DSP Project done. AI Project still need to do. Still need a decent job. We'll see what's going to happen in a few days. Hopefully, it will something good. The two weeks is almost up. I can't wait till the good stuff happens. Then exams. But at least now, there's hope!

Oh, and my sister bought a book that basically allows you to find out what type of person you are. It makes for very interesting reading. Very good insightful stuff.

I think this project was the most motivating thing about Waterloo so far. It is concrete and I can see what's happening, what needs to be done, what needs to be fixed, etc. I really don't know how I'd have done it if it was a boring project. It may seem simple on the surface, but I think I learned a lot in how to program microcontrollers, especially the MSP430 series. As well, I think I learned quite a bit about transceivers and PLLs as well. Very interesting.

Well. Tomorrow is another day, and 5:30 in the morning is not when I do my best thinking, no matter how I slice it. Till I meet you again, my Muse, my Valkyrie.

1 comment:

Roma said...

GOOOOOOOO TEAAAAAAAAAAAM!!!!