1
00:00:00,870 --> 00:00:04,710
What is a vending machine controller and how can we design that?

2
00:00:04,740 --> 00:00:07,700
Nicholas, this lecture will cope with this question.

3
00:00:12,000 --> 00:00:19,260
Several electronic automated systems, such as vending machine dishwashers and robots, to name a few,

4
00:00:19,380 --> 00:00:27,720
are working by going through several tasks or states based on the input, data or settings adjusted

5
00:00:27,720 --> 00:00:28,460
by users.

6
00:00:29,280 --> 00:00:34,650
They usually utilize digital controllers to guide the machine throughout their state's.

7
00:00:36,240 --> 00:00:40,220
It the state machine is a common way to model these controllers.

8
00:00:40,740 --> 00:00:48,060
The control process of all these examples consists of a few states and the controller can only go from

9
00:00:48,060 --> 00:00:54,930
one state to another if it receives the correct inputs and only a set of acceptable state transitions

10
00:00:54,930 --> 00:00:55,650
are possible.

11
00:00:58,390 --> 00:01:06,760
Here we take a simplified controller for a vending machine as an example to describe that this machine

12
00:01:06,760 --> 00:01:09,580
sells candy bars for twenty five cents.

13
00:01:10,900 --> 00:01:19,810
The inputs are nickel and diming and cautery, indicating the type of coin that was deposited, the

14
00:01:19,810 --> 00:01:26,020
circuit controller responses with the outputs, can they underscore out to dispense a candy bar, plus

15
00:01:26,200 --> 00:01:32,140
nickel underscore out or dayme underscore out, asserted when change is due?

16
00:01:34,020 --> 00:01:41,580
The controller has another input named thanks, underscoring this input is asserted when you take your

17
00:01:41,580 --> 00:01:46,710
candy and check, it resets the system ready for the next candy request.

18
00:01:50,590 --> 00:01:52,370
Let's throw the finite state machine.

19
00:01:53,350 --> 00:02:00,210
The controller starts at the state e0 zero, if you put a nickel coin, it goes to the eighty five state.

20
00:02:00,820 --> 00:02:04,630
If you put a dime coin, it goes to the Stenness state.

21
00:02:05,050 --> 00:02:09,080
And if you put a quarter coin, it goes to the state 25 state.

22
00:02:10,150 --> 00:02:13,180
Now let's assume the controller is in city five.

23
00:02:13,930 --> 00:02:16,840
If you put a nickel coin, it goes to Stan.

24
00:02:17,680 --> 00:02:25,090
If you put a dime coin, it goes to S.T. 15, and if we put a quarter coin, it goes to ESTIE 30.

25
00:02:26,680 --> 00:02:29,470
Now, let's assume the controller is in city 10.

26
00:02:30,310 --> 00:02:33,100
If you put a nickel coin, it goes to city 15.

27
00:02:33,820 --> 00:02:41,440
If we put a dime coin, it goes to ESTIE 20, and if we put a quarter coin, it goes to ESTIE 35.

28
00:02:43,270 --> 00:02:50,890
Now, let's assume the controller is in city 15, if you put a nickel coin, it goes to ESTIE 20, if

29
00:02:50,890 --> 00:02:57,310
you put a dime coin, it goes to S.T. 25, and if you put a quarter coin, it goes to E40.

30
00:02:58,210 --> 00:03:00,760
Now, let's assume the controller is in a state 20.

31
00:03:01,360 --> 00:03:04,110
If you put a nickel coin, it goes to a city 25.

32
00:03:04,750 --> 00:03:07,380
If you put a dime coin, it goes to city 30.

33
00:03:07,990 --> 00:03:11,680
And if you put a quarter coin, it goes to ESTIE 45.

34
00:03:15,050 --> 00:03:21,950
Now, let's assume the controller is in a state 25, then the machine gives you a candy and the controller

35
00:03:22,100 --> 00:03:26,000
goes to state a suite waiting for you to take the candy.

36
00:03:26,960 --> 00:03:33,260
Now, if the controller is not 30, then the machine gives you a candy and then they kill and the controller

37
00:03:33,260 --> 00:03:36,560
goes to state as wait, waiting for you to take the candy.

38
00:03:37,250 --> 00:03:44,090
Now, if the controller is in C 35, then the machine gives you a candy and a dime and the controller

39
00:03:44,240 --> 00:03:47,570
goes to a state suite waiting for you to take the candy.

40
00:03:48,600 --> 00:03:55,050
Now, if the controller is in difficulty, then the machine gives you a candy, a nickel and a dime

41
00:03:55,470 --> 00:04:00,000
and the controller goes to state a suerte waiting for you to take the country.

42
00:04:00,450 --> 00:04:07,260
Now, if the controller is in city 45, then the machine gives you a candy and two dimes and the controller

43
00:04:07,380 --> 00:04:11,340
goes to a state, a suite waiting for you to take the candy.

44
00:04:11,350 --> 00:04:18,110
If the controller is in a sweet and you take the candy and you change, the system goes to a state zero

45
00:04:18,270 --> 00:04:19,770
ready for the next purchase.

46
00:04:22,210 --> 00:04:28,120
In addition, the controller uses the system reset to reset the vending machine whenever it is a cost.

47
00:04:31,190 --> 00:04:37,430
How can we describe this, a state machine in the next lecture will implement this FSM, invite the

48
00:04:37,440 --> 00:04:38,020
socialist.

49
00:04:43,520 --> 00:04:45,080
These are our takeaway messages.

50
00:04:46,300 --> 00:04:52,590
The behavior of the most electronic automated system can be described by finite state machines, since

51
00:04:53,320 --> 00:04:59,500
drawing an accurate FSM with all the input and output details is the first step to design a digital

52
00:04:59,500 --> 00:05:01,330
controller for such systems.

53
00:05:04,900 --> 00:05:09,890
Now, the quiz question in our efforts and diagram, which states accept includes.
