









Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Material Type: Project; Class: Advanced Digital Projects Lab; Subject: Electrical and Computer Engr; University: University of Illinois - Urbana-Champaign; Term: Spring 2007;
Typology: Study Guides, Projects, Research
1 / 15
This page cannot be seen from the preview
Don't miss anything!










Overview.............................................................................................................................. 1 Hardware.............................................................................................................................. 1 6-Legged Robot Chassis.................................................................................................. 1 Servos – Hitec HS-422 Deluxe........................................................................................ 3 Microphones.................................................................................................................... 3 Peripheral Interface Controller – PIC 16F877................................................................. 3 Digital Signal Processor/Peripheral Interface Controller – dsPIC 30F4013................... 3 LINX Receiver/Transmitter............................................................................................. 3 Misc. Chips...................................................................................................................... 4 Wireless Spy Camera/Base Station/Laser Pointer........................................................... 5 Software............................................................................................................................... 6 PIC Program..................................................................................................................... 6 dsPIC Program................................................................................................................. 8 Host Computer Program................................................................................................ 10 Algorithms......................................................................................................................... 10 Sound Tracking.............................................................................................................. 10 Distance Measuring....................................................................................................... 12 Possible Future Improvements........................................................................................... 15
The main purpose of this project was to create a spying robot that could be deployed anywhere to take video of anything. The name of the project/robot is Spyder in hopes that the final result would be an extremely mobile robot, like a spider, that would be able to take video of anything, to be used in spying. Spyder’s major features include the ability to autonomously head toward sound sources as well as use its camera to avoid collision. Spyder’s main chassis is taken from the Fall 2005 project ‘Multi-legged Robot’ by Cesar Corzo and is essentially a body that has seven servos attached to it, one that will be used for camera movement, and two for each of the six legs to give them a full range of vertical and horizontal motion. The control signals for these servos will come from a PIC which in turn has signals being fed to it from a dsPIC. The dsPIC will feature two modes, the first being a manual mode where one could remotely control Spyder from the computer and the second being an automatic mode where Spyder will track sound sources and head toward them. Then the computer will be sent information from the camera on Spyder which can be recorded or used for collision avoidance. The final product will be a flexible robot with the ability to be manually controlled or autonomously follow sound sources all the while recording its surroundings.
6-Legged Robot Chassis The body consists of two plastic plates with six legs sandwiched between them and a servo for the camera. This can be seen in Figure 1.
Figure 1 – Frontal View of Spyder Each leg consists of two servos, one to control back and forth motion and another to control up and down motion. This can be seen in Figure 2. Figure 2 – Close Up View of Leg Setup
to the receiver using RF and this will finally feed into the dsPIC giving it the computers commands. The setup used is as follows: Transmitter in Figure 3 and Receiver in Figure
Figure 3 – Receiver Setup Figure 4 – Transmitter Setup http://www.linxtechnologies.com/Documents/RXM-900-HP3-xxx_Data_Guide.pdf or (References/Linx Receiver(RXM-900-HP3-xxx_Data_Guide).pdf) http://www.linxtechnologies.com/Documents/TXM-900-HP3-xxx_Data_Guide.pdf or (References/Linx Transmitter(TXM-900-HP3-xxx_Data_Guide).pdf) Something to note is that we send multiple signals for each command. To be specific we send 4 0x00 ‘s and then the actual command we want sent. This is due to the unreliability of the chips in the initial reception which is caused by the fact that the chips are rated at a minimum of 100Hz and thus not constantly sending data messes this up. We found that buffering any commands we send with a few 0x00’s in front led to flawless reception (as of yet) and is our current solution to this problem. Misc. Chips
http://pdfserv.maxim-ic.com/en/ds/1798.pdf or (References/MAX232.pdf)
Initialization loop Is instruction 1? WalkForward ResetLegs Transmit RaiseReachKick_A Lower_A RaiseReachKick_B Lower_B CycleWait CycleWait CycleWait CycleWait LongWait Yes LongDelay Timer 0 Time out? No ShortWait Yes phi/theta = 0? cycleCount = 0? No Decrement cycleCount Yes No Yes No ResetLegs CycleWait CycleWait Clear instruction Timer 1 Interrupt Increment counter_0.01ms Serial Interrupt Return Return Return Set Angles and Set instruction to 1 Figure 7 – Flow of PIC Program
The crawling motion used can be seen in the following drawing. One set of legs will raise and reach while the other set kicks back, propelling the robot forward. While turning, only one set of legs will swing while the other set will strut in place, creating a differential in distance covered to facilitate the turn. Figure 8 – Movement Sequence dsPIC Program The program on the dsPIC controls the motion of the robot by sending commands to the PIC via the UART interface, and interfaces with the host computer via a second UART interface, which is connected to the dsPIC on the robot through as set of wireless RF transceivers. As the host computer issues commands through the wireless link, the dsPIC buffers and interprets them. The dsPIC initializes the robot into Idle Mode, doing nothing and awaiting commands. As soon as a valid “Mode Change” command is received, the dsPIC starts to operate in Manual Mode or Automatic Mode, depending on the command received. In Manual Mode, the dsPIC will expect the host computer to continue to send commands, which can be among walking forward, turning left/right, turning the camera left/right, and resetting the camera. Once a command is received, it is relayed without any modification onto the PIC, which controls all motor functions of the robot. In Automatic Mode, the dsPIC takes over and performs sound tracking. It is set up to sample from three microphones at a rate of 44.1 kHz per channel. The microphones are installed in a “L” fashion, enabling cross-correlation algorithms in both length-wise and width-wise directions of the robot (see “Sound Tracking” in “Algorithms”). The output from the cross-correlation is used to place the sound source in five distinct zones: straight ahead, in front but to the left, in front but to the right, behind and to the left, or behind and to the right. There are five different sets of step sizes associated with each of the scenario: if the sound comes from straight ahead, the left and right legs move equal amounts. If the sound comes from the front, but either to the left or right, legs on the opposite side move, but legs on the side of the sound source do not. If the sound comes from behind, legs on the opposite side move a lot, while legs on the same side do not, thus attempting to turn around. The captured video is sent back to the computer; if at any point the distance finding algorithm running on the host computer (see “Distance Measuring” in “Algorithms”) finds that the robot is too close to a surface, the host
Host Computer Program The host computer elicits user input, displays video, and performs collision avoidance by distance measuring. A GUI is developed with the Windows Software Development Kit (Windows SDK) and the Microsoft Foundation Class Library (MFC Library) in Visual Studio 2005. It displays the video stream in a small preview window, and a captured frame refreshed every 5 seconds in a bigger window. It also contains some control buttons for user interaction. The user can send commands to the robot by pressing buttons that set modes and issue movements. When a button is pressed, the appropriate command is sent to the wireless chip via the serial interface. At every frame capture, the program will scan the upper central portion of the image where the laser dot is expected to be (see “Distance Finding” in “Algorithms”), and display the distance in centimeters. In Automatic Mode, if the distance becomes less than 40 centimeters, the computer will initiate a “Mode Change”. Firstly, it requests the dsPIC to switch into Idle Mode, then Manual Mode. While in Manual Mode, it first commands the robot to turn the camera to the left, records the distance measured while it is turned to the left. Then it commands the robot to turn the camera to the right, and measure another distance. Those results are then compared against each other, and the program commands the robot to turn to the direction with the larger distance. After that is done, the program switches the robot back into Idle Mode, then Automatic Mode. Thus collisions can be avoided.
Sound Tracking The sound tracking algorithm is based on the assumption that a sound wave will approach receivers in essentially a flat plane. Then using 3 microphones in an L-shape we can use the delay in reception of each to determine the direction of the sound. A simplification of the setup is shown in Figure 10.
Figure 10 – Simple Setup As can be seen in the figure microphone 2 would receive the wave before microphones 1 and 3. This delay in reception of the same wave is what we use to then isolate the direction of the wave. For example if the wave was parallel to the axis created by microphones 2/3 the wave would hit both microphones at the same time and thus no delay would be created. In this situation we can then reliably say the wave either came directly from the left or directly from the right of the axis. To determine between left and right we then check how the wave approached 1/2 and depending on which is leading we can determine from the left or right. Similarly if the wave instead came perpendicularly to the axis the delay would be maximized and we could determine that it came from either directly above the axis or directly below. Then to determine between the two we simply look at which microphone was leading. To get the specific values of the delay we use cross-correlation on the inputs from the microphones. The idea behind this being that the two microphones would have received the same signal however at different points in time. By multiplying the values of the two arrays together we can isolate a time in which the numbers align the most and yield the greatest value. When we find this we have found the time at which they align and thus by how much they are delayed by. A simple example of this is shown in Figure 11.
Figure 12 – Sample of Distance Measuring Setup As can be seen in the figure regardless of where the face is it will be represented by the same number of vertical pixels. This indicates that each pixel is essentially representative of an angle and thus we can determine the angle to which it is from the center of the camera to the dot on the wall by counting the number of pixels. Knowing the angle and one of the lengths we can then calculate the other length, which happens to be the distance to the wall using the following equation. d cm angle
Figure 13 – Sample of Distance Measuring – Far Figure 14 – Sample of Distance Measuring – Near