﻿1
00:00:00,580 --> 00:00:01,300
‫Welcome back.

2
00:00:01,750 --> 00:00:09,070
‫I think that the best way to do this section is by briefly looking at what we had previously done in

3
00:00:09,070 --> 00:00:11,980
‫implementing the NPC controller to the vehicle.

4
00:00:12,460 --> 00:00:19,410
‫And then in parallel to that, we will look at how to implement these steps in the other case.

5
00:00:20,140 --> 00:00:28,480
‫That way you will see the similarities and the differences that would appear in this process of implementing

6
00:00:28,480 --> 00:00:30,840
‫the NPC controller to the UAE.

7
00:00:31,630 --> 00:00:36,340
‫So in case of the vehicle, we followed a similar process.

8
00:00:36,970 --> 00:00:42,970
‫We first hand our equations of motion in the lateral direction.

9
00:00:44,050 --> 00:00:51,790
‫Then we transformed them into the state's base equations, those states base equations were used in

10
00:00:51,790 --> 00:00:53,060
‫the plant of the vehicle.

11
00:00:53,950 --> 00:01:01,210
‫However, when it came to the NPC controller, we had to put these equations in the.

12
00:01:02,130 --> 00:01:05,280
‫Continues LTI system for.

13
00:01:06,370 --> 00:01:19,420
‫Or continuous linear time invariant form this LTI form of the state base equations was a special state

14
00:01:19,420 --> 00:01:26,660
‫space form in which you first put your state's space equations in this form.

15
00:01:27,640 --> 00:01:37,660
‫This one here where your state of vector, the control input vector, the output vector and then the

16
00:01:37,660 --> 00:01:40,240
‫time derivative of your state vector.

17
00:01:41,180 --> 00:01:43,410
‫They are all as a function of time.

18
00:01:44,560 --> 00:01:49,570
‫And then you made the assumptions possible in the systems states based equations.

19
00:01:50,640 --> 00:02:00,360
‫In order to make sure that the Matrixes, A, B, C and D will be completely constant as a function

20
00:02:00,360 --> 00:02:04,970
‫of time, you did not want these mattresses to change at all.

21
00:02:06,110 --> 00:02:13,340
‫And so when you're A, B, C and D matrices are completely constant in terms of time, then your system

22
00:02:13,340 --> 00:02:17,250
‫is in the LTI state space form.

23
00:02:18,290 --> 00:02:23,900
‫And once you have your system in the continuous LTI form, you have to democratize it.

24
00:02:24,800 --> 00:02:27,570
‫You would get your discrete LTI system.

25
00:02:28,520 --> 00:02:32,980
‫The main difference between the continuous and discrete system was the following.

26
00:02:34,010 --> 00:02:40,070
‫This was the continuous form here and this would be the discrete form here.

27
00:02:41,130 --> 00:02:50,250
‫The continuous LTI system gives you the time, derivatives of your status as a function of time, and

28
00:02:50,250 --> 00:02:57,120
‫then the discreetness system gives you a new state at K plus one.

29
00:02:57,360 --> 00:02:58,010
‫All right.

30
00:02:58,830 --> 00:03:05,210
‫So when you have a continuous form, you get a time derivative of your state as a function of time.

31
00:03:05,640 --> 00:03:12,330
‫And when you have a discrete form, then you get a new state, another time derivative of the state,

32
00:03:12,340 --> 00:03:19,200
‫but a new state at K plus one at one time, sample later.

33
00:03:20,170 --> 00:03:28,630
‫Because remember, now you don't have continuous time, you have time samples here and also that this

34
00:03:28,630 --> 00:03:32,100
‫critize states based system has different matrices.

35
00:03:32,110 --> 00:03:37,390
‫You have A sub D, B, sub DC, sub D and disturbed.

36
00:03:38,560 --> 00:03:45,370
‫In the previous course, I showed you how to derive the equations for these discrete matrices using

37
00:03:45,370 --> 00:03:47,230
‫the forward oilor method.

38
00:03:48,310 --> 00:03:56,770
‫The formulas that we have got were the following aid equals the identity matrix, plus the continuous

39
00:03:56,770 --> 00:04:01,270
‫a matrix times the time sample interval.

40
00:04:02,350 --> 00:04:08,350
‫Then BD was the continuous B matrix times the time sample interval.

41
00:04:09,470 --> 00:04:16,550
‫Then KDDI was equal to continue C and the D was equal to continues D.

42
00:04:17,470 --> 00:04:19,930
‫And then after that step.

43
00:04:20,980 --> 00:04:28,200
‫We use our discrete A, B, C and D matrices in the NPC control technique.

44
00:04:29,350 --> 00:04:35,800
‫Now, the DBE Matrix, and then they did Matrix, they were Xeros.

45
00:04:36,970 --> 00:04:46,870
‫Because remember the vector Y in the continuous form and also in the discrete form, it was our output

46
00:04:46,870 --> 00:04:56,230
‫vector and in our case and in most cases, the outputs are simply the states chosen in order to compare

47
00:04:56,230 --> 00:04:57,900
‫them with reference values.

48
00:04:58,780 --> 00:05:05,020
‫You would only need a D matrix if your output was some kind of mix between the states and the control

49
00:05:05,020 --> 00:05:05,540
‫inputs.

50
00:05:06,400 --> 00:05:09,360
‫For example, let's say that this is your state vector.

51
00:05:09,880 --> 00:05:13,600
‫You have one element X1 and then you have X2.

52
00:05:13,600 --> 00:05:20,770
‫And let's say that it's transposed because it's a common vector and let's say that you choose X one

53
00:05:20,770 --> 00:05:30,130
‫to be your output and then your output, which is X1 would be a matrix, which in this case would just

54
00:05:30,130 --> 00:05:41,380
‫be a role vector one and zero, and then you would multiply by the state vector x1 and X to.

55
00:05:42,340 --> 00:05:45,370
‫And this would be your see matrix, of course.

56
00:05:46,390 --> 00:05:55,600
‫And so this SI matrix would extract X one from this state vector, and that would become your output.

57
00:05:56,760 --> 00:06:02,040
‫And then obviously, you don't need anything from here, so your deal would be zero.

58
00:06:03,140 --> 00:06:11,900
‫You don't need to extract anything from the control input vector here, but then let's say that again,

59
00:06:11,900 --> 00:06:15,650
‫your state vector is X1 and X2.

60
00:06:15,770 --> 00:06:26,230
‫You have two states and then you control input vector is you one and you two, which is also common

61
00:06:26,240 --> 00:06:26,840
‫vector.

62
00:06:27,890 --> 00:06:34,520
‫But let's say that you want your output to be a mix of your state and control inputs and let's call

63
00:06:34,520 --> 00:06:40,820
‫it X and asterisk, then, for example, you could have something like this.

64
00:06:41,060 --> 00:06:43,630
‫You have to here you have five here.

65
00:06:44,030 --> 00:06:46,790
‫This would be your C matrix, of course.

66
00:06:47,790 --> 00:06:56,580
‫And then you multiply by your state vector and plus then you have something else here, one and two,

67
00:06:56,910 --> 00:07:07,050
‫so that would be your D matrix and you multiply it by you one and you two, which are your control inputs

68
00:07:08,100 --> 00:07:21,780
‫and then your output X asterisk would be two times X one plus five times X two plus one times you one

69
00:07:21,780 --> 00:07:24,870
‫and plus two times you two.

70
00:07:25,830 --> 00:07:34,560
‫So you see now your output is some kind of mix of your X one X two states and then you want and you

71
00:07:34,570 --> 00:07:35,940
‫to control inputs.

72
00:07:37,110 --> 00:07:40,980
‫But this kind of thing almost never happens in control engineering.

73
00:07:40,980 --> 00:07:51,390
‫In most cases, the outputs are simply states that you extract from the state vector because you have

74
00:07:51,390 --> 00:07:57,180
‫to compare that state against your reference value.

75
00:07:57,180 --> 00:07:59,430
‫X1 are.

76
00:08:00,390 --> 00:08:04,560
‫And therefore, in most cases, your democracies are zero.

