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.