Tuesday, March 10, 2009

The darkness is darkest just before the dawn...

But the dawn is coming! After so many hindrances with our project, our latest meeting proved to be extremely promising. We have finalized the design of our system, with our stepper motors, webcam, and wiring finished. Our image processing code has been optimized to increase our frames per second, and now, instead of being forced to wait for the spotlights to catch up after moving our infrared emitters, the wait time delay is practically non-existent. Things are looking pretty good.

Things that still need to be done:
--Finalize the stage area. Though we have an exact area on which we have finalized our stage area to be on, we have not labeled it on our platform.
--Make a recording. To demonstrate a working model of our system online.
--Fix spotlights. Our spotlights (flashlights) are malfunctioning again. We have concluded that the flashlights are a piece of .... As such, we will have to find some more reliable flashlights to act in their stead.

Another update is expected in the next 24 hours, most likely with a video

Monday, March 9, 2009

A Baffling Error

Today we replaced the burnt out stepper motor driver. We found that desoldering AND buying a new circuit board were BOTH unnecessary. Apparently, there was EXACTLY enough room on our old circuit board to solder the new stepper motor driver! It was quite an ordeal to solder it on with such limited space, but it was done successfully.

That, however, proved to be the least most difficult part of our day. After hooking up out entire system, we were astounded to run into problem after problem. Stepper motors were moving erratically when they should have been still (and without any inputs from the laptop either), then some of the stepper motors lost power. Some of these problems were due to incorrect wiring configurations, but the problem that took up most of our time was an error that was absolutely mind baffling. With everything correctly connected, we found that only one side (2 stepper motors) were getting power, while the other side was not!

After quite a few different tests, we concluded that although all of our grounds were connected together, they were NOT all the same value. You could say that not all grounds were the same! Further testing led us to believe that our wires were the issue. We were using quite a few wires that were very long, and we found that circuits that were close together were able to get power correctly.

So to fix this, we had to basically undo all of our wiring, push everything closer together, and connect all our wires as close to the bredboards as possible. This took quite a bit of time, but at its final result, we found that we had resolved the problem. Although we were not able to test the new system with the webcam code, the system was no longer moving erratically.

Perhaps more good news (unless it turns out to be premature celebration), we found some new potentially useful ideas for our program to be implemented in C++, where some initial tests show that we can now perhaps up our image capturing speed to maybe 4 pictures a second (as opposed to the one picture a second we were currently getting). Also, we plan to use a spare webcam that we had in reserve to see if that would potentially reduce some of our delay as well.

Another update is to be expected in the next 24 hours.

Saturday, March 7, 2009

Setback

Today we were able to mount spotlights onto stepper motors. So now, we have two flashlights on top of their respective stepper motors (total of 4 stepper motors and 2 flashlights, as is our system requirements). We finished connecting all our components together, and soldered all the necessary connections together. But during the testing phase, we had accidentally wired a voltage source incorrectly, and forced too much voltage onto our stepper motor driver. It was given a 15V voltage, when its maximum allowed is between 5V and 7.5V. Meaning, this chip was fried. We did a few tests to ensure that this was indeed the problem. Luckily for us, we had bought one extra precautionary chip to replace this one, but now we are out of chances to mess up chips (this would be our third stepper motor driver that has been rendered unusable). Also, because we no longer have any more space on which to put our stepper motor drivers, we will need to buy another circuit board. And those things weren't cheap in the first place.

We are continuing to explore various possibilities in improving the delay of our system, but testing on these methods will have to wait until our current problems are fixed. An update will be posted most likely in the next 24 hours.

Working In Crunchtime

It's almost presentation day! We are working hard to get everything working properly. We have successfully mounted one stepper motor on top of the other, both of which are responding in the correct direction (and seemingly correct magnitude) when given inputs by the webcam. We created a infrared emitter to test the system with, which we will most likely be using come Senior Design Expo Day. We have placed this onto our make-shift stage, and used its proportions to kind of finalize our project's layout (knowing exactly where the stepper motors will be, the camera's location, the "stage area").

Things left to do:
-Mount flashlight onto stepper motor. We bought a relatively cheap flashlight, and wouldn't you know it, it breaks right before testing of it could occur. Purchase of a new one has already occurred, so this problem will be resolve ASAP.
-Make the connections for the second set of stepper motors. Our project intended to have two spotlights shine on the stage. Now that we know the first one works, we will now adjust our code and system to incorporate the second one.
-Mounting of the webcam. We will have to secure the webcam in place, at a fixed height from the stage.
-Increase lag time. Though the system seems to react as expected, there is still the matter of a 2 second pause time between each rotation of the spotlight. We hope to be able to improve this.

The following is a video of our tests with the infrared emitter. Though not the best of quality, does show the basic operation of the system, as well as our layout.

http://www.youtube.com/watch?v=9KwXzpIbQnY

Wednesday, February 25, 2009

Hardwiring the Hardware

Soldering 24 wires to each of the 4 stepper motor drivers is proving to be quite a messy job. We have decided to attach all the input connections that are never modified by our system onto a separate circuit board (as opposed to a bredboard) to prevent any confusion and for tidiness. This way, we will not make the mistake of connecting one of these connections to an output connection, where something could go haywire. Further, we have also attached labels to each of our output wires to make changes in wiring a tad easier. We would no longer have to search through a mess of wires to find the one wire we are looking for.

We have code to use to test the system with two stepper motors. To do this, we have switched to a C# compiler (as opposed to Java, C, and C++). Testing will begin shortly and a new update will be soon.

Saturday, February 21, 2009

Unexplained AI?!

Twice now we have experienced a weird phenomena. We have our code working, doing what it needs to do, only to find out the next day that it no longer functions. This has happened twice now, for no apparent reason. So now, after we had gotten the code RE-working again, we have decided to leave it completely in tact, without moving anything to prevent it from randomly malfunctioning again.

Also, now we have gotten a simple test up and running. We have our webcam detecting infrared light, and when it does, we have code that determines in which direction the light moved, and by how much it moved. This is processed by the laptop, and sends this information via USB to a pic. The pic in turn, processes this information and then sends the proper commands to the stepper motor driver, which has a stepper motor attached to it. And as we witnessed, the stepper motor was able to turn with just the moving of a LED light!

Our next step now is to attach more stepper motors. Though we were able to successfully test one stepper motor, we have not mounted a second stepper motor on top of it yet and tested that. Also, we will have to attach the flashlight to our two stepper motors to see if our system points the flashlight in the correct system.

Wednesday, February 18, 2009

The progress

Today we have managed to create an interface between PC and Pic! Using a program known has Hyperterminal, we have a program that can, with the push of a button from the keyboard, have the pic read it, and output back to the user that a button was pushed. With this code, we have modified it so that it will, by pressing the L or R keys, change the direction of a stepper motor either clockwise or counter-clockwise. Theoretically the code will work as programmed, but because the lab closed, we were unable to test it with the in-lab waveform generator. That will have to wait until tomorrow.

We are deciding upon whether to use a dummy loop to act as our delay function, or an Pic interrupt. The delay function, though easier to implement, has the potential to lose a few instructions in the delay time between the pic and the pc. The Pic interrupt can circumvent this, but must be implemented carefully. For now, we will use a dummy delay loop (just a for loop that does nothing) to act as our delay for the purposes of development, and have plans to replace this with something more efficient.