MASTERCLASS

# Robot joint Control

### Lessons

#### Share

#### Transcript

We're going to do a bit of a recap of simple dynamical systems and we're going to start with the very classical system which is a mass on wheels connected by a spring to a fixed point.

The displacement of the cart with respect to some data is given by the variable X. And X increases positively to the right. If the spring is compressed then it's going to push the cart towards the left. And the direction indicated by the arrow and the symbol Fs.

That's the force exerted by the spring. Now we can imagine the situation where this spring is stretched and that's the case when X is negative. And now the spring is trying to pull the cart towards the right. And so the arrow indicating the direction of Fs is now pointing towards the right. So the spring can either push or pull the cart and the spring force is equal to minus K times X, the way I've drawn this particular diagram.

Now there's friction operating and friction is a force that opposes the direction of motion. So in the top figure, if the cart is moving towards the left, then the friction force is going to be towards the right and vice versa for the figure below that. And the friction force is proportional to the velocity, proportional to ẋ And B is the friction coefficient.

In order to understand this we're going to draw a free body diagram. So here I have a mass M and its displacement X. And there were two forces acting on the mass. There is the spring force Kx and the friction force Bẋ.

The acceleration of the body is equal to the sum of the forces that are acting on it. And I can rearrange this expression into this form here. So this is a second order linear differential equation which describes the motion of the mass M.

Now if you're a little bit rusty on solving your differential equation, let me give you a hint. We can propose that X is equal to E to the ST. That it is an exponential function of time. And S is the time constant.

Now I could take the derivative of this, and I got an expression now for ẋ. And with some simplification I can see that ẋ. is equal to S times X. And I can take the derivative again and get this expression here. Now I can make these substitutions into my original equation and I end up with this expression and I can cancel out the X's and I end up with this, which is called the characteristic equation. This is now a quadratic equation in the variable S. And we can solve for S quite easily.

Here is the quadratic equation again and the well-known solution to the quadratic equation is here. These values of S are known as the poles of the system. And they define the response, the position response of the mass as a function of time. And remember X is an exponential function of time and S.

If we consider the determinant of this equation, that's the expression inside the square root. It has three interesting sets of values. If the determinant is greater than zero then S has two real and different values. If the determinant is equal to zero then S has two real and equal values. Two values of S are the same. And if the determinant is less than zero, then S is a complex conjugate pair.

In terms of the physical response of the system, this case is referred to as the damped response. This case is called critically damped. And this case is an oscillating response. The overall response, the position of our mass as the function of time is the superposition of the response due to each pole. So it's some constant, times the response of the first pole, plus some constant times the response due to the second pole.

A very classical way to consider the response of a second order dynamical system such as we're studying here is to look at it's damping ratio and that's given by this expression here. And the graph shows the time response for different values of damping ratio. When the damping ratio is greater than one, we say that the response is over damped. We see that it responds very very slowly as a function of time. When the damping ratio is less than one, we see that the response is somewhat oscillatory. And as the damping ratio get's smaller and smaller we see that the system's response is more and more oscillatory. The over shoot is higher and there are more cycles of oscillation.

When the damping ratio gets to zero there is no decay at all. And the system will continue to oscillate forever without any kind of decay. The damping ratio 1 corresponds to critical damping. It is the smallest value of the damping ratio for which there will be no overshoot.

Consider now we want to simulate the response of this differential equation. I can rearrange it so that ẍ is isolated by itself on the left hand side. And now I am going to start to draw of block diagram of a system which has got the same dynamics as our differential equation. I'm going to draw an arrow and label it ẍ. And I'm going to add an integrator we integrate ẍ. And now I have ẋ. And I'm going to integrate it again and now I have X. The signal ẋ and multiply it by minus b then I have compute this term here. And the triangle indicates a gain block. It's output is equal to minus b times it's input.

Then we introduce another gain block here with a gain of minus K. If I add these two signals together with a summing junction, the result now is this expression shown here in yellow. And if I divide that by M, that is by applying a gain of 1 on M, I have now computed an expression that is equivalent to ẍ.

So I joined the output of this gain block to the signal that I started with. So this is a block diagram of a dynamic system. And if I built this in a simulation environment and simulated how it performed as a function of time, the signal X is going to give me the position response of the dynamic system that we looked at in the first place. The system with a cart and a spring and some friction.

Well this is the system that I just described but I implemented it in the Simulink modelling package that's a part of MATLAB. Here are the two integrators; the integrator that integrates the ẍ into ẋ that is acceleration to velocity and this integrator which integrates velocity into position.

This particular integrator has got an initial condition of 1. That's the initial value of the displacement X. That's the initial position of the cart. So the way we define our coordinate conventions means that for X=1, the spring is compressed. That means the first thing that the spring is going to do is to push the cart away. It's going to push the cart into -X direction.

So let's simulate the model as we have it here. And here we see the position response of the cart. As I just said a moment ago, the cart is moving in the -X direction. It's oscillating a little bit but the energy is decaying from the system and it settles out at a position of X=0.

Now I'm going to adjust some of the parameters. This gain block here represents the inverse mass so I can open up the parameter settings here and I'm going to change the mass from 2 kg to 4 kg. And I'm going to apply that parameter. And now I am going to simulate the response. You'll note that it changes. We'll see that the oscillations are in fact more intense. And that's because our system starts with a greater amount of potential energy. That's the energy stored in that compressed spring.

More mass is going to have more initial potential energy, which is going to take longer to be dissipated by the friction. If I increase the mass even more, turn it up to 2 kg, apply that, and here we see that the oscillation has become much slower and it's also the rate of decay is much much less.

I'm going to do now is to put that back to the value I started with which was 2 kg, simulate the original system that looks like this. And now what I'm going to do is to increase the amount of friction.

So originally we had a friction coefficient of 2 and changed the friction coefficient to 4 and what we should see is that the oscillation should die out more quickly because the energy is dissipated much more quickly because there is an increased amount of friction; increase it some more, increase it say to 8, and apply that parameter and simulate again and there we see. There’s absolutely no oscillation at all now. The system is over damped.

So let's recap on how we convert differential equation to an algebraic equation. I make these substitutions for X and it's derivative ẋ and ẍ in terms of S and X. Now it's possible that we can consider S as an operator. That is it's an operator that converts differential equation to an algebraic equation. Once we've done this we can solve for S and we call these values of S the poles of this system. And they indicate the dynamic response of the system as a function of time. If a system has got more than one pole, the system we looked at has two poles, then the response is the superposition, the summation of the response due to each particular value of S.

What we considered earlier was called the unforced response. There was no other force acting on the system apart from the spring and the friction. We position the cart at some initial value of X not equal to zero. And then let it go and watched what happens.

Now what I'm interested in is what's called the forced response. Now I'm going to apply a force F to the cart and I want to understand how it moves. So I draw the free body diagram again but now it's got an extra force. It's got the force that I'm applying to the cart F as well as the spring force and the friction force. Now I consider the force balance acting on the mass in the free body diagram and rearrange it like this. Now I'm going to consider S as an operator. I'm replacing the derivatives of X with the operator S and now I'm going to write this. And you'll notice a few differences.

Firstly the derivatives have gone and I've introduced my operator S. You'll also notice that I've changed the lower case x to a capital X and I've changed the lower case f to a capital F. What I've done is computed the Laplace transform of my differential equation. Capital X represents the Laplace transform of the position of the cart lower case x and capital F represents the Laplace transform of the applied force which is lower case f.

Now I can rearrange my Laplace transform expression into a ratio which we call a transfer function. It is the ratio of the output of the system X to the input of the system F. And to make things very clear I've said that capital X is the function of the operator S and capital F is a function of the operator S.

Let's consider a very general dynamic system as a black box. The input is a signal x which is a function of time and the output is another signal y which is a function of time. Then mathematically the output of the system y is related to the input to the system x, convolved with the impulse response of that dynamic system, which is denoted by G as a function of time.

In the Laplace domain where we've just been operating, things are a little bit simpler. The Laplace transform of the input system is capital X. Laplace transform output is capital Y. And G is the transfer function of the system.

So now the output Y is simply the product of the input X multiplied by the transfer function. The simple multiplication in the Laplace domain where it is a convolution in the time domain.

I've covered a lot of territory in this section. And if you previously encountered these concepts, I hope that it served as a bit of a memory refresher for you. If you've never encountered these concepts before then what I've been talking about is probably a little bewildering. It might be worthwhile trying to go through the content again. Perhaps contact a friend or colleague who can talk you through some of this material or try and find an introductory control systems text which will cover this material in much much more detail.

#### Code

If your knowledge of dynamics is a bit rusty then let’s quickly revise the basics of second-order systems and the Laplace operator. Not rusty? Then go straight to the next section.

### Skill level

Undergraduate engineering

#### Undergraduate-level engineering

This content requires an understanding of undergraduate-level engineering; for example, dynamics, classical control theory - PID, poles, zeros, probability theory - random variables and Bayes’ rule.

#### Undergraduate-level mathematics

This content requires an understanding of undergraduate-level mathematics; for example, linear algebra - matrices, vectors, complex numbers, vector calculus and MATLAB programming.

### Rate this lesson

## Check your understanding

## Discussion

## Leave a comment

Please Sign In to leave a comment.

“And the friction force is proportional to the velocity, proportional to ẋ And B is the friction coefficient.” I have some confusion about the above sentence. According to what I know，the friction force should be proportional to the positive pressure and the friction coefficient. Maybe my understanding is wrong or there is something I don’t learn, can you give me an explanation about my puzzle? Thank you !

The equation you mention is for static friction, that’s the force you need to apply to an object before it will begin to slide. Once the object is sliding we have dynamic friction which is a force opposing the motion of the object and will also depend on the normal force. However for lubricated sliding, as in the bearing of a motor, it is viscous friction that is important and it is proportional to speed. For motion through a fluid (air or water) there will be a drag force, which is proportional to speed squared which can be considered a type of friction: a velocity dependent force that opposes motion.

Hello, Prof. Corke.

Thank you for your reply. I think I’m use to automatically apply a positive valued vector with opposed direction to the movement for the spring and friction force. I think the difference is that in the explanation, you applied a positive position vector to the right, as well as its derivative (velocity) with the spring and friction constant with a negative value (wich will invert the vector direction). Your explanation is more in tune with classic literature as in Hibbeler’s and Rao’s books.

I’m sorry Prof. Corke, but if i’m not wrong, there might be a small error in the beginning of the video. If the friction force oposes the movement, in the top figure, the mass translate to the right, the friction force should act to the left, in the same direction of the spring force. This is more evident in the Free Body Diagram, in the next slide. Maybe the ideia was to just exemplify if the mass in the top figure was going to the left, instead of right, but it could cause a little of confusion. Parton me if I’m wrong in my assumptions and did not understand corretly your explanation.

The first figure (upto time 1:26) you refer to is about spring force not friction force. I’m explaining how my particular spring works. Are you OK with that?

With the definitions I’ve given, with x increasing to the right, xdot positive is also motion to the right. So that means that friction force is to the left. Since the arrow is labeled with b xdot, if the mass was moving to the left, xdot would be negative so the arrow would go the other way.

I’m not sure I’ve fully understood your concern, but I’m happy to keep discussing.

Hello, Prof. Corke.

Thank you for your reply. I think I’m use to automatically apply a positive valued vector with opposed direction to the movement for the spring and friction force. I think the difference is that in the explanation, you applied a positive position vector to the right, as well as its derivative (velocity) with the spring and friction constant with a negative value (wich will invert the vector direction). Your explanation is more in tune with classic literature as in Hibbeler’s and Rao’s books.

(sorry for the reply in the other question).