A sample text widget

Etiam pulvinar consectetur dolor sed malesuada. Ut convallis euismod dolor nec pretium. Nunc ut tristique massa.

Nam sodales mi vitae dolor ullamcorper et vulputate enim accumsan. Morbi orci magna, tincidunt vitae molestie nec, molestie at mi. Nulla nulla lorem, suscipit in posuere in, interdum non magna.

Controlling the Speed of our rocket car – Part 1 Proportional Control.

Generic Feedback Block Diagram

Generic Feedback Block Diagram

Now that we have created ourselves a simplified model of a car in “Understanding why cars reach a maximum speed”  we are going to replace the driver controlling the speed of the car with a control loop.  All of the things going through our mind now have to go through a relatively dumb circuit and/or computer and we have to design the circuit or program the computer.

I like playing with stereotypes so we might as well make a story to go along with this problem.   We will say the designer of this circuit is from a big city in New York and he has watched a lot of movies over the years.   He is thinking about the last time he made a trip down here to Alabama and he had to stop at a stop light on a major highway.   The speed limit is 55 mph and as he set at that stop light an Alabama State Trooper pulled up behind him.  Here he sits with the New York License plate on his car. The trooper has the “Smokey the Bear” hat on and even is wearing mirrored sunglasses.  The driver just knows this trooper can’t wait to stop the Yankee and say those words: “You’re in big trouble boy”.  (Remember I am playing with stereotypes… none of this is true, the police have all been courteous to me.)   This designer thinks: “I’ve got to make this controller hold the speed limit.”

Propotional only control to replace the driver.

Propotional only control to replace the driver.

The first attempt to build this controller is to use proportional control. That means the gas pedal position will be proportional to the speed error. We have a magic number called the proportional gain that we will multiply the error by to calculate the gas pedal position.   Gain is adjustable so we can “tune it” to get a value that will operate correctly.

The spread sheet used for proportional control

The spread sheet used for proportional control

Just like last time, I created a spreadsheet to do these calculations. I named this spreadsheet PIDv2 and you can download it.  This whole post will be a lot more fun and understandable if you do download it and run it.  Changes from the previous spreadsheet are:  First the gas pedal column comes from the “total out” column, column L.  We are now under automatic control.   There are now two new yellow coefficients, Prop Gain & Limit.   Limit was set at 100% and all this does is limit us so the “pedal cannot go past the metal”.  The other calculations is simply multiplying the speed error by the gain to come up with the output value.   There are two columns left blank.  Those will be used soon enough in a future post.

Proportional gain of 1

Proportional gain of 1

Not knowing where to set the gain we try it on the first go-around at one. One just seemed like a good number to start with. The light turns green, we calculate, 55 mph speedlimit – 0 speed = 55 error and with a gain of one we depress the pedal to the 55% position and off we go. Meanwhile the man in mirrored sunglasses is not very happy. Not only did we accelerate very fast, his glasses melted on his nose. Remember, this is a rocket car. (Never let the facts mess up a good story!).

As we increase speed the error decreases so we depress the pedal less.   The problem is that we never get up to 55 mph.  As we decrease the amount of pedal we supply, the wind resistance is increasing due to the speed.   Those reach equilibrium at about 27 1/2 mph.   Well heck… this ain’t gonna get it!   Let’s try increasing the gain.

Proportional gain of 2

Proportional gain of 2

If  a gain of one didn’t do the job, lets try a gain of 2.  Things improved, but not all that much.  Now I reached a maximum speed of 36.6 mph.  That is still not the speed limit of 55 but better.
Note that the limit we set is now being used.   2 X the initial error of 55 would come out to 110% pedal position.   No matter what all the bosses say of give 110%, it ain’t possible.

Proportional gain of 5

Proportional gain of 5

If two makes things better, then let’s go to a gain of 5.   The limit is really in effect now.   Things are getting closer.  Now we reach a maximum speed of 46 mph.   But better just doesn’t get the job done.  We want 55.

Proportional gain of 100

Proportional gain of 100

 

 

I don’t know about you, but I am tired of messing with it. Let’s crank that gain up to 100.  There really is several problems with this.  First, I removed from the graph the proportional output because it was off the scale and would have caused the other graph lines to be unreadable.  The second problem is we have still not reached 55 mph.  We are at approximately 54.5 mph.  The biggest problem is that with this excessive gain our neck is getting sore riding in this car because it seems to always be full on or off.   This is shown in the graph by the action of the gas pedal line.   It would be much worse in real life.  The computer model maintains the speed feedback relatively constant, but in real life we have rises and dips in the road, we have wind gusts and changes in the road surface.   With the gain so high the car would constantly be surging and then releasing the gas pedal.   We could add a random number generator to the equations in the spreadsheet to model this, but then we would have a more complicated model and to do the model right we would need to really understand all those variables.  We don’t so we won’t.   However, I do want to point out that no computer program, no matter how complicated can completely predict reality.

About now we are completely frustrated.   Nothing seems to work, so we hop in our real car and go to the grocery store to buy some more supplies.  One the way there it hits us like a thunderbolt from the sky.   When I drive my real car on a real highway and I am going the speed limit I don’t completely let off the gas pedal because I have 0 error.   Somehow, I have a memory component in my head that kind of calculates the position needed and maintains that position.   It also kind of averages things out so that momentary changes in speed are disregarded unless they are longer term, like climbing a long hill.

This memory is where we are going in the next post and you will be introduced to a new concept.

Gary

If you enjoyed this post and learned something, please consider subscribing using one of the methods on the homepage or the e-mail subscription form at the bottom of each page.


 

Print Friendly

5 comments to Controlling the Speed of our rocket car – Part 1 Proportional Control.

  • […] the post “Controlling the speed of our Rocket car – Proportional Control“, we had a very hard time ever getting the car up to speed.  At the very end of the post I […]

  • Brian Voss

    Yes, Gary, I know Peter Senge’s book, have read it and attended one of his lecture’s many years ago. The theory is intriguing for anyone with a technical bent, but remains a theory, I think. Your insight about reducing the feedback gain and relating it to checks-and-balances of the US Constitution makes sense to me; I often think that we move too quickly to exploit new opportunities. Maybe reducing the feedback gain is equivalent to taking more time to evaluate consequences before progressing.

    Brian

    • Gary

      Brian:

      It has been a long time since I have read that book. I remember at the time one of those really struck me in relation to some of the social problems going on a the time. I think it had to do with imprisoning people which just seems to be growing more and more. I think I associated it with the Archetype he called “Fixes that fail”.

      The thing about machines and feedback loops and even nature and feedback loops is negative loops normally create the desired fix. Sometimes it can create an undesired problem of oscillations, but tuning the loop correctly usually eliminates that. With people and animals it seems to me that selective positive feedback loops work much better. Trying to stop negative behaviour by negative reinforcement often just creates better ways to hide the negative behaviour and avoidance, but rewarding the positive behaviour encourages more of it leaving less time for the negative.

      However, I may be wrong… I often am. hahaha (Avoidance in action to avoid negative feedback.)

      Gary

  • Brian Voss

    Back, maybe 20 years ago, a theory called ‘systems thinking’, using the concepts of feedback control systems, was tried, to apply to real world management problems. One common problem, called ‘the tragedy of the commons’, always intrigued me because it seems to come up so frequently. An example is an ocean fishery: each fisher-person operates in their own feedback loop that tells them the more fish they take the more profit they will gain. Unfortunately, every fisher depletes the same fish resource (which is limited), so by each maximizing their catch, they collectively ensure the destruction of their common business.

    I don’t know if the application of feedback theory has continued to be applied to management problems. I’d be interested to know and, more particularly, if better insight has led to better solutions to some of these problems. Pollution is another example.

    • Gary

      Wow Brian… most excellent statement and most excellent question. You are getting in an area I like to think and talk about, but I decided to not talk much about it on here. I think similar thinking is being taught but have not seen much of it put into action. I have seen the exact opposite in most cases and the ocean fish population is a very good example. (Although I am sure you can easily find those that will question what I just said.) However, you have hit upon a point where engineering and sociology/politics/management overlap.

      Feedback in general is reactionary. Something has to “go out of whack” before anything is changed. As shown in this post and will especially be shown in the next post, increasing the gain for faster reaction time is not often a very good answer. Without going to far this may very well be why the constitution was written to be a slow process of modifying the laws of the land. People of a Libertarian bent will get in endless discussions about how we are a Republic and not a Democracy. I have regressed as far as I want to go down that road on here.

      I made it about 1/2 toward getting a Masters of Engineering Management. I dropped out because I knew that I enjoyed the classes, but I would hate the job and I do not have the personality to fit with management. The most interesting book was about systems engineering. The Fifth Discipline, The Art & Practice of The Learning Organization by Peter M. Senge. In that book he mentions several Systems Archetypes, complete with very simple feedback diagrams. One of those is “The Tragedy of the Commons”. As you look at those Archtypes there is much that can be applied to society’s problems.

      Thanks a lot for making me think some.

      Gary

Leave a Reply to Putting the memory from our right foot into the controller. Cancel reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>