OK, after we have seen the theory of gravity compensation, let's see how it will be applied in practice
or in how it will be simulated, and let's see the results.
OK?
As we have the first imported model of our robot manipulator, in this case, you are five robot manipulator.
Then we will define just PD gains.
OK.
You can tune this OK as in tuning of PD controllers, OK?
You can.
Just by changing the values you can practice at the results.
I mean, you can visualize the results in this practice.
This is the time span to execute the whole process.
And here we start to simulate the simulated file.
And then at the end, we just open the result of the scopes automatically in order to see what, what,
what, in order to visualize the configuration errors or position error if we reached at the end the
desired configuration or not and our velocity.
OK, let's see this link file.
As you can see, this is very simple.
Simple link is very simple.
Excuse me, not similar, but very simple controller we have here.
Our plan, which is our robot manipulator, which accepts the input and gives output as and the actual
Veloce, excuse me, position, configuration, velocity and acceleration.
OK, then we are just applying PD plus gravity compensation.
So as our velocity is zero, we just give the actual our desired velocity input to the wheels.
But these are those is zero.
We just input for the key determine just the actual velocity, as you can see for the capital and the
input.
Um, the configuration or position, or as you can see V by QTL, the V just plot here the position
and wrote OK and the position error is come, uh, came from here.
So this is the desired.
This is the desired position.
And this this is the actual position or configuration.
Let me say it's more correct.
And as you can see, this is our gravity compensation term, OK?
This computes the gravity torque, and as the gravity only depends on the configuration, the on input
is Q.
And we also add here the gravity torque to their PD torque and overall the input the all the input is
given to our robot manipulator.
And here we visualize the velocity.
So it's easy to adjust, uh, to see.
In order to visualize the result, you have to just run the script.
I will not do that now because it takes a bit of time.
You can do it by changing these values.
You can see different results.
But let's see.
I have done beforehand, so I have figures.
I saved the figures.
So let's see.
This is our configuration position.
OK?
As you can see, the position error is at the end is almost zero.
Very, very small.
OK.
Not on the zero.
OK, but it's very small.
Let's just zoom in.
OK?
Zoom in the error.
OK?
And the here is our error.
As you can see, it is not zero, but it is 10 to the minus something.
You will see this when you calculate it.
Excuse me, when you run the script file OK here, because I have said it before and it doesn't seem
here, then it is 10 to the negative which amount?
OK, but you will see that, but it is 10 to the negative of something.
OK.
It's very it's small error, as you can see.
So with PD control, LAPD plus gravity compensation controller, which is not that advanced controller,
even with that controller, we can reach to the desired configuration.
OK.
So let's now see the velocity term, OK?
As you can see, the velocity at the beginning was zero because we have initially started with zero,
and at the end the velocity is also zero because we reach the desired configuration.
So the robot reached the desired configuration and stopped.
OK.
So at the end, we had the velocity of zero.
Again, I have said, as I say, I have said before, I highly recommend to change in this p and values
experiment.
What will be the result?
OK.
Sure, the oscillations will change, so the state response will change oscillations.
Peak values will change.
OK.
You can change this as in the tuning of PD controllers.