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.

Tuesday, February 17, 2009

From Thursday through the long weekend...

We met everyday from Thursday through Monday (yes, even President's day) to continue development of our project. Our mission was to continue working upon our code of making a LED light blink, but instead of having it already programmed into the pic, we wanted to use the USB interface to control the blinking. Ideally, we wanted to have a system working such that if we plugged in the USB cable attached to our bread board (on which the Pic is connected), the connected PC would detect the "new hardware" that we had just connected, and then would allow us to use some sort of GUI to control the LED.

To prepare for this, extensive reading was done. We also turned an MC1455 into a 20MHz oscillator. However, though the resistor and capacitor values we used to achieve this seems to be correct, after using an oscilloscope, we found that it was only running at 2MHz. We are unsure whether this was an error in the oscilloscope, or in the equation we used to try and create the oscillator. Now, we have created a 4MHz oscillator to act as our external oscillator, and further testing will see if we need to change this as well. We have an old satellite receiver, on which has three crystal oscillators, but we are unsure of whether they work or not. Nevertheless, we have managed to de-solder one of them, and will test it on the oscilloscope to test its actual frequency rate. In the worst case, we will go out to Action Electronics and purchase an oscillator from them.

Tuesday, February 10, 2009

Slow steady progress

After our last couple of meetings, we have managed to correctly create a program to make an LED blink using our pic. This is important because it has accomplished three tasks. First, it has proven to us that the pic actually does work, and that we are able to program it and change the program at will. Second, being able to output voltage through the pins of the pic is extremely similar to what our pic will be doing in its final stage -- the only difference being that it will have to output at a certain time instead of turning on and off at a regular interval. Lastly, thanks to this experiment we were able to finalize the language of choice to use for the pic's program: C (as opposed to Assembly).

We are now trying to create an interface between a USB port and the pic itself. We have done a good amount of research on it, and are beginning to use some sample code online and integrate it with our pic. Our next goal is to use the USB interface to allow a computer to dictate when the LED will light up. If we can accomplish this little task, then we will be able to fully connect our image processing program with the pic.

Tuesday, February 3, 2009

Things are slowly coming together

Our new pics have arrived. These re-programmable pics are compatible with the pic programmer, and testing of it will begin shortly. We have successfully mounted a stepper motor on top of another stepper motor, and tested to see if the stepper motor on bottom can still rotate with the added load. This test proved successful, and the entire contraption will be complete soon. All four stepper motor drivers have been soldered onto a circuit board, and because we are able to hook up one successfully to a stepper motor, we can just duplicate its setup for the other stepper motor drivers. Things are really coming together, and completion of the initial prototype is imminent.

Wednesday, January 28, 2009

Technical Difficulties

We have finished construction of the two stands for the stepper motors/spotlights. We plan to add bridges to it to increase the stability of the structure. The height of the stands have been overestimated so that if need be, we could cut off some of its height to better fit our project. There may be some difficulties connecting the stepper motors to the bred boards (as the stepper motors are now mounted so high above the ground), but this could easily be remedied by soldering additional wires as intermediaries between the two.

We also tried to use our new threading set to thread the shaft of the stepper motor, but this proved difficult because it is difficult to keep the stepper motor's shaft from rotating while simultaneously threading it. We plan to use some sort of tool to keep the shaft steady the next time we meet.

Tuesday, January 27, 2009

Construction of the stage

We turned our attention to another part of our project that needs to be completed before the Senior Design Expo: the stage. Initially, we were planning on using a regular table to act as our stage, but because of potential errors and complications that could occur from using one of the provided tables (perhaps light would refract of the table, or it was unsteady...the potential list of problems goes on) we decided to create a stage on which to mount all our necessary equipment on (the stepper motors, stepper, spotlight, camera, etc).

We bought the necessary materials which included plywood, aluminum, screws, and begun working! The basic layout is to create a plywood matting on which we could place on top of any tabletop. On this matting would be a clearly marked of area to act as our stage, while having some leftover space on the matting to erect several stands that will hold the stepper motors and the webcam. The stands will be constructed to a specific height so we can use that height in the calculations we need to make (when finding the person on stage).

Yet another task that we will work on simultaneously with the list of other things we have to do.

Thursday, January 22, 2009

Pic Programmer

On Tuesday, we were able to acquire our pic programmer, which we hastily began to work on. Using our own laptop with the necessary software (MPLAB IDE), we immediately took some simple code (to test the functionality of both the programmer as well as our pic) that would light up a LED light, and attempted to test it. But after hooking up the pic to the LED, we were baffled to find that the LED did NOT light up. Initially, we assumed that our code was incorrectly programmed, and proceeded to debug it. But after we found no error, we assumed that we were not using the software correctly. It was only after we brought up our problems with Professor Ihler was the REAL problem found. We had bought a OTP pic: One Time Programmable. Naturally, we did not do this intentionally. But we had overlooked this one piece of valuable information. Good thing we had bought two spares of the same pic.

We now have two paths we can choose to take. We could go ahead and order another pic (this time a RE-programmable one) and work off of that, OR to save money, we could thoroughly test our program on the software simulator, THEN attempt to program on our remaining pics. This approach is extremely risky (as we only have two tries before we are out of options) but is a road we are still contemplating as we have already passed our set budget.

Tuesday, January 13, 2009

Using the new lab

Today we decided to test how the stepper motor works when given a step function. So, we have gone to the lab today to use the Arbitrary Waveform generator. And after spending a couple of hours to learn how to use the machine properly, we are able to make the stepper motor move with various step sizes, step speeds, making it start and stop, etc. The results of these experiments will be useful when programming our pic, which we will be the goal of our next meeting provided we are able to acquire a pic programmer. A video of our results will be posted shortly.

Also as an update to our project, we have decided to use a laptop instead of the NSLU. And should we have time after completing the project, we will go back to it. This will allow us to advance in our project without further hindrances.

Friday, January 9, 2009

Analyzing the stepper motor

Although we were able to pass enough current to the stepper motor to make it move, we were unable to make it continuously turn in a single direction (it kept turning clockwise, then jumping to counter clockwise, and so forth). So, today's mission was to find any potential wiring problems that may have caused this error. And after a bit of trial and error, we have managed to fix the stepper motor so that it will rotate in the counter-clockwise direction.

However, we have discovered a potential flaw: our stepper motor driver may potentially be hindering the usefulness of our stepper motors. The stepper motors we have purchased have the potential to take 1.8 degree steps; but the stepper motor driver seems to have a 11.8 degree step minimum. As such, unless we are able to somehow circumvent this, our stepper motors will be forced to take such large steps each time to move. This will make our project less accurate than hoped for.

Another issue that has arisen is that to be able to power four stepper motors with enough current each, we would have to go out and buy three more power supplies (we already own one). They cost about $10 each, and as we are already past our set budget, this may prove to be a hindrance to us.

Lastly, we have discussed how to create on which to connect the stepper motor and the webcam. We are thinking of finding some sort of durable material that is both strong enough to hold both the stepper motor and the webcam without snapping, but at the same time light enough so as not to give the bottom stepper motor more weight to move. One potential material is the material which circuit boards are made of.

Thursday, January 8, 2009

Stepper motor funcitonal!

Success! After thinking about our problem of not having enough voltage being passed to the stepper motor, we realized that the resistor we had put there was limiting our voltage input. As such, by removing it, enough voltage was now being passed to the stepper motor to make it move. Now to resolve the problem of how to make it turn in an angle of less than 180 degrees (as that is what it is currently doing).

Tuesday, January 6, 2009

Return from the Break!

After the long Winter break, we have once again resumed our work on the Senior Design Project. Turning our primary focus now onto the stepper motor, we have attempted to connect the correct wires to the stepper motor driver, and make connections between the stepper motor and its respective driver. This proved to be somewhat successful, as we have confirmed that our stepper motor does indeed work (it managed to turn), but connections between it and the stepper motor driver did not succeed as planned. We believe the problem to be a lack of source voltage, as the supplied voltage seems to be insufficient when tested with a multimeter. More analysis on how to resolve this issue will be conducted.