















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: Senior Design Project Lab; Subject: Electrical and Computer Engr; University: University of Illinois - Urbana-Champaign; Term: Spring 2002;
Typology: Study Guides, Projects, Research
1 / 23
This page cannot be seen from the preview
Don't miss anything!
















In conjunction with the project of Ben Mathews and Cole Zemke, our project sought to expand the functionality of a designed mobile, tank-like DSP unit. To supplement our sister project, a wireless data link and vehicle control, a graphical user interface was developed. The GUI allowed a user to display image data from the onboard, wireless camera and monitor status parameters of the vehicle. The status parameters include vehicle speed and camera position. In addition, a pan/tilt head for the onboard camera was developed allowing it to take image data of its complete surroundings. The final project component consisted of implementing a joystick for both vehicle and camera motion control utilizing DirectX®. II
In conjunction with the project of Ben Mathews and Cole Zemke (Project 32), our project sought to expand the functionality of a designed mobile, tank-like DSP unit. Dan Block and Brian George had completed the vehicle’s mechanical design. To supplement our sister project, we developed a “neck” for the wireless, onboard camera allowing it to take image data of its complete surroundings by giving it 120° of pitch motion and 180° of yaw motion. The “neck” was mounted on the mobile unit and interfaced with the available DSP PWM and A/D channels. Joystick input was also developed to control both the motion of the tank-like unit, as well as, the “neck” of the mounted camera. A GUI to display image data, control inputs and status parameters of the vehicle was another component of our project. The status parameters include camera position feedback and vehicle motor speeds, while control inputs include desired vehicle motor speeds and camera positioning motor speeds. The complete GUI operates remotely on a PC, while utilizing two wireless links. One wireless channel is used for vehicle control and feedback, while the other is used to provide image data.
JOYSTICK MOTION CONTROL GUI VEHICLE DSP RECEIVE TRANSMIT TRANSMIT RECEIVE VEHICLE CAMERA SYSTEM STATUS CAMERA NECK DRIVES VEHICLE DRIVES PC BASE STATION MOBILE DSP UNIT NOTE: ITALICIZED ITEMS DEVELOPED BY BEN MATHEWS AND COLE ZEMKE. W I R E L E S S C O N T R O L RECEIVE TRANSMIT L I N K W I R E L E S S V I D E O L I N K Figure 1. Complete System Block Diagram 1
The GUI served as the primary end-user component. It provided the user with all the feedback available from the vehicle. Feedback was provided visually through the use of the video stream and progress bars and numerically through the use of text boxes displaying the vehicle’s operating parameters. Joystick data was processed by the GUI and prepared for transmission of the wireless link. The GUI also served as the interface between the wireless links installed on the PC. The user software served as a wrapper for transmission of the 16-bit control data from the joystick to the vehicle. Joystick Motion Control Hardware utilization of an analog joystick was completed using a PC sound card with a game port. The DirectX® Software Development Kit with the DirectInput® library served as the software interface between the joystick and the GUI. The joystick’s X-Y position, along with its 4-way hat switch, provide the user with a way to manipulate the vehicle’s motor speeds and camera position, respectively Camera Neck The mechanical design consisted of a simple frame that is mounted on the front of the vehicle. To provide two-axis motion for the camera, two servo motor assemblies with feedback circuitry were mounted to the frame, with one servo providing pitch adjustment and the other providing yaw adjustment. Vehicle Camera A wireless camera provided video feedback for the vehicle. The camera interfaced with GUI software at the PC base station. The project is compatible with two different wireless camera setups. The GUI is able to use both an X-10 wireless camera and the D-Link 802.11b wireless camera. For the final demonstration we selected the D-Link version due to its superior video quality.
The GUI displayed nearly all of the vehicles operating parameters to the end user in addition to allowing the user to control the vehicle. The GUI handled the interfacing between the joystick motion control system and the wireless link. It used DirectX® to read the position of the joystick, the hat switch and the trigger button. The control information to be sent to the vehicle was displayed numerically and graphically. The left and right motor speeds to be sent to the vehicle ranged from -63 to 63 and are also represented by color progress bars indicating the magnitude of forward or reverse motion. The hat switch control indicated whether the camera is moving up, down, left or right. The GUI also displayed the feedback information from the vehicle over the wireless link. It displayed the actual motor speeds of the vehicle in the same manner as the speeds to be sent. The GUI also displayed the actual position of the camera neck. The neck’s pitch and yaw were displayed along an axis of -90° to 90°. In addition to control and feedback information the GUI contained command buttons allowing the user change various options relating to the vehicle and camera control. 2
The GUI was designed to bring several different components together in order to provide easy control and monitoring to the end user. The GUI had to display the wireless video stream provided by the D-Link camera. Since the video stream is displayed through a java script on a web page, the GUI contains a web browser form that directs to the camera’s built-in web server. The GUI was designed to display vehicle control and feedback parameters. To achieve that goal various animations were created to provide visual indicators of the vehicle’s status. The GUI contains the code used for the joystick motion control system. This code takes the DirectX® joystick input and formats it for display and for transmission over the wireless link. FlightStick Pro Input/Output at Serial Port Wireless Link Joystick Handler to Vehicle Vehicle Status Display Wireless Camera Wireless Video Link Video Display Camera Neck GUI Components Figure 2. GUI Component Block Diagram
A simple joystick with x-y positioning and point-of-view capabilities served as the primary motion controller for the vehicle. Although, both analog and digital joysticks can be incorporated into the GUI, an analog joystick, the FlightStick Pro®, was implemented due to its low cost and simple interface with the PC’s game port. The joystick is then configured, initialized, and polled using the software tools contained in the Microsoft DirectX® Software Development Kit.
A pan/tilt head, or neck, was developed to give the end-user a more complete image of the vehicle’s surroundings. The frame for the neck needed to be strong and rigid to support a camera of any size. In order to accommodate the frame, high-torque servomotors were required to provide the necessary torque to both pitch and yaw the camera assembly. Also, a universal mounting bracket or screw for the camera was necessary to incorporate the wide range of wireless camera body styles. Pre-assembled units were available for use, but in general, do not provide the necessary universal mounting assembly. They are often custom built for a particular camera body style. Also, as a result of our Design Review, feedback was necessary to provide the end-user with a means to discern the relative position of the camera. By using simple gearing on a servo head and a pot shaft, we easily achieved a reliable feedback signal of the camera position without doing invasive work, as would be the case with a pre-assembled pan/tilt head. A general electrical schematic is shown in Figure 3, while a general mechanical schematic is shown in Figure 4. +5 V SERVO PWM SIGNAL GND FEEDBACK VOLTAGE SERVO CONTROL SIGNAL +5 V GND SERVO +5 V GND Figure 3. General Feedback Circuit for Camera Positioning
The GUI design incorporates many other components into the final functional form for the end user. As shown before, it incorporates the joystick motion control and wireless camera components, which are covered in further detail below.
The FlightStick Pro was first used with a simple joystick test Visual Basic program provided with the DirectX® Software Development Kit [1]. The resulting data sample is contained in Table 1. TABLE 1. RAW JOYSTICK DATA Joystick Position (POV position)
Upper Left (Neutral) 0 0 - Center (Neutral) 5000 5000 - Center (Up) 5000 5000 0 Center (Right) 5000 5000 9000 Center (Down) 5000 5000 18000 Center (Left) 5000 5000 27000 Lower Right (Neutral) 1000 0
By using this coordinate frame, a desired motion scheme was built. The motion scheme is depicted in Table 2. TABLE 2. VEHICLE MOTION SCHEME Raw Joystick Values Vehicle Motor Speeds (% of Maximum Available Speed) X Y POV Left Right Camera 0 0 Neutral 0 100 Hold Position 0 5000 Neutral -100 100 Hold Position 0 10000 Neutral -100 0 Hold Position 5000 0 Neutral 100 100 Hold Position 5000 5000 Neutral 0 0 Hold Position 5000 5000 Up 0 0 Pitch Up 5000 5000 Right 0 0 Yaw Right 5000 5000 Down 0 0 Pitch Down 5000 5000 Left 0 0 Yaw Left 5000 10000 Neutral -100 -100 Hold Position 10000 0 Neutral 100 0 Hold Position 10000 5000 Neutral 100 -100 Hold Position 10000 10000 Neutral 0 -100 Hold Position NOTE: NEGATIVE VALUES INDICATE BACKWARD SPEED With this complete set of data, a simple coordinate transformation that will transform the raw joystick values into vehicle motor speeds was developed. The specific transformation used for the joystick control is depicted in Equation (1). The desired motor speeds sent to the vehicle are scaled values and are shown in Equation (2). A graphical depiction of the transformation is shown in Figure 6.
raw raw scale right left
scale right right scale left left
RIGHT SPEED AXIS LEFT SPEED AXIS JOYSTICK X-AXIS JOYSTICK Y-AXIS (0,0) @ JOYSTICK’S UPPER LEFT Figure 6. Transformation from Joystick Raw Coordinate Frame to Motor Speed Coordinate Frame With a mathematical foundation for producing the desired vehicle motor speeds, a software algorithm was developed to take raw joystick data, perform the necessary transformation to motor speeds, and send these values over the wireless link. A flowchart of this algorithm is shown in Figure 7.
The preliminary mechanical design of the camera neck was shown in Figure 4. This large design was utilized to allow the maximum available viewing area. However, after construction, the electrical wiring required to provide power, control, and feedback to the positioning servomotors interferes with available range of motion. The motors selected were 131 oz.-in. servomotors to provide the necessary torque to position the camera. These motors have built-in feedback and protective stop tabs on their gears. The built-in feedback potentiometer was disconnected from the gearing, essentially fixing the feedback voltage. Also, the protective stop tabs limit the range of motion on the servo and were removed to allow a greater angular range of motion. To mount the camera a standard tripod screw (1/4 inch-20 threads per inch) was implemented to accommodate a wide range of wireless camera body styles. In order to control the position of the camera, pulse-width measurements were taken to indicate the motor direction. These values were then implemented on the DSP software to allow joystick control of the camera position. The resulting data is shown in Tables 3 and 4. TABLE 3. PITCH SERVO CONTROL SIGNALS Servo Command Pitch Servo Pulse Width (Period = 12ms) Pitch Up 1.220 ms Pitch Down 1.265 ms Hold Pitch 1.235 ms TABLE 4. YAW SERVO CONTROL SIGNALS Servo Command Yaw Servo Pulse Width (Period = 12ms) Yaw Left 1.237 ms Yaw Right 1.260 ms Hold Yaw 1.249 ms After construction of the necessary PWM control signals, feedback circuitry was established to provide the end-user with a means of ascertaining the position of the camera. All yaw motion was referenced relative to the vehicle’s heading, with positive angular measurement corresponding to the right and negative to the left. All pitch motion was referenced to level ground, with positive angular measurement corresponding to looking up and negative to looking down. An electrical schematic of the feedback circuitry is shown in Figure 8.
1k 1W 1T Pot 0.1uF 1k ¼W +5 V SERVO PWM SIGNAL GND POT FEEDBACK SIGNAL SERVO PWM SIGNAL (YELLOW) +5 V GND SERVO +5 V (RED) GND (BLACK) Figure 8. Complete Electrical Feedback Circuit To incorporate the feedback voltage into a meaningful angular position, a series of data points were collected and a linear fit of the data was developed to translate a feedback voltage into an angular position. The data collected is shown in Tables 5 and 6, with the linear fit of the data shown in Figures 9 and 10. TABLE 5. PITCH SERVO FEEDBACK SIGNALS UP LEVEL Pitch (Degrees) Feedback Voltage 80 2.627 V 45 2.423 V 22.5 2.170 V 0 1.875 V Pitch(Feedback Voltage) = 103.0275(Feedback Voltage) - 197. TABLE 6. YAW SERVO FEEDBACK SIGNALS RIGHT LEFT Yaw (Degrees) Feedback Voltage 90 2.590 V 45 2.077 V 0 1.487 V -45 0.400 V -75 0.002 V Yaw(Feedback Voltage) = 60.1936(Feedback Voltage) – 75.
The wireless camera transmits over the 802.11b protocol. The camera and the NIC attached to the PC base station are configured to create an ad-hoc peer-to-peer network. These devices would also work with an 802.11b wireless infrastructure. The two 802.11b establish their connection and use that to transmit video and configuration data. The video stream is displayed by navigating the web form within the GUI to the IP address of the wireless camera. This action is displayed in Figure 11. D-Link 802. USB NIC Video Display Java Enabled Web Page Ad- hoc 802.11b Wireless Link Microsoft Internet Control D-Link 802. Wireless Camera Wireless Video Display frmBrowser Object FIGURE 11. Wireless Camera Diagram
The GUI design was verified by testing all other components of the project at once. The video stream was displayed within the GUI form and was found to have acceptable performance. As the joystick motion control was verified, the GUI was found to display the proper numerical values along with the correct visual indicators for the joystick motion and the actual motor speeds of the vehicle. Similarly, for the camera neck test, the GUI displayed the direction of desired neck movement along with the actual pitch and yaw positions of the camera neck.
In order to maintain control of the vehicle, both motor speed values were limited to 24 for greater maneuverability when driving the vehicle through the wireless camera link. This corresponds to approximately 25% of the maximum motor output torque range. In addition to limiting the output torque, a “trim joystick” function was added to the GUI to allow the user to center the joystick manually. This allowed a user to counteract the hysteresis associated with the device. After these modifications, the vehicle was operated to demonstrate the motion scheme depicted in Table 2. The vehicle adhered to the motion scheme with a 200 ms delay between joystick command and corresponding motor output. The resulting motor feedback was also properly displayed to the user in the GUI.
Similar to the vehicle motion scheme, the camera motion scheme was executed with the vehicle stopped. The camera neck adhered to the motion scheme depicted in Table 2 with a 200 ms delay between hat switch command and camera motion. The resulting camera position feedback was also properly displayed to the user in the GUI.
In order to minimize the lag associated with the 802.11b wireless connection and provide the best possible video quality, the camera was set to transmit a 320 pixel x 240 pixel video stream at the highest level of compression with the frame rate determined by the camera’s web server. This allowed for a high quality video stream at an average of over 20 frames per second. The lag between an occurrence and its display by the camera was on the order of 500ms to 750ms.