﻿1
00:00:01,680 --> 00:00:02,500
Hello everyone.

2
00:00:02,500 --> 00:00:06,910
Welcome to lab 7 R C servo.

3
00:00:07,270 --> 00:00:13,710
Here are some servo uses servos are used in robotics and automation.

4
00:00:13,830 --> 00:00:18,760
These And each joint on the server are servo or the robot.

5
00:00:18,810 --> 00:00:25,150
You can see it's got every joint has a servo and what it uses to control a robot to give it however

6
00:00:25,270 --> 00:00:26,730
may servo's it has.

7
00:00:26,760 --> 00:00:33,330
Example here this robot it's got six different servos which allows six different degrees of motion.

8
00:00:33,360 --> 00:00:40,700
And this here on the right is the remote control plane which is what we'll be using in our lab today

9
00:00:40,980 --> 00:00:47,460
as an actual RCA servo which is using remote control planes remote control cars and things of that nature

10
00:00:48,900 --> 00:00:50,370
to control servo.

11
00:00:50,370 --> 00:00:54,140
They use this technique called Pulse with modulation.

12
00:00:54,240 --> 00:01:01,920
If you look here on the screen you'll see we've got a signal and the signal that comes in it brings

13
00:01:01,920 --> 00:01:05,110
a has to come at a specific frequency.

14
00:01:05,310 --> 00:01:09,680
And then right here it is dictated at a 10 to 20 milliseconds.

15
00:01:09,750 --> 00:01:11,090
You have to.

16
00:01:11,250 --> 00:01:16,910
That gives you your period there or the frequency you need which is going to be specified in the servo

17
00:01:16,920 --> 00:01:18,240
data sheet you use.

18
00:01:18,420 --> 00:01:25,110
And so for each different pulse with modulation percent or for the amount of time that it's a logic

19
00:01:25,110 --> 00:01:29,200
high year service is going to go in a different direction.

20
00:01:29,370 --> 00:01:35,270
So this here is not applicable to ours but just kind of gives you an idea if you're high for one no

21
00:01:35,280 --> 00:01:36,690
second year.

22
00:01:36,710 --> 00:01:42,380
R C servo arm is going to be to the to the left at a minimum value.

23
00:01:42,480 --> 00:01:49,230
And if it's high for 1.5 milliseconds proxy server is going to be at the center value or if you're high

24
00:01:49,230 --> 00:01:56,760
for two milliseconds you're RNC service is going to be at the maximum value of the servo that the RC

25
00:01:56,760 --> 00:02:03,660
server that I'm using for this lab is from Radio Shack and here's a picture of the datasheet or just

26
00:02:03,660 --> 00:02:05,060
kind of walk through it here.

27
00:02:05,340 --> 00:02:13,470
It tells you that the voltage justification is between 4.8 and 6 volts which you're probably wondering

28
00:02:13,470 --> 00:02:18,090
the basis to board that I'm using to control it only it runs at 3.3 volts.

29
00:02:18,090 --> 00:02:25,410
So if I were to take and hook this servo directly up to my base to board it wouldn't work it wouldn't

30
00:02:25,410 --> 00:02:26,890
be able to.

31
00:02:27,120 --> 00:02:30,310
Three four point three volts would not be recognized by this.

32
00:02:30,300 --> 00:02:33,270
So we're going to have to create a circuit on here.

33
00:02:33,300 --> 00:02:40,770
Or designed to take our 3.3 volt signal and create it into a FEIBEL signal.

34
00:02:41,010 --> 00:02:48,570
And it also gives you the torque speed size and weight of your servo and they use single meaning that

35
00:02:49,200 --> 00:02:53,610
this circuit has a total range of less than 160 degrees.

36
00:02:54,120 --> 00:03:00,390
And then it tells you there you can you can see it tells us what we need to have a pulse with modulation

37
00:03:00,390 --> 00:03:09,750
signal that has a frequency of 50 hers and the angle of the RC servo is directly relative to the logic

38
00:03:09,750 --> 00:03:20,070
high up on the table there you can see it 0.6 milliseconds a degree of zero a logic high for 0.9 no

39
00:03:20,070 --> 00:03:24,030
seconds gives you a 30 degree angle and so on and so forth.

40
00:03:24,420 --> 00:03:35,160
And so I mean table up here which shows you the the difference the different duration of your logic

41
00:03:35,160 --> 00:03:39,300
horizon and compares that to the air gives you a hexadecimal value.

42
00:03:39,450 --> 00:03:46,230
So for the logic high for zero point six seconds since in our design we're going to be using an 8 8

43
00:03:46,260 --> 00:03:55,230
bits resolution so the hexadecimal value for that would be 0 8 and for 0.9 seconds the hexadecimal value

44
00:03:55,230 --> 00:03:57,600
for that would be zero of B.

45
00:03:57,810 --> 00:04:03,090
And this is to give you a reference on the basis to board when you're clicking on the buttons to change

46
00:04:03,090 --> 00:04:06,410
the resolution of your sort of a controller.

47
00:04:06,540 --> 00:04:12,480
You can see the duration of logic high and you can relate it to the datasheet to see that you're getting

48
00:04:12,480 --> 00:04:14,890
that actual specified angle

49
00:04:17,610 --> 00:04:30,870
here is a S R C servo diagram design and B R C servo BICI that a big box is dotted around the outside.

50
00:04:30,870 --> 00:04:37,770
That is the what we would call the top level VHDL file that is like your main project file you're going

51
00:04:37,770 --> 00:04:46,650
to have in your in your project here and inside that design we've got two other VHDL designs.

52
00:04:46,790 --> 00:04:53,100
We've got that Polsce with modulation that Peto you got VHDL component which is what you're going to

53
00:04:53,100 --> 00:04:56,190
have to create in order to make this lab work.

54
00:04:56,400 --> 00:05:04,680
And we've got the hecks to seven segment component here which you should have created in lab 4.

55
00:05:04,770 --> 00:05:09,610
So you can just pull that right and you shouldn't have to modify anything if you've got that working.

56
00:05:09,900 --> 00:05:17,220
You just have to map it to your date of resolute resolution and register we have said here and you're

57
00:05:17,220 --> 00:05:25,550
also going to have to create an add or subtract process and add or subtract process to count.

58
00:05:25,740 --> 00:05:33,690
Count your button presses and then take those values and put them into the 8 bit resolution register

59
00:05:34,110 --> 00:05:40,350
and you also have two switches to determine whether it's an add or subtract process and a select if

60
00:05:40,350 --> 00:05:42,330
it's enabled or not enabled.

61
00:05:42,660 --> 00:05:47,130
And then your three point three output coming out of Bass's to board is going to have to go through

62
00:05:47,130 --> 00:05:55,410
a circuit or a step that up to 5 volt output which then in turn will go on to your RCA servo to the

63
00:05:55,410 --> 00:05:55,980
output there.

64
00:05:55,980 --> 00:06:00,420
So this is definitely designed you can do a screen capture on and get a picture of when you want to

65
00:06:00,420 --> 00:06:07,770
use this to help you as you start architecting and putting everything together.

66
00:06:07,770 --> 00:06:14,850
And here is a three point three to five all level shifting circuit already provided for you if you have

67
00:06:14,850 --> 00:06:15,990
a different way of doing this.

68
00:06:15,990 --> 00:06:23,010
Maybe you have a specific I see that takes a 3.3 people and converts it up to five all single then you

69
00:06:23,000 --> 00:06:29,010
don't you don't need to use this or if you have an RC server that accepts the 3.3 bold input then you

70
00:06:29,010 --> 00:06:30,370
don't have to do this either.

71
00:06:30,400 --> 00:06:36,750
So but if you don't if you're like me and you've got a FEIBEL servo controlling with the three point

72
00:06:36,750 --> 00:06:42,090
people signal Here's a simple circuit you can use to do that.

73
00:06:42,150 --> 00:06:46,620
I'm not going to go through the specifics of how this works that's a whole other course an electronic

74
00:06:46,620 --> 00:06:53,640
circuit design but basically you can see the three point 3PL you bring that in and connected to your

75
00:06:53,640 --> 00:07:02,760
one k ohm resistor and two or two and thirty nine or four transistor which then the collector on that

76
00:07:02,760 --> 00:07:08,850
is connected to the another one resistor which is connected to the base of a second two and thirty nine

77
00:07:09,060 --> 00:07:14,850
for transistor where both of their emitters are connected to ground and B.

78
00:07:14,890 --> 00:07:20,790
Now it's important to know that on your second transistor that the five ought out is coming out of you

79
00:07:20,790 --> 00:07:28,350
need to have 100 ohm 150 or somewhere in that range a lot smaller resistor because you want to make

80
00:07:28,350 --> 00:07:32,010
sure that you've got the current to supply the RC servo.

81
00:07:32,010 --> 00:07:39,210
If you have too high a value like if you put a 10K resistor in there your servos just kind of chatter

82
00:07:39,300 --> 00:07:42,390
and it'll it'll be pretty messy and you try to figure out what's going on.

83
00:07:42,390 --> 00:07:51,510
So make sure you look at these values closely and follow this circuit set up exactly.

84
00:07:51,540 --> 00:07:55,580
So here's the tasks for our RC servo lab.

85
00:07:55,650 --> 00:08:01,440
You're going to create a pulse with modulation design using model sim to help you debug which I'll be

86
00:08:01,440 --> 00:08:07,690
giving you a test bench if you download the lab 7 file folders that folder.

87
00:08:07,740 --> 00:08:13,560
You'll have a pulse pole small with modulation design.

88
00:08:13,560 --> 00:08:15,100
Sorry about that.

89
00:08:15,300 --> 00:08:20,880
I'll give you a testbench in there and a tool command line file to help automate that process.

90
00:08:20,880 --> 00:08:26,910
And then you're gonna have to create a project in IMC and implement all the different parts of the RC

91
00:08:26,910 --> 00:08:28,060
servo controller.

92
00:08:28,190 --> 00:08:34,710
Patricia you previously on the diagram there and then as an extra if you can see if you can modify the

93
00:08:34,710 --> 00:08:38,390
ECF file and have it control the brightness of an LCD

94
00:08:41,370 --> 00:08:45,260
some hints here to get you started start by.

95
00:08:45,260 --> 00:08:52,170
First off you want to start by creating your Holsworth with modulation design using a test pulse with

96
00:08:52,170 --> 00:08:55,790
modulation dot the file I give you.

97
00:08:56,340 --> 00:09:01,650
You're going to want to test this because if this doesn't work then when you go ahead and try and create

98
00:09:01,650 --> 00:09:06,130
your design you're going to have all kinds of problems like nothing's going to work for you and you're

99
00:09:06,930 --> 00:09:09,150
sitting there just spinning your wheels trying to hear what's going on.

100
00:09:09,150 --> 00:09:16,320
So make sure that this pulse with modulation designed you create once you measure that work you can

101
00:09:16,320 --> 00:09:17,330
verify that works.

102
00:09:17,340 --> 00:09:22,020
Everything else we want the other parts have created in different labs so it should just be kind of

103
00:09:22,020 --> 00:09:24,950
wire things together and getting it to go.

104
00:09:25,230 --> 00:09:30,570
And then another thing you can do is take all our stuff from the previous lab such as the counter and

105
00:09:30,570 --> 00:09:36,450
the Nexus 7 segment display and see if you can put those together to get it where when you push a button

106
00:09:36,480 --> 00:09:40,890
you can get the results to display on the 7:7 displays.

107
00:09:41,010 --> 00:09:46,260
And once you get those two parts done at that point it should be relatively easy for you just kind of

108
00:09:46,740 --> 00:09:52,330
wire the thing together and use the references I gave you in previous lectures to figure it all out.

109
00:09:54,430 --> 00:10:03,250
Here you see a file I give you the pin mappings are you've got your ADD right here you can see on the

110
00:10:03,250 --> 00:10:09,370
far left that switch if you have a high or low is going to dictate whether you're adding or subtracting

111
00:10:09,850 --> 00:10:16,390
values and then your switch on the far right enables your pulse with modulation output.

112
00:10:16,420 --> 00:10:22,840
So if you could give that a logic high your pulse modulation output will go to zero if you get a logic

113
00:10:22,840 --> 00:10:23,500
one.

114
00:10:23,530 --> 00:10:29,220
It'll output whatever value you have and resolution register and then you're sent out.

115
00:10:29,270 --> 00:10:32,170
There's going to be the 8 bit

116
00:10:35,260 --> 00:10:41,150
8 bits of resolution you have in the resolution or register those we map to the seven Sigma display.

117
00:10:41,200 --> 00:10:42,930
As you can see circuit here.

118
00:10:43,150 --> 00:10:48,460
And then you've got the two buttons there that start reset buttons.

119
00:10:48,640 --> 00:10:55,000
If you click on those as they're going to add different values such as ones or one or five when you

120
00:10:55,000 --> 00:11:01,600
click on those you're going to see here your values go up and down based upon whichever one you click

121
00:11:02,020 --> 00:11:08,260
and then the top up there you can see you've got the pulse with modulation output and that you're going

122
00:11:08,260 --> 00:11:15,310
to want to wire directly into your RC servo pulse with modulation input when you look at the datasheet

123
00:11:15,370 --> 00:11:20,350
on the RC servo it's going to tell you what you need to connect your voltage waiting to connect the

124
00:11:20,350 --> 00:11:28,810
ground and what you need to connect to the your control your modulator input and the outcomes of this

125
00:11:28,810 --> 00:11:29,410
lab.

126
00:11:29,780 --> 00:11:37,030
Or that you should be able to understand how multiple VHDL designs can be reused in multiple VHDL designs

127
00:11:37,040 --> 00:11:39,290
which this is very useful.

128
00:11:39,290 --> 00:11:44,410
You'll come to find out that as we create a library visit Zeins you'll be using an array using them

129
00:11:44,830 --> 00:11:51,370
all over the place so it's definitely useful to keep these and have them handy and you'll become more

130
00:11:51,370 --> 00:11:57,470
comfortable with using model sim as you design your pulse with modulation component.

131
00:11:57,690 --> 00:12:01,770
You're pretty much having to come from the ground up on mass so you're going to use model assumed to

132
00:12:01,780 --> 00:12:07,050
verify and make sure everything's happening just as as you'd like.

133
00:12:07,600 --> 00:12:13,180
And also you got to understand how to control an RC servo motor using external components which is where

134
00:12:13,180 --> 00:12:16,900
we're using the transistors resistors and things like that.

135
00:12:16,900 --> 00:12:24,430
Take a 3.3 volt signal and convert it up to 5 volts signal and you're learning how to create a pulse

136
00:12:24,490 --> 00:12:27,720
with modulation design implementation in VHDL.

137
00:12:27,730 --> 00:12:29,140
There are other ways you can do this.

138
00:12:29,140 --> 00:12:38,080
You can use a microcontroller or you can use your own transistors and just a 555 timer and a whole slew

139
00:12:38,080 --> 00:12:38,710
of different ways.

140
00:12:38,710 --> 00:12:40,560
But this is one of the ways we can do it.

141
00:12:40,600 --> 00:12:42,520
And we're going to learn how.

