29
ii SOUND TRACKING PAN-TILT MACHINE Progress Report for ECSE-4962 Control Systems Design Kevin Murphy Matthew Daigle Matthew Gates Vadiraj Hombal March 24 th , 2004 Rensselaer Polytechnic Institute

SOUND TRACKING PAN-TILT MACHINE Progress Report for ECSE …cats-fs.rpi.edu/~wenj/ECSE4962S04/progress/progress... · 2004-03-25 · The system will be able to use a microphone sensor

  • Upload
    others

  • View
    4

  • Download
    0

Embed Size (px)

Citation preview

Page 1: SOUND TRACKING PAN-TILT MACHINE Progress Report for ECSE …cats-fs.rpi.edu/~wenj/ECSE4962S04/progress/progress... · 2004-03-25 · The system will be able to use a microphone sensor

ii

SOUND TRACKING PAN-TILT MACHINE

Progress Report for ECSE-4962

Control Systems Design

Kevin Murphy

Matthew Daigle

Matthew Gates

Vadiraj Hombal

March 24th, 2004

Rensselaer Polytechnic Institute

Page 2: SOUND TRACKING PAN-TILT MACHINE Progress Report for ECSE …cats-fs.rpi.edu/~wenj/ECSE4962S04/progress/progress... · 2004-03-25 · The system will be able to use a microphone sensor

ii

Executive Summary

The focus of this report is to discuss the progress of our final proposed design to use sound localization to develop a pan-tilt laser tracking system. This also includes a discussion of initial results from the beginning stages of the modeling and control aspects of the project. We plan to use the pan-tilt mechanism to track an object making sound on a 5 foot by 5 foot test bed with a laser pointer in less than 1 second. We will summarize the project goal, objective, and specifications. We then outline the importance of our design strategy, plan of action, and then verification of our system. The machine will have to integrate two major sub-systems. The first is the sensor array which will be a microphone network. The second is the actual sensor system which will use Time Difference of Arrival approaches to take the microphone signals and triangulate the position on the test bed in a smooth and fast fashion. Included are also a current cost analysis and up to date schedule and comparison from previous estimates. We are currently below estimated cost and just about on schedule.

Page 3: SOUND TRACKING PAN-TILT MACHINE Progress Report for ECSE …cats-fs.rpi.edu/~wenj/ECSE4962S04/progress/progress... · 2004-03-25 · The system will be able to use a microphone sensor

iii

Table of Contents Page #

1 Introduction 1 2 Preliminary Results 4 A) System Modeling 4

B) Model Validation 6 C) Source Triangulation 13 D) Initial Control 15

3 Summary of Progress 16 4 Bibliography 20 5 Appendix A – Microphone Specifications 21 6 Appendix B – MATLAB Code 22 7 Appendix C – Motor, Gear, and Pulley Specifications 24 8 Appendix D - Initial Construction Plans 25 9 Team Member Contribution 26

List of Figures

Figure 1 – Block Diagram of System 2 Figure 2 – Tilt Axis Friction Plot 5 Figure 3 – Pan Axis Friction Plot 5 Figure 4 – Overall System 7 Figure 5 – Pan-Tilt Dynamics 7 Figure 6 – Subsystem 7 Figure 7 – F (qdot) 7 Figure 8 – Tilt Axis for +1.8 Volt 3 Second Square Pulse 8 Figure 9 – Tilt Axis for -2.5 Volt 3 Second Square Pulse 9 Figure 10 - Tilt Axis for 4 Volt 4 Second Ramp 9 Figure 11- Tilt Axis for -4 Volt 4 Second Ramp 10 Figure 12 - Pan Axis for +3 Volt 3 Second Square Pulse 11 Figure 13 - Pan Axis for -3 Volt 3 Second Square Pulse 11 Figure 14 - Pan Axis for +4 Volt 4 Second Ramp 12 Figure 15 - Pan Axis for -4 Volt 4 Second Ramp 12

Figure 16 – Sensor Position Perturbations vs. Target Position Estimation Error 13

Figure 17 – Sensor Position Perturbations vs. Target Position Estimation Error 14

Figure 18 – Bode Plot of Plant with Coulomb Friction Cancelled 15

List of Tables

Table 1 – Tracking Specifications 3 Table 2 – Control Specifications 3 Table 3 – Identified Model Parameters 4 Table 4 – Experimentally Identified Friction Parameters 6

Table 5 – Microphone Specifications 16

Page 4: SOUND TRACKING PAN-TILT MACHINE Progress Report for ECSE …cats-fs.rpi.edu/~wenj/ECSE4962S04/progress/progress... · 2004-03-25 · The system will be able to use a microphone sensor

l Page

1

1 Introduction

Sound detection can be an important security procedure for many applications. Whether at home, work, or elsewhere, personal protection is always one of everyone’s utmost concerns. Sound is one of several key ways to detect a security breach. Being able to detect a sound in a completely dark room would enhance many current security procedures that involve video and motion detection. Our proposed project goal is to use the pan-tilt mechanism and sound detection to track a moving object on a 5 foot by 5 foot test bed grid.

By designing this system we are furthering the functionality for a rather large market for

security and safety in home and safety systems worldwide. Our perspective uses and motivation are for home, work and office. The reason we chose sound is because in a dark room a camera would not be good for detecting a problem. The challenges we foresee are the microphone sampling rates, the overhead of our triangulation algorithms, calibration, and the rate of new position inputs, all of which we will overcome through testing, and analysis. With what we have learned about triangulation of sound sources, we are confident that our project, while challenging, is feasible to complete.

The system must be able to track a single sound source in our test bed configuration. In order to accomplish this, the system must be able to, given a sound signal, compute the position of the source, transform this position into desired pan and tilt angles, calculate the new motor output, and send this to the motors. See Figure 1.

The system will be able to use a microphone sensor array to detect and locate a single sound

source and then adjust a laser pointer mounted on the system to point directly at the sound. The system will also be able to disregard background hums and other noises while focusing on the sound that really matters. The system should be able to locate and point at this sound in less than 1 second.

The system software will use the “Time difference of arrival” (TDOA) algorithm in

conjunction with triangulation to determine the location of the sound on the test bed. As Aarami [1] explains, TDOA is the relative time difference of a signal between two receivers. Aatique [2] discusses methods to do this. The most popular is generalized cross-correlation.

For the purposes of this application we will be investigating 3 specific types of motion of a

single source on a strictly 2 dimensional surface. The first type of motion is point to point motion. The second type of motion we plan to investigate is linear motion. The last type of investigated motion will be random motion.

Page 5: SOUND TRACKING PAN-TILT MACHINE Progress Report for ECSE …cats-fs.rpi.edu/~wenj/ECSE4962S04/progress/progress... · 2004-03-25 · The system will be able to use a microphone sensor

l Page

2

Figure 1 – Block Diagram of System

Currently we have been begun working from our preliminary design and have many results to

discuss. We have completed many of the preliminary tasks which are needed to do more in depth study of our project. We have identified both coulomb and viscous friction for both the pan and tilt directions and positive and negative applied torques. We have identified inertia values for both the pan and tilt axes. Using these values and values from our motor specification sheet, we have developed in MATLAB a useful working model for our system. Using this model we have simulated the response of our system to two distinct input voltages. The two chosen were a single pulse and a ramp. From the results of our simulations and verification we believe we have a model that will allow us to design a controller that will adequately control our actual system.

Other progress towards the completion of the project involves physical setup of the system.

We have ordered and received our microphones for the system. There was an unanticipated challenge for this project regarding the microphones. We were under the impression that there were leads attached to the microphones but when we actually received them we found that we needed to solder our own leads to the microphones. The microphones are also very tiny. This means that the uncertainty in our sensor position now becomes even more important. It will be even more difficult to

Sampler

Microphone Signals

Triangulation Algorithm

TDOA Measurements (every 10 ms)

Control System

Get input from microphones.

Sample the microphone signals.

Compute TDOA between microphone pairs.

Compute sound source position in world coordinates. Transform Cartesian position to motor angles. Compute new motor output.

Move laser pointer

Pan and Tilt Motors

Page 6: SOUND TRACKING PAN-TILT MACHINE Progress Report for ECSE …cats-fs.rpi.edu/~wenj/ECSE4962S04/progress/progress... · 2004-03-25 · The system will be able to use a microphone sensor

l Page

3

keep these tiny microphones from moving from their exact position in the array. Also physical construction of the test bed and mounting system has begun.

Our tracking requirements of our system are summarized in Table 1. Our typical tracking

target will be a walking person. On average, it takes a person 2.5 sec to walk 5 feet, i.e. a velocity of 2 ft/s. Our system will at most have to cover 180 degrees for 5 ft in 2.5 sec, giving an angular velocity requirement of about 1.25 rad/s, however, we are designing to take care of a slightly larger angular velocity. Our tracking frequency was decided to be 3 Hz, because it would be hard for a person to walk much faster. We will try to achieve less than 10% error for this bandwidth.

Specification Value Target Velocity 2 ft/sec Angular Target Velocity 1.3 rad/sec (max) Tracking Frequency 3 Hz Maximum Tracking Error 10 %

Table 1 – Tracking Specifications

Our control specifications were derived from our chosen workspace configuration and experimentation with the limits of our system. They are shown in Table 2. We would like a relatively fast rise time, so we will tolerate a small amount of overshoot. Rise and settling times were chosen from system responses to step inputs and what the team with our system of last year was able to accomplish. An overshoot for either axis translates to at most 0.25 ft in our test bed. We feel we can achieve zero steady state error with a decent controller, although it does not matter than much for a large target. These values have changed from our proposal because we were able to test the system and discover its limits in these areas.

Pan Specifications Time Domain Joint Angle (for unit step) Workspace Maximum Overshoot 5% 0.05 rad 0.25 ft (max) Rise Time < 0.3 s - - Settling Time < 0.4 s - - Steady State Error 0 0 rad 0 ft Tilt Specifications Time Domain Joint Angle (for unit step) Workspace Maximum Overshoot 5% 0.05 rad 0.25 ft (max) Rise Time < 0.4 s - - Settling Time < 0.5 s - - Steady State Error 0 0 rad 0 ft

Table 2 – Control Specifications The remainder of the project does look challenging but not impossible to complete. We

expect to have a very suitable controller designed as well as very good input data from our sensor array. An anticipated challenge we will encounter will be integrating the sensor and control systems together. We actually believe this may be the single most challenging task left to complete. Our overall prognosis at this point is that we are still on schedule for completion.

Page 7: SOUND TRACKING PAN-TILT MACHINE Progress Report for ECSE …cats-fs.rpi.edu/~wenj/ECSE4962S04/progress/progress... · 2004-03-25 · The system will be able to use a microphone sensor

l Page

4

2 Preliminary Results

A) System Modeling

Modeling of our system consisted of parameter identification of each joint using the single joint model:

Motor inertias and gear ratios were determined from the motor and gear specifications. Table

3 summarizes these parameters for each joint.

Tilt Axis Parameter Symbol Identified Value Load Inertia JL 4.777x10-5 kg m2 Motor Inertia Jm 1.6x10-6 kg m2 Gear Ratio N 32.319 Pan Axis Parameter Symbol Identified Value Load Inertia JL 1.4x10-3 kg m2 Motor Inertia Jm 1.6x10-6 kg m2 Gear Ratio N 32.319

Table 3 – Identified Model Parameters

The pan axis will be mounted to avoid gravity, and we are currently not adding gravity for the

tilt axis of our model since we have not actually mounted our payload onto the machine. The gears and motors used are the same for both axes, so for both the gear ratio is (2.6/0.506)*(6.3) = (5.13)*(6.3) = 32.319, where the first value is the ratio of gear diameters, and the second is the motor’s internal gear ratio. Inertia values of the load were calculated using a Solidworks model.

Out next step was identifying friction for each joint. This was done by first commanding a 10 volt spike for 1 second to break stiction, then commanding constant voltage. Velocities were calculated using finite differences, and steady state velocities were measured by averaging the last second of each velocity plot, for each voltage. This was done for positive and negative voltage ranges for each axis. Voltages were converted to torques using N*Kt*Kn, where Kt is the motor torque constant, and Kn is the current to voltage ratio for the amplifiers. This comes to 32.319*4.36x10-2*0.1 = 0.141 Nm/V. Figures 2 and 3 show applied torque versus steady state velocity for the tilt and pan axes, respectively. The figures also clearly show that our selected motors can achieve angular velocities above our initial angular velocity requirements, which were far less than 30 rad/s.

Page 8: SOUND TRACKING PAN-TILT MACHINE Progress Report for ECSE …cats-fs.rpi.edu/~wenj/ECSE4962S04/progress/progress... · 2004-03-25 · The system will be able to use a microphone sensor

l Page

5

Figure 2 – Tilt Axis Friction Plot

Figure 3 – Pan Axis Friction Plot

Page 9: SOUND TRACKING PAN-TILT MACHINE Progress Report for ECSE …cats-fs.rpi.edu/~wenj/ECSE4962S04/progress/progress... · 2004-03-25 · The system will be able to use a microphone sensor

l Page

6

Stiction values were also identified for each joint by commanding a constant voltage to each axis. Higher voltages were looped through until the joint moved. Table 4 summarizes our friction identification results. After our first trial, we were concerned that viscous friction values were not the very similar for positive and negative voltage ranges. The results shown in Figures 2 and 3 and Table 4 represent results using averaged steady state velocities for each voltage over three trials.

Tilt Friction Parameters Experimentally Identified Values Coulomb (+) 0.227694 Nm Coulomb (-) -0.27297 Nm Viscous (+) 0.001653 NmS/rad Viscous (-) 0.004779 NmS/rad Stiction (+) 0.2679 Nm Stiction (-) -0.27918 Nm Pan Friction Parameters Experimentally Identified Values Coulomb (+) 0.379921 Nm Coulomb (-) -0.340428 Nm Viscous (+) 0.001432 NmS/rad Viscous (-) 0.002309 NmS/rad Stiction (+) 0.51888 Nm Stiction (-) 0.52734 Nm

Table 4 – Experimentally Identified Friction Parameters

Our complete friction model, including stiction, is (from Schilling [3]):

Bv*v+sgn(v)[Bc+(Bs-Bc)exp(-|v|)/ε)]

Here, Bv is viscous friction, Bc is Coulomb friction, Bs is stiction, ε is some small positive number (we chose 0.01), and v is angular velocity. This model will be used for model validation and friction cancellation.

B) Model Validation

After friction identification, we built a Simulink model in order to simulate our system with our identified model, and compare this to actual system results. We tried two input types for this purpose. The first is a 3 second square pulse, because a step response captures a lot of the system dynamics. The second input is a 4 second ramp input, from 0 to 4 volts. This was chosen so we could see if placing stiction in our friction model could accurately represent what the system would do when given a voltage which would not break stiction. A second reason was to see if the torque saturation in our model was accurate, since for both axes 4 volts saturates the motor. Figures 4 to 7 show the single joint Simulink model constructed.

Page 10: SOUND TRACKING PAN-TILT MACHINE Progress Report for ECSE …cats-fs.rpi.edu/~wenj/ECSE4962S04/progress/progress... · 2004-03-25 · The system will be able to use a microphone sensor

l Page

7

Figure 4 – Overall System

Figure 5 – Pan-Tilt Dynamics

Figure 6 – Subsystem

Figure 7 – F(qdot)

For the tilt axis, actual vs. simulated results for a +1.8 volt pulse are shown in Figure 8. The

effect of quantization noise in position can be seen in the velocity plot of that same figure.

Page 11: SOUND TRACKING PAN-TILT MACHINE Progress Report for ECSE …cats-fs.rpi.edu/~wenj/ECSE4962S04/progress/progress... · 2004-03-25 · The system will be able to use a microphone sensor

l Page

8

0 1 2 3 4 5 6 7 8 9 10-10

0

10

20

30

40

Time (sec)

Ang

ular

Pos

ition

(ra

d)

Tilt Axis - Actual vs. Simulated for 3 second +1.8 Volt Pulse

ActualSimulated

0 1 2 3 4 5 6 7 8 9 10-5

0

5

10

15

20

Time (sec)

Ang

ular

Vel

ocity

(ra

d/s)

ActualSimulated

Figure 8 – Tilt Axis for +1.8 Volt 3 Second Square Pulse

Figure 9 shows the tilt axis’s response to a -2.5 volt pulse. The results match closely, although

the velocity graph for the negative pulse looks strange enough to warrant a closer look. Figures 10 and 11 show the positions and velocities for the tilt axis using the ramp input. As seen in the figures, the model doesn’t quite capture the system behavior for the ramp input. The position for the model does not get as high as for the actual system, and the velocity never reaches the saturation point.

Page 12: SOUND TRACKING PAN-TILT MACHINE Progress Report for ECSE …cats-fs.rpi.edu/~wenj/ECSE4962S04/progress/progress... · 2004-03-25 · The system will be able to use a microphone sensor

l Page

9

0 1 2 3 4 5 6 7 8 9 10-50

-40

-30

-20

-10

0

10

Time (sec)

Ang

ular

Pos

ition

(rad

)

Tilt Axis - Actual vs. Simulated for 3 second -2.5 Volt Pulse

ActualSimulated

1 2 3 4 5 6 7 8 9 10

-25

-20

-15

-10

-5

0

Time (sec)

Ang

ular

Vel

ocity

(ra

d/s)

ActualSimulated

Figure 9 – Tilt Axis for -2.5 Volt 3 Second Square Pulse

0 1 2 3 4 5 6 7 8 9 10-20

0

20

40

60

80

Time (sec)

Ang

ular

Pos

ition

(rad)

Tilt Axis - Actual vs. Simulated for 4 second 4 Volt Ramp

ActualSimulated

0 1 2 3 4 5 6 7 8 9 10-10

0

10

20

30

40

Time (sec)

Ang

ular

Vel

ocity

(ra

d/s)

ActualSimulated

Figure 10 - Tilt Axis for 4 Volt 4 Second Ramp

Page 13: SOUND TRACKING PAN-TILT MACHINE Progress Report for ECSE …cats-fs.rpi.edu/~wenj/ECSE4962S04/progress/progress... · 2004-03-25 · The system will be able to use a microphone sensor

l Page

10

0 1 2 3 4 5 6 7 8 9 10-60

-40

-20

0

20

Time (sec)

Ang

ular

Pos

ition

(ra

d)

Tilt Axis - Actual vs. Simulated for 4 second -4 Volt Ramp

ActualSimulated

0 1 2 3 4 5 6 7 8 9 10-40

-30

-20

-10

0

10

Time (sec)

Ang

ular

Vel

ocity

(ra

d/s)

ActualSimulated

Figure 11- Tilt Axis for -4 Volt 4 Second Ramp

For the pan axis, Figures 12 to 15 summarize the results for the two inputs. The step inputs

come pretty close, but the ramp input comparisons are quite different. Our pan axis tends to get stuck sometimes when starting up, seemingly having different stiction values at different times. The model does not yet adequately capture this dynamic.

Page 14: SOUND TRACKING PAN-TILT MACHINE Progress Report for ECSE …cats-fs.rpi.edu/~wenj/ECSE4962S04/progress/progress... · 2004-03-25 · The system will be able to use a microphone sensor

l Page

11

0 1 2 3 4 5 6 7 8 9 10-10

0

10

20

30

40

50

Time (sec)

Ang

ular

Pos

ition

(rad

)

Pan Axis - Actual vs. Simulated for 3 second +3 Volt Pulse

ActualSimulated

0 1 2 3 4 5 6 7 8 9 10-5

0

5

10

15

20

25

Time (sec)

Ang

ular

Vel

ocity

(ra

d/s)

ActualSimulated

Figure 12 - Pan Axis for +3 Volt 3 Second Square Pulse

0 1 2 3 4 5 6 7 8 9 10-50

-40

-30

-20

-10

0

10

Time (sec)

Ang

ular

Pos

ition

(ra

d)

Pan Axis - Actual vs. Simulated for 3 second +3 Volt Pulse

ActualSimulated

0 1 2 3 4 5 6 7 8 9 10-25

-20

-15

-10

-5

0

5

Time (sec)

Ang

ular

Vel

ocity

(ra

d/s)

ActualSimulated

Figure 13 - Pan Axis for -3 Volt 3 Second Square Pulse

Page 15: SOUND TRACKING PAN-TILT MACHINE Progress Report for ECSE …cats-fs.rpi.edu/~wenj/ECSE4962S04/progress/progress... · 2004-03-25 · The system will be able to use a microphone sensor

l Page

12

0 1 2 3 4 5 6 7 8 9 10-5

0

5

10

15

20

Time (sec)

Ang

ular

Pos

ition

(rad

)

Pan Axis - Actual vs. Simulated for 4 second +4 Volt Ramp

ActualSimulated

0 1 2 3 4 5 6 7 8 9 10-10

0

10

20

30

40

Time (sec)

Ang

ular

Vel

ocity

(ra

d/s)

ActualSimulated

Figure 14 - Pan Axis for +4 Volt 4 Second Ramp

0 1 2 3 4 5 6 7 8 9 10-25

-20

-15

-10

-5

0

5

Time (sec)

Ang

ular

Pos

ition

(ra

d)

Pan Axis - Actual vs. Simulated for 4 second +4 Volt Ramp

ActualSimulated

0 1 2 3 4 5 6 7 8 9 10-40

-30

-20

-10

0

10

Time (sec)

Ang

ular

Vel

ocity

(ra

d/s)

ActualSimulated

Figure 15 - Pan Axis for -4 Volt 4 Second Ramp

Page 16: SOUND TRACKING PAN-TILT MACHINE Progress Report for ECSE …cats-fs.rpi.edu/~wenj/ECSE4962S04/progress/progress... · 2004-03-25 · The system will be able to use a microphone sensor

l Page

13

The previous results show that we have a good enough model of our system for model-based control design. The model is not perfectly validated, for there are discrepancies between the actual and simulated results, but that is to be expected with an approximate model with experimentally identified parameters. Not all the dynamics of the system can be modeled anyway. It may be worth it to continue to experiment with the model, but it is, after all, the job of the controller to compensate for uncertainty in it. C) Source Triangulation

Continuing from our earlier work in this area (Murphy et al [4]), we developed a MATLAB® routine to solve the hyperbolic isochrones’ equations for target position. This routine is based on the MATLAB ‘fsolve’ routine that finds the zero of a set of non-linear equations. As our equations are real and continuous and our formulation requires only one root, this function suits our purpose. The routine only requires selection of sensor pairs; the functions corresponding to these sensor pairs are automatically generated. This feature allows us to experiment with different sensor combinations. Having written the necessary function and wrapping code, we tested this code for solutions to several target positions. The numerical solutions matched the solutions previously obtained graphically (Murphy et al [4]).

We further used this tool to quantify our previous study of sensor position uncertainties on target position estimation. As shown in Figure 16 below, in general, the error in target position estimation is a nonlinear function of the uncertainty in sensor position. This is simulated by creating perturbations in the sensor position.

Figure 16 – Sensor Position Perturbations vs. Target Position Estimation Error

Page 17: SOUND TRACKING PAN-TILT MACHINE Progress Report for ECSE …cats-fs.rpi.edu/~wenj/ECSE4962S04/progress/progress... · 2004-03-25 · The system will be able to use a microphone sensor

l Page

14

However, even with use of a ruler scale for measurement of sensor positions, we could measure a sensor’s position with an error less than 0.5cm (0.0164 feet) in one direction. Based on this premise, extensive experimentation with various perturbations revealed that within the 0.5 cm limit for perturbation the target position uncertainty can be approximated as a linear function of the sensor position perturbations. Figure 17 below illustrates the basic result we obtained through this experimentation - if the all sensors in an array (i.e. the row of sensors along the same axis) were perturbed by the same amount, then the error in target position estimation, though increasing, is small, especially when compared to uneven perturbations of each sensor position in an array.

Figure 17 – Sensor Position Perturbations vs. Target Position Estimation Error

In the experiments, uneven perturbations were created by scaling the perturbation index by

fractions indicated in the brackets. Hence, even if all but one sensor were accurately positioned, the error in target position estimation would be higher than when all sensors were perturbed by the same amount. Hence we have to approach the calibration of sensor position with highest possible accuracy in measurement and protocol. We thus have a firm basis to approach the calibration of the actual workspace now. We are also exploring auto-calibration of the sensor position as the problem of minimization of error in actual and estimated positions. The objective function for this unconstrained optimization problem is of the following form, where (Xa,Ya),(Xe,Ye) correspond to the actual and estimated target positions respectively:

Min (Xa – Xe)2 + (Ya – Ye)2

Page 18: SOUND TRACKING PAN-TILT MACHINE Progress Report for ECSE …cats-fs.rpi.edu/~wenj/ECSE4962S04/progress/progress... · 2004-03-25 · The system will be able to use a microphone sensor

l Page

15

The mean runtime (over several runs) for triangulation using two equations was found to be 0.02s on a 2.7 G Hz Pentium 4 machine. However on a Pentium 3 running ar 498 M Hz with 128 MB RAM this figure rose to 0.18s.

D) Initial Control

Our initial control results are based on our group’s decision to use a PID controller to control our system. To do this we are approximating each axis as a single input single output system. After finding the closed loop system we can find theta and error transfer functions. Our design objective is to create a stable system with small overshoot and small settling time. We want the effect of noises on the system to be zero, but since this isn’t an ideal system we want the noises to be as small as possible. First, for stability we know that the closed loop poles all have to be in the left half plane. Since we are just in beginning stages of implementing control we have only few results to discuss. .

The plant is a simple two pole system. Using the closed loop system we need to design the controller to make the response have small overshoot and small settling time in response to a step input. Using this information we are using MATLAB, and its rltool to design a controller based on our plant. Figure 18 shows the initial Bode plot of our open loop plant. The figure shows that it will need compensation because the open loop behavior does not match our specifications. So, now we have a linear and non-linear model to base our control design from. Next, we need to design a controller to meet our control specifications in Table 2.

Figure 18 – Bode Plot of Plant with Coulomb Friction Cancelled

Page 19: SOUND TRACKING PAN-TILT MACHINE Progress Report for ECSE …cats-fs.rpi.edu/~wenj/ECSE4962S04/progress/progress... · 2004-03-25 · The system will be able to use a microphone sensor

l Page

16

3 Summary of Progress

The total project was previously broken down into smaller subtasks that each group member would contribute to individually to more easily complete the project. Below are some brief summaries regarding those individual tasks from the team member who was chosen to lead that section.

Working System Model

The Simulink model has been completely developed. Several major pieces of information were needed for this. The first was motor information found from the parts specifications in Appendix C. The second was proper inertia values found by using the CAD parts in Solidworks to get the scalar inertia values for pan and tilt directions. More were needed and found in the next section. (Parameter Identification and Model Verification)

Parameter Identification and Model Verification

Lastly for our model we needed to identify friction. This was accomplished through repeated experiments on the system. When all the proper information for the model was identified, we tested our model with two different types of input shapes. One was the step and the other was the ramp. The step will probably be more useful because it captures all relevant dynamics to the system quite well. Based on the simulated vs. actual response plots discussed earlier we believe our model will work quite well for allowing us to work on controlling the actual system.

Purchasing of Parts

There was only a need for few purchases for the scope of this project to date. One was the choice of microphone for the system. We have purchased Panasonic WM61-A/B microphone cartridge (See Appendix A). From the specifications it meets our needs for this project well. Table 5 shows the specifications for the microphones for the system.

Part Range Sensitivity Price Panasonic WM61-A 20 Hz – 5 kHz 35 dB $1.63 per unit Panasonic WM61-B 20 Hz – 5 kHz 35 dB $1.85 per unit

Table 5 –Microphone Specifications

Other purchases included material for the test bed and mounting system for the project. MDL

board was purchased for the 5’ by 5’ test bed area and assorted wooden boards were purchased for mounting.

Page 20: SOUND TRACKING PAN-TILT MACHINE Progress Report for ECSE …cats-fs.rpi.edu/~wenj/ECSE4962S04/progress/progress... · 2004-03-25 · The system will be able to use a microphone sensor

l Page

17

Microphone Network

Our schedule indicates that the week of 3/28 – 4/3 will be the beginning of sensor network construction. However, an unexpected problem occurred when the microphone came without leads attached so we have soldered wires to the backs of the microphones to make network construction easier when that begins. The exact positions and number of sensors will be decided by testing and tuning of different combinations of sensors. We would ideally like to choose the minimum number of sensors that still adequately covers our test bed area and lets us accurately identify target position.

Pan-Tilt System and Test bed

Construction on our test bed has begun. We have bought enough ¾” MDF and 2” by 3” wooden boards to create a raised 6’ by 6’ platform on which we will put our 5’ by 5’ test bed. There will be a supporting structure that will hold our pan and tilt mechanism in a downward pointing manner. The raised portion of the test bed is to hide the wires underneath for the microphones. The initial plans for our test bed are in Appendix D.

Soldering the microphones to the wires has been completed. We will begin testing them as

soon as possible. The microphones will also be arranged according to the plans in Appendix D. We will be connecting the microphones to a parallel port connection to the A/D port that Ben Potsaid Course TA has offered to help us construct. Construction will be finished when testing of the microphones and their range has been completed.

Sampling Microphone Signals

A challenge will be to determine the sampling rate for the microphone array output. A sampling rate of at least twice the upper frequency of the sound being detected is needed. A window size of 10 ms is anticipated with sampling at 10 kHz. It may be permissible, however, to increase the window size because initial tests indicate that computation time for TDOA may take up to about 20 ms. A larger window size will give us more information to make an accurate TDOA estimate, but 10 ms is, in practice, enough to get a good TDOA. The sampling rate may also have to decrease depending on overflow of the sampling interrupts. Further, the relationship between coherence of the source and TDOA estimates will affect sampling rate.

Sound Localization

Based on our work done previously (Murphy et al [4]), we developed a MATLAB routine that estimates the TDOA between two signals. It uses the MATLAB ‘xcorr’ function that produces the cross-correlation sequence of length 2N-1 given two signals of length N each. The basic assumption for the cross correlation of two signals to be a relevant measure of the TDOA estimate is that the signals be jointly stationary. As we only collect samples of a sound source at multiple locations we can assume that the signals are jointly stationary. Further, as the signals are collected using synchronized sampling, the maximum of the correlation occurs at a signal time index that corresponds to the TDOA. The source code for TDOA is listed in Appendix B. It has been tested using a sample audio stream with delay simulated by shifting the original signal.

Page 21: SOUND TRACKING PAN-TILT MACHINE Progress Report for ECSE …cats-fs.rpi.edu/~wenj/ECSE4962S04/progress/progress... · 2004-03-25 · The system will be able to use a microphone sensor

l Page

18

Transformations

The control commands are obtained by transformation of the target co-ordinates to pan and tilt angles. The pan angles are measured counter clockwise positive to the axis passing through the center of the workspace and parallel to the sensor arrays. The tilt angles are measured counter clockwise positive with respect to the axis perpendicular to the plane of the workspace. The MATLAB routines to compute these transformations are listed in Appendix B; they are based on trigonometric transformations for pan (Tp) and tilt (Tt) angles given by:

Initial Control

. The beginning of control design has begun for the project. We have determined that our best course of action for controlling our system would be to cancel coulomb and static friction using our identified values. We have implemented this cancellation in Simulink by using a negative feedback loop back through the plant. We have begun inspection of our plant through preliminary root locus and bode diagrams and hope to have most of the control design done in about a week.

Simulation Testing, Integrated Testing, and Demonstrations

The last task was to test and demonstrate on the system at various points throughout the design process. The first point in this has occurred already and was testing the plant in simple simulated situations. This means not connecting the controller to the actual microphone network but merely fabricating voltage signals and seeing what the simulated vs. actual response of our plant. This let us know that our model will work well for our purposes. Another stage will be after the controller has been implemented. That will be when we will simulate target position and see if the controller can have the laser point at the specified point. The next stage in testing will be integrating the control system to the sensor system. When the integrated system works properly there must be demonstrations to examine our three investigated types of motion.

Cost We have compared our actual costs from the estimated one from our project proposal. Our estimated new cost was $83.50. We were subsequently informed that we would be allowed a $100 budget for the project. We are pleased to announce that as of now we are well under our estimated cost. We have purchased the microphones and materials for the test bed. Below is a list of the parts and cost to date.

+−

−=Θ −

22

1

)5.2(

5.2sin

xy

yp

+−=Θ −

5)5.2(

tan22

1 xyt

Page 22: SOUND TRACKING PAN-TILT MACHINE Progress Report for ECSE …cats-fs.rpi.edu/~wenj/ECSE4962S04/progress/progress... · 2004-03-25 · The system will be able to use a microphone sensor

l Page

19

Parts: Price

MDF Board (x2) $37.92 2”x 3” Wood (x3) $ 3.99 2”x 4” Wood (x3) $ 7.32 Wood Screws $ 3.65 Microphone Catridges (x10) $16.21 Subtotal (TO DATE) $69.09 Estimated cost from Proposal $83.50 Schedule We have compared our planned schedule to that of our project proposal. Below is the schedule from that proposal. The tasks highlighted in bold are those that have been completed. The tasks highlighted in italics are those that have been started but not yet completed. Those not highlighted have not yet been started. As you can see we are about ½ a weeks work behind schedule. We have been rapidly been catching up on our schedule however so we have elected not to change it. By the end of this week in fact we hope to be caught up completely by finishing construction and PID control design. Week Task(s) Persons 6 (2/15 – 2/21) Final Design and Modeling Hombal 7 (2/22 – 2/28) Order Parts Gates Verification of Model Daigle/Hombal 8 (2/29 – 3/6) Pan/Tilt System Construction Gates MATLAB algorithms for TDOA Hombal / Daigle 9(3/7 – 3/13) SPRINK BREAK 10 (3/14 – 3/20) Work on Progress Report/Presentation Team 11 (3/21 – 3/27) Control System (PID) Construction Murphy / Gates 12 (3/28 – 4/3) Sensor Network Construction Murphy / Gates 13 (4/4 – 4/10) System Integration Team (Control System and Sensors) 14 (4/11 – 4/17) Final Tuning and Optimization Team Final System Demonstration Team 15 (4/18 – 4/24) Final System Presentation Team 16 (4/25 – 4/28) Work on Final Report Team

Page 23: SOUND TRACKING PAN-TILT MACHINE Progress Report for ECSE …cats-fs.rpi.edu/~wenj/ECSE4962S04/progress/progress... · 2004-03-25 · The system will be able to use a microphone sensor

l Page

20

4 Bibliography

[1] P. Aarabi, "The Fusion of Distributed Microphone Arrays for Sound Localization," EURASIP Journal of Applied Signal Processing, Vol. 2003, No. 4, pp. 338-347, March 2003.

[2] Muhammad Aatique, Evaluation Of TDOA Techniques For Position Location In CDMA Systems, Master of Science Thesis, Virginia Polytechnic Institute and State University, September 1997.

[3] Robert J. Schilling, Fundamentals of Robotics: Analysis and Control, New Jersey: Prentice-Hall, 1990, pp. 202-203.

[4] Kevin Murphy et al., SOUND TRACKING PAN-TILT MACHINE, ECSE Control Systems Design, Rensselaer Polytechnic Institute, February 2004.

Page 24: SOUND TRACKING PAN-TILT MACHINE Progress Report for ECSE …cats-fs.rpi.edu/~wenj/ECSE4962S04/progress/progress... · 2004-03-25 · The system will be able to use a microphone sensor

l Page

21

5 Appendix A – Microphone Specifications

Page 25: SOUND TRACKING PAN-TILT MACHINE Progress Report for ECSE …cats-fs.rpi.edu/~wenj/ECSE4962S04/progress/progress... · 2004-03-25 · The system will be able to use a microphone sensor

l Page

22

6 Appendix B – MATLAB Code

MATLAB® routine for Time Delay of Arrival(TDOA)

function [tau] = tdoa(x,y) % x and y are signals of the same length % tau is time difference of arrival from signal x to y midpoint = length(x); c = xcorr(x,y); [a,b]=max(c); tau = midpoint-b; % tau is time difference between x and y, % so if x leads y, tau>0, else tau<0 end

MATLAB® Routine for Source Triangulation function Xt = triangulate(SensorSelection,Xs,Ys,Dij,Xg) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%% Solving the Hyperbolic Equations %%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % SensorSelection : Mx2 matrix of sensor pairs M = no of equations max(M)=N-1. % Xs Nx1 matrix of X co-ordinates of the N Sensors % Ys Nx1 matrix of Y co-ordinates of the N Sensors % Dij NxN matrix of TDOA between the N sensors with Dii =0; % Xg [X,Y] initial guess for the target position. % returns: Xt=[x,y] estimated target position. P1=Xs(SensorSelection); P2=Ys(SensorSelection); [m,n]=size(SensorSelection); for i = 1:m P3(i)=Dij(SensorSelection(i,1),SensorSelection(i,2)); end options=optimset('Display','off'); % Option to display output Xt=fsolve(@hypeqns,[Xg], options,P1,P2,P3); MATLAB® Routine for Generation of Isochrones Equations function F = hypeqns(x,P1,P2,P3) % This function simultaneously solves 'n' number % of hyperbolic equations to triangulate a target % position. % inputs % x = nx1 matrix of initial guess [xt,yt]' % P3 = nx1 matrix of tdoas. between sensors i and j % P1 = nx2 matrix of x positions of sensors i and j % P2 = nx2 matrix of y positions of sensors i and j % so if P3 contains [d12;d13] % prepare P1 to be like [Sx1, Sx2; Sx1, Sx3];

Page 26: SOUND TRACKING PAN-TILT MACHINE Progress Report for ECSE …cats-fs.rpi.edu/~wenj/ECSE4962S04/progress/progress... · 2004-03-25 · The system will be able to use a microphone sensor

l Page

23

% prepare P2 to be like [Sy1, Sy2; Sy1, Sy3]; % where Sxi = X co-ordinate of sensor i % and Syi = Y co-ordinate of sensor i s=''; for i = 1:length(P3); s =sprintf('%ssqrt((x(1)-P1(%d,1))^2 + (x(2)-P2(%d,1))^2) - sqrt((x(1)-P1(%d,2))^2 + (x(2)-P2(%d,2))^2)-P3(%d);',s,i,i,i,i,i); end s1=sprintf('[%s];',s); F=eval(s1);

MATLAB® Routine for Generation of Transformations function [pan,tilt]=xy2pantilt(x,y) % x,y should be in feet % pan,tilt will be in radians r = sqrt((y-2.5)^2+x^2); pan = asin((y-2.5)/r); tilt = atan(r/5); fprintf('r is %d',r);

Page 27: SOUND TRACKING PAN-TILT MACHINE Progress Report for ECSE …cats-fs.rpi.edu/~wenj/ECSE4962S04/progress/progress... · 2004-03-25 · The system will be able to use a microphone sensor

l Page

24

7 Appendix C – Motor, Gear, and Pulley Specifications

Page 28: SOUND TRACKING PAN-TILT MACHINE Progress Report for ECSE …cats-fs.rpi.edu/~wenj/ECSE4962S04/progress/progress... · 2004-03-25 · The system will be able to use a microphone sensor

l Page

25

8 Appendix D – Initial Construction Plans

Page 29: SOUND TRACKING PAN-TILT MACHINE Progress Report for ECSE …cats-fs.rpi.edu/~wenj/ECSE4962S04/progress/progress... · 2004-03-25 · The system will be able to use a microphone sensor

l Page

26

9 Team Member Contribution

Task/Chapter Primary Contributor Executive Summary Kevin Murphy Introduction Kevin Murphy

System Modeling Matthew Daigle Model Verification Matthew Daigle System Construction Matthew Gates Time Delay of Arrival Vadiraj Hombal Source Triangulation Vadiraj Hombal Initial Control Matthew Gates Summary of Progress Kevin Murphy

____________________________ Kevin Murphy ____________________________

Matthew Gates ____________________________ Vadi Hombal ____________________________

Matthew Daigle