Robot Arm & Controller - Building the DFRobot 5 DOF Robot Arm

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
today in the workshop I'll be building a DF robot five degree of freedom robotics arm after putting together the arm I'll show you how you can build a controller using an Arduino Nano and a PC a 96 85 pwm module so let me take you by the arm and welcome you to the workshop [Music] hello and welcome to the workshop today we're going to be working on a DF robotics five degree of freedom robotic arm now those of you who have been with the workshop for a while will know that this isn't the first robotic arm project I've worked on about a year and a half ago I built a me arm which is a small robotic arm that is really made for educational purposes and while the me arm is great it's inexpensive it teaches you all the components of a robotic arm it's not really that practical and arm it can't really lift too many things and the design of it makes it difficult to add sensors to the arm which is where you can really make a robotic arm turn from a toy to a useful tool now this robotics arm that we're going to build today from DF robotics is very different it's made of aluminum it uses heavy-duty servo motors it can lift an appreciable amount of weight and most importantly for me I can mount all kinds of sensors and things on it to really make some interesting robotic arm projects but those sensors and things are for a future video today what we are going to do is we are going to look at the parts of the arm and we're going to assemble it now this is a wonderful kit but one thing I should let you know that most of these robotic arm kits like this one don't really come with any instructions so what I'm going to do today is fill that gap I'm going to show you how to put this together step-by-step and you can follow along the video or on the article in the drone bot workshop comm website where I'll show you a step by step as well we're gonna build a rudimentary controller so we can control the arm and then from there we're gonna leave it and then go on to future things with the arm and later videos now before we get started I should mention that this arm was provided to me from DF robotics and I thank them very much for providing it I was in conversation with them I let them know how I've used some of their products before and we'll be using some other ones including a really neat four-wheel drive robot car base and I mentioned it would be great to be able to attach a robot arm onto that and lo and behold they sent me this so thank you very much dia for robotics for that so we're going to get started in a moment we're going to take look at what's inside the kit I'll show you a bit about the principle about how the arm works I've got the arm over here as you can see obviously so we'll show you the features of it and then we will build it so let's get going so all of the parts for the robot arm were packaged in this Orange Box and I've taken everything out of the box the only thing left in the box is an empty plastic bag and what I would assume to be my warranty card although not written in English so I can't really tell you but any rate here are the contents of the box and as you can see you get quite a bit of value in this box everything looks to be a pretty high quality too first of all we've got the five servo motors we've got two of these scr 0:01 these are high-tech hs3 11 servos so these are standard servo motors these are rated at about three and a half kilograms per centimeter and as you can see that's a nice high-tech servo these two motors are actually going to be used for the gripper then you've got these two big beasts over here these motors are DSS m15 motors that are actually made for DF robot these are metal gear motors and these are rated at 15 kilograms per centimeters so these are very strong motors I'm going to be using these for the elbow and the shoulder or base if you wish of the arm design and there's a fifth motor over here is also a DF robot motor this one is rated at about five kilograms per centimeter and this one's going to be used up around the wrist joint of the robot and it's a plastic yeards servo and all of the servos come course with all of the different appendages and horns and things like that the two can attach to them so leave a servo up here now this is a gripper itself and as you can see the gripper design over here it's designed to open and close on on you which is really kind of nice it's actually made so that you'll insert a servo motor into here and that you use a servo over here at the back of it so it's quite easy to put together and so the gripper and a couple of extra pads for the gripper comes in a little box here next you get four of these these are all-purpose servo brackets I can show you one of them over here and as you can see this is meant just to mount the servo motor like that and it's got a number of holes drilled and everything they use this pattern a lot to make the different brackets up to each other and also to make them up to the horn on the servo motor so these things are quite versatile then you'll get three of these long u brackets over here and I'll try to get one out for you though the height these are just simply u brackets again they've got the same pattern on them that you can use for mounting etc and they're going to be basically used to build the actual arm itself the actual appendage portion of the arm I'll just leave that up is hard to get back in this is a small little L bracket that you get and I'll be showing you what that's for that's basically to hold the top wrist servo bracket on you just use this L bracket and it's got the same pattern again on it that you'll be using to bolt things together they give you this wire sheathing over here you just make your wire neat because about a meter of that inside here I really like the way this one has been labeled this is a person's bearing kit now what a person's bearing kit actually really is is it's just a bearing along with a nut and a screw and a lock washer and you're going to be using that when you're mounting the servo motors you're going to mount the horn on when so the servo is turning one end like that the back of it is where this little bearing is going to be used and there's three of them in with the kit which is the correct number then you get a number of these little screws over here I think that's just basically for holding the horns on to the mounting brackets over here so you get a bunch of these tiny little self tapping screws and finally you get a number of these little m3 screws and nuts over here and that's basically for putting everything together for holding all the little metal brackets and that together you'll be using these screws as well as some of the screws and things that come with the servo motors and you'll notice I've had this here on my workbench because I was using this little servo tester just to test all of the servo motors and just to play with the the gripper to see how the motors and that work inside the gripper and it all seems like it's gonna go together pretty simply the parts are of pretty high quality these are all aluminum over here the motor seem to be pretty durable and they've got pretty strong torque ratings so all in all I think this is going to be a pretty good project so as you can see this arm consists of a number of pretty high quality parts and powerful servo motors and powerful servo motors are going to take an appreciable amount of current so one thing we should discuss before we get going on this arm is the power supply that you're going to need for those servos now you definitely absolutely cannot run the servos off the five volt supply from your Arduino so abandon that idea right away the current capability of the Arduino power supply is nowhere near what these servos are going to require also the servos are rated at maximum torque at 6 volts and not 5 volts although they will run on 5 volts you'd be better off using a 6 volt power supply something that has at least 2 amperes of capability would be ideal now if you don't have such beats the bench power supply or something like that a wall work that gives off six volts two amps you could always use a lantern battery now a lantern battery isn't the most ideal supply in the sense that of course it's going to get depleted and will need to be replaced but otherwise it's a source of pure DC and it does have the current capability that this arm will require now the sensors in the PC a 96 85 that I'm mounting on the arm those will be powered from the 5 volts in thereat we know so again I just want you to take into account that you're going to need to supply a decent power supply in order to run your robotic arm one term that is used when describing robotic arms is degrees of freedom and I want to discuss what that means because it can mean two different things the classical meaning of degree of freedom is from the perspective of an object from an object's perspective that can move forward or backwards it can move up or down and it can move to the left or to the right there are also three arcs that the object can travel in one of them is called roll there's also pitch and the third one is yaw these are six degrees of freedom and these are the classical six degrees of freedom used for Aeronautics those of you who work with quad copters are probably pretty familiar with this now with robotics arms degrees of freedom can mean a different thing a degree of freedom is essentially every movable joint in a robotic arm so our arm uses five movable joints with five motors and thus has five degrees of freedom there is the base the elbow the wrist the grip pivot and the grip jaws each of these is considered to be one degree of freedom in our robotic arm so I'm just about ready to build my robot arm I've got all of the parts taken out of there plastic bags for the most part and laid out on the workbench but all my servo motors here and their respective horns and attachments below them these are the motor mounts and you'll note that the motor mounts come with a set of the screws for holding them together these are larger screws and nuts than this package of nuts which is also to hold pieces together I've got that out here here's my little gripper I've also got the tools out that I'm going to be needing in order to assemble this arm now you don't need very much in order to put this all together in fact you don't even need everything I've got shown over here what you really need is a Phillips screwdriver I've got a couple of different sizes for the different size screws and a couple of set suppliers for the nuts I've also got a nut driver for these larger nuts over here but that's kind of optional in fact there's a lot of spots and assemble in the arm that it's probably going to be very difficult to get a nut driver in anyway so the fires will certainly suffice if you don't happen to have a nut driver another thing I should let you know is that I've already modified a couple of pieces of the arm these two large u brackets I've drilled a couple of holes in them and what that is for is that I intend to power these servo motors of my arm using the PC a 96 85 16 channel PWM driver which we've used before in my video about servo motors if you're not familiar with it at any rate these mounting holes are what I've drilled for the driver it's going to sit on the side of the arm over here and then I'll be able to plug the servo motors into here this is an i2c device I'm going to be placing another eye to see device on the arm as well this little device over here which is an MP u 6 0 5 0 now this is both a 3-axis gyroscope and a 3-axis accelerometer and so it's going to be very useful and interesting to measure the actual position in space of the top of the robot arm which is where I'm going to mount this I'm just going to use one of the existing mounting holes on the back of one of the motor brackets for this particular device now this is also I to see so it will connect to the pc a 96 85 very effectively so I can both send signals up from the Arduino to control the servo motors and I can also read back the information I'm getting from the accelerometer and gyroscope over here okay this is the gripper piece of course one of the other assemblies I'm going to be putting together now I'm just about ready to go with this but there is one other tool that I need to tell you about and it isn't sitting here on this workbench and what that tool is is a method of taking the servo motors and rotating their motor shaft into a specific position so that I can mount it into the robot arm now there are a number of different ways of doing that I've got my own method set up on the other workbench so let's take a quick look at that first and then we'll start constructing the actual D F robot 5 degree of freedom robot arm now one thing that you're going to need before you start building your robot arm is a method of controlling your servo motors you're going to want to do that both to test the servo motor and to be able to move the servo shaft into a specific position before assembling it into the robot arm itself now there's a number of ways you can do that what are the methods is this very simple little servo tester I've showed you this before in the video we did about servomotors now this is a $2.00 item that allows you to rotate a servo throughout its rotation and also to zero it and to sweep it back and forth so you can both test the servo and position the shaft in to a specific position before you put it into the robot arm another thing you could do is to use the Arduino knob sketch this is one of the demo sketches that comes with the Arduino IDE now we went over that one in the servo video as well and it's basically just used as an Arduino a potentiometer and you drive the servo from the Arduino with its own power supply thank you and you can again move the servo into any position you want now what I've got over here on a breadboard is an Arduino Nano and it's connected to five potentiometers and I'm also using a PC a 96 85 driver board this is a 16 Cannell pwm driver board and I'm going to be using this in my final design and that's why I'm using this and not connecting directly to the Arduino Nano otherwise I'm using the Nano to control this board and to control the 5 servo motors so I thought my servos over here and I can move the potentiometers and I can move the servos now I'm doing this both to test the servos to position the servo motors into the right place but also because I'm developing a controller for the arm that's going to use I to see and it's going to be based around the Nano so I'm bread boarding that as well but this is just the method that I am using right now just to test all my servo motors and to move them in the correct position before assembly so you'll need something similar to that as well and I'm not going to show you the hook of this right now but I will be showing you the hook up a little later on when I show you how to build the complete controller for your robot arm so it's about time to get started building this robotic arm now as I mentioned before there are not any instructions included in the kit so there are a number of ways you could ascend the arm what I'm about to show you is a sequence that I've determined through trial and error is the simplest way of getting the arm together but you may disagree and want it to put it together another way and that's the beauty of these kits is that you can do what you wish with the parts they've been provided but if you decide to follow the sequence I've followed it is as follows we're going to start off by assembling the gripper assembly because the assemblies already put together we really just need to put a couple of motors on it then after that we're going to work from the bottom up we're going to assemble the brackets that hold all the motors and the arm components themselves finally we are going to add the motors onto those individual sections and join the sections together and then we're going to put the gripper onto the arm so with that being said let's get started and assemble our gripper now the first section of our robot arm that we'll be putting together is the gripper assembly now the gripper itself has been preassembled and so you'll need this and you'll also need two of the high-tech hs3 eleven servo motors included with the kit and in addition you'll want to get a set screw for each of the servo motors you'll find that in the accessory pack that comes with the servos now the first motor you're going to want to put on is the one to twist the gripper back and forth and you'll want to open up your gripper so you can see this hole over here because that's the access point for your screwdriver and take one of your high-tech motors and place it on like this now I should mention that these motors have all been set for the fully counterclockwise position so that's very important so the fully counterclockwise position my gripper looks like this with the gripper assembly so to speak on the top of the servo motor over here and then what you'll need to do is what does that screw in now tighten it but don't over-tighten it that's very important okay now that you've got that on there is a second motor that gets mounted now this is the one that actually drives the mechanism that opens and closes the jaw on the gripper and if you play with that mechanism you'll notice that at one extreme of course it's closed and then you'll open it and then it actually goes to a point where it goes past that extreme and starts to close again you don't want to include that part in your motion so what you want to do is set this to it's fully open position before it starts to come back upon itself and then you'll take your servo motor and you want to install that under here you'll notice there's a hole for it you may need to move this a tiny bit just to mess it with the gears and then take your set screw and put that in now it's very important I found out the hard way that you do not over tighten this particular set screw my thought I had some detective servo motors but actually it turns out that they were just binding so I'm going to tighten that screw but not over tighten it and there is my assembly now you'll probably want to go back to your servo tester and verify that you can exercise the servos and move the jaws to open and closed and move this back and forth but otherwise this completes this assembly and we'll move on to the next one now the next piece we're going to put together is the base motor mount and it's quite simple there's only two parts are going to need you're going to need one of the multi-purpose servo brackets so take that and you're going to need the amusingly named person's bearing kit which consists of a screw a nut a lock washer and an actual bearing and so the assembly on this one is very easy what you do is you orient yourself so you're looking at the front of the motor mount so this is the front of the motor mount the motor is going to be facing up toward us and so that's the back and so on the back side you'll see a hole and you're going to put your person's bearing kit into that hole so insert the screw over here and then get the bearing itself now you'll notice the bearing has a flat end on it that needs to be flush with this bracket here so put it there and get myself a lock washer which goes on top of that and finally put the nut on top of this over here and so you're gonna want to tighten this one quite well it's going to take my screwdriver and my pliers for this and get that nice and tight now after you do you're going to want to make sure that the bearing is still without a little bit of movement on it and it does and so that's great that's the base motor mount assemble let's move on to the next component this next piece is also very easy to get together we're going to take two of the u brackets and put them together this is going to form the bottom section of our arm now what you're going to need are two of the long u brackets and you're going to need four of the screws that and the nuts that come from that bag of m3 screws and nuts so take four of those out now you'll notice on my u brackets they might look a little different than yours you'll see these little spacers as you recall I drilled some holes in these brackets because I'm going to be mounting my PC a 96 85 pwm controller on it so I drilled and I threaded the holes using my tap and die set and put a couple of these spacers in so of course you won't have that concern if you're not doing that but in my case I have to be careful that these both go on to the same side now these join very simply these screw holes at the bottom the four of them are how the screws are going to mate so you just simply put them both together and start putting screws in now once you've got all the four screws in you're going to want to tighten these and there you have it the bottom assembly with the 2w brackets so put this aside and we'll move on to the next component now the next assembly is the motor mount for the elbow motor as well as a couple of brackets and so we're going to need some pieces for this this is the multi-purpose servo mounting bracket like we used before this is the little L bracket does you'll notice one end of it is longer than the other pay attention to that and the remaining u bracket I also have the person's bearing kit again so the screw the lock washer the nut and the bearing plus I've got some screws here now four of these screws and nuts came with the L bracket the other four come from that bag of m3 screws and nuts so in total you're going to need eight of them now the first thing we're going to do is to do the same thing we did before we're going to put the person's bearing onto this motor holder over here and it's going to go in the same place if you look at at the front to the back left so let's put that in right now and once again we can tighten that one up okay that appears pretty tight now the next thing we're going to do is we're going to take this L bracket and mount it to the u bracket now take the short side of the L bracket and put it on to you back bracket it like a right angle to it over here again align the four holes up over here and we'll put some screws through I'm putting the screw so the screw head is on the L bracket side and once you get them in you're gonna want to tighten them all right now what you're going to want to do is to join these two pieces together so take the motor mount have it facing toward deal with the person's bearing on the back left and take this end of the l-brackets and put it underneath the motor mount like this line up the holes you get over here and put the screws through there and again I'm putting the screw head on the L bracket side and once again you're going to want to tighten these up good ok so we've got this assembly completed and now let's move on to the next one now for this next assembly we're going to take two of our motor mounts one is for the wrist motor mount and the other one is for the motor at the back of the gripper motor and so we'll need two of these multi-purpose servo brackets we're going to take the final one of our persons bearing kit so we've got that over here plus four of the screws and nuts from the bag that has the m3 screws and nuts so once again we're going to start with the person's bearing kit we'll take one of the motor mounts now in this case it's going in the opposite hole so looking at it from the front it's going to be on the right side as opposed to the way the other ones are done on the left so assemble the bearing kit as you before make sure that the flat end of the bearing is flush with this and once again you're going to want to tighten that up okay now looking at this first assembly take the second motor assembly turn it this way so that the motor would be facing off to the right and upside down and place it under this assembly now go and line up these holes over here and line it like this so it's going to be something like this and once again we're going to place four screws into this now it really doesn't matter what side you put the screw heads on and tighten everything up and there you go so this is going to be where the Arista motor mounts and this is going to be where the motor before the gripper mounts and so we've got this component completed now it's time to start hooking up a few of these things so now we're going to install the base motor now we will take the base motor assembly that we worked on earlier the one that already has the bearing on the back and we'll also take the dss m15 the 15 kilogram per centimeter torque metal geared servo motors that come with the kit there are two of them so take one of these motors now it's important that again you put this motor into what I'm calling the zero Degree position so use your servo tester or whatever it is you're using to drive the server and drive the motor to the fully counterclockwise position first you're going to need one of the horns from the motor we've got this round one it's around aluminum horn that has four threaded holes inside it and you're going to need the motor mounting screws that came with the motor bracket so that consists of these four larger screws and these four nuts and it's really this the matter of placing the motor onto the motor mount so the motor installs in the mount and I'll take the shaft of the motor make sure to lines up with the bearing and install it this way the motor faces on the outside so as you can see the shaft is here and the bearing is over here and then it's simply a matter of placing the four screws in to hold it okay now you can tighten those screws okay now the last thing you want to do is take this horn now remember I've got this motor set so it's completely counterclockwise so looking at it this way what we want to do is we want to take the horn and we want to line it up something like this so it's almost like a cross in place it's something like that now we're not putting the set screw and now we're going to be doing that during the next step when we actually hook this up to the u-joints so let's do that right now let's join up our W joint with the bass servo motor now in order to do this we'll need the assembly we made before with the W joint and of course the bass motor assembly we just worked on and remember we've got this horn sitting here it's not fastened but it's kind of in a cross position and this motor is turned all the way counterclockwise now one thing I want to point out is I found out that these motors the dss em 15s spin in the opposite directions as the high-tech motor so when you're setting it fully counterclockwise remember that that the motor will be turning opposite to the last motors that you set so once again I'm using fully counterclockwise as my reference point now in addition to these you're going to need the set screw that came with the servo motor and that's just a mount the horn over here and you're also going to take four of the screws from the bag of m3 screws and nuts and these are going to be used to actually attack for the servo horn and so this goes together fairly simply although you got to kind of wiggle it a bit you take the bearing and you take your two L joints here now my two L brackets I've added these little spacers on and I want these to be on the motor side but if you haven't done anything like this then it doesn't matter which way around the bracket goes in my case it does and so you want to insert the bracket you need to bend it open a bit and serve it in the back there and then you'll notice that you can line up the holes over here and this is where you're going to pass these screws now don't tighten them completely until you've got all four of them in okay now you can tighten these and you can also finally insert the center screw in to hold the servo the set screw and there we go now this is the base motor mount completed now what you'll probably want to do is go and test this with your servo tester now when you do this be very very careful how you hold it remember this is a 15 kilogram per centimeter torque servo motor it's very powerful these are made of aluminum if it happened to be for example that my servo tester was set to the opposite end as soon as I applied power this thing's going to flip back this way and but that kind of power if your finger gets in the way it's going to hurt a lot you could do yourself a serious injury so please be careful when you test this but at any rate that joins the W joint to the base mount so let's move on to the next step and join up the wrist mount to the top of this now the next assembly is to place the elbow motor into the bracket that we created for it earlier the one that we use the L bracket in the u bracket now i've already mounted mine and the reason that didn't show it to you quite frankly is that placing this mounting screw in the bottom was quite challenging I found that I had to get behind it with some needle nose pliers and it was a bit frustrating so I didn't want you to have to witness all of that but essentially I've used another DSS m15 the 50 kilogramme servos placed it on the bracket make sure to align the shaft with the bearing at the back and I've used the Force herbal manting screws and nuts that came with the servo mounting bracket and use it to install it and as I said these two screws especially the one at the bottom here you'll probably find you need some long nose pliers to be able to grab the nut while you're tightening it at any rate install it and tighten it now once again I've got this motor rotated so that the shaft is at the 180 degree or the fully counterclockwise position and I'm going to put the horn on without fastening it now it's the same horn we used before this time place the horn so that it looks more like a square so that the two holes over here kind of face up toward these two holes and these two holes sort of face up toward these two mounting holes and that'll put it in about the right position for the next step so now it's time to join the assembly we made with the base motor and the two u brackets to the elbow motor assembly that we have already constructed and so I'm going to put these together now this is very similar to mounting the u brackets to the base motor we're essentially mounting it to the elbow motor now so we will need the set screw that came with the motor and four of the screws from the m3 screw pack in order to attach everything to the horn so once again you'll start off by putting the back of this on and slipping this over the front now you remember I told you to align this up with the holes kind of matching this way the horn is what I'm talking about here that's because I want my motor angle to be something like this this is going to be the position when the arm has come fully close to one direction and you don't want to be able to hit over here so this is a good angle you might want to adjust this maybe by one gear step or something to bring it a little bit closer if I'm going to leave mine here as it is and just place the four screws in now once again don't tighten these four screws until you have them all in place and finally you can take the set screw and place that in the center here okay so it's starting to look a bit more like an arm again the same warning applies if you're going to test the servo motor over here it is going to make a movement make sure that you don't have your finger in the way of the movement or you could hurt yourself quite a bit so now it's starting to look a bit more like an arm let's go and add another piece up over here now in this step we're going to install the wrist motor as you recall we took two servo mounting brackets earlier and we placed one of the bearings on the back of one of them and that's the where the wrist motor is going to go so I've got your wrist motor this is the df0 5vb motor now this is the five kilogram per centimeter motor with the plastic shaft and it aligns the exact same way as the other motors did with the shaft lined up with the screw at the back and then we just use the four nuts and bolts from the mounting kit the ones that came with the servo mount in order to fasten the motor in it and tighten all of the screws down alright and so now we've got the wrist motor mounted in place the next step in building the arm is to take the assembly we already have and make this with the assembly we made with the df0 5bb servo motor and the two servo mounting brackets now this assembly is going to need to be fastened with one of these plastic horns that comes with the servo motors this servo motor does not come with aluminum horns notice there are a number of holes inside this horn I hope you can see that there's a series of three on each side this is going to made up with these four holes in our arm but what we want to do is go for one of the edge holes not the center ones in these groups of three that sort of threw me for a loop Balkan fest so I've taken the one on this side over here you could also take the one on that side and that's what I'm going to be using to orient my motor now I'm gonna take the motor and I'm going to take this and make kind of again what I describe as a cross pattern in other words the top maybe I can move that one notch over yeah okay a cross pattern with one end over here one here one there and one there if that makes sense now you're going to need five of these little screws that came in the self-tapping screw bag for this assembly one of these screws is identical to one that you'll find included with the motor and it's the set screw for the motor the other four are going to be used to fasten this to the horn and although the servo does come with screws for that purpose they're too long and they would bind so that's why they've included these otherwise the installation is pretty similar than before what we do is we oriented this way so that this motor bracket is on this side of the assembly and facing down and the game we place the berry in the back and slip this over the front like so and so it could look like this so Wan tend to travel the servomotor is going to be here and then it's going to allow this mechanism move up up to the point where it starts to bind with the back of this and then we just put the four set screws in you can tighten these once you've got em in don't over tighten them though but tighten them pretty good and take the fifth group and use it as a set screw for the motor okay and that completes this part of the assembly so we've reached the final part of the mechanical assembly and basically we're taking the rest of the arm assembly and joining it up to the gripper assembly that we put together in the very first step now the installation of this is pretty simple and rather obvious there's one remaining servo motor mount here and we're basically taking this servo motor and mounting it over here note the orientation of the wire coming out the end of the servo motor in fact all of the wires for your servo should seem to come out from pretty well the same side except of course the one on the gripper here which is going to move back and forth now this is installed again with the four servo mount nuts and bolts that were included with the servo amount and it's a little hard to get the screws under here these ones are pretty easy so let's put these in and of course after you've done this you can tighten them Eve wala we have got an assembled five degree of freedom robot arm now it's time to hook it up to our rudimentary controller and give it a test we'll be basing our controller around an Arduino Nano in addition to the Nano you're also going to need five potentiometers one to control each of the motors and a robot arm we'll begin by connecting the ground from the arduino nano to one side of each of the potentiometers will then connect five volts from the Arduino to the other side of each pot we'll also take the ground and the five volts and bring them out to the i2c connection now we'll start wiring the pots the wiper of the base potentiometer is connected to analog input a zero the elbow pot is connected to analog input a 1 the wrist pot goes to a 2 the grip pivot pot goes to analog input 83 and the wiper of the grip jaws pot is connected to analog input a six now pin a4 connects to the SDA output on the i2c connector pin a5 connects to the SCL connection for the i2c connection now we'll wire up the PC a 96 85 16-channel pulse width modulation controller in addition to the controller you'll also need a power supply for the five servo motors we'll begin by connecting the i2c connections to the PC a ninety 685 controller now we'll hook up our servo motors the base motor will hook up to output number 0 the elbow servo will go to output number 1 the wrist servo to output number 2 the grip pivot motor to output number 3 and the motor for the jaws to output number 4 finally we'll connect the power supply for the motors to the PC a 96 85 and now that we have our connections made let's take a look at the sketch we'll be using now this is a sketch I'm going to be using with the robot arm now this is a very basic controller and for those of you who've seen my video and article on using servo motors you'll recognize a lot of the code because I've taken a lot of the code I used when explaining the PC a 96 85 module and just modify to the bit from my robotic arm now as I've noted up over here I've designed this to use 5 potentiometers for my 5 degree of freedom arm but if you wish you could add another potentiometer by connecting it to analog input a 7 and that way you could use a 6 degree of freedom arm now the step starts off by including the wire library this is the library necessary for doing I to see communications and this is part of your Arduino IDE it also needs another library the Adafruit PWM library now this is not included in your IDE but you can install it through your library manager if you have difficulty doing that again please see the video I did on servo motors as I'll explain that in detail after that we define a couple of constants for minimum and maximum pulse width and for the frequency of the PWM signal these values here will work perfectly with the servo motors in the DF robotics kit we now start off by career a PWM object with the Adafruit PWM servo driver and then we define a number of variables the first one are the inputs that we're going to be using for the potentiometers so that's these over here then the outputs on the motor board itself not the Arduino but the motor board now these are the outputs we've connected our servo motors to if by the way you decide to use different outputs you can just change these numbers accordingly i've also defined a number of variables that just represent the position and degrees for each of the servo motors our setup is quite simple all we do is we do a pwm begin and we set the frequency of our pwm controller now we've got a couple of functions before we get to the loop the first function i call move motor deck that supposed to mean move motor by degrees and it takes two inputs both integers the number of degrees we want to move the motor and the motor number itself that we wish to move now this function again is identical to a function that I used in my previous video so I won't go into great detail basically what we are going to do is convert the frequency into a pulse width over here and then we control the motor you use the set PWM function in the Adafruit library to tell it which motor we want to control where we want the starter pulse and what the width of the pulse is going to be and that controls the position of the servo motor I have another function down over here called get degree this function has one input and that's the control number that we're talking about and it outputs the number of degrees that the control represents so basically the heart of this is that we read the value of the control and assign it to this pot vowel and then we calculate the number of degrees by using a map function now our value of course will go from 0 to 1023 and we'll map that to a value of 0 to 180 to see what we are representing in terms of removing the servomotor and then we returned that number back out so when we get into our loop controlling the motors is very simple we'll take a look at controlling the base motors all five of them are identical we basically get the position so we used to get degree function and we pass the controller using in this case the base control and that will give us the number of degrees we want to turn the motor and then we'll this move the motor that particular number of degrees so we give it the number of degrees and the motor we wish to move and we do exactly the same thing for the elbow motor their wrist motor the pivot motor and the jaws motor at the very end of it we'll add a short time delay and then we'll go right back through the loop and continue over and over again controlling the position of the motors so now that you've seen the sketch let's take a look at it hooked up to our robotic arm alright well here is our arm and controller and all of our glory as you can see I've got my PC a ninety six eighty five controller actually mounted directly to the arm and I've got all the servo wiring directly to that and I've used a little bit of this wire feeding that come included with the kit just to try to clean up the wiring a little bit I've also got my accelerometer and gyroscope mounted on the top over here but I haven't got it connected up in a future video I'll show you how we're going to use that and here of course are my five controls now this is the control for the base so as you can see this was the base motor all the way back and forth very nicely and here's the elbow motor and the wrist motor and here's the pivot and then finally the jaws so as you can see our robotic arm is working properly as is our controllers well that about wraps it up for today's video but it certainly doesn't wrap it up for this DF robotics 5 degree of freedom robot arm in fact this is just the beginning of the things I'm going to do with this arm now as you know I'm adding an MP u 6 0 5 0 gyroscope and accelerometer to the arm and in the next video we're going to look at how we interface with that and get readings back about the arm position I'm also going to expand upon that controller that we built so that not only can it read the output of the MP u 6 0 5 0 it can also memorize arm positions and allow you to program a sequence to put the arm in and then finally as most of you have noticed my 5 degree of freedom robotic arm is fastened down right now in a piece of wood well that as I said earlier is a temporary arrangement now DF robotics makes a really neat device it's a turntable called a hex turntable it's quite inexpensive and it can be used as the base for an arm like this essentially turning it into a six degree of freedom robotics arm so I'm going to add that as well and as I mentioned earlier DF robotics has a very neat four-wheel drive robotics chassis that I purchased a while ago and finally I want to make the arm to the robot chassis so you're going to be seeing a lot of this arm now in order to continue seeing a lot of this arm the best thing to do is subscribe to the YouTube channel so if you haven't subscribed to the channel yet please do I would appreciate that another thing you should know is that I have a mailing list and link for the mailing list you'll find that below the video the mailing list is designed so that you can give me feedback and let me know what videos and subjects you'd like me to cover and what articles you would like me to write for you because I really want to be able to create content that you will enjoy and so having said that I'd like to thank you very much for spending the time with me to assemble this D F robotics robotic arm take care of yourself and I hope to see you soon again here in the workshop good bye [Music]
Info
Channel: DroneBot Workshop
Views: 153,029
Rating: 4.9502311 out of 5
Keywords: Robot Arm, DFRobot, Arduino, Arduino Project, Arduino Robot Arm, Servo Motor, Robotics, Arduino Nano
Id: dzyKqRVN2kc
Channel Id: undefined
Length: 56min 15sec (3375 seconds)
Published: Sun Jun 03 2018
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.