Hello everyone.
Welcome to lab 7 R C servo.
Here are some servo uses servos are used in robotics and automation.
These And each joint on the server are servo or the robot.
You can see it's got every joint has a servo and what it uses to control a robot to give it however
may servo's it has.
Example here this robot it's got six different servos which allows six different degrees of motion.
And this here on the right is the remote control plane which is what we'll be using in our lab today
as an actual RCA servo which is using remote control planes remote control cars and things of that nature
to control servo.
They use this technique called Pulse with modulation.
If you look here on the screen you'll see we've got a signal and the signal that comes in it brings
a has to come at a specific frequency.
And then right here it is dictated at a 10 to 20 milliseconds.
You have to.
That gives you your period there or the frequency you need which is going to be specified in the servo
data sheet you use.
And so for each different pulse with modulation percent or for the amount of time that it's a logic
high year service is going to go in a different direction.
So this here is not applicable to ours but just kind of gives you an idea if you're high for one no
second year.
R C servo arm is going to be to the to the left at a minimum value.
And if it's high for 1.5 milliseconds proxy server is going to be at the center value or if you're high
for two milliseconds you're RNC service is going to be at the maximum value of the servo that the RC
server that I'm using for this lab is from Radio Shack and here's a picture of the datasheet or just
kind of walk through it here.
It tells you that the voltage justification is between 4.8 and 6 volts which you're probably wondering
the basis to board that I'm using to control it only it runs at 3.3 volts.
So if I were to take and hook this servo directly up to my base to board it wouldn't work it wouldn't
be able to.
Three four point three volts would not be recognized by this.
So we're going to have to create a circuit on here.
Or designed to take our 3.3 volt signal and create it into a FEIBEL signal.
And it also gives you the torque speed size and weight of your servo and they use single meaning that
this circuit has a total range of less than 160 degrees.
And then it tells you there you can you can see it tells us what we need to have a pulse with modulation
signal that has a frequency of 50 hers and the angle of the RC servo is directly relative to the logic
high up on the table there you can see it 0.6 milliseconds a degree of zero a logic high for 0.9 no
seconds gives you a 30 degree angle and so on and so forth.
And so I mean table up here which shows you the the difference the different duration of your logic
horizon and compares that to the air gives you a hexadecimal value.
So for the logic high for zero point six seconds since in our design we're going to be using an 8 8
bits resolution so the hexadecimal value for that would be 0 8 and for 0.9 seconds the hexadecimal value
for that would be zero of B.
And this is to give you a reference on the basis to board when you're clicking on the buttons to change
the resolution of your sort of a controller.
You can see the duration of logic high and you can relate it to the datasheet to see that you're getting
that actual specified angle
here is a S R C servo diagram design and B R C servo BICI that a big box is dotted around the outside.
That is the what we would call the top level VHDL file that is like your main project file you're going
to have in your in your project here and inside that design we've got two other VHDL designs.
We've got that Polsce with modulation that Peto you got VHDL component which is what you're going to
have to create in order to make this lab work.
And we've got the hecks to seven segment component here which you should have created in lab 4.
So you can just pull that right and you shouldn't have to modify anything if you've got that working.
You just have to map it to your date of resolute resolution and register we have said here and you're
also going to have to create an add or subtract process and add or subtract process to count.
Count your button presses and then take those values and put them into the 8 bit resolution register
and you also have two switches to determine whether it's an add or subtract process and a select if
it's enabled or not enabled.
And then your three point three output coming out of Bass's to board is going to have to go through
a circuit or a step that up to 5 volt output which then in turn will go on to your RCA servo to the
output there.
So this is definitely designed you can do a screen capture on and get a picture of when you want to
use this to help you as you start architecting and putting everything together.
And here is a three point three to five all level shifting circuit already provided for you if you have
a different way of doing this.
Maybe you have a specific I see that takes a 3.3 people and converts it up to five all single then you
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
don't have to do this either.
So but if you don't if you're like me and you've got a FEIBEL servo controlling with the three point
people signal Here's a simple circuit you can use to do that.
I'm not going to go through the specifics of how this works that's a whole other course an electronic
circuit design but basically you can see the three point 3PL you bring that in and connected to your
one k ohm resistor and two or two and thirty nine or four transistor which then the collector on that
is connected to the another one resistor which is connected to the base of a second two and thirty nine
for transistor where both of their emitters are connected to ground and B.
Now it's important to know that on your second transistor that the five ought out is coming out of you
need to have 100 ohm 150 or somewhere in that range a lot smaller resistor because you want to make
sure that you've got the current to supply the RC servo.
If you have too high a value like if you put a 10K resistor in there your servos just kind of chatter
and it'll it'll be pretty messy and you try to figure out what's going on.
So make sure you look at these values closely and follow this circuit set up exactly.
So here's the tasks for our RC servo lab.
You're going to create a pulse with modulation design using model sim to help you debug which I'll be
giving you a test bench if you download the lab 7 file folders that folder.
You'll have a pulse pole small with modulation design.
Sorry about that.
I'll give you a testbench in there and a tool command line file to help automate that process.
And then you're gonna have to create a project in IMC and implement all the different parts of the RC
servo controller.
Patricia you previously on the diagram there and then as an extra if you can see if you can modify the
ECF file and have it control the brightness of an LCD
some hints here to get you started start by.
First off you want to start by creating your Holsworth with modulation design using a test pulse with
modulation dot the file I give you.
You're going to want to test this because if this doesn't work then when you go ahead and try and create
your design you're going to have all kinds of problems like nothing's going to work for you and you're
sitting there just spinning your wheels trying to hear what's going on.
So make sure that this pulse with modulation designed you create once you measure that work you can
verify that works.
Everything else we want the other parts have created in different labs so it should just be kind of
wire things together and getting it to go.
And then another thing you can do is take all our stuff from the previous lab such as the counter and
the Nexus 7 segment display and see if you can put those together to get it where when you push a button
you can get the results to display on the 7:7 displays.
And once you get those two parts done at that point it should be relatively easy for you just kind of
wire the thing together and use the references I gave you in previous lectures to figure it all out.
Here you see a file I give you the pin mappings are you've got your ADD right here you can see on the
far left that switch if you have a high or low is going to dictate whether you're adding or subtracting
values and then your switch on the far right enables your pulse with modulation output.
So if you could give that a logic high your pulse modulation output will go to zero if you get a logic
one.
It'll output whatever value you have and resolution register and then you're sent out.
There's going to be the 8 bit
8 bits of resolution you have in the resolution or register those we map to the seven Sigma display.
As you can see circuit here.
And then you've got the two buttons there that start reset buttons.
If you click on those as they're going to add different values such as ones or one or five when you
click on those you're going to see here your values go up and down based upon whichever one you click
and then the top up there you can see you've got the pulse with modulation output and that you're going
to want to wire directly into your RC servo pulse with modulation input when you look at the datasheet
on the RC servo it's going to tell you what you need to connect your voltage waiting to connect the
ground and what you need to connect to the your control your modulator input and the outcomes of this
lab.
Or that you should be able to understand how multiple VHDL designs can be reused in multiple VHDL designs
which this is very useful.
You'll come to find out that as we create a library visit Zeins you'll be using an array using them
all over the place so it's definitely useful to keep these and have them handy and you'll become more
comfortable with using model sim as you design your pulse with modulation component.
You're pretty much having to come from the ground up on mass so you're going to use model assumed to
verify and make sure everything's happening just as as you'd like.
And also you got to understand how to control an RC servo motor using external components which is where
we're using the transistors resistors and things like that.
Take a 3.3 volt signal and convert it up to 5 volts signal and you're learning how to create a pulse
with modulation design implementation in VHDL.
There are other ways you can do this.
You can use a microcontroller or you can use your own transistors and just a 555 timer and a whole slew
of different ways.
But this is one of the ways we can do it.
And we're going to learn how.