collocated proportional-integral-derivative (pid) control ... · collocated...

46
ABabcdfghiejkl Collocated proportional-integral-derivative (PID) control of acoustic musical instruments Edgar Berdahl and Julius O. Smith III Department of Electrical Engineering Center for Computer Research in Music and Acoustics (CCRMA) Stanford University Stanford, CA, 94305 Education in Acoustics: Tools for Teaching Acoustics Thursday Morning at 10:20AM, June 7th, 2007 Special thanks to the Wallenberg Global Learning Network for supporting the REALSIMPLE project

Upload: others

Post on 03-Dec-2019

10 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Collocated proportional-integral-derivative (PID) control ... · Collocated proportional-integral-derivative (PID) control of acoustic musical instruments Edgar Berdahl and Julius

ABabcdfghiejkl

Collocated proportional-integral-derivative(PID) control of acoustic musical instruments

Edgar Berdahl and Julius O. Smith III

Department of Electrical EngineeringCenter for Computer Research in Music and Acoustics (CCRMA)

Stanford UniversityStanford, CA, 94305

Education in Acoustics: Tools for Teaching AcousticsThursday Morning at 10:20AM, June 7th, 2007

—Special thanks to the Wallenberg Global LearningNetwork for supporting the REALSIMPLE project

Page 2: Collocated proportional-integral-derivative (PID) control ... · Collocated proportional-integral-derivative (PID) control of acoustic musical instruments Edgar Berdahl and Julius

ABabcdfghiejkl

Outline

Overview

Theory

Laboratory Exercise In Pure Data

Page 3: Collocated proportional-integral-derivative (PID) control ... · Collocated proportional-integral-derivative (PID) control of acoustic musical instruments Edgar Berdahl and Julius

ABabcdfghiejkl

The RealSimPLE Project

◮ RealSimPLE is a web-based teacher’s resource for studentlaboratory sessions in musical acoustics.

Page 4: Collocated proportional-integral-derivative (PID) control ... · Collocated proportional-integral-derivative (PID) control of acoustic musical instruments Edgar Berdahl and Julius

ABabcdfghiejkl

The RealSimPLE Project

◮ RealSimPLE is a web-based teacher’s resource for studentlaboratory sessions in musical acoustics.

◮ Music is a good way to interest young people in math,science, and engineering.

Page 5: Collocated proportional-integral-derivative (PID) control ... · Collocated proportional-integral-derivative (PID) control of acoustic musical instruments Edgar Berdahl and Julius

ABabcdfghiejkl

The RealSimPLE Project

◮ RealSimPLE is a web-based teacher’s resource for studentlaboratory sessions in musical acoustics.

◮ Music is a good way to interest young people in math,science, and engineering.

◮ Physical experiments and pedagogical computer-basedsimulations of the same systems run in parallel andinterconnected.

Page 6: Collocated proportional-integral-derivative (PID) control ... · Collocated proportional-integral-derivative (PID) control of acoustic musical instruments Edgar Berdahl and Julius

ABabcdfghiejkl

The RealSimPLE Project

◮ RealSimPLE is a web-based teacher’s resource for studentlaboratory sessions in musical acoustics.

◮ Music is a good way to interest young people in math,science, and engineering.

◮ Physical experiments and pedagogical computer-basedsimulations of the same systems run in parallel andinterconnected.

◮ The traditional lab bench is enhanced rather than replaced.

Page 7: Collocated proportional-integral-derivative (PID) control ... · Collocated proportional-integral-derivative (PID) control of acoustic musical instruments Edgar Berdahl and Julius

ABabcdfghiejkl

The RealSimPLE Project

◮ RealSimPLE is a web-based teacher’s resource for studentlaboratory sessions in musical acoustics.

◮ Music is a good way to interest young people in math,science, and engineering.

◮ Physical experiments and pedagogical computer-basedsimulations of the same systems run in parallel andinterconnected.

◮ The traditional lab bench is enhanced rather than replaced.◮ Only standard computers and some inexpensive,

easy-to-build hardware are required.

Page 8: Collocated proportional-integral-derivative (PID) control ... · Collocated proportional-integral-derivative (PID) control of acoustic musical instruments Edgar Berdahl and Julius

ABabcdfghiejkl

The RealSimPLE Project

◮ RealSimPLE is a web-based teacher’s resource for studentlaboratory sessions in musical acoustics.

◮ Music is a good way to interest young people in math,science, and engineering.

◮ Physical experiments and pedagogical computer-basedsimulations of the same systems run in parallel andinterconnected.

◮ The traditional lab bench is enhanced rather than replaced.◮ Only standard computers and some inexpensive,

easy-to-build hardware are required.◮ The RealSimPLE Project is a collaboration between

Stanford University and KTH in Sweden.

Page 9: Collocated proportional-integral-derivative (PID) control ... · Collocated proportional-integral-derivative (PID) control of acoustic musical instruments Edgar Berdahl and Julius

RealSimPLE Laboratory Assignment Dependencies

Transfer Function

PsychoacousticsLab

Harmonic Contentof a Plucked String

ExperimentsMonochord

Monochord ActivityWeighted

ControlPID

Plucked String DigitalWaveguide Model

Traveling Waves InA Vibrating String

Auditory FilterBank Lab

Illusions LabMusical

Flute LabVirtual

Virtual AcousticTube Lab

MonochordAssembly

SoundcardSetup

START

Introduction to STKand Reverberation

Time−VaryingDelay Effects

Guitar ModelElectric

and Piano ModelsAcoustic Guitar

Measurement Toolbox

Page 10: Collocated proportional-integral-derivative (PID) control ... · Collocated proportional-integral-derivative (PID) control of acoustic musical instruments Edgar Berdahl and Julius

ABabcdfghiejkl

Summary Of PID Control Lab Objectives

◮ Explain the basic idea behind feedback control.

Page 11: Collocated proportional-integral-derivative (PID) control ... · Collocated proportional-integral-derivative (PID) control of acoustic musical instruments Edgar Berdahl and Julius

ABabcdfghiejkl

Summary Of PID Control Lab Objectives

◮ Explain the basic idea behind feedback control.◮ Describe how this discipline may be applied to a vibrating

string.

Page 12: Collocated proportional-integral-derivative (PID) control ... · Collocated proportional-integral-derivative (PID) control of acoustic musical instruments Edgar Berdahl and Julius

ABabcdfghiejkl

Summary Of PID Control Lab Objectives

◮ Explain the basic idea behind feedback control.◮ Describe how this discipline may be applied to a vibrating

string.◮ Describe how modifying the control parameters affects the

harmonic content.

Page 13: Collocated proportional-integral-derivative (PID) control ... · Collocated proportional-integral-derivative (PID) control of acoustic musical instruments Edgar Berdahl and Julius

ABabcdfghiejkl

Summary Of PID Control Lab Objectives

◮ Explain the basic idea behind feedback control.◮ Describe how this discipline may be applied to a vibrating

string.◮ Describe how modifying the control parameters affects the

harmonic content.◮ Explain what instability is and how it may arise.

Page 14: Collocated proportional-integral-derivative (PID) control ... · Collocated proportional-integral-derivative (PID) control of acoustic musical instruments Edgar Berdahl and Julius

ABabcdfghiejkl

Summary Of PID Control Lab Objectives

◮ Explain the basic idea behind feedback control.◮ Describe how this discipline may be applied to a vibrating

string.◮ Describe how modifying the control parameters affects the

harmonic content.◮ Explain what instability is and how it may arise.◮ Experiment with a virtual controlled string using the Pure

Data software.

Page 15: Collocated proportional-integral-derivative (PID) control ... · Collocated proportional-integral-derivative (PID) control of acoustic musical instruments Edgar Berdahl and Julius

ABabcdfghiejkl

Summary Of PID Control Lab Objectives

◮ Explain the basic idea behind feedback control.◮ Describe how this discipline may be applied to a vibrating

string.◮ Describe how modifying the control parameters affects the

harmonic content.◮ Explain what instability is and how it may arise.◮ Experiment with a virtual controlled string using the Pure

Data software.◮ Gain experience using Pure Data.

Page 16: Collocated proportional-integral-derivative (PID) control ... · Collocated proportional-integral-derivative (PID) control of acoustic musical instruments Edgar Berdahl and Julius

ABabcdfghiejkl

Feedback control

Feedback control is the discipline in which system dynamics arestudied and altered by creating feedback loops.

System+r xu

Controller

Figure: Typical block diagram for a control application

Page 17: Collocated proportional-integral-derivative (PID) control ... · Collocated proportional-integral-derivative (PID) control of acoustic musical instruments Edgar Berdahl and Julius

ABabcdfghiejkl

Feedback control

Feedback control is the discipline in which system dynamics arestudied and altered by creating feedback loops.

System+r xu

Controller

Figure: Typical block diagram for a control application

◮ Application to cruise control

Page 18: Collocated proportional-integral-derivative (PID) control ... · Collocated proportional-integral-derivative (PID) control of acoustic musical instruments Edgar Berdahl and Julius

ABabcdfghiejkl

Feedback control

Feedback control is the discipline in which system dynamics arestudied and altered by creating feedback loops.

System+r xu

Controller

Figure: Typical block diagram for a control application

◮ Application to cruise control◮ Application to a vibrating string

Page 19: Collocated proportional-integral-derivative (PID) control ... · Collocated proportional-integral-derivative (PID) control of acoustic musical instruments Edgar Berdahl and Julius

ABabcdfghiejkl

Outline

Overview

Theory

Laboratory Exercise In Pure Data

Page 20: Collocated proportional-integral-derivative (PID) control ... · Collocated proportional-integral-derivative (PID) control of acoustic musical instruments Edgar Berdahl and Julius

ABabcdfghiejkl

System Model

◮ If we collocate the sensor and actuator, then we can use thefollowing model of the lowest resonance:

Figure: Lightly-damped harmonic oscillator (R is small)

Page 21: Collocated proportional-integral-derivative (PID) control ... · Collocated proportional-integral-derivative (PID) control of acoustic musical instruments Edgar Berdahl and Julius

ABabcdfghiejkl

System Model

◮ If we collocate the sensor and actuator, then we can use thefollowing model of the lowest resonance:

Figure: Lightly-damped harmonic oscillator (R is small)

◮ Equivalent mass m, spring with constant K , and dampingparameter R

Page 22: Collocated proportional-integral-derivative (PID) control ... · Collocated proportional-integral-derivative (PID) control of acoustic musical instruments Edgar Berdahl and Julius

ABabcdfghiejkl

System Model

◮ If we collocate the sensor and actuator, then we can use thefollowing model of the lowest resonance:

Figure: Lightly-damped harmonic oscillator (R is small)

◮ Equivalent mass m, spring with constant K , and dampingparameter R

◮ mx + Rx + Kx = 0

Page 23: Collocated proportional-integral-derivative (PID) control ... · Collocated proportional-integral-derivative (PID) control of acoustic musical instruments Edgar Berdahl and Julius

ABabcdfghiejkl

System Model

◮ If we collocate the sensor and actuator, then we can use thefollowing model of the lowest resonance:

Figure: Lightly-damped harmonic oscillator (R is small)

◮ Equivalent mass m, spring with constant K , and dampingparameter R

◮ mx + Rx + Kx = 0

◮ Pitch f0 ≈ 12π

Km , and the decay time constant τ = 2m

R

Page 24: Collocated proportional-integral-derivative (PID) control ... · Collocated proportional-integral-derivative (PID) control of acoustic musical instruments Edgar Berdahl and Julius

ABabcdfghiejkl

Proportional-Derivative (PD) Control

◮ If we implement the feedback law F = PD x + PPx , then wearrive at the following differential equationmx + Rx + Kx = PDx + PPx

Page 25: Collocated proportional-integral-derivative (PID) control ... · Collocated proportional-integral-derivative (PID) control of acoustic musical instruments Edgar Berdahl and Julius

ABabcdfghiejkl

Proportional-Derivative (PD) Control

◮ If we implement the feedback law F = PD x + PPx , then wearrive at the following differential equationmx + Rx + Kx = PDx + PPx

◮ The controlled dynamics aremx + (R − PD)x + (K − PP)x = 0

Page 26: Collocated proportional-integral-derivative (PID) control ... · Collocated proportional-integral-derivative (PID) control of acoustic musical instruments Edgar Berdahl and Julius

ABabcdfghiejkl

Proportional-Derivative (PD) Control

◮ If we implement the feedback law F = PD x + PPx , then wearrive at the following differential equationmx + Rx + Kx = PDx + PPx

◮ The controlled dynamics aremx + (R − PD)x + (K − PP)x = 0

◮ f0 ≈ 12π

K−PPm and decay time τ = 2m

R−PD

Page 27: Collocated proportional-integral-derivative (PID) control ... · Collocated proportional-integral-derivative (PID) control of acoustic musical instruments Edgar Berdahl and Julius

ABabcdfghiejkl

Integral Control

◮ Similarly the feedback law F = PI∫

x dt

Page 28: Collocated proportional-integral-derivative (PID) control ... · Collocated proportional-integral-derivative (PID) control of acoustic musical instruments Edgar Berdahl and Julius

ABabcdfghiejkl

Integral Control

◮ Similarly the feedback law F = PI∫

x dt◮ The controlled dynamics are third order

mx + Rx + Kx = PI∫

x dt

Page 29: Collocated proportional-integral-derivative (PID) control ... · Collocated proportional-integral-derivative (PID) control of acoustic musical instruments Edgar Berdahl and Julius

ABabcdfghiejkl

Integral Control

◮ Similarly the feedback law F = PI∫

x dt◮ The controlled dynamics are third order

mx + Rx + Kx = PI∫

x dt◮ The analysis is more complicated, but for small |PI |,

τ ≈ 2m

R+PI

4π2f 2

0

Page 30: Collocated proportional-integral-derivative (PID) control ... · Collocated proportional-integral-derivative (PID) control of acoustic musical instruments Edgar Berdahl and Julius

ABabcdfghiejkl

Integral Control

◮ Similarly the feedback law F = PI∫

x dt◮ The controlled dynamics are third order

mx + Rx + Kx = PI∫

x dt◮ The analysis is more complicated, but for small |PI |,

τ ≈ 2m

R+PI

4π2f 2

0

◮ PID Control:◮ Can control the damping with PD and PI

Page 31: Collocated proportional-integral-derivative (PID) control ... · Collocated proportional-integral-derivative (PID) control of acoustic musical instruments Edgar Berdahl and Julius

ABabcdfghiejkl

Integral Control

◮ Similarly the feedback law F = PI∫

x dt◮ The controlled dynamics are third order

mx + Rx + Kx = PI∫

x dt◮ The analysis is more complicated, but for small |PI |,

τ ≈ 2m

R+PI

4π2f 2

0

◮ PID Control:◮ Can control the damping with PD and PI◮ Can control the pitch (some) with PP

Page 32: Collocated proportional-integral-derivative (PID) control ... · Collocated proportional-integral-derivative (PID) control of acoustic musical instruments Edgar Berdahl and Julius

ABabcdfghiejkl

Outline

Overview

Theory

Laboratory Exercise In Pure Data

Page 33: Collocated proportional-integral-derivative (PID) control ... · Collocated proportional-integral-derivative (PID) control of acoustic musical instruments Edgar Berdahl and Julius

ABabcdfghiejkl

Pure Data

Page 34: Collocated proportional-integral-derivative (PID) control ... · Collocated proportional-integral-derivative (PID) control of acoustic musical instruments Edgar Berdahl and Julius

ABabcdfghiejkl

Instability

◮ Students can choose the control parameters PP , PI , and PD

over a reasonable range.

Page 35: Collocated proportional-integral-derivative (PID) control ... · Collocated proportional-integral-derivative (PID) control of acoustic musical instruments Edgar Berdahl and Julius

ABabcdfghiejkl

Instability

◮ Students can choose the control parameters PP , PI , and PD

over a reasonable range.◮ Some combinations of the control parameters result in

instability.

Page 36: Collocated proportional-integral-derivative (PID) control ... · Collocated proportional-integral-derivative (PID) control of acoustic musical instruments Edgar Berdahl and Julius

ABabcdfghiejkl

Instability

◮ Students can choose the control parameters PP , PI , and PD

over a reasonable range.◮ Some combinations of the control parameters result in

instability.◮ The patch disables sound if the level becomes too large.

Page 37: Collocated proportional-integral-derivative (PID) control ... · Collocated proportional-integral-derivative (PID) control of acoustic musical instruments Edgar Berdahl and Julius

ABabcdfghiejkl

Questions For Students

After students have been given the relevant backgroundinformation, they are prodded through a series of questions toconclude the following

Page 38: Collocated proportional-integral-derivative (PID) control ... · Collocated proportional-integral-derivative (PID) control of acoustic musical instruments Edgar Berdahl and Julius

ABabcdfghiejkl

Questions For Students

After students have been given the relevant backgroundinformation, they are prodded through a series of questions toconclude the following

1. Sensors placed at nodes of particular harmonics will notmeasure any energy at these frequencies.

Page 39: Collocated proportional-integral-derivative (PID) control ... · Collocated proportional-integral-derivative (PID) control of acoustic musical instruments Edgar Berdahl and Julius

ABabcdfghiejkl

Questions For Students

After students have been given the relevant backgroundinformation, they are prodded through a series of questions toconclude the following

1. Sensors placed at nodes of particular harmonics will notmeasure any energy at these frequencies.

2. In comparison with PD, PI causes lower harmonics to bedamped more quickly than higher harmonics.

Page 40: Collocated proportional-integral-derivative (PID) control ... · Collocated proportional-integral-derivative (PID) control of acoustic musical instruments Edgar Berdahl and Julius

ABabcdfghiejkl

Questions For Students

After students have been given the relevant backgroundinformation, they are prodded through a series of questions toconclude the following

1. Sensors placed at nodes of particular harmonics will notmeasure any energy at these frequencies.

2. In comparison with PD, PI causes lower harmonics to bedamped more quickly than higher harmonics.

3. It is not possible to change the pitch as far as the modelpredicts before instability sets in.

Page 41: Collocated proportional-integral-derivative (PID) control ... · Collocated proportional-integral-derivative (PID) control of acoustic musical instruments Edgar Berdahl and Julius

ABabcdfghiejkl

Questions For Students

After students have been given the relevant backgroundinformation, they are prodded through a series of questions toconclude the following

1. Sensors placed at nodes of particular harmonics will notmeasure any energy at these frequencies.

2. In comparison with PD, PI causes lower harmonics to bedamped more quickly than higher harmonics.

3. It is not possible to change the pitch as far as the modelpredicts before instability sets in.

4. This is a weakness of the simplified model.

Page 42: Collocated proportional-integral-derivative (PID) control ... · Collocated proportional-integral-derivative (PID) control of acoustic musical instruments Edgar Berdahl and Julius

ABabcdfghiejkl

Challenge Problem

◮ We use Pure Data because it is easy to see how thepatches work.

Page 43: Collocated proportional-integral-derivative (PID) control ... · Collocated proportional-integral-derivative (PID) control of acoustic musical instruments Edgar Berdahl and Julius

ABabcdfghiejkl

Challenge Problem

◮ We use Pure Data because it is easy to see how thepatches work.

◮ We challenge advanced students to modify the patch toimplement a time-varying amplitude effect.

Page 44: Collocated proportional-integral-derivative (PID) control ... · Collocated proportional-integral-derivative (PID) control of acoustic musical instruments Edgar Berdahl and Julius

ABabcdfghiejkl

Challenge Problem

◮ We use Pure Data because it is easy to see how thepatches work.

◮ We challenge advanced students to modify the patch toimplement a time-varying amplitude effect.

◮ They are given the following hint:

Page 45: Collocated proportional-integral-derivative (PID) control ... · Collocated proportional-integral-derivative (PID) control of acoustic musical instruments Edgar Berdahl and Julius

ABabcdfghiejkl

Bibliography

E. Berdahl and J. O. Smith III,PID Control of a Plucked String, Online REALSIMPLELaboratory,http://ccrma.stanford.edu/realsimple/pidcontrol,2007.

C. Besnainou,Transforming the voice of musical instruments by activecontrol of the sound radiation,International Symposium on Active Control of Sound andVibration, Fort Lauderdale, FL, 1999.

E. Berdahl, J. O. Smith III, and A. Freed,Active damping of a vibrating string,International Symposium on Active Control of Sound andVibration, Adelaide, Australia, 2006.

Page 46: Collocated proportional-integral-derivative (PID) control ... · Collocated proportional-integral-derivative (PID) control of acoustic musical instruments Edgar Berdahl and Julius

ABabcdfghiejkl

Thanks

Questions?