Placeholder Image

字幕列表 影片播放

  • Hello for this video.

  • I wanted to do something a little bit different, and that's been made possible by the very generous support from my patriotic or patriots, depending on where you're from for a while, I wanted to tackle embedded systems as a topic, but I've looked for a suitable entry point that simply enough to make into a nice video but also lays the foundations for future video work.

  • So let's get to it.

  • Let's make and program over biotic arm.

  • The aim of this video is to control a robot arm while asleep.

  • Fear my computer here, I've got my computer on on the screen.

  • I want to have some sliders, which allow me to set the joint positions off the robot's movable parts on my computer.

  • I have a USB port on into that I have a Bluetooth jungle the Bluetooth jungle is going to transmit to a Bluetooth receiver.

  • This receiver is going to then communicate with a microcontroller micro.

  • See, in this case, it's an embed L.

  • P C 17 68 on.

  • It's going to do that communication via what's known as a you are out on.

  • I will go through all of these terms as part of this video vote.

  • Bottom consists of six degrees of freedom.

  • That means he's got six movable components.

  • These are known as servos on the servos require a pulse width modulation signal P W M from the microcontroller to set their positions.

  • So from the microcontroller bones have six lots of P w m.

  • We also need to think about power.

  • It's a power my system from a small supply connected into the mains, which is going to convert it to six volts and then want to power my microcontroller by this six faults.

  • But then I also want to power all of my servos bythe same six volts.

  • I'm going to use the pixel game engine to draw some sliders on the screen on.

  • I want to communicate with the Bluetooth jungle Veer, a virtual calm part.

  • And so the ultimate aim is that when we move a slider, we see a joint move in real time.

  • This is the robot arm I intend to build.

  • It's the D i y more rock through you.

  • Six degrees of freedom aluminium robot arm with a claw on this specific purchase from Amazon, you can upgrade to also include the six servos, and I did just that.

  • So thank you to my patrons for funding this project.

  • But there is no doubt it is the cheapest and nastiest robot arm on Amazon.

  • But I think that's OK, because if we can get this to work and get it to work, well, then you know it just goes to show you don't have to pay a fortune for some really cool stuff.

  • The microcontroller I'm going to use is the embed L.

  • P C 17 68 and this is a really nice microcontroller.

  • I know a lot of you will be familiar with things like our DWI.

  • No, I don't tend to use those very much.

  • I prefer using this instead, mainly because it's also quite applicable to use in industry.

  • I like the fact that it's so small and it's so modular on.

  • It's so easy to program and we'll see just how easy to program it is later on.

  • They're not the cheapest microcontroller modules available, however.

  • It is entirely open source, both from a firmware aunt hardwork perspective on it has lots of ready to go peripherals just simple and easy to use.

  • It also has a form factor, which makes it very easy to plug into prototyping board and a quick look at some of the specifications here.

  • It's an arm cortex M three, which is a low respect, armed process, sir, but it's a tremendously capable process.

  • Er, it can clock in about 96 megahertz.

  • It's got 32 K of RAM on 512 K of Flash has got a whole bunch of io for us to exploit, but the bits I love about it, the most of these programming is dragon Drop.

  • It pops up like a flash drive, and you just drag the program file onto it.

  • Very nice on all of the coding that can be done via the browser.

  • And you might be thinking, Oh, dear May, That sounds dreadful.

  • Actually, it's not that bad and experience it all.

  • It's quite a sophisticated Web interface.

  • You can use offline tools if you want to, but that does require a bit of setting up.

  • I like embeds.

  • I've been using them for quite a number of years, even an industry as we can see, it's quite a small device, so it measures here.

  • About 53 millimeters by 25 millimeters.

  • And it's designed to fit into standard 2.54 millimeter pitch headers on the back here because it is also two things going on on.

  • This is what makes it easy to use.

  • This is the user interface circuitry.

  • There'll actually just plug it into your computer and program it quite simply.

  • But on the on the top is that where the real stuff happens?

  • And there's not that many features, really.

  • We have a big button in the middle.

  • This is to reset the module, that this is the arm cortex M three process itself, and we have four little L.

  • Edie's, which are under user control.

  • The other two big components on here are just power regulation because we can provide power to this very the pins or via the USB, and there's an advantage to being able to power it by the pin.

  • So here we've got ground involved a gym, but because that's accepts the vaulted range between 4.5 to 14 faults.

  • Where is from us being?

  • We just get five.

  • It's more convenient sometimes to just power your system from one place, particularly in this case because the sober motors I'm going to use I'm going to power those at six volts.

  • They would work at five volts.

  • But I don't have the current capacity from the U.

  • S.

  • Be hope in order to drive all of them.

  • So I'm having to drive the servers from a separate power supply every time you buy an embed and I must support about 50 off them.

  • By now, you get a little card like this, so I'm quite a stack of these things.

  • But it's a really convenient thing to show you where all the pins up so we can see we've got power pins here, labeled in red on all of the other pins are music configurable.

  • I owe in one way or another.

  • So we've got two lots of espionage bosses on.

  • We've got to lots of new art on this side.

  • We've also got a You are on this side, too.

  • Well, look at you out for communicating between the computer on the control module.

  • We've also got some analog in pain.

  • So there's a built in analog to digital converter on here and that will accept up to six inputs.

  • It's it's okay it's not the fastest, and it's not the most noise free.

  • But for most applications, it's fine.

  • And with some twit Lee of the hard work, this sort of assembly level in my control, you can actually tidy that up quite a bit.

  • There's a single analog out employing the opposite.

  • There is a digital time low convertible.

  • We've also got two I scored.

  • See bosses.

  • They're usually quite popular.

  • I don't like them as much as SP I, but it depends on the application.

  • But most importantly for today we've got six pw em out pin.

  • So these are hard work and figured so.

  • The PW M is handled by the hard work, meaning we don't have to maintain that in software.

  • There's also us peace.

  • If you doing USB on the go applications.

  • These the pigeons use for that.

  • And finally, there's Ethernet.

  • At best.

  • It's a functional level.

  • Ethernet.

  • It's not for any high speed streaming.

  • The whole device is really only clock Kable at 96 megahertz, which doesn't sound like a lot, but it's enough to do a lot of interesting things for sure.

  • The embassy also really conveniently provides a regulated 3.3 faults output on will be using that to power the Bluetooth module.

  • This is the Bluetooth module.

  • I'm intending to use the D S D tec H c 05 Bluetooth serial passed through module with while a serial communication with button.

  • They says for Arduino, but doesn't matter.

  • It's just a Bluetooth module that gives us access to a U art.

  • And I've chosen this because I'm literally just going to plug it straight into the bread board and hope that it works.

  • I have a little USB dongle on my main computer and this is my Bluetooth module.

  • And I chose this just because of its simplicity.

  • It's entirely contained.

  • So here you can see we've got the Bluetooth antenna on.

  • We've got some interface checks to handle the radio.

  • I guess on on the back, it very conveniently labels what the pins are.

  • We're not interested in all of the what we're interested in his VCC, which will go to power from now.

  • We're gonna parrot from 3.3 volts.

  • Not the recommended 3.6 faults you can see here.

  • Exactly.

  • It's OK.

  • It works on dhe.

  • We've got the t, X t and R X d lives there.

  • The ur lives.

  • That's where our communication is going to be happening.

  • So the computer is going to transmit via Bluetooth to this module, and this module will convert it into three vault three level you are which the embed can understand quite naturally, the other pins.

  • I'm not too interested in what they do when you enter the world of embedded systems development.

  • One of the first things you'll come across is the need to have things very overtime in a kind of analog e type way.

  • But all you've got is a bunch of digital pins.

  • Well, one way to satisfy this is to use pulse width modulation, which sounds very complicated but is in fact, quite a simple thing.

  • If I create an axis which represents time on, I take two points along that access.

  • This is more commonly known as the period, because what I'm going to assume is that we're going to have some repeating signal between these two points.

  • Digital signals, of course, can only really be zero on Dwan.

  • Just to make this clear, I'm going to add in another timeline.

  • So I've got two sections of time here a digital clock is a signal that isolates between one and zero.

  • So, for example, it may look something like this.

  • The time that the clock is high is the same as the time that the clock is low on this.

  • Repeats for a P W M Perspective O'clock is P W M at 50%.

  • Let's consider a P W M A 25% Well, in this case, it's high for 25% of the period, but low for 75% of it.

  • And it repeats.

  • I'm sure you've already worked out by now.

  • But if we wanted something like 75% P W.

  • M, it's highly for 75% of the period on low for the remaining 25%.

  • So to specify a PW EM signal, we need two pieces of information.

  • We need the period, which is this duration of time, and we need the duty cycle.

  • There are variations of this depending on the polarity of your signals, but I'm not going to look into that today.

  • So let's program the microcontroller now.

  • Now, firstly, I must apologize.

  • Unlike Visual Studio, I don't have as much graphical control over how the browser Integrated development environment looks for embed, so I can't really change the font and zoom in quite as easily as I can in visual studio, so we'll just have to make do.

  • But all of the source code for this will be available in the getup and is Linka ble from the description below a blank embed program.

  • Looks like this on this is the environment have put on the dark theme, so I don't blind myself and it looks just like a C plus plus programming environments.

  • I've got some files and projects down here on the left.

  • I've got a coding window here and I've got some output window at the bottom on that.

  • This is the skeleton stub program.

  • You include embed dot H, which provides you with all of the tools and new Cilla sees of the board on it gives you an in Maine and says, Well, have at it.

  • You compress control and be or click build from the menu appear and it builds it and gives you the syntax error.

  • And this is all happening in the browser now, since we've just been looking at Peter, you am.

  • I think the first thing to implement is a simple PW AM exercise, so I'm just going to specify a pin called pw em out.

  • So this is an object which will facilitate the coordination