Introducing Feedback Control to Middle and High School STEM Students, Part 2: Control System Math⁎

Introducing Feedback Control to Middle and High School STEM Students, Part 2: Control System Math⁎

12th IFAC Symposium on Advances in Control Education 12th IFAC Symposium on Advances in Control Education July Philadelphia, PA, USAin 12th IFAC Sympo...

1MB Sizes 0 Downloads 52 Views

12th IFAC Symposium on Advances in Control Education 12th IFAC Symposium on Advances in Control Education July Philadelphia, PA, USAin 12th IFAC Symposium on Control 12th 7-9, IFAC2019. Symposium on Advances Advances Control Education Education July 7-9, 2019. Philadelphia, PA, USAinAvailable online at www.sciencedirect.com July 7-9, 7-9, 2019. Philadelphia, PA, USA USAin Control Education 12th IFAC2019. Symposium on Advances July Philadelphia, PA, July 7-9, 2019. Philadelphia, PA, USA

ScienceDirect

IFAC PapersOnLine 52-9 (2019) 177–183

Introducing Feedback Control to Middle Introducing Feedback Control to Middle Introducing Feedback Control to Middle Introducing Feedback Control to and High School STEM Students, Part 2: Introducing Feedback Control to Middle Middle and High School STEM Students, Part 2: and High School STEM Students, Part 2:  and High School STEM Students, Part 2:  System Math and HighControl School STEM Students, Part 2: Control System Math   Control System Math Control System Math  Control System Math ∗ Daniel Y. Abramovitch ∗

Daniel Y. Abramovitch ∗ Daniel Daniel Y. Y. Abramovitch Abramovitch ∗∗ ∗ Daniel Y. Abramovitch Stevens Creek Blvd., ∗ Mass Spec Division, Agilent Technologies, Mass Spec Division, Agilent Technologies, 5301 5301 Stevens Creek Blvd., ∗ ∗ Mass Spec Division, Agilent Technologies, 5301 Stevens Creek M/S: 3U-WT, Santa Clara, (e-mail: Division, 5301USA Stevens Creek Blvd., Blvd., M/S: 3U-WT,Agilent Santa Technologies, Clara, CA CA 95051 95051 USA (e-mail: ∗ Mass Spec Mass Spec Division, Agilent Technologies, 5301 Stevens Creek Blvd., M/S: 3U-WT, Santa Clara, CA 95051 USA (e-mail: [email protected]). M/S: 3U-WT, Santa Clara, CA 95051 USA (e-mail: [email protected]). M/S: 3U-WT, Santa Clara, CA 95051 USA (e-mail: [email protected]). [email protected]). [email protected]). Abstract: Abstract: This This paper paper presents presents some some insights insights on on introducing introducing control control concepts concepts to to middle middle and and Abstract: This paper presents some insights on introducing control concepts to middle and high school STEM students. It summarizes the author’s experience in introducing control to Abstract: This paper presents some insights on introducing control concepts to high school STEM students. It summarizes the author’s experience in introducingmiddle controland to Abstract: This paper presents some preceding insights onauthor’s introducing controlin concepts to middle and high school STEM students. It summarizes the experience introducing control to such students at multiple workshops control conferences. In Part 1 (Abramovitch high school STEM students. It summarizes the author’s experience in introducing control to such students at multiple workshops preceding control conferences. In Part 1 (Abramovitch high school STEM students. It summarizes the author’s experience in introducing control to such students at multiple workshops preceding control conferences. In Part 1 (Abramovitch (2019)), we share here the ideas behind the success of these talks. In Part 2 (this paper), we such students at multiple preceding control conferences. Part2 (this 1 (Abramovitch (2019)), we share here the workshops ideas behind the success of these talks. InInPart paper), we such students at multiple workshops preceding control conferences. In Part 1 (Abramovitch (2019)), we share here the ideas behind the success of these talks. In Part 2 (this paper), we show how to discuss control systems math to students who have not had calculus or differential (2019)), here the ideas behind these talks. 2 (this paper), we show howwetoshare discuss control systems maththe to success studentsofwho have not In hadPart calculus or differential (2019)), here the ideas behind these talks. 2 (this paper), we show how howweto toshare discuss control systems maththe to success studentsofwho who have not In hadPart calculus or differential differential equations. show discuss control systems math to students have not had calculus or equations. show how to discuss control systems math to students who have not had calculus or differential equations. equations. © 2019, IFAC (International Federation of Automatic Control) Hosting by Elsevier Ltd. All rights reserved. equations. Keywords: Keywords: Teaching, Teaching, education, education, second-order second-order systems, systems, closed closed loops, loops, computers. computers. Keywords: Keywords: Teaching, Teaching, education, education, second-order second-order systems, systems, closed closed loops, loops, computers. computers. Keywords: Teaching, education, second-order systems, closed loops, computers. 1. INTRODUCTION TO PART 2 • We cannot hope 1. INTRODUCTION TO PART 2 • We cannot hope to to teach teach them them the the math math they they need need 1. INTRODUCTION TO PART 2 • We cannot hope to teach them the math they need in the time we are with them, but we can teach 1. INTRODUCTION TO PART 2 • in Wethe cannot hope teach them they them need time we aretowith them, butthe wemath can teach them 1. INTRODUCTION TO(2019)) PART discussed 2 • We cannot hope towith teach them the math they them need in the time we are with them, but we can teach them what the math tells us and how it helps us. Part 1 of this paper (Abramovitch the in the time we are them, but we can teach what the math tells us and how it helps us. Part 1 of this paper (Abramovitch (2019)) discussed the in the time we are with them, but we can teach them what the math tells us and how it helps us. Part 11 of (Abramovitch (2019)) the need more complete public the what therespond math tells and it helpsWe us.can follow Part for ofa this paper (Abramovitch (2019))of discussed the The students wellus thishow sequence. need for a this morepaper complete public knowledge knowledge ofdiscussed the concepts concepts what therespond math tells usto and how it helpsWe us.can follow Part 1 of this paper (Abramovitch (2019)) discussed the The students well to this sequence. need for a more complete public knowledge of the concepts behind, the ubiquity of, and the methods used in feedback need for a more complete public knowledge of the concepts Theby students respond well to of thismath sequence. We canwill follow up describing thewell kind that We they be behind, the ubiquity of, and the methods used in feedback The students respond to this sequence. can follow need for a more complete public knowledge of the concepts up by describing the kind of math that they will be behind, the ubiquity of, and the methods used in feedback control. It was focused on how to make these relevant behind, the ubiquity of, and in feedback students respond well to of thismath sequence. We can follow up by describing the kind that they will be learning. They will learn differential and integral calculus control. It was focused on the howmethods to makeused these relevant The up by describing the kind of math that they will be learning. They will learn differential and integral calculus behind, the ubiquity of, and the methods used in feedback control. It was focused on how to make these relevant to middle and high school students interested in Science, control. washigh focused onstudents how to interested make these relevant up by describing the kind of math that they will be learning. They will learn differential and integral calculus that will tell them the beginning of how things move. to middleItand school in Science, learning. They will learn differential and integral calculus that will tell them the beginning of how things move. control. was focused on how to interested make these relevant to middle high school students in Technology, Engineering, and Math subjects. One to middleItand and high school students interested in Science, Science, learning. They will learn differential and integral calculus that will tell them the beginning of how things move. integrals will allow them to do transforms (Laplace, Technology, Engineering, and Math (STEM) (STEM) subjects. One The that will tell will themallow the them beginning how things move. The integrals to do of transforms (Laplace, to middle and high schooland students interested in Science, Technology, Engineering, Math (STEM) One of the challenges with such a is Technology, Engineering, Math (STEM) subjects. One that willetc.) tell will them the beginning how property things move. The integrals allow them toconvenient do of transforms (Laplace, Fourier, which have the that of the greatest greatest challengesand with such a task task subjects. is that that these these The integrals allow them do transforms (Laplace, Fourier, etc.) will which have theto convenient property that Technology, Engineering, and Math (STEM) subjects. One of the greatest challenges with such a task is that these students have almost universally not learned about difof the greatest challenges with such task is that integrals will allow them to do transforms (Laplace, Fourier, etc.) which have the convenient property that they turn differential equations into algebra. Once we get students have almost universally nota learned aboutthese dif- The Fourier, etc.) which have the convenient property that they turn differential equations into algebra. Once we get of the greatest challenges with such a task is that these students have almost universally not learned about differential equations, linear algebra, and transform theory. students equations, have almost universally about dif- Fourier, etc.) which have the convenient property that they turn differential equations into algebra. Once we get to algebra (which they know), their old friend of finding ferential linear algebra, not andlearned transform theory. they turn differential equations into algebra. Once we get students have almost universally not learned about difto algebra (which they know), their old friend of finding ferential algebra, and theory. Only the upper high students are have ferential equations, linear algebra, and transform transform theory. turn allows differential equations into algebra. Once we get to algebra (which they know), their old friend of finding the roots, them to understand the system behavior. Only the equations, upper level level linear high school school students are likely likely to to have they to algebra (which they know), their old friend of finding the roots, allows them to understand the system behavior. ferential equations, linear algebra, and transform theory. Only the upper level high school students are likely to have had physics integral or differential This Onlya upperclass levelor school arecalculus. likely to have algebra (which they their the old system friend of finding the allows to understand behavior. Now we tied something they to we had athe physics class orhigh integral or students differential calculus. This to the roots, allows them toknow), understand the system behavior. Nowroots, we have have tiedthem something they know know to something something we Only upperclass level school are likelysystems to have had physics or integral or differential calculus. This makes presenting the math that underlies control had aathe physics class orhigh integral or students differential calculus. This the roots, allows them to understand the system behavior. Now we have tied something they know to something we need to know to understand control systems. makes presenting the math that underlies control systems Now we have tied something they know to something we need to know to understand control systems. had a physics class or integral or differential calculus. This makes presenting the math that underlies control systems hard to explain. However, we do have some avenues still makestopresenting the math we thatdounderlies control systems we have tied something they know to something we need to know to understand control systems. hard explain. However, have some avenues still Now need to know to understand control systems. makes presenting the math that underlies control systems hard available to hard to to explain. explain. However, we we do do have have some some avenues avenues still still need to know to understand control systems. available to us. us. However, hard to explain. However, we do have some avenues still 2. available to us. available to us. 2. NEWTON NEWTON AND AND THE THE RIGID RIGID BODY BODY What we can count 2. NEWTON AND THE RIGID BODY available What we to canus. count on on is is that that they they have have had had some some algebra, algebra, 2. NEWTON AND THE RIGID BODY What we count on is have algebra, that have seen (an introduction 2. NEWTON AND THE RIGID BODY Whatthey we can can count on geometric is that that they theyproofs have had had some algebra, that they have seen geometric proofs (an some introduction What we can count on is that they have had some algebra, that they have seen geometric proofs (an introduction to theorem-proof methods), that they are familiar with thattheorem-proof they have seen geometric (an familiar introduction to methods), thatproofs they are with x that they have seen geometric proofs (an familiar introduction to methods), they are finding the a order polynomial with the x to theorem-proof theorem-proof methods), that they are familiar with finding the roots roots of of a second secondthat order polynomial withwith the x f to theorem-proof methods), that they are familiar with finding the roots of a second order polynomial with the quadratic equation, and they are familiar with localizing x f finding theequation, roots of and a second order polynomial with the quadratic they are familiar with localizing x m f finding the roots of a second order polynomial with the quadratic equation, and they are familiar with localizing roots of higher order polynomials. f m quadratic equation, and they are familiar with localizing roots of higher order polynomials. m f quadratic equation, and they are familiar with localizing roots of higher order polynomials. m rootshave of higher order polynomials. We found that respond m rootshave of higher polynomials. We found order that students students respond well well to to being being told told No We have found that students respond well to being told the following: We have found that students respond well to being told No friction friction the following: No We have found that students respond well to being told the following: No friction friction the• following: To is No plane friction the• following: To understand understand what what the the systems systems we we want want to to control control Fig. Fig. 1. 1. A A rigid rigid mass mass on on aa frictionless frictionless plane is the the starting starting •• are To understand what the systems we want to control doing and how our control will affect them, Fig. 1. A rigid mass on a frictionless plane is point for understanding Newton’s Law. To understand what the systems we want to control 1. A rigid mass on a frictionless plane is the the starting starting are doing and how our control will affect them, Fig. point for understanding Newton’s Law. • we To what want to control are doing how our control will affect them, 1. A rigid mass on a frictionless need model systems using science (to point for understanding understanding Newton’splane Law.is the starting are understand doing to and how the oursystems control we will affect them, for Newton’s Law. we need toand model the systems using science (to Fig. point are doing how the our systems control will affect them, we to model science for understanding Newton’s have Law. derive models) and (to the in aa Mostpoint we need need toand model the systems using science (to derive models) and math math (to put putusing the models models in(to Most students students in in this this age age group group will will have seen seen at at some some we need to model the systems using science (to derive models) and math (to put the models in a mathematically form that helps us predict what will derive models) and math (to put the models in a Most students in this age group will have seen atthis some level, Newton’s Second Law: f = ma. We can tie to mathematically form that helps us predict what will Most students in this age group will have seen at some level, Newton’s Second Law: f = ma. We can tie this to derive models) and math (to put the models in a mathematically form that helps us predict what will happen next). students in this age group will have seentie atthis some mathematically level, Newton’s Second Law: f = ma. We can to aa simple mass on a frictionless plane, as shown in Figure happen next). form that helps us predict what will Most level, Newton’s Second Law: f = ma. We can tie this to simple mass on a frictionless plane, as shown in Figure mathematically form that helps us predict what will happen next). •• It takes about 3 years of math from where the average Newton’s Second Law: f = ma. We can tie this to happen next). 3 years of math from where the average level, a1. simple mass on a frictionless plane, as shown in Figure 1. Now, we remind them that acceleration is the second It takes about a simple mass on a frictionless plane, as shown in Figure Now, we remind them that acceleration is the second happen next). •• student It years where the average in that point. (It aa bit simple mass on a frictionless plane, as shown in Figure It takes takes about about yearsis ofat math from where the be average 1. Now, we remind them that acceleration is the second of position. Some of the high school students student in the the 33room room isof atmath thatfrom point. (It will will be bit aderivative 1. Now, weofremind them thatofacceleration is thestudents second derivative position. Some the high school • more It takes about 3room yearsschool from where the average student the is that point. bit for students, a bit less for Now, we them that is thestudents second student inthe themiddle room isofat atmath that point. (It will be bit 1. derivative ofremind position. Some ofacceleration the high school students have had differentiation, but most can understand that vemore forin the middle school students, a(It bitwill lessbe foraa the the derivative of position. Some of the high school have had differentiation, but most can understand that vestudent in the room is at that point. (It will be a bit more for the middle school students, a bit less for the upper level high school students.) derivative of position. Some of the high school students more for the middle school students, a bit less for the have had differentiation, but most can understand that velocity is the change of position over time, and acceleration upper level high school students.) have had differentiation, but most can understand that velocity is the change of position over time, and acceleration more for the middle school students, a bit less for the upper level high school students.) have had differentiation, but most can understand that veupper level high school students.) locity is the change of position over time, and acceleration is the change in velocity over time. Thus we can rewrite locity is the change of position over time, and acceleration is the change in velocity over time. Thus we can rewrite upper Abramovitch level high school students.)  Daniel is a system architect in the Mass Spec locity is the change of position over time, and acceleration is the change in velocity over time. Thus we can rewrite f = ma for them as:  Daniel Y. Y. Abramovitch is a system architect in the Mass Spec is the in velocity over time. Thus we can rewrite f= machange for them as:  Division Technologies. Daniel Y. Abramovitch is  is the in velocity over time. Thus we can rewrite f= = machange for them them as: Daniel at Y.Agilent Abramovitch is a a system system architect architect in in the the Mass Mass Spec Spec Division at Agilent Technologies. f ma for as:  Division at Agilent Technologies. Daniel at Y.Agilent Abramovitch is a system architect in the Mass Spec f = ma for them as: Division Technologies.

Division at©Agilent Technologies. 2405-8963 2019, IFAC IFAC (International Federation of Automatic Control) Copyright © 2019 182 Hosting by Elsevier Ltd. All rights reserved. Copyright © under 2019 IFAC 182 Control. Peer review responsibility of International Federation of Automatic Copyright © 2019 IFAC 182 Copyright © 2019 IFAC 182 10.1016/j.ifacol.2019.08.191 Copyright © 2019 IFAC 182

2019 IFAC ACE 178 1-3, 2016. Bratislava, Slovakia June

Daniel Y. Abramovitch / IFAC PapersOnLine 52-9 (2019) 177–183

When we are done, from the transformed math we know that this system is not stable. That is, if we push the block on the frictionless plane, it will go on forever. Once we stop pushing, the velocity remains constant (middle plot), but the position keeps increasing. That being said, it is easy to control. That is, if we apply the same amount of force in the opposite direction for the same amount of time, the block stops. Finally, a lot of systems look like this (assuming we do not look too closely). Even without imagination, this shows up in most spacecraft control problems, since there is no air to generate friction and no spring force of gravity.

Double Integrator: K_n = 1 1.2 1 0.8 Force

0.6 0.4 0.2 0 −0.2

0

0.2

0.4

0.6

0.8

1 Time (s)

1.2

1.4

1.6

1.8

0

0.2

0.4

0.6

0.8

1 Time (s)

1.2

1.4

1.6

1.8

2

0

0.2

0.4

0.6

0.8

1 Time (s)

1.2

1.4

1.6

1.8

2

1.2 1

Velocity

0.8 0.6 0.4 0.2 0 −0.2

1.5

Position

1

0.5

0

−0.5

Fig. 2. Response of double integrator to force applied over finite time.

The above discussion has shown how we can lead the students along a path that is supported by a lot of knowledge they already have to the concept of a dynamic system and its stability. Not only have we discussed it qualitatively, but we have tied it into the physics of the problem (using an equation that they almost certainly know), and we have discussed some of the useful tools (transforms) that we use to understand the problem. Finally, they have seen an example of this behavior plotted out. With this, they are ready for the next step: adding feedback into this problem. 3. ADDING FEEDBACK TO DOUBLE INTEGRATOR

f

a

_1 m

v

_1 S

_1

x

Fig. 3. The block diagram of the double integrator achieved when we ignore the initial conditions and use Laplace Transforms. �t

1 f −→ v = adt + v0 −→ m 0 ⎛ ⎞ �t �t �t x = vdt + x0 = ⎝ adτ + v0 ⎠ dt + x0 . a=x ¨=

0

0

(1)

0

Here is where we need them to trust us. We tell them that there are a set of special integrals (Bracewell (1978)) which allow us to transform equations such as Equation 1 into algebra. Thus, x=

0

0

(a)dtdt ←→ X(s) =

(2) 183

m

b

Fig. 4. Adding a spring and a damper to our original mass block.

-



_1 m

a

_1

v

S

_1

x

S

b

k

Fig. 5. The block diagram of the double integrator with velocity and position feedback. One of the great pedagogical things about laying out the double integrator as we have done above is that now we can transform it to a spring-mass-damper system by adding a position feedback (k) and a velocity feedback (b). We are in a position to describe these not only in the picture of Figure 4, but in the block diagram of Figure 5. Equation 1 gets modified to be: 1 X(s) m = 2 , b k F (s) s +m s+ m Time Domain (math) Transform Domain (3) where we see these feedback terms showing up explicitly in the time domain equation and this is transformed on

m¨ x = f − bx˙ − kx ←→

1 F (s) ms2

Time Domain (math) Transform Domain

k

f

Again, they don’t have to know how to do integrals, but we have led them to the idea that these matter and that they allow us to describe the physical system of Figure 1. Equation 1 has two integrals and so this system is called a double integrator, and it shows up a lot. One can imagine an air hockey puck on an infinite table. In each case, if one taps the puck, it has a constant velocity. However, if we push it with a constant force, it accelerates as long as the force is being applied. This is displayed in Figure 2. The top plot is the applied force, the middle plot is the velocity of the block, and the bottom plot is the position. We will use these types of plots to explain the behavior of different systems under control both open loop and closed-loop.

�t �t

x

f

S

2019 IFAC ACE June 1-3, 2016. Bratislava, Slovakia

Daniel Y. Abramovitch / IFAC PapersOnLine 52-9 (2019) 177–183

Original System: K_n = 1, f_d = 8, zeta_d = 0.1 1.2 1 0.8 Force

0.6 0.4 0.2 0 −0.2

0

0.2

0.4

0.6

0.8

1 Time (s)

1.2

1.4

1.6

1.8

0

0.2

0.4

0.6

0.8

1 Time (s)

1.2

1.4

1.6

1.8

2

0

0.2

0.4

0.6

0.8

1 Time (s)

1.2

1.4

1.6

1.8

2

Velocity

50

0

−50

2 1.5

Position

1 0.5 0 −0.5 −1

Fig. 6. Response of double integrator with velocity and position feedback to force applied over finite time. K_n = 1, f_d_fsf = 8, zeta_d_fsf = 0.1

179

number under the radical is greater than 0, the roots are real, but if the quantity is less than 0, things get weird. Some of them will know that this produces complex numbers. We can use this to introduce the idea of a Bode plot with Figure 7. Many STEM students will have seen something like this when they are looking at specifications for things like headphones (or ear buds). They might not understand what they saw, but it’s straightforward enough to explain to them that the top plot would be like one they might have seen, except that they’d never want to buy ear buds if the response showed that resonance. They’d be looking for something flat. In buying ear buds, they would never see the lower plot, which is the phase – the relative angle of output to the input. Again, this is a teachable moment in that we can explain to them that worrying about this lower plot is one of the main differences between folks who work in signal processing and folks who work in feedback systems. We can come back to it later, but we can tell them that the plot relates the response and helps us understand what is going on even without a computer. We can tell them that from a plot like this, we can tell that the roots of that denominator polynomial are complex, and that if the system gets hit with something like a step in force, it will oscillate (ring) back and forth before settling down.

20

Now, we have gone, in very straightforward steps, from a double integrator system to one with feedback from the outputs of both integrators. We have shown them that using some math they don’t have (differential equations and transform theory) and some math that they do have (algebra and root finding) that they can understand or “model” the behavior of this very physical system. Equations 5 and 6 tell us about the behavior:

Mag (dB)

0 −10 −20 −30 −40 −50 −3 10

−2

−1

10

0

10

1

10 10 Frequency (Hz)

2

3

10

10

0

Phase(deg)

−50

−100

• k/m tells us how fast it rings. • b/m (in relationship to k) tells us how long it rings • Making k bigger means the spring is stiffer, which results in higher frequency ringing. • Making b bigger relative to k causes the ringing to damp out faster. • Because denominator polynomial is 2nd order, we can get roots with quadratic equation. • Any polynomials that are more than 2nd order are a lot harder.

−150

−1

0

10

1

10 10 Frequency (Hz)

2

3

10

10

Fig. 7. We can even show them a Bode plot; not by telling them all the math, but by explaining to them what it means to us. the right into a relationship which we can introduce to them as a transfer function. On the transfer function side, they see that if we set k and b to 0 we are back at our double integrator case. Furthermore, we can relate the second order relationships of k and b and m to those of an oscillatory system by matching coefficients in Equation 4 which relates the spring and damper parameters to that of a simple resonance: X(s) = 2 F (s) s + where



1 m b ms

+

k m

=

s2

Kωd2 , + 2ζd ωd s + ωd2

(4)



(5)

1 k = ωd = 2πfd ⇐⇒ fd = m 2π

k , m

(6)

Now, they have almost certainly seen that when they try to solve for the roots of a quadratic polynomial and the 184

Original System: K_n = 1, f_d = 8, zeta_d = 0.3

Original System: K_n = 1, f_d = 8, zeta_d = 1

2

2

Force Position

Force Position

Force Position

1.5

1

1.5

1

0.5

1

0.5

0.5

0

0

0

−0.5

−0.5

−0.5

−1

and b b = 2ζd ωd ⇐⇒ ζd = √ . m 2 km

Compensated System: K_n = 1, f_d_fsf = 8, zeta_d_fsf = 0.1 2

1.5

Position

−2

10

Position

−200 −3 10

Position

10

0

0.2

0.4

0.6

0.8

1 Time (s)

1.2

1.4

1.6

1.8

2

−1

0

0.2

0.4

0.6

0.8

1 Time (s)

1.2

1.4

1.6

1.8

2

−1

0

0.2

0.4

0.6

0.8

1 Time (s)

1.2

1.4

1.6

1.8

2

Fig. 8. Double integrator with spring and damper feedback. Resonant frequency (ωd ) at 8 Hz. We show the effect of changing the damping (ζd ) from 0.1 on the far left, to 0.3 in the center, to 1 on the far right. To illustrate the changes we can make by changing k/m and/or b/m we can show some relatively straightforward plots in Figure 8. Since we have described the damping and the oscillatory frequency as functions of b, k, and m, we can show how changing their relationship can change the damping and dramatically change the behavior of the system. We have introduced these as properties of the

2019 IFAC ACE 180 1-3, 2016. Bratislava, Slovakia June

Daniel Y. Abramovitch / IFAC PapersOnLine 52-9 (2019) 177–183

4. INTRODUCING HUMAN AUGMENTATION OF NATURE’S FEEDBACK f

-

a

_1



_1

m

v

_1

S

Original Sys: K_n = 1, f_d = 8, zeta_d = 0, Compensated System: K_n = 1, f_d_fsf = 8, zeta_d_fsf = 0.8 2 Force Position (original) Position (compensated)

1.5

1.5

1

1

Position

Position

This structure has set them up for the next step: introducing our own augmentation to nature’s parameters.

Original Sys: K_n = 1, f_d = 8, zeta_d = 0, Compensated System: K_n = 1, f_d_fsf = 8, zeta_d_fsf = 0.1 2 Force Position (original) Position (compensated)

0.5

1.5

1

0.5

0

0

0

−0.5

−0.5

0

0.2

0.4

0.6

0.8

1 Time (s)

1.2

1.4

1.6

1.8

−1

2

0

0.2

0.4

0.6

0.8

1 Time (s)

1.2

1.4

1.6

S

k kf

Original System: K_n = 1, f_d = 8, zeta_d = 0

where fdf

1 = 2π



+

s2

Kωd2 2 , (7) + 2ζdf ωdf s + ωdf

b + bf k + kf and ζdf = √ . m 2 km

0

0.2

0.4

0.6

0.8

1 Time (s)

1.2

1.4

1.6

1.8

2

(8)

We have shown the students in a very straightforward way that we can augment nature’s feedback with our own. We can also tell them that this is called “full state feedback”, which is the 800 pound gorilla of control. (This gives one a chance to explain the 800 pound gorilla joke from our parents’ generation.) At this point, we can show them very simply that by cleverly choosing our feedback parameters, as shown in Figure 10, we can dramatically improve the system’s behavior. By adding a little bit of damping (on the left) the system rings but eventually settles down. A bit more damping (center) and the system settles without ringing. If we maintain this new damping and artificially increase the stiffness of the spring, we get a higher frequency which means that the system responds even more quickly. This is analogous to cars that can adjust their suspensions to the driving conditions. The next level is to explain what happens when we get the feedback parameters wrong. This can be simply illustrated by showing cases where the damping gets set to 0 (on the left of Figure 11) or even negative (on the right of Figure 185

2 Force Position

Force Position

1.5

1.5

1

1

Position

Position

At this point, we have shown them the effects of nature’s feedback parameters on the behavior of our simple system, and it is natural to ask, “What if nature’s k and b are lame? Can we compensate?” The answer is – of course – yes (or we would all need to find new jobs), but we can use this model to show how we introduce augmented feedback into the system as shown in Figure 9. We can describe this as adding our own signals to feed back the output of each energy collector (which we call a state) back into the input of the system. If we do it right, we are – in the words of Shrek – compensating for something. We can analyze this to pick our parameters by looking at modifications of Equations 4–6. =

−1

2

Compensated System: K_n = 1, f_d_fsf = 8, zeta_d_fsf = −0.02

2

Fig. 9. Adding our own feedback to the spring-massdamper system.

k+kf m

1.8

Fig. 10. Our spring mass damper with ζd = 0 and fd = 8Hz. The cyan curve shows this response, which rings without stopping. The blue curve shows the response of the system to the same input, when we humans have augmented nature’s feedback. We then use our augmented feedback to change ζd to 0.1 (far left), ζd to 0.8 (center), and even change the frequency, fd to 20 Hz.

x

bf

1 m b+bf m s

0.5

−0.5

−1

b

X(s) = F (s) s2 +

Original Sys: K_n = 1, f_d = 8, zeta_d = 0, Compensated System: K_n = 1, f_d_fsf = 20, zeta_d_fsf = 0.8 2 Force Position (original) Position (compensated)

Position

physical system itself. We are trying to understand/model the behavior with these equations and plots to gain insight.

0.5

0

0

−0.5

−1

0.5

−0.5

0

0.2

0.4

0.6

0.8

1 Time (s)

1.2

1.4

1.6

1.8

2

−1

0

0.2

0.4

0.6

0.8

1 Time (s)

1.2

1.4

1.6

1.8

2

Fig. 11. If we accidentally set bf = −b (left plot) we zero out the damping of the original system and now it rings forever. If we accidentally set set bf = −1.02b (right plot) we have negative damping which gives us positive feedback, and this is bad. 11). The negative damping results in positive feedback and by then, they should have been told that when negative feedback becomes positive feedback, bad things happen – as illustrated by the ever increasing oscillations. Again, this can be tied back to physical examples such as a car swerving erratically because a driver under the influence is compensating for the weaving far too slowly. Looking back at what we have done: we have introduced a simple system, shown how nature’s feedback affects its behavior, added in our own feedback to improve the behavior, and shown the pitfalls of making a mistake. We have shown them modeling, feedback, full state feedback to augment nature’s feedback, stability, and instability in a very simple progression. What is left to do? We can shown them what happens when we cannot measure everything and we can show them how we use math to help us deal with systems that are bigger than second order. 5. FEEDBACK CONTROL WITH FEWER MEASURED OUTPUTS The curves of Figures 13 and 14 show us that when we only feed back information from position in this problem, something goes horribly wrong. How do we explain this to the students? We have to tell them about the math without expecting them to know how to do it themselves. We tell them instead, what it tells us. Here is where the transforms and Bode plots that we introduced before (knowing full well that they would not at this point be able to do the math themselves) tell us things. Since they have seen feedback loops in our prior discussion, we can show them

2019 IFAC ACE June 1-3, 2016. Bratislava, Slovakia

Daniel Y. Abramovitch / IFAC PapersOnLine 52-9 (2019) 177–183

181

Open Loop Responses with Proportional Control 200

f

-

a

_1 m



v

_1

x

_1

S

150

S 100

Mag (dB)

50

C

0

−50

−100

Fig. 12. The double integrator with feedback only from the position state. P Control: Kp = 150

−200 −3 10

−2

−1

10

0

10

1

2

10 10 Frequency (Hz)

10

3

10

P Control: Kp = 500

2

2 Force Position

Force Position

1.5

1.5

1

1

Position

Position

Physical System Open Loop: Kp_1 = 150 Open Loop: Kp_2 = 1000 Open Loop: Kp_3 = 2000

−150

0.5

Fig. 16. Bode magnitude plots of the different levels of gain show that all we did was change the level of the sloped line, but did not alter the shape.

0.5

0

0

−0.5

−0.5

Physical System and Compensator (Open Loop)

Physical System and Compensator (Open Loop)

150

200

100 100

0

0.2

0.4

0.6

0.8

1 Time (s)

1.2

1.4

1.6

1.8

−1

2

0

0.2

0.4

0.6

0.8

1 Time (s)

1.2

1.4

1.6

1.8

2

Mag (dB)

−1

Mag (dB)

50 0 −50 −100

Physical System Compensator Open Loop

−150 −200 −3 10

−1

10

0

1

10 10 Frequency (Hz)

2

10

1.5

1.5

1

1

Position

Position

Force Position

0.5

0

0

−0.5

−1

0

0.2

0.4

0.6

0.8

1 Time (s)

1.2

1.4

1.6

1.8

2

−1

0

0.2

0.4

0.6

0.8

1 Time (s)

1.2

1.4

1.6

1.8



-

e

C

0

1

10 10 Frequency (Hz)

2

10

3

10

P Control: Kp = 2000

50

50 Phase(deg)

0 −50 −100

0 −50 −100 −150

−2

10

−1

10

0

1

10 10 Frequency (Hz)

1 + P C = 1 + k0

2

Fig. 14. Our double integrator system when we only feed back position. Here we have position feedback scaling (gains) of 1000 (left) and 2000 (right).

r

−1

10

2

10

3

10

−200 −3 10

−2

10

−1

10

0

1

10 10 Frequency (Hz)

2

10

3

10

Fig. 17. Again, we use a Bode plot. On the left, our compensator gain is 150, on the right 2000. However, as neither has changed the phase, we eventually have a ringing of the system.

0.5

−0.5

−2

10

100

−200 −3 10

P Control: Kp = 2000 2 Force Position

Physical System Compensator Open Loop

P Control: Kp = 150

−150

P Control: Kp = 1000 2

−200 −3 10

3

10

100

Phase(deg)

Fig. 13. Our double integrator system when we only feed back position. Here we have position feedback scaling (gains) of 150 (left) and 500 (right).

−2

10

0

−100

u

P

y

(s + b1 )(s + b2 ) · · · (s + bm ) . (s + a1 )(s + a2 ) · · · (s + an )

Now, the critical points of P C are often very easy, but the critical points of 1 + P C are actually pretty hard – especially when one is in the 1940s/1950s and doesn’t have a digital computer to help. We know from all the equations in Equation 9 that things get bad when 1 + P C = 0. A long time ago, someone had the insight that this means: P C = −1 ⇔ �P C� = 1 & � P C = −180◦ .

Fig. 15. Simplified abstract control loop. Transitioning from the complex block diagrams to this simple abstraction allows us to explain the uses of Equations 9 and 10. the simplified model of Figure 15, which is an abstraction, something simplified so that we can get some insight from the math. We can tell them that in the transform space, we get ratios of polynomials from the models comprising Figure 15: Y PC 1 E = = R 1 + PC R 1 + PC C P U Y = = . (9) R 1 + PC U 1 + PC We can point out that all four of these have the same denominator and that this denominator governs a lot of behavior. We can tell them as they know about these that it’s about finding the roots of the rational equation (where 1 + P C = 0): 186

(10)

(11)

This means that if we can check the magnitude and phase against each other, we can be careful that the magnitude should be less than 1 before the phase gets to −180◦ . This explains our fascination with Bode plots. The plots of Figure 17 show that no matter how big we make the gain, we have the problem that the phase is always at −180◦ and so when the gain gets to 1 (which is 0 dB on this logarithmic plot), it will ring. It will ring at different frequencies depending upon our gain, but it will still ring. 6. FAKING MEASUREMENTS: ESTIMATION In order to fix (or compensate for) our lack of velocity measurement, we know that we need extra information. This is pretty obvious to the students. While control theorists understand that we need some sort of estimate of velocity (or derivative information), this is hard to explain to students who have not yet computed a derivative. This author has found that the example of Figure 18 works spectacularly well, since almost every kid has thrown and caught a ball. The figure represents two images of balls

2019 IFAC ACE 182 1-3, 2016. Bratislava, Slovakia June

8 feet

6 feet

Daniel Y. Abramovitch / IFAC PapersOnLine 52-9 (2019) 177–183

4 feet

6 feet

Fig. 18. Two images of a ball in the air with only position information for each of them. On their own, there is not enough information to catch a moving ball from these images. A time stamp is needed on each. Physical System and Compensator (Open Loop)

PD Control: f_zl = 0.1 Hz, Kd = 345000, => Kp = 27.096236637 150

2 Force Position

100

Mag (dB)

50

1.5

0 −50 −100

Position

1

−150

Physical System Compensator Open Loop

−200 −3 10

−2

−1

10

0

10

1

2

10 10 Frequency (Hz)

0.5

10

3

10

PD Control: f_zl = 0.1 Hz, Kd = 345000, => Kp = 27.096236637 100 50 Phase(deg)

0

−0.5

0 −50 −100 −150

−1

0

0.2

0.4

0.6

0.8

1 Time (s)

1.2

1.4

1.6

1.8

2

−200 −3 10

−2

−1

10

0

10

1

2

10 10 Frequency (Hz)

10

3

Comparison of Uncompensated, FSF, and Compensated Time Resp. 2

1.5

Position

1

0.5

0

−1

Force Position (No FB, Double Integrator: K_n = 1) Position (FSF, K_n_fsf = 1, f_d_fsf = 8, zeta_d_fsf = 0.85) Position (PD Control: f_zl = 0.1 Hz, Kd = 345000, => Kp = 27.096236637) 0

0.2

0.4

0.6

0.8

1 Time (s)

1.2

1.4

1.6

1.8

Our system that fed back everything had no issues because it was getting velocity information. Can we somehow estimate velocity from our position measurement, and to do this, we need to differentiate, that is see how quickly our position is changing over time. We are now introducing proportional plus derivative control in doing this. In the transform space, we can point out that this makes the phase less negative. There is even a simple relationship for the new controller that we can show them: (s + bf ) C = kf , 0 ≤ bf < af , (12) (s + af )

10

Fig. 19. Our double integrator system when we only feed back position information. Here we have used position and the derivative of position to make the feedback effective and stop the ringing. On the right, we can show them that the Bode plot helped us predict that this would happen and how to choose the relative and overall gains.

−0.5

take the difference and add a time stamp. Our brains (meat computers) are estimating the velocity of the ball from changes in position over time. In fact, for many North American kids who have played baseball or softball, we can relate this to learning to play catch, how as their skill level improved, they could catch balls thrown much less accurately and with greater speed. This relates to their brain learning to produce better estimates over time. For kids from other parts of the world, similar analogies can be made with soccer (football), tennis, etc. They get the message: we need to teach our machine how to estimate the velocity.

2

Fig. 20. Here, we repeat the plot on the left of Figure 19, because we have curves from full state feedback as well. Thus, we are showing that using some signals to estimate others can give us almost as good a result (sometimes) as when we can measure everything. in the air with only position information. Having been through the prior material, we can all conclude that it is impossible from only that information for anyone to catch the ball. We then produce a soft ball and toss it to one of the students who almost always catches it. We then get a chance to explain the contradiction, that if the speaker is not a nonsensical liar, something else must have taken place. That something can be explained as follows. Our eyes take repeated still images (position information). Our brains 187

and point out two important things: that there is a set of algebra from our transform space that allows us to predict what math we need to do to estimate velocity and that this math is often very simple. We can also point out that a lot of very useful control systems have simple guts such as this. When we do this, we get the response on the left side of Figure 19, which looks pretty good. On the right, we see that our Bode plot shows some differences, but the main thing that we show them is that the phase is well above −180◦ when the gain gets to 1 (0 dB). In fact, we can splurge a bit and show them Figure 20 which has the results of both the full state feedback and our PD feedback and we are showing them that with a good estimate, we can do almost as well as when we measure everything. Again, it is worthwhile to look at the path we have taken with a set of bright students who have not yet studied calculus. We have shown them that we can do something with a limited set of signals to produce estimates of the signals we need to cause the system to behave the way we want. We have shown them that some math that they don’t yet have leads to some math that they already know and that the math they already know tells us how to fix the problem, sometimes simply. We have attached physical meaning to the equations and examples that we use, so that even if they don’t understand the details, they have a very strong sense that they get the basic idea. 7. SOME DEPTH ON ESTIMATION While we have taken the students a long way in a short time with the previous discussion, there are some extensions and abstractions that are useful because they tie what we have been discussing to problems that they hear about every day. We start with the example of Figure 21. Here we have extended the simple physical example. We can then ask:

2019 IFAC ACE June 1-3, 2016. Bratislava, Slovakia

Daniel Y. Abramovitch / IFAC PapersOnLine 52-9 (2019) 177–183

x1

f1 k1

m1

f3 m2

k2

m3

k3

b2

b1

x3 k4

m4

b4

b3

Fig. 21. Extending our spring mass damper system to one with a lot more springs, masses, and dampers.

Input

u1

w1

u2

w2

uni

wno

u1

w1

u2

w2

uni

wno

Entity (x1,x2,...,xn)

Model (x1,x2,...,xn)

S1

y1

v1

y2

v2

yni

vno

S2 Sno

z1 z2 zno

-

S1

y1

v1

y2

v2

yni

vno

+



z1 z2 Sno zno Filter Gain

• Computation has gone digital, not because digital gives better performance, but because digital gives cookie cutter, which gives miniaturization which gives more capability in small spaces everywhere. (They will recognize this immediately from their own experiences with smart devices.) • To do useful things that touch the real world, you have to understand the real world and this usually takes modeling, and modeling takes math. (This answers the high school students inevitable questions in math class: “Are we ever going to use this?”) • Some folks do math for its own sake. Scientists and engineers tend to do math in order to enable them to do something practical. (This draws the distinction between different branches of STEM work in a relatable way.) Again, at this point, we are trying to capture their imaginations for what they can do with all those math, science, and programming classes. This author always closes with the following set of comments about control systems and tech work in general:

S2

Adjustment Vector

183

Error Vector

Fig. 22. A generalized view of model based filtering 1) What if we can’t measure every “state”? 2) What if the physical system is more complicated than our model? The trick is that since (2) is always true, then (1) is always true. This allows us to discuss really big, big systems with lots of stuff that we can’t model exactly. Power grid, air traffic control, automated highways, systems biology, have many more things (states) than can be measured. However, these kids are comfortable with computers, with games, with simulations. This means that we can refer to Figure 22 as a general metaphor for how we handle these problems. The general process steps are: • Build a simulation. • Run simulation in parallel with real world. • Compare simulation output to things we can measure in real world. • Correct simulation with measurements from the real world. In doing so, we get a lot of advantages, including that the inside of our simulation will have useful information we could not measure in the real world and that the student gets to tell their friends that they work with models. 8. CLOSING COMMENTS FOR MIDDLE AND HIGH SCHOOL STUDENTS With such a whirlwind tour of control and system theory, the students might very well be energized, but not know where to go with the information. It is best to take a step back and give them an overview here, some thoughts about control systems and tech work in general: • A lot of this discussion shows up in all technical work. Ideas about making measurements, using science to generate models, transforming those models into mathematics, using those math models to make predictions and improve design, and implementing things using computer programming are fairly universal.. 188

• I’m not telling you this stuff is easy. It’s not. • Technical work takes work. There is a lot to learn, whether you want to be a biologist, a computer scientist, a chemical engineer, or a controls engineer. • And every time you work on a new problem, you learn stuff you wish you had known on your last problem. • What makes it fun? · A lifetime of learning. · Understanding the world. · Doing something about it. · Getting paid well in the process. 9. CONCLUSIONS FOR PART 2 This author’s experience in giving such seminars to middle and high school students in a variety of pre-conference workshops has led them to believe that this pattern is highly successful and can be adopted by others. In Part 1 (Abramovitch (2019)) we presented the basic concepts that can be readily taught. In this part, we have tried to show how we can use some simple examples to tie Newton’s Laws to control theory. We discuss how to explain what the math tells us without having to teach them the math itself. Furthermore, we discuss how some of that math allows us to turn these problems into some that they know, i.e. algebra. This allows us to display some algebra to explain what the math tells us about the behavior of control systems. These methods have worked extremely well for the author, and it is hoped that others can use them to get more middle and high school students interested in control engineering. REFERENCES Abramovitch, D.Y. (2019). Introducing feedback control to middle and high school stem students, Part 1: Basic concepts. In Proceedings of the 12th IFAC Symposium on Advances in Control Education. IFAC, IFAC, Philadelphia, PA. Bracewell, R.N. (1978). The Fourier Transform and Its Applications. McGraw-Hill, New York, 2 edition.