arduino uno drivers
So we’re, going to start out by taking a look at the hardware, will actually peek inside the 28 byj motors and see how they work and we’ll talk about what that UL in 2003 chip is and how you can hook up to it and then we’re going To come back and talk about a variety of driving methods, we’ll talk about wave, driving, full stepping and half stepping and see how to drive the motor from really any microcontroller. So this is microcontroller agnostic. You can take what you learn in this video and work with these components from the microcontroller of your choice, then we’re going to come back and talk about the fact that there’s some gears inside the case of the motor we’ll, see what their overall effect is on. The behavior of the motor, as well as on how you drive it and then lastly we’ll point chops to some resources and give you some next steps to see how to move on from here. This video is part of my overall IOT series. You can grab a copy of these slides, as well as the slides and demo files for all the other videos in the series using the links on the screen, so let’s dive right in and take a look at these 28 byj 48 motors, the corresponding UL in 2003 driver boards, so this motor driver board combination is a pretty popular set of components. You can buy them readily online and typically pretty inexpensively.
I usually get them for about 5 u.s. give or take a couple of dollars. If you took that motor and actually cracked it open and took a look inside of it, you’d see that first of all there’s this outer case at the bottom of that case notice, there’s 8 teeth poking up and then in the center. Is this metal post that’s coming up that’s what the rotor actually slips down over then inside that case, we’d have 2 coils wrapped up in these white plastic rings and interspersed with those coils or some other plates with their own teeth on them. We’Ve got a plastic rotor body with a permanent magnet raptor on the outside of it there’s a plate with some gears on it and then a final gear that’s attached to the actual motor shaft that’s sticking out of the top plate there, and then you get this Little board that has a ul in 2003 Darlington or a chip on it and some supporting components. So those coils are just regular, magnet wire wrapped around these white plastic rings and a single coil would have two ends. However, this is a unipolar stepper motor, and that means that we also attach to the center of the coil. So we’ll have a connection for each end of a coil, as well as a connection for the center of the coil and with two coils. That means I’m. Going to have a total of four ends and we connect to the center of both coils, but we actually connect those centers to each other as well and that’s what we call our common center tap.
So that leaves us with a total of five leads coming out of this coil assembly. The blue and the yellow leads are the ends of one coil. The red lead in the center is that center tap that’s attached to the center of that coil and then we’ve got the pink and orange coil again. The red lead is also attached to the center of that coil as well. Then we’ve got these teeth right. So at the bottom of the case, are these eight teeth that are pointing up, and that makes one layer of teeth then, interspersed with the coils are three other plates, each with eight teeth on them and those teeth are spread apart each one. Basically, being eleven point, two five degrees from the one next to it, and that gives us a total of 32 teeth overall and that’s, going to end up basically being one tooth per step of this rotor as we make it go around the rotor. Who, then, is, as I said, this plastic body that has this permanent magnet wrapped around the outside of it? The permanent magnet is where the magnetic poles are right, so we’re going to use those to line up to those metal teeth based on the magnetic field. That’S generated by those coils sticking up out of the rotor is its own little gear and that’s going to be what meshes up with the other gear on that gear plate. The gears then sit on top of this plate, that’s a set of ganged gears.
That means that there’s really two gears on each one of those little plastic bodies. So in fact, you’ll notice that this one here has a large set of teeth at the bottom and then, as part of that same plastic unit, there’s. A set of other teeth that are poking up out of that and it’s called a ganged gear, but overall those gears in addition to the gear that’s on the outer motor shaft, combine to give us an overall 64 to 1 gear ratio. For this motor and we’ll talk about what that means later on. If we started then to reassemble this motor, we could stick those coils down inside that case and slip the rotor down over that post that’s coming out of the outer case. I could then lay down that gear plate with its gears and notice that those gears then mesh up with that 9 to 3 up on the rotor body and then finally stick the final gear with the motor shaft and that top plate right on top of it. Let’S next take a look at how it’s electromagnetics work, so the 28 byj 48 is a unipolar stepper motor as opposed to a bipolar and there’s. Also, some other kinds out there as well and I’ll, give you some links off to some other references at the end of this video, but with unipolar motors. The advantage is that we don’t need to create an electronic circuitry to change the direction of current we’re.
Instead, just going to send a voltage through the center tap on our coil and then pull our one end or the other end down to ground, to change the direction of current that’s going through that portion of the coil. So we start out with that blue lead. Coming in right – and it starts to coil around through that magnet wire, and then if I were to actually energize that coil I’d create a magnetic field and that magnetic field would be sort of focused on these little metal teeth that we can use to sort of Attract the rotor, but rather than continuing directly around, we first come out to this red centre, tap right and then we go right back in and continue coiling around and it’s. The other end of that coil that comes out is that yellow lead and, of course, it’s got its own set of teeth associated with it, and that rotor then sits down inside the motor case, centered just right inside of those teeth. So if I were to then take that Center tap and attach it to five volts DC and then use that Darlington array to pull the appropriate end of that coil down to ground. I would then send current just from the center tap through the coil down to the blue, lead and not send any current through the yellow. Half of that coil that current flowing through the blue half of the coil then is going to generate a magnetic field, and the polarity of that magnetic field is going to be based on the right hand, rule that says that if you take your right hand and Curl your fingers around in the direction of the flow of current, then your thumb is going to be pointing towards the North Pole, whereas the opposite direction would then be the South Pole.
And in this case, if our thumb is pointing out of the motors case, then that means the bottom of the motor case, where those teeth that are sort of associated with the blue coil are are going to be South Poles, so they’ll then attract the North Pole’s. On that rotor because opposite poles attract, I then turn off the blue half of that coil and instead pull the yellow and down to ground and energize the yellow portion of the coil, giving its yellow teeth a South Pole and attracting the north poles of the rotor. Further around and that’s sort of how we’re going to step this remember there’s another coil, though first we’ve got a pink lead coming in with its own set of teeth. It comes out to a center tap and goes back around through the orange half of the coil, and it has its own set of teeth. We then wrap the whole thing up in a plug and change the order of the leads so that they are in the proper firing order. We want to fire the blue coil. First then, the pink then the yellow, then the orange and the red out there at the end there’s our five volt DC power supply. So next let’s take a look at this board with the UL in 2003. Chip on it, you will in 2003, is a Darlington array it’s. Basically, a chip that has seven different Darlington pairs inside it and a Darlington pair is really just a pair of transistors, where the second transistor is used to amplify the output current to the first transistor.
The benefit is that we can drive a higher demand current from our stepper motor, with the low voltage low current output from our microcontrollers digital io pens. Now, in addition to the chip, there’s, also a handy little socket that you can use to just plug your motor right into there’s, some header pins that you can use to hook up to your microcontrollers digital io pins as well as to ground and your voltage supply. There’S, even a little jumper that you can remove to break the power circuit to the motor. You could hook a switch up to that if you wanted to have sort of an onoff switch for the motor without affecting the microcontroller and then finally there’s some LEDs with their current limiting resistors. Those LEDs are used to visualize, which half of a coil is turned on. So if I energize the blue half of the coil, the a light turns on energized. The pink light turns on the blue. The yellow turns on the C and the orange turns on the D, so this gives me a handy way to tell which coils are currently being energized on the motor. So now let’s see how to hook this all up together. First of all, we can take the plug at the end of that motor, just plug it right into the socket on the UL in 2003 driver board. Now the microcontroller could really be any microcontroller on the screen. It kind of looks like an Arduino, but it could be a Raspberry Pi.
It could be a spark or it could be pretty much any other microcontroller now we’re, going to take the in 1 through in4 header, pins on the driver board and wire those up to digital io pins on your microcontroller. You can really use any digital io pins. You want you’ll just want to make sure that you know which pin wires up to which phase on the motor for the voltage you might be able to connect to the same power supply as your microcontroller. But you’ll want to make sure that the power supply has the right voltage for the motor, as well as enough current to drive both the motor as well as your microcontroller you’ll, probably be safer. If you just use an external power supply for the motor itself, you just want to make sure that you take the ground for your power supply circuit and connect it up to your microcontroller as well, so that you’ve got a common ground all right. Well, now that we’ve seen how the motor works and how to hook it all up to our microcontroller let’s, take a look at how we can actually go about driving this thing. So I’ll talk about three basic methods for driving the stepper motor we’ll start out. Talking about wave driving with wave driving we’re going to fire just a single phase at a time. This is probably the simplest method, but it’s likely the least used, because the other two methods have some advantages, but with wave driving again we’re only going to fire a single phase at a time.
So if I look through this diagram on the right in any one time, slice so with step one, just the blue phases, energized then just the pink phase, then just the yellow, then just the orange, so there’s really four phases in this cycle here and then I Just repeat: blue, pink, yellow orange full stepping is going to give me the same step angle as wave driving so I’m going to get the same precision with full step, as I do with wave drive but I’m going to get double the torque because with full stepping We’Re actually going to energize two phases at a time, so at any one given time slice here, two phases are energized: first, the blue and the pink. Then the pink and the yellow, then the yellow and orange. Then the blue and the orange so that’s a single cycle through those four phases and then again, I repeat: blue and pink, yellow, pink, yellow orange orange and blue. The third choice that you have is half stepping with half stepping we’re, actually going to sort of make a combination of wave driving and full stepping is. This is going to give us a little bit less torque than full stepping, because half of the time two phases will be energized, but half of the time only one phase will be energized, so it’s not going to have as much torque as full step. The benefit of half stepping, though, is that we’re going to get half the step angle.
So we get double the precision. If you will, with half stepping we’ll start out with just the blue phase, then we’ll also turn on the pink and get the blue in the pink. Then just the pink and the pink and the yellow they’re, just the yellow, then the yellow and the orange. Then just the orange and then the blue and the orange so there’s actually eight phases in the full cycle here with half stepping so let’s see what that looks, like you know, with our setup that we had earlier, first of all to the diagram that we’ve had I’M, adding in this little pointer arrow sort of at the top of the rotor, so you can sort of follow that to watch the rotor, as it turns also I’ll, be calling out down here the different values on the digital io pins, be they ones or zero. So you can look down there, then you also look at the LEDs on the board, whatever to sort of see what’s happening here in the system, but with wave driving I’m going to get an 11 point. 2. 5 degrees step angle, for a total of 32 steps. For the rotor to go a full 360 degree, rotation we’re, going to start out by energizing, just one of the phases. I’Ll drive that blue phase high by sending a digital value of 1 or a high value out through my digital io port that’s, then going to energize through that.
You will, in 2003 board the blue side of that coil and cause the rotor to turn around and align with the blue teeth or the teeth are associated with the blue coil right then I turn off that digital io pin and I turn on the next one. For the pink coil and the rotor turns to point towards the pink teeth and that step from the blue to the pink is 11 point, 2 5 degrees. And then I continue energize, the yellow, coil and then the orange coil, by sending their appropriate digital io pins. To once or zeros, and then I can just keep repeating right, I can go blue, pink, yellow orange and I can see that that rotor continues to turn to align, to the teeth, with full stepping I’m going to get the same step angle as wave drive. It’S. Just that the steps are going to point at the gap between the teeth, rather than centered, on a specific tooth and that’s, because the magnetic poles are going to be spread across two teeth and the center of it will be in the gap between them. So the rotor will be pointing at the gaps, not the Centers of the teeth but I’m going to start out by energizing, the blue in the pink and the rotor will turn to point at the gap between the two of those. Then I turn off the blue and energize, the pink in the yellow and the rotor will turn to the next gap between the pink and the yellow.
So it’s again the same 11 point 2, 5 degree angle, it’s, just gapped a gap not center of tooth the center of tooth as it was with wave driving. I continue, though I do yellow and orange and then blue and orange the benefit with full. Stepping, though, is since two coils are energized. The magnetic field is twice as strong and that’s going to give this motor a stronger, pull out and holding torque be able to work with higher load without slipping. So the third method was half stepping again. The benefit with half stepping is that we’re going to get half of the step angle, we’re now down to a five point: six to five degrees, step angle, we’re actually going to start by pointing at the center of a tooth and then to the gap between two Teeth then, to the center of the next tooth, then to the gap then to the center then to the gap etc. This is going to give us a total of 64 steps needed for that rotor to go a single 360 degree. Full rotation. The downside of half stepping relative to full stepping is that it doesn’t have as much torque, because we’re only going to have two phases on half at the time. The other half only one phase will be on so it’s a little more torque than wave driving, but not as much torque is full stepping. So let’s start out here. The first one will energize just the blue phase, it’s going to turn the rotor to point to the blue tooth.
Then we also turn on the pink coil and it’ll. Now turn to the point to the gap between the two teeth, then we turn off the blue and energize, just the pink and now it turns the remainder to point to the pink tooth, so there’s that half step ankle tooth to gap to tooth the gap. As we go, so we just continue: energize the pink and the yellow than just the yellow, yellow and the orange just the orange the orange and the blue and we’re getting those five point: six to five degrees steps between each one of those phases. So the last thing in terms of driving these motors has to do with the direction. So so far as I’ve been firing, these phases I’ve been firing them in order that makes the rotor go clockwise, as I look down on the top of it. If you wanted to go the opposite direction, just fire those phases in the reverse order chart out with orange, then the yellow, then the pink then to blue and the rotor will turn the other way. So everything we’ve talked about so far deals with just the rotor and the teeth and the coils and doesn’t take into account those gears. So let’s take a look at what the gears do to the behavior of the motor so remember, sitting on top of the coils and the rotor and and all that stuff was this plate there’s a hole in the middle that the rotor shaft pokes through that rotor Shaft is itself a little 9 to that plate are some other gears.
The first is a 32 tooth gear that meshes up with that 92 gear. When two gears are in mesh, you can figure out their gear ratio simply by dividing the one by the other. That gives me a three point: five, five: five gear ratio. That means that that inner rotor has to go around three point: five: five five times for the outer 32 tooth gear to go around just once now, ganged on to that thirty two tooth gear is an 11 to 3 and it meshes up with a 22 to That San 9 to that meshes up with a 26 to 30 point 888 gear ratio and then a final 10 tooth messed up to the 31 to thats poking through the top plate. And that gives me a 3.1 gear ratio now to figure out the gear ratio of the entire system. I simply multiply those individual gear ratios up, and that gives me a total 63 point: six, five to one gear ratio, so not exactly 64 but we’ll round it up and just call it a 64 to 1 gear ratio. And what that means is that that inner rotor has to go around a total is 64 full rotations. In order for the outer motor shaft that keyed brass post coming up out of the top plate to go around just once, that’s going to give you some pretty good precision for this inexpensive motor. So, in fact, if you go back and remember with wave driving or full stepping, it took us 32 steps for a full rotation of the rotor inside, and that was at an 11 point.
2 5 degrees step angle. If we did half stepping that changed 64 steps at at five point, six to five degrees, step angle, that 64 to 1 gear ratio, though, is going to change things with that we now take 64 times the number of rotations and at 32 steps per rotation. That means it’s 2048 steps for a single motor shaft rotation at a point, one eight degrees step angle and if we half step, but we double the step, count to 4096 steps per rotation at a point: zero, nine degrees, step angle. So again, some pretty good precision for such an inexpensive motor. Well, hopefully, this video has given you a solid understanding of how the 28 byj 48 promoter works and how you can drive it with the microcontroller of your choice, using that UL in 2003 driver board. So, where do you go from here? Well, first of all, I’ll have some follow up videos on actually driving the motor with the Raspberry Pi, the Arduino and possibly some others so stay tuned for those. But in the meantime, here’s a couple of resources to get you started. Tom ego has a great resource on working with stepper motors from the Arduino, as well as a couple of other microcontrollers, and the link is there on the screen Douglas W Jones has more technical overview of them again using the link on the screen and, of course, Just do an internet search on the twenty eighth byj 48, the microcontroller of your choice and you’ll likely find plenty of resources.
So, with that we took a look at the 28 byj 48 motors and their corresponding UL in 2003 driver boards. We talked about driving them with wave driving, full stepping and half stepping talked about how the gears worked and what that did to the behavior of the motor and talked about some next steps and where to go from here. So with that go have fun.
arduino uno drivers Video
arduino uno drivers news
Posted on Monday October 07, 2019Best CNC Software for Arduino All 3DP … Continue Reading »
Posted on Thursday September 26, 2019Review: OSEPP STEM Kit 1, A Beginner’s All-in-One Board Found In The Discount Aisle Hackaday … Continue Reading »
Posted on Monday February 11, 2019Ender 3 & Marlin: How to Install Marlin Firmware on an Ender 3 All 3DP … Continue Reading »
arduino uno drivers Social
🔬 Now that you’ve gotten your feet wet, dive into the kit and enjoy all nine experiments. Order yours today: http://bit.ly/2MnQ7fr