1
00:00:00,450 --> 00:00:07,290
OK, after we have seen the theory of gravity compensation, let's see how it will be applied in practice

2
00:00:07,290 --> 00:00:10,650
or in how it will be simulated, and let's see the results.

3
00:00:11,230 --> 00:00:11,620
OK?

4
00:00:11,660 --> 00:00:19,480
As we have the first imported model of our robot manipulator, in this case, you are five robot manipulator.

5
00:00:19,500 --> 00:00:21,850
Then we will define just PD gains.

6
00:00:21,870 --> 00:00:22,290
OK.

7
00:00:22,740 --> 00:00:29,160
You can tune this OK as in tuning of PD controllers, OK?

8
00:00:29,460 --> 00:00:29,880
You can.

9
00:00:29,880 --> 00:00:33,000
Just by changing the values you can practice at the results.

10
00:00:33,540 --> 00:00:35,820
I mean, you can visualize the results in this practice.

11
00:00:36,120 --> 00:00:38,700
This is the time span to execute the whole process.

12
00:00:38,970 --> 00:00:42,360
And here we start to simulate the simulated file.

13
00:00:42,360 --> 00:00:48,630
And then at the end, we just open the result of the scopes automatically in order to see what, what,

14
00:00:48,630 --> 00:00:55,410
what, in order to visualize the configuration errors or position error if we reached at the end the

15
00:00:55,410 --> 00:00:58,140
desired configuration or not and our velocity.

16
00:00:58,230 --> 00:01:01,020
OK, let's see this link file.

17
00:01:01,380 --> 00:01:03,220
As you can see, this is very simple.

18
00:01:03,490 --> 00:01:05,010
Simple link is very simple.

19
00:01:05,160 --> 00:01:09,050
Excuse me, not similar, but very simple controller we have here.

20
00:01:09,060 --> 00:01:16,560
Our plan, which is our robot manipulator, which accepts the input and gives output as and the actual

21
00:01:16,560 --> 00:01:21,330
Veloce, excuse me, position, configuration, velocity and acceleration.

22
00:01:21,360 --> 00:01:25,430
OK, then we are just applying PD plus gravity compensation.

23
00:01:25,650 --> 00:01:32,130
So as our velocity is zero, we just give the actual our desired velocity input to the wheels.

24
00:01:32,880 --> 00:01:34,350
But these are those is zero.

25
00:01:34,350 --> 00:01:42,090
We just input for the key determine just the actual velocity, as you can see for the capital and the

26
00:01:42,840 --> 00:01:43,410
input.

27
00:01:43,530 --> 00:01:54,120
Um, the configuration or position, or as you can see V by QTL, the V just plot here the position

28
00:01:54,120 --> 00:01:57,600
and wrote OK and the position error is come, uh, came from here.

29
00:01:57,870 --> 00:01:59,520
So this is the desired.

30
00:01:59,850 --> 00:02:01,140
This is the desired position.

31
00:02:01,140 --> 00:02:05,400
And this this is the actual position or configuration.

32
00:02:05,410 --> 00:02:06,510
Let me say it's more correct.

33
00:02:07,200 --> 00:02:11,320
And as you can see, this is our gravity compensation term, OK?

34
00:02:11,340 --> 00:02:16,860
This computes the gravity torque, and as the gravity only depends on the configuration, the on input

35
00:02:16,860 --> 00:02:17,400
is Q.

36
00:02:17,670 --> 00:02:25,560
And we also add here the gravity torque to their PD torque and overall the input the all the input is

37
00:02:25,560 --> 00:02:27,120
given to our robot manipulator.

38
00:02:27,180 --> 00:02:28,980
And here we visualize the velocity.

39
00:02:29,370 --> 00:02:32,950
So it's easy to adjust, uh, to see.

40
00:02:32,980 --> 00:02:35,520
In order to visualize the result, you have to just run the script.

41
00:02:35,620 --> 00:02:38,500
I will not do that now because it takes a bit of time.

42
00:02:38,520 --> 00:02:40,800
You can do it by changing these values.

43
00:02:40,800 --> 00:02:42,300
You can see different results.

44
00:02:42,540 --> 00:02:43,470
But let's see.

45
00:02:43,470 --> 00:02:45,750
I have done beforehand, so I have figures.

46
00:02:45,750 --> 00:02:46,680
I saved the figures.

47
00:02:46,680 --> 00:02:47,240
So let's see.

48
00:02:47,250 --> 00:02:50,940
This is our configuration position.

49
00:02:51,300 --> 00:02:51,630
OK?

50
00:02:51,660 --> 00:02:56,550
As you can see, the position error is at the end is almost zero.

51
00:02:56,580 --> 00:02:58,150
Very, very small.

52
00:02:58,170 --> 00:02:58,500
OK.

53
00:02:58,800 --> 00:02:59,190
OK.

54
00:02:59,360 --> 00:03:00,140
Not on the zero.

55
00:03:00,140 --> 00:03:01,430
OK, but it's very small.

56
00:03:01,440 --> 00:03:02,670
Let's just zoom in.

57
00:03:02,670 --> 00:03:03,270
OK?

58
00:03:03,330 --> 00:03:04,380
Zoom in the error.

59
00:03:04,380 --> 00:03:04,920
OK?

60
00:03:05,040 --> 00:03:06,900
And the here is our error.

61
00:03:07,860 --> 00:03:13,230
As you can see, it is not zero, but it is 10 to the minus something.

62
00:03:13,470 --> 00:03:15,990
You will see this when you calculate it.

63
00:03:16,350 --> 00:03:22,260
Excuse me, when you run the script file OK here, because I have said it before and it doesn't seem

64
00:03:22,260 --> 00:03:27,650
here, then it is 10 to the negative which amount?

65
00:03:27,660 --> 00:03:31,930
OK, but you will see that, but it is 10 to the negative of something.

66
00:03:31,980 --> 00:03:32,230
OK.

67
00:03:32,250 --> 00:03:34,760
It's very it's small error, as you can see.

68
00:03:34,770 --> 00:03:40,710
So with PD control, LAPD plus gravity compensation controller, which is not that advanced controller,

69
00:03:41,760 --> 00:03:46,920
even with that controller, we can reach to the desired configuration.

70
00:03:46,950 --> 00:03:47,370
OK.

71
00:03:48,420 --> 00:03:51,940
So let's now see the velocity term, OK?

72
00:03:51,960 --> 00:03:56,220
As you can see, the velocity at the beginning was zero because we have initially started with zero,

73
00:03:56,220 --> 00:04:00,090
and at the end the velocity is also zero because we reach the desired configuration.

74
00:04:00,090 --> 00:04:03,840
So the robot reached the desired configuration and stopped.

75
00:04:04,200 --> 00:04:04,590
OK.

76
00:04:04,890 --> 00:04:07,230
So at the end, we had the velocity of zero.

77
00:04:07,560 --> 00:04:13,500
Again, I have said, as I say, I have said before, I highly recommend to change in this p and values

78
00:04:14,160 --> 00:04:14,820
experiment.

79
00:04:14,820 --> 00:04:15,910
What will be the result?

80
00:04:15,930 --> 00:04:16,320
OK.

81
00:04:16,510 --> 00:04:20,910
Sure, the oscillations will change, so the state response will change oscillations.

82
00:04:20,910 --> 00:04:22,150
Peak values will change.

83
00:04:22,170 --> 00:04:22,560
OK.

84
00:04:22,860 --> 00:04:27,180
You can change this as in the tuning of PD controllers.
