A Python-powered pantographic plotter
Procida, Daniele
I present an ultra-cheap (total cost of materials :€12.50) plotter that can be built with minimal skills. At its heart is a Raspberry Pi Zero and some relatively custom software, driving three servo motors. The mechanical hardware can be built from nothing but stiff card, a ball-point pen and some glue. The only tools required are a ruler, a sharp knife, a screwdriver and something to make holes in the card. Almost everything required can be found in a desk or kitchen drawer. The entire device can be built with no special skills in about an hour (and much of that time will be spent getting the glue off the kitchen table before you get in trouble). It can also function as the world's most inconvenient camera: take a photo using the Raspberry Pi's camera, convert it into lines, and draw it. This is fun, but it's much more than that. There are barriers of skill, expense and materials around robotics. This project comes with me to African PyCons, and makes it possible for programmers to explore Python-based robotics, however limited their resources. The tools and complete kit of materials to build several plotters can be carried in a small box. The plotter code is published on GitHub: The code for converting bitmaps to cartesian vectors is at I expect this to appeal to anyone who is interested in the idea of Python-driven robotics but is put off by the cost and complexity of hardware required actually to achieve something. It will be particularly of interest to people involved in education, or who'd like to explore Python with young people. The code, mathematics and especially the hardware in this project are all simple. The code resists the temptation to abstraction, and makes a point of breaking operations down into steps that are as easy as possible to follow. The project shows that doing things with robotics isn't just for people with well-equipped workshops and the engineering skills to use them.
 First of all, I apologize for the delay. I tested my hardware and software last night before I went to bed and this morning after breakfast before packing it all up. So of course as soon as I plugged it in here, it refused to work as it normally does. And that's what you get for not just doing live demonstrations or worse live demonstrations with hardware but live demonstrations with home-built hardware that's held together with rubber bands. So I think the actual problem is my MacBook that the networking between the MacBook and the Raspberry Pi is not working as it should. You should be able to connect them via a USB cable and the Raspberry Pi will go into a certain mode and will be available to the, well, in this case to a MacBook that as well as providing power is also connecting to it with a network connection. So this means I'm going to have to do a bit of swapping, typing on an unfamiliar keyboard. There might still be a problem with the Pi and so we might have some other troubles as well but I feel you're probably on my side rather than against me. Not like that keynote speaker yesterday where some people were rather unkind. So this is me. I'm Daniela. That's what I look like on television. As you can see, I'm Python software. Can we turn the volume down a little bit because I'm getting it rather loud in my, yeah. Thank you. I work at DVO. I have a web cloud hosting platform built in Python and Django and for Python and Django developers but we also host other things. So please come and talk to me if you want to talk about Docker or Django or deployment or any of those things. I'm a core developer of the Django project itself and an ex-vice president of the Django software foundation which is not really as grand as it sounds although. I go to a lot of these events. It's part of my job so I'm really fortunate to have a job in which I go to events all over the place. I love going to these events. I love meeting people. And what happens at these events is this kind of valuable, friendly magic of your pythons and pycons. And after all these conferences I still enjoy coming to them. But this magic works hardest on the people who are new to their careers or to Python or to programming or even in places where Python and programming are quite new as industries. So for the people who aren't yet confident, who aren't yet sure whether this is for them, who aren't sure of their future success, there's something really brilliant going on in these events. And I see it particularly in my African travels. So I'm amazingly fortunate to be able to do some of these things as part of my job. I've been involved in Python Namibia since 2015. We've held five editions. And from that have come several others. There's also a regular Pycon in South Africa but that can run under its own steam. So if you saw yesterday in the lightning talks, I mentioned that we're holding Pycon Africa in August this year. These are some of my friends from Namibia, part of the organizing team of Pycon Namibia. There's Pycon Africa, if you want to know about that, come and talk to me. And as I mentioned, we have opened a fundraising campaign just to try and get a little bit more money into our financial assistance program. You can probably know where to find me here but you can also find me online. So when I go to conferences, for example, in Namibia, one of the things people are interested in is robotics. And there are all kinds of robotics projects you can do with Python. You can find out a lot of information about them. And they look really good but they all seem to involve things like 3D printers and laser cutters and hack spaces and university laboratories and so on. And most people don't have that kind of thing. So I wondered if I could build a pen plotter. This is an axial pen plotter with a pen to move on two axes. So the challenge that I set myself was what is the cheapest and simplest pen plotter that could possibly be made? Well, I've got a camera here so I can also show you some more video. But here it is. Here's one of the first iterations of it. What can you see there? You can see it uses a ballpoint pen for the drawing in the hinges. It uses the part of the tube of a ballpoint pen. And those are some wooden sticks I found. Here's another version. I found it's a good way to get your talks accepted at a conference if you flatter them by printing out their logo with your robot. Those are some rather nice servos that I blew up so I don't have those. This is how the pen lifts up and down. You can see there's a... It uses the arm of the servo to do that. I had to call into play all my high school mathematics, which is from a very long time ago because I'm probably older than you think I am. And so I had to relearn a certain amount of trigonometry. And this is how it works. It's a pantograph, which is the same kind of mechanism that's used on a tram to lift the connector up to the wires. So we have two motors at the top that rotate. And there are two... There's a yellow and red driving arm and a green and a blue following arm. So it forms a pentagon. There are five sides because you've got to account for the space between the two motors. So two motors, four arms, five sides. And then when you're doing the maths for this, after a while the whole world seems to be composed of triangles. It's remarkable. And this is the mathematics. You don't need to worry too much about that. Because this is intended as an educational thing, it's actually broken down as much as I could possibly break it down. So you can see that as long as you're able to break down a shape into triangles, you can do this with fairly simple trigonometry. So the bill of materials. This is crucial because, say, a Namibian student does not have a 3D printer or something like that that was bought on a whim. The total bill of materials, Raspberry Pi zero for $5, three servo motors for about $3 each, some stiff card, some wood glue which you need to buy, and a ballpoint pen which you can probably steal from somewhere. And then the tools are very simple. You need something to make some holes with. You need a knife to cut the card, a small screwdriver, a first aid kit. And to avoid getting into domestic trouble, then I recommend having a damp clothed white wood glue off the table when you finish because it saves, it helps. So there's a very incomplete, in progress GitHub repository for the code that I've written for this. I'll show it again afterwards. It is very incomplete and I'm not doing a very good job at updating it. So there we are doing an update. You can go away. That was the slides part. Now I want to show you what the machine looks like. So if I switch over to this and with this magic camera with a delay, apparently, or maybe not a delay, maybe it's not working at all. Now that Martin came and showed us how to set this up and get it going, I'm going to just, oh, well, that is quite a delay. Oh, no, there we are. I think that's, so, you can't see it. Why can't you see it? Because I've got to do that. Yes. Okay. So this is really difficult with a delay. Can I make this full screen? Well probably I can make it full screen, but I'm pushing my luck here with hardware and software. So this is the pantograph. So we've got, there really is a delay there. Maybe it seems to stop. Okay. Well, you can see that. You can see the two motors and the forearms. You can see a weight on top of the pen to hold it down because it needs a bit of pressure to keep it drawing on the paper. And there's the, well, this is not actually tremendously useful now that it's stopped doing that. What is going on? I'm going to just try that again. So I need to open a, no, open capture device. That's it. And I assume I need to. Yeah. Okay. This is not the most terribly reliable thing. Oh, there we are. So what we have here are the two motors. We have a Raspberry Pi zero. All the software is running on that. I've got a little wiring loom that I soldered together to make it easier. And here is the, and it stopped again. And there is the control for the pen. So let me just leave that there. Ben, could I have a helper, please, with the camera? I'm going to try doing some. Now, this is going to be really difficult because I'm going to be typing blind into a terminal because we had that hardware issue. So I'm just going to show you the plotter moving its pen up and down. PG.pen.down. Now for the gentleman who lent me this keyboard, can you show me where the brackets are, please? No, no, what do you call them? Braces. Perenthesies. Yes, yes, yes. Your Pee World, yes. So this is new to me. Shift, yes. Good. You opened and closed them. No, I didn't get my closing now, too. There you go. Okay. So if I've done the right thing, oh, there you are. Okay. You haven't seen the pen has moved, but the video hasn't. There you are. Okay. So good. And I can do PG for pantograph.pen.up. Can you show me again where this? Shift. Oh, my goodness. Okay. Like so. Yeah. And that will, I mistyped something there. So let's PG.pen. Do you know what's going to, well, then we can't have both, can we? Can you dictate the typing? Yeah. Yes. My God. In the 1970s, there's a terrible air crash when engine number two of a DC-10 exploded and severed a number of the hydraulic lines. And the only way they had left, they discovered a new way to fly a DC-10, which was through asymmetric thrust of the two engines they could control because they could barely control anything else. And the captain called in other pilots who happened to be on the plane, and there was a team of them in the cockpit, and they basically invented a new way of flying. So he stepped back from the controls completely. And they managed to land the plane at Sioux City. You probably have heard of this terrible accident. At the very last moment, there was a downdraft or a gust of wind, and the plane actually some assaulted, but they saved most of the lives of the people on that plane. So this is not as heroic, but I'm very grateful that we've got some pilots on board. So PG. Yes. Do PG.PEN.UP and then the parentheses. There you are. Okay. Now, wait. So I'm going to switch back to this here, and I'm going to show you how Ben, perhaps you can shine the camera on one of those. So you can draw little pictures like so. Oh, I've got them on here. I can show you what they look like, and you can come around and have a look. Any minute. I'll be on the screen. Yeah. So there you are. So this is the kind of output we can get. Oh, it makes me look like a narcissist that is pictures of me. You can do this picture instead. There you are. So there's a little boy holding a teddy bear or a rabbit. As you can see, it's a very accurate pen plotter, but I think it has a kind of charm through its wiggly lines. Now it's a little bit, you have to understand, to draw a straight line with an axial plotter is very easy. You just move the pen down one of the axes. On this, the only movement that I have is rotation. So if my point, my XY point is over here and the end of my line is over there, another XY point, I want to draw a straight line between them. But if I make the motors go from the position they need to be at for that point to the position they need to be at for that point, what I'll get is not a straight line, but I'll get a curve because the motion of the motors is rotary. So every line I get, I have to break it down into lots of small pieces. So I break it down into 1 tenth of a millimeter, as if I'm going to make that kind of accuracy, but that's what I do. So every line has to be broken into many, many smaller lines so that we can get a straight line. And so with a little bit of confusion here because everything is in the wrong place due to the little panic I had earlier. So I adapted a library that I found called line draw that vectorizes bitmaps. And I adapted it to give me some JSON output that I can feed into the plotter. So for example, this morning, just before I came into the building, I took this photograph and line draw, I'm going to run it on my Mac. I could run it on the Raspberry Pi, but the reason that I don't is that it uses NumPy and OpenCV. So although it does work, it is rather slow. So am I in the... No, I'm not in the right directory. Where am I? Let's see line draw.Mac. And... So let's do Python. I probably need to make that a little bigger. Import line draw. Don't... Thank you very much. Okay. So... Yeah, okay. Thank you. Thank you. But don't go too far. Okay. So what I've got, I've got that crane image and I'm going to do line draw. I've probably got... There you are. So I'm going to take some input. Can you see that well enough, I hope? Yeah. There's the crane.jpg. I'm going to put it out as JSON. I'm not going to draw hatches. I'm not going to fill in the image. It makes it faster. And I'm going to simplify the contours. So I'll show you. If I make this, if I simplify... No, I've got no... Line draw. See I'm such a bad programmer. I always do that because I like it. So I'm going to simplify the contours a lot. So it only makes 28 strokes for the whole thing and that's going to be looking like that. Okay. That's the rendition of that. But if I did it without any simplification, it would take quite a long time. But I was experimenting earlier and 1.5 will do it reasonably quickly and give me a reasonably accurate output. So has it finished yet? There you are. I'm going to send to the plotter. And that is just some JSON. As you can see, it looks exactly like the crane, doesn't it? So earlier I sent that over to the Raspberry Pi and I think we'll head over... You're good at typing, aren't you? And so I've got to remember now. It's... Do you want to switch to that? Yes, let's switch this. Let's do this. That's probably better. And then we can always switch back to the camera afterwards. Okay. So actually if you just go up, that would be... Here's one I made earlier. If it's remembered the command. I was experimenting with some stuff. There we are. So instead of... No, don't make it plot me. Make it plot the crane.json, please. And now... Go ahead. Hit fire. Oh. Okay. Can you exit from there? Let's have a look at the... You were in the right place. There is no crane there. Never mind. We'll print another image instead. Let's... Okay. Go back into Python. And can you do from... Pantograph... Sorry. From... Oh, God. Yeah. Okay. Let's go find the... From pgm.star. I wanted to show you some of the calibration routines so that it makes this more accurate, but never mind that for now. We'll have to do something else. Let's plot my little nephew, Oscar. So he was... Where's the... Okay. Okay. Let's... Okay. Let's... Okay. Let's... So pg.plot underscore file. No. Yes. Sorry. Sorry. Sorry. Sorry. So, we might... Um, parentheses and quotes and other quotes, yep. And it's ep19.json. And this is the logo of EuroPython. Let's try that. Okay. I will... Let's just let... Let this go so we can see... It's going to take a while. I'll go ahead. Yeah. Great. So you can see it's... You need to switch back. Yup, I'm going to. So you can see it's looping all over the lines in that JSON. Now you'll get the delayed action over here. I think this is what they use on live broadcasts when they think somebody might do something I've seen in the audience. And they've got three seconds in which to, we need the camera, don't we? And don't worry. I'm going to start that again. We're not having too much luck with the camera, Martin. Would you do that? Just a quick time instead. Sorry, we're trying to get the video, but it's very laggy. This is another pilot coming to help us. This is a. I might just use my windows. Go ahead. Yes. OK. I'm getting some new video recording from the camera. Yep. OK. And will it show live? OK. It's not much diversity among these pilots. Oh, OK. Yeah, let's get a better angle. Let's make it that bigger. So can you get a better angle, Ben, so that we can see? And now what I normally have to do is drawing. Normally, I rub the pen a little bit to prime it, but you can see that it's. I'll take charge of this. So it's not very fast. But it does plot. As you can see, it's tracing out its wiggly line. Let's see if we can capture it from there. And it's drawing a long line right now. And the moment you see the pen is in the down position, when it's finished this line, that server will twitch and will lift the pen. There you are. It's going up and down. Can you see that well enough from where you're sitting? Yeah? So it's pretty simple. I mean, that's really the whole of it. And I'm kind of running out of time now. So I think we've, thank you very much. We've landed safely. That all means come and have a look at this afterwards. And maybe you've got some ideas about how to make Macbooks and Raspberry Pis talk more reliably when they're at conferences and not just before breakfast. I can probably leave this there, so it's still drawing. I just want to quickly go back and finish off here. So I'm always, it's a work in progress. I want to make this better. I've got another design now, which I think will be much simpler. And this is going to, instead of having a pantograph, we'll just have two arms, still the same number of motors, one, two, and three. This will have better reach. I think it will be simpler to make. I think it will have more mechanical advantage on the motors. So I think I'll get better results from this, but I haven't actually written the mathematics to drive that. So that's, and I think it'll be simpler, which is the important thing. Because for me, I don't mind that the lines are all quite wiggly on this. I think it's just part of the charm. So I don't want to make it more precise. I want to make it better, which means I want to make it simpler and cheaper and easier to build and reproduce. Because somebody who doesn't have success with it first time is going to give up. So I want to be able to make a kit or a set of instructions that almost anybody can do something with this. So I'm going to be sprinting on that, perhaps, on Saturday. Another reminder of that, please take a look. I'd be very grateful. And talk to me. Thank you very much. I don't know if we have time for questions, but I think we just about made it. We do have time for questions. Great. Thank you very much. Thank you. And we'll be 的下去できでき属于 Let's do that again. Will�我们必须做什么? Ed, please bring the seatbelt. Let's take a picture. Yes. Thank you. Thank you. Thank you for doing that. Thank you very much. Okay. Now, I just would like to thank David, for the interview caused. I can't think and hold the camera at the same time. Yeah. You definitely could. You just need motors powerful enough to do that. And I did have some larger motors that could draw bigger and were more accurate. Ironically, I found the cheapest motors, sorry, the volume is rather loud for me again. Danuka, could you turn it down a bit for me please? If you use digital server motors which are faster and stronger and more accurate, you just get lots of oscillations because they're trying to constantly correct. So this has got lots of dead spots in the movement. And that actually absorbs many of the problems that I had with digital motors. So cheapo actually worked better. But with a powerful motor, with rigid materials, yes, of course it could be scaled up. Could you do that at the time you were talking about the jittery? Could you do that at the time of mechanical compensator service, basically a suspension that stops it from jittery? I wasted a huge amount of time trying to make those better servos work. But I never, in the end, the cheap ones worked best. If you've got a few minutes and there are no more questions, please come and crowd around and have a look at it actually working because you'll get a much better sense of it when you're standing in front of it. And if you think of any questions, go ahead. Yes, let's close the session. Thanks, Danila. Thank you very much. Thank you all. And thank you for your patience. Yes. Thank you.
 First of all, I apologize for the delay.  I tested my hardware and software last night before I went to bed and this morning after  breakfast before packing it all up.  So of course as soon as I plugged it in here, it refused to work as it normally does.  And that's what you get for not just doing live demonstrations or worse live demonstrations  with hardware but live demonstrations with home-built hardware that's held together with  rubber bands.  So I think the actual problem is my MacBook that the networking between the MacBook and  the Raspberry Pi is not working as it should.  You should be able to connect them via a USB cable and the Raspberry Pi will go into a  certain mode and will be available to the, well, in this case to a MacBook that as well  as providing power is also connecting to it with a network connection.  So this means I'm going to have to do a bit of swapping, typing on an unfamiliar keyboard.  There might still be a problem with the Pi and so we might have some other troubles as  well but I feel you're probably on my side rather than against me.  Not like that keynote speaker yesterday where some people were rather unkind.  So this is me.  I'm Daniela.  That's what I look like on television.  As you can see, I'm Python software.  Can we turn the volume down a little bit because I'm getting it rather loud in my, yeah.  Thank you.  I work at DVO.  I have a web cloud hosting platform built in Python and Django and for Python and Django  developers but we also host other things.  So please come and talk to me if you want to talk about Docker or Django or deployment  or any of those things.  I'm a core developer of the Django project itself and an ex-vice president of the Django  software foundation which is not really as grand as it sounds although.  I go to a lot of these events.  It's part of my job so I'm really fortunate to have a job in which I go to events all  over the place.  I love going to these events.  I love meeting people.  And what happens at these events is this kind of valuable, friendly magic of your pythons  and pycons.  And after all these conferences I still enjoy coming to them.  But this magic works hardest on the people who are new to their careers or to Python  or to programming or even in places where Python and programming are quite new as industries.  So for the people who aren't yet confident, who aren't yet sure whether this is for them,  who aren't sure of their future success, there's something really brilliant going on in these  events.  And I see it particularly in my African travels.  So I'm amazingly fortunate to be able to do some of these things as part of my job.  I've been involved in Python Namibia since 2015.  We've held five editions.  And from that have come several others.  There's also a regular Pycon in South Africa but that can run under its own steam.  So if you saw yesterday in the lightning talks, I mentioned that we're holding Pycon Africa  in August this year.  These are some of my friends from Namibia, part of the organizing team of Pycon Namibia.  There's Pycon Africa, if you want to know about that, come and talk to me.  And as I mentioned, we have opened a fundraising campaign just to try and get a little bit  more money into our financial assistance program.  You can probably know where to find me here but you can also find me online.  So when I go to conferences, for example, in Namibia, one of the things people are interested  in is robotics.  And there are all kinds of robotics projects you can do with Python.  You can find out a lot of information about them.  And they look really good but they all seem to involve things like 3D printers and laser  cutters and hack spaces and university laboratories and so on.  And most people don't have that kind of thing.  So I wondered if I could build a pen plotter.  This is an axial pen plotter with a pen to move on two axes.  So the challenge that I set myself was what is the cheapest and simplest pen plotter that  could possibly be made?  Well, I've got a camera here so I can also show you some more video.  But here it is.  Here's one of the first iterations of it.  What can you see there?  You can see it uses a ballpoint pen for the drawing in the hinges.  It uses the part of the tube of a ballpoint pen.  And those are some wooden sticks I found.  Here's another version.  I found it's a good way to get your talks accepted at a conference if you flatter them  by printing out their logo with your robot.  Those are some rather nice servos that I blew up so I don't have those.  This is how the pen lifts up and down.  You can see there's a...  It uses the arm of the servo to do that.  I had to call into play all my high school mathematics, which is from a very long time  ago because I'm probably older than you think I am.  And so I had to relearn a certain amount of trigonometry.  And this is how it works.  It's a pantograph, which is the same kind of mechanism that's used on a tram to lift  the connector up to the wires.  So we have two motors at the top that rotate.  And there are two...  There's a yellow and red driving arm and a green and a blue following arm.  So it forms a pentagon.  There are five sides because you've got to account for the space between the two motors.  So two motors, four arms, five sides.  And then when you're doing the maths for this, after a while the whole world seems  to be composed of triangles.  It's remarkable.  And this is the mathematics.  You don't need to worry too much about that.  Because this is intended as an educational thing, it's actually broken down as much as  I could possibly break it down.  So you can see that as long as you're able to break down a shape into triangles, you  can do this with fairly simple trigonometry.  So the bill of materials.  This is crucial because, say, a Namibian student does not have a 3D printer or something like  that that was bought on a whim.  The total bill of materials, Raspberry Pi zero for $5, three servo motors for about  $3 each, some stiff card, some wood glue which you need to buy, and a ballpoint pen which  you can probably steal from somewhere.  And then the tools are very simple.  You need something to make some holes with.  You need a knife to cut the card, a small screwdriver, a first aid kit.  And to avoid getting into domestic trouble, then I recommend having a damp clothed white  wood glue off the table when you finish because it saves, it helps.  So there's a very incomplete, in progress GitHub repository for the code that I've written  for this.  I'll show it again afterwards.  It is very incomplete and I'm not doing a very good job at updating it.  So there we are doing an update.  You can go away.  That was the slides part.  Now I want to show you what the machine looks like.  So if I switch over to this and with this magic camera with a delay, apparently, or maybe  not a delay, maybe it's not working at all.  Now that Martin came and showed us how to set this up and get it going, I'm going to  just, oh, well, that is quite a delay.  Oh, no, there we are.  I think that's, so, you can't see it.  Why can't you see it?  Because I've got to do that.  Yes.  Okay.  So this is really difficult with a delay.  Can I make this full screen?  Well probably I can make it full screen, but I'm pushing my luck here with hardware and  software.  So this is the pantograph.  So we've got, there really is a delay there.  Maybe it seems to stop.  Okay.  Well, you can see that.  You can see the two motors and the forearms.  You can see a weight on top of the pen to hold it down because it needs a bit of pressure  to keep it drawing on the paper.  And there's the, well, this is not actually tremendously useful now that it's stopped  doing that.  What is going on?  I'm going to just try that again.  So I need to open a, no, open capture device.  That's it.  And I assume I need to.  Yeah.  Okay.  This is not the most terribly reliable thing.  Oh, there we are.  So what we have here are the two motors.  We have a Raspberry Pi zero.  All the software is running on that.  I've got a little wiring loom that I soldered together to make it easier.  And here is the, and it stopped again.  And there is the control for the pen.  So let me just leave that there.  Ben, could I have a helper, please, with the camera?  I'm going to try doing some.  Now, this is going to be really difficult because I'm going to be typing blind into a  terminal because we had that hardware issue.  So I'm just going to show you the plotter moving its pen up and down.  PG.pen.down.  Now for the gentleman who lent me this keyboard, can you show me where the brackets are, please?  No, no, what do you call them?  Braces.  Perenthesies.  Yes, yes, yes.  Your Pee World, yes.  So this is new to me.  Shift, yes.  Good.  You opened and closed them.  No, I didn't get my closing now, too.  There you go.  Okay.  So if I've done the right thing, oh, there you are.  Okay.  You haven't seen the pen has moved, but the video hasn't.  There you are.  Okay.  So good.  And I can do PG for pantograph.pen.up.  Can you show me again where this?  Shift.  Oh, my goodness.  Okay.  Like so.  Yeah.  And that will, I mistyped something there.  So let's PG.pen.  Do you know what's going to, well, then we can't have both, can we?  Can you dictate the typing?  Yeah.  Yes.  My God.  In the 1970s, there's a terrible air crash when engine number two of a DC-10 exploded  and severed a number of the hydraulic lines.  And the only way they had left, they discovered a new way to fly a DC-10, which was through  asymmetric thrust of the two engines they could control because they could barely control  anything else.  And the captain called in other pilots who happened to be on the plane, and there was  a team of them in the cockpit, and they basically invented a new way of flying.  So he stepped back from the controls completely.  And they managed to land the plane at Sioux City.  You probably have heard of this terrible accident.  At the very last moment, there was a downdraft or a gust of wind, and the plane actually  some assaulted, but they saved most of the lives of the people on that plane.  So this is not as heroic, but I'm very grateful that we've got some pilots on board.  So PG.  Yes.  Do PG.PEN.UP and then the parentheses.  There you are.  Okay.  Now, wait.  So I'm going to switch back to this here, and I'm going to show you how Ben, perhaps  you can shine the camera on one of those.  So you can draw little pictures like so.  Oh, I've got them on here.  I can show you what they look like, and you can come around and have a look.  Any minute.  I'll be on the screen.  Yeah.  So there you are.  So this is the kind of output we can get.  Oh, it makes me look like a narcissist that is pictures of me.  You can do this picture instead.  There you are.  So there's a little boy holding a teddy bear or a rabbit.  As you can see, it's a very accurate pen plotter, but I think it has a kind of charm  through its wiggly lines.  Now it's a little bit, you have to understand, to draw a straight line with an axial plotter  is very easy.  You just move the pen down one of the axes.  On this, the only movement that I have is rotation.  So if my point, my XY point is over here and the end of my line is over there, another  XY point, I want to draw a straight line between them.  But if I make the motors go from the position they need to be at for that point to the position  they need to be at for that point, what I'll get is not a straight line, but I'll get a  curve because the motion of the motors is rotary.  So every line I get, I have to break it down into lots of small pieces.  So I break it down into 1 tenth of a millimeter, as if I'm going to make that kind of accuracy,  but that's what I do.  So every line has to be broken into many, many smaller lines so that we can get a straight  line.  And so with a little bit of confusion here because everything is in the wrong place due  to the little panic I had earlier.  So I adapted a library that I found called line draw that vectorizes bitmaps.  And I adapted it to give me some JSON output that I can feed into the plotter.  So for example, this morning, just before I came into the building, I took this photograph  and line draw, I'm going to run it on my Mac.  I could run it on the Raspberry Pi, but the reason that I don't is that it uses NumPy  and OpenCV.  So although it does work, it is rather slow.  So am I in the...  No, I'm not in the right directory.  Where am I?  Let's see line draw.Mac.  And...  So let's do Python.  I probably need to make that a little bigger.  Import line draw.  Don't...  Thank you very much.  Okay.  So...  Yeah, okay.  Thank you.  Thank you.  But don't go too far.  Okay.  So what I've got, I've got that crane image and I'm going to do line draw.  I've probably got...  There you are.  So I'm going to take some input.  Can you see that well enough, I hope?  Yeah.  There's the crane.jpg.  I'm going to put it out as JSON.  I'm not going to draw hatches.  I'm not going to fill in the image.  It makes it faster.  And I'm going to simplify the contours.  So I'll show you.  If I make this, if I simplify...  No, I've got no...  Line draw.  See I'm such a bad programmer.  I always do that because I like it.  So I'm going to simplify the contours a lot.  So it only makes 28 strokes for the whole thing and that's going to be looking like that.  Okay.  That's the rendition of that.  But if I did it without any simplification, it would take quite a long time.  But I was experimenting earlier and 1.5 will do it reasonably quickly and give me a reasonably  accurate output.  So has it finished yet?  There you are.  I'm going to send to the plotter.  And that is just some JSON.  As you can see, it looks exactly like the crane, doesn't it?  So earlier I sent that over to the Raspberry Pi and I think we'll head over...  You're good at typing, aren't you?  And so I've got to remember now.  It's...  Do you want to switch to that?  Yes, let's switch this.  Let's do this.  That's probably better.  And then we can always switch back to the camera afterwards.  Okay.  So actually if you just go up, that would be...  Here's one I made earlier.  If it's remembered the command.  I was experimenting with some stuff.  There we are.  So instead of...  No, don't make it plot me.  Make it plot the crane.json, please.  And now...  Go ahead.  Hit fire.  Oh.  Okay.  Can you exit from there?  Let's have a look at the...  You were in the right place.  There is no crane there.  Never mind.  We'll print another image instead.  Let's...  Okay.  Go back into Python.  And can you do from...  Pantograph...  Sorry.  From...  Oh, God.  Yeah.  Okay.  Let's go find the...  From pgm.star.  I wanted to show you some of the calibration routines so that it makes this more accurate,  but never mind that for now.  We'll have to do something else.  Let's plot my little nephew, Oscar.  So he was...  Where's the...  Okay.  Okay.  Let's...  Okay.  Let's...  Okay.  Let's...  So pg.plot underscore file.  No.  Yes.  Sorry.  Sorry.  Sorry.  Sorry.  So, we might...  Um, parentheses and quotes and other quotes, yep.  And it's ep19.json.  And this is the logo of EuroPython.  Let's try that.  Okay.  I will...  Let's just let...  Let this go so we can see...  It's going to take a while.  I'll go ahead.  Yeah.  Great.  So you can see it's...  You need to switch back.  Yup, I'm going to.  So you can see it's looping all over the lines in that JSON.  Now you'll get the delayed action over here.  I think this is what they use on live broadcasts  when they think somebody might do something I've seen  in the audience.  And they've got three seconds in which to, we need the camera,  don't we?  And don't worry.  I'm going to start that again.  We're not having too much luck with the camera, Martin.  Would you do that?  Just a quick time instead.  Sorry, we're trying to get the video, but it's very laggy.  This is another pilot coming to help us.  This is a.  I might just use my windows.  Go ahead.  Yes.  OK.  I'm getting some new video recording from the camera.  Yep.  OK.  And will it show live?  OK.  It's not much diversity among these pilots.  Oh, OK.  Yeah, let's get a better angle.  Let's make it that bigger.  So can you get a better angle, Ben, so that we can see?  And now what I normally have to do is drawing.  Normally, I rub the pen a little bit to prime it,  but you can see that it's.  I'll take charge of this.  So it's not very fast.  But it does plot.  As you can see, it's tracing out its wiggly line.  Let's see if we can capture it from there.  And it's drawing a long line right now.  And the moment you see the pen is in the down position,  when it's finished this line, that server will twitch  and will lift the pen.  There you are.  It's going up and down.  Can you see that well enough from where you're sitting?  Yeah?  So it's pretty simple.  I mean, that's really the whole of it.  And I'm kind of running out of time now.  So I think we've, thank you very much.  We've landed safely.  That all means come and have a look at this afterwards.  And maybe you've got some ideas about how  to make Macbooks and Raspberry Pis talk more reliably  when they're at conferences and not just before breakfast.  I can probably leave this there, so it's still drawing.  I just want to quickly go back and finish off here.  So I'm always, it's a work in progress.  I want to make this better.  I've got another design now, which I think will be much simpler.  And this is going to, instead of having a pantograph,  we'll just have two arms, still the same number of motors,  one, two, and three.  This will have better reach.  I think it will be simpler to make.  I think it will have more mechanical advantage on the motors.  So I think I'll get better results from this,  but I haven't actually written the mathematics to drive that.  So that's, and I think it'll be simpler,  which is the important thing.  Because for me, I don't mind that the lines are all  quite wiggly on this.  I think it's just part of the charm.  So I don't want to make it more precise.  I want to make it better, which means I want to make it simpler  and cheaper and easier to build and reproduce.  Because somebody who doesn't have success with it first time  is going to give up.  So I want to be able to make a kit or a set of instructions  that almost anybody can do something with this.  So I'm going to be sprinting on that, perhaps, on Saturday.  Another reminder of that, please take a look.  I'd be very grateful.  And talk to me.  Thank you very much.  I don't know if we have time for questions,  but I think we just about made it.  We do have time for questions.  Great.  Thank you very much.  Thank you.  And we'll be 的下去できでき属于  Let's do that again.  Will�我们必须做什么?  Ed, please bring the seatbelt.  Let's take a picture.  Yes.  Thank you.  Thank you.  Thank you for doing that.  Thank you very much.  Okay.  Now, I just would like to thank David,  for the interview caused.  I can't think and hold the camera at the same time.  Yeah.  You definitely could.  You just need motors powerful enough to do that.  And I did have some larger motors that could draw bigger and were more accurate.  Ironically, I found the cheapest motors, sorry, the volume is rather loud for me again.  Danuka, could you turn it down a bit for me please?  If you use digital server motors which are faster and stronger and more accurate,  you just get lots of oscillations because they're trying to constantly correct.  So this has got lots of dead spots in the movement.  And that actually absorbs many of the problems that I had with digital motors.  So cheapo actually worked better.  But with a powerful motor, with rigid materials, yes, of course it could be scaled up.  Could you do that at the time you were talking about the jittery?  Could you do that at the time of mechanical compensator service, basically a suspension that stops it from jittery?  I wasted a huge amount of time trying to make those better servos work.  But I never, in the end, the cheap ones worked best.  If you've got a few minutes and there are no more questions,  please come and crowd around and have a look at it actually working  because you'll get a much better sense of it when you're standing in front of it.  And if you think of any questions, go ahead.  Yes, let's close the session.  Thanks, Danila.  Thank you very much.  Thank you all.  And thank you for your patience.  Yes.  Thank you.
Daniele_Procida_-_The_world_s_cheapest__simplest_plotter_Rn4X2ZgZvsk_0_2207.png Daniele_Procida_-_The_world_s_cheapest__simplest_plotter_Rn4X2ZgZvsk_2208_2603.png Daniele_Procida_-_The_world_s_cheapest__simplest_plotter_Rn4X2ZgZvsk_2604_3371.png Daniele_Procida_-_The_world_s_cheapest__simplest_plotter_Rn4X2ZgZvsk_3372_6479.png Daniele_Procida_-_The_world_s_cheapest__simplest_plotter_Rn4X2ZgZvsk_6480_7235.png Daniele_Procida_-_The_world_s_cheapest__simplest_plotter_Rn4X2ZgZvsk_7236_8183.png Daniele_Procida_-_The_world_s_cheapest__simplest_plotter_Rn4X2ZgZvsk_8184_10331.png Daniele_Procida_-_The_world_s_cheapest__simplest_plotter_Rn4X2ZgZvsk_10332_10931.png Daniele_Procida_-_The_world_s_cheapest__simplest_plotter_Rn4X2ZgZvsk_10932_11003.png Daniele_Procida_-_The_world_s_cheapest__simplest_plotter_Rn4X2ZgZvsk_11004_11171.png Daniele_Procida_-_The_world_s_cheapest__simplest_plotter_Rn4X2ZgZvsk_11172_11303.png Daniele_Procida_-_The_world_s_cheapest__simplest_plotter_Rn4X2ZgZvsk_11304_12107.png Daniele_Procida_-_The_world_s_cheapest__simplest_plotter_Rn4X2ZgZvsk_12108_12431.png Daniele_Procida_-_The_world_s_cheapest__simplest_plotter_Rn4X2ZgZvsk_12432_13079.png Daniele_Procida_-_The_world_s_cheapest__simplest_plotter_Rn4X2ZgZvsk_13080_13175.png Daniele_Procida_-_The_world_s_cheapest__simplest_plotter_Rn4X2ZgZvsk_13176_13379.png Daniele_Procida_-_The_world_s_cheapest__simplest_plotter_Rn4X2ZgZvsk_13380_14639.png Daniele_Procida_-_The_world_s_cheapest__simplest_plotter_Rn4X2ZgZvsk_14640_15503.png Daniele_Procida_-_The_world_s_cheapest__simplest_plotter_Rn4X2ZgZvsk_15504_15659.png Daniele_Procida_-_The_world_s_cheapest__simplest_plotter_Rn4X2ZgZvsk_15660_15755.png Daniele_Procida_-_The_world_s_cheapest__simplest_plotter_Rn4X2ZgZvsk_15756_18647.png Daniele_Procida_-_The_world_s_cheapest__simplest_plotter_Rn4X2ZgZvsk_18648_19607.png Daniele_Procida_-_The_world_s_cheapest__simplest_plotter_Rn4X2ZgZvsk_19608_20447.png Daniele_Procida_-_The_world_s_cheapest__simplest_plotter_Rn4X2ZgZvsk_20448_20807.png Daniele_Procida_-_The_world_s_cheapest__simplest_plotter_Rn4X2ZgZvsk_20808_21023.png Daniele_Procida_-_The_world_s_cheapest__simplest_plotter_Rn4X2ZgZvsk_21024_21083.png Daniele_Procida_-_The_world_s_cheapest__simplest_plotter_Rn4X2ZgZvsk_21084_21923.png Daniele_Procida_-_The_world_s_cheapest__simplest_plotter_Rn4X2ZgZvsk_21924_22607.png Daniele_Procida_-_The_world_s_cheapest__simplest_plotter_Rn4X2ZgZvsk_22608_22799.png Daniele_Procida_-_The_world_s_cheapest__simplest_plotter_Rn4X2ZgZvsk_22800_23903.png Daniele_Procida_-_The_world_s_cheapest__simplest_plotter_Rn4X2ZgZvsk_23904_26591.png Daniele_Procida_-_The_world_s_cheapest__simplest_plotter_Rn4X2ZgZvsk_26592_31691.png Daniele_Procida_-_The_world_s_cheapest__simplest_plotter_Rn4X2ZgZvsk_31692_32399.png Daniele_Procida_-_The_world_s_cheapest__simplest_plotter_Rn4X2ZgZvsk_32400_32567.png Daniele_Procida_-_The_world_s_cheapest__simplest_plotter_Rn4X2ZgZvsk_32568_32615.png Daniele_Procida_-_The_world_s_cheapest__simplest_plotter_Rn4X2ZgZvsk_32616_32771.png Daniele_Procida_-_The_world_s_cheapest__simplest_plotter_Rn4X2ZgZvsk_32772_34271.png Daniele_Procida_-_The_world_s_cheapest__simplest_plotter_Rn4X2ZgZvsk_34272_35663.png Daniele_Procida_-_The_world_s_cheapest__simplest_plotter_Rn4X2ZgZvsk_35664_36083.png Daniele_Procida_-_The_world_s_cheapest__simplest_plotter_Rn4X2ZgZvsk_36084_39023.png Daniele_Procida_-_The_world_s_cheapest__simplest_plotter_Rn4X2ZgZvsk_39024_39203.png Daniele_Procida_-_The_world_s_cheapest__simplest_plotter_Rn4X2ZgZvsk_39204_40667.png
First of all, I apologize for the delay. I tested my hardware and software last night before I went to bed and this morning after breakfast before packing it all up. So of course as soon as I plugged it in here, it refused to work as it normally does. And that's what you get for not just doing live demonstrations or worse live demonstrations with hardware but live demonstrations with home-built hardware that's held together with rubber bands. So I think the actual problem is my MacBook that the networking between the MacBook and the Raspberry Pi is not working as it should. You should be able to connect them via a USB cable and the Raspberry Pi will go into a certain mode and will be available to the, well, in this case to a MacBook that as well as providing power is also connecting to it with a network connection. So this means I'm going to have to do a bit of swapping, typing on an unfamiliar keyboard. There might still be a problem with the Pi and so we might have some other troubles as well but I feel you're probably on my side rather than against me. Not like that keynote speaker yesterday where some people were rather unkind. So this is me. I'm Daniela. That's what I look like on television. As you can see, I'm Python software. Can we turn the volume down a little bit because I'm getting it rather loud in my, yeah. Thank you. I work at DVO. I have a web cloud hosting platform built in Python and Django and for Python and Django developers but we also host other things. So please come and talk to me if you want to talk about Docker or Django or deployment or any of those things. I'm a core developer of the Django project itself and an ex-vice president of the Django software foundation which is not really as grand as it sounds although. I go to a lot of these events. It's part of my job so I'm really fortunate to have a job in which I go to events all over the place. I love going to these events. I love meeting people. And what happens at these events is this kind of valuable, friendly magic of your pythons and pycons. And after all these conferences I still enjoy coming to them. But this magic works hardest on the people who are new to their careers or to Python or to programming or even in places where Python and programming are quite new as industries. So for the people who aren't yet confident, who aren't yet sure whether this is for them, who aren't sure of their future success, there's something really brilliant going on in these events. And I see it particularly in my African travels. So I'm amazingly fortunate to be able to do some of these things as part of my job. I've been involved in Python Namibia since 2015. We've held five editions. And from that have come several others. There's also a regular Pycon in South Africa but that can run under its own steam. So if you saw yesterday in the lightning talks, I mentioned that we're holding Pycon Africa in August this year. These are some of my friends from Namibia, part of the organizing team of Pycon Namibia. There's Pycon Africa, if you want to know about that, come and talk to me. And as I mentioned, we have opened a fundraising campaign just to try and get a little bit more money into our financial assistance program. You can probably know where to find me here but you can also find me online. So when I go to conferences, for example, in Namibia, one of the things people are interested in is robotics. And there are all kinds of robotics projects you can do with Python. You can find out a lot of information about them. And they look really good but they all seem to involve things like 3D printers and laser cutters and hack spaces and university laboratories and so on. And most people don't have that kind of thing. So I wondered if I could build a pen plotter. This is an axial pen plotter with a pen to move on two axes. So the challenge that I set myself was what is the cheapest and simplest pen plotter that could possibly be made? Well, I've got a camera here so I can also show you some more video. But here it is. Here's one of the first iterations of it. What can you see there? You can see it uses a ballpoint pen for the drawing in the hinges. It uses the part of the tube of a ballpoint pen. And those are some wooden sticks I found. Here's another version. I found it's a good way to get your talks accepted at a conference if you flatter them by printing out their logo with your robot. Those are some rather nice servos that I blew up so I don't have those. This is how the pen lifts up and down. You can see there's a... It uses the arm of the servo to do that. I had to call into play all my high school mathematics, which is from a very long time ago because I'm probably older than you think I am. And so I had to relearn a certain amount of trigonometry. And this is how it works. It's a pantograph, which is the same kind of mechanism that's used on a tram to lift the connector up to the wires. So we have two motors at the top that rotate. And there are two... There's a yellow and red driving arm and a green and a blue following arm. So it forms a pentagon. There are five sides because you've got to account for the space between the two motors. So two motors, four arms, five sides. And then when you're doing the maths for this, after a while the whole world seems to be composed of triangles. It's remarkable. And this is the mathematics. You don't need to worry too much about that. Because this is intended as an educational thing, it's actually broken down as much as I could possibly break it down. So you can see that as long as you're able to break down a shape into triangles, you can do this with fairly simple trigonometry. So the bill of materials. This is crucial because, say, a Namibian student does not have a 3D printer or something like that that was bought on a whim. The total bill of materials, Raspberry Pi zero for $5, three servo motors for about $3 each, some stiff card, some wood glue which you need to buy, and a ballpoint pen which you can probably steal from somewhere. And then the tools are very simple. You need something to make some holes with. You need a knife to cut the card, a small screwdriver, a first aid kit. And to avoid getting into domestic trouble, then I recommend having a damp clothed white wood glue off the table when you finish because it saves, it helps. So there's a very incomplete, in progress GitHub repository for the code that I've written for this. I'll show it again afterwards. It is very incomplete and I'm not doing a very good job at updating it. So there we are doing an update. You can go away. That was the slides part. Now I want to show you what the machine looks like. So if I switch over to this and with this magic camera with a delay, apparently, or maybe not a delay, maybe it's not working at all. Now that Martin came and showed us how to set this up and get it going, I'm going to just, oh, well, that is quite a delay. Oh, no, there we are. I think that's, so, you can't see it. Why can't you see it? Because I've got to do that. Yes. Okay. So this is really difficult with a delay. Can I make this full screen? Well probably I can make it full screen, but I'm pushing my luck here with hardware and software. So this is the pantograph. So we've got, there really is a delay there. Maybe it seems to stop. Okay. Well, you can see that. You can see the two motors and the forearms. You can see a weight on top of the pen to hold it down because it needs a bit of pressure to keep it drawing on the paper. And there's the, well, this is not actually tremendously useful now that it's stopped doing that. What is going on? I'm going to just try that again. So I need to open a, no, open capture device. That's it. And I assume I need to. Yeah. Okay. This is not the most terribly reliable thing. Oh, there we are. So what we have here are the two motors. We have a Raspberry Pi zero. All the software is running on that. I've got a little wiring loom that I soldered together to make it easier. And here is the, and it stopped again. And there is the control for the pen. So let me just leave that there. Ben, could I have a helper, please, with the camera? I'm going to try doing some. Now, this is going to be really difficult because I'm going to be typing blind into a terminal because we had that hardware issue. So I'm just going to show you the plotter moving its pen up and down. PG.pen.down. Now for the gentleman who lent me this keyboard, can you show me where the brackets are, please? No, no, what do you call them? Braces. Perenthesies. Yes, yes, yes. Your Pee World, yes. So this is new to me. Shift, yes. Good. You opened and closed them. No, I didn't get my closing now, too. There you go. Okay. So if I've done the right thing, oh, there you are. Okay. You haven't seen the pen has moved, but the video hasn't. There you are. Okay. So good. And I can do PG for pantograph.pen.up. Can you show me again where this? Shift. Oh, my goodness. Okay. Like so. Yeah. And that will, I mistyped something there. So let's PG.pen. Do you know what's going to, well, then we can't have both, can we? Can you dictate the typing? Yeah. Yes. My God. In the 1970s, there's a terrible air crash when engine number two of a DC-10 exploded and severed a number of the hydraulic lines. And the only way they had left, they discovered a new way to fly a DC-10, which was through asymmetric thrust of the two engines they could control because they could barely control anything else. And the captain called in other pilots who happened to be on the plane, and there was a team of them in the cockpit, and they basically invented a new way of flying. So he stepped back from the controls completely. And they managed to land the plane at Sioux City. You probably have heard of this terrible accident. At the very last moment, there was a downdraft or a gust of wind, and the plane actually some assaulted, but they saved most of the lives of the people on that plane. So this is not as heroic, but I'm very grateful that we've got some pilots on board. So PG. Yes. Do PG.PEN.UP and then the parentheses. There you are. Okay. Now, wait. So I'm going to switch back to this here, and I'm going to show you how Ben, perhaps you can shine the camera on one of those. So you can draw little pictures like so. Oh, I've got them on here. I can show you what they look like, and you can come around and have a look. Any minute. I'll be on the screen. Yeah. So there you are. So this is the kind of output we can get. Oh, it makes me look like a narcissist that is pictures of me. You can do this picture instead. There you are. So there's a little boy holding a teddy bear or a rabbit. As you can see, it's a very accurate pen plotter, but I think it has a kind of charm through its wiggly lines. Now it's a little bit, you have to understand, to draw a straight line with an axial plotter is very easy. You just move the pen down one of the axes. On this, the only movement that I have is rotation. So if my point, my XY point is over here and the end of my line is over there, another XY point, I want to draw a straight line between them. But if I make the motors go from the position they need to be at for that point to the position they need to be at for that point, what I'll get is not a straight line, but I'll get a curve because the motion of the motors is rotary. So every line I get, I have to break it down into lots of small pieces. So I break it down into 1 tenth of a millimeter, as if I'm going to make that kind of accuracy, but that's what I do. So every line has to be broken into many, many smaller lines so that we can get a straight line. And so with a little bit of confusion here because everything is in the wrong place due to the little panic I had earlier. So I adapted a library that I found called line draw that vectorizes bitmaps. And I adapted it to give me some JSON output that I can feed into the plotter. So for example, this morning, just before I came into the building, I took this photograph and line draw, I'm going to run it on my Mac. I could run it on the Raspberry Pi, but the reason that I don't is that it uses NumPy and OpenCV. So although it does work, it is rather slow. So am I in the... No, I'm not in the right directory. Where am I? Let's see line draw.Mac. And... So let's do Python. I probably need to make that a little bigger. Import line draw. Don't... Thank you very much. Okay. So... Yeah, okay. Thank you. Thank you. But don't go too far. Okay. So what I've got, I've got that crane image and I'm going to do line draw. I've probably got... There you are. So I'm going to take some input. Can you see that well enough, I hope? Yeah. There's the crane.jpg. I'm going to put it out as JSON. I'm not going to draw hatches. I'm not going to fill in the image. It makes it faster. And I'm going to simplify the contours. So I'll show you. If I make this, if I simplify... No, I've got no... Line draw. See I'm such a bad programmer. I always do that because I like it. So I'm going to simplify the contours a lot. So it only makes 28 strokes for the whole thing and that's going to be looking like that. Okay. That's the rendition of that. But if I did it without any simplification, it would take quite a long time. But I was experimenting earlier and 1.5 will do it reasonably quickly and give me a reasonably accurate output. So has it finished yet? There you are. I'm going to send to the plotter. And that is just some JSON. As you can see, it looks exactly like the crane, doesn't it? So earlier I sent that over to the Raspberry Pi and I think we'll head over... You're good at typing, aren't you? And so I've got to remember now. It's... Do you want to switch to that? Yes, let's switch this. Let's do this. That's probably better. And then we can always switch back to the camera afterwards. Okay. So actually if you just go up, that would be... Here's one I made earlier. If it's remembered the command. I was experimenting with some stuff. There we are. So instead of... No, don't make it plot me. Make it plot the crane.json, please. And now... Go ahead. Hit fire. Oh. Okay. Can you exit from there? Let's have a look at the... You were in the right place. There is no crane there. Never mind. We'll print another image instead. Let's... Okay. Go back into Python. And can you do from... Pantograph... Sorry. From... Oh, God. Yeah. Okay. Let's go find the... From pgm.star. I wanted to show you some of the calibration routines so that it makes this more accurate, but never mind that for now. We'll have to do something else. Let's plot my little nephew, Oscar. So he was... Where's the... Okay. Okay. Let's... Okay. Let's... Okay. Let's... So pg.plot underscore file. No. Yes. Sorry. Sorry. Sorry. Sorry. So, we might... Um, parentheses and quotes and other quotes, yep. And it's ep19.json. And this is the logo of EuroPython. Let's try that. Okay. I will... Let's just let... Let this go so we can see... It's going to take a while. I'll go ahead. Yeah. Great. So you can see it's... You need to switch back. Yup, I'm going to. So you can see it's looping all over the lines in that JSON. Now you'll get the delayed action over here. I think this is what they use on live broadcasts when they think somebody might do something I've seen in the audience. And they've got three seconds in which to, we need the camera, don't we? And don't worry. I'm going to start that again. We're not having too much luck with the camera, Martin. Would you do that? Just a quick time instead. Sorry, we're trying to get the video, but it's very laggy. This is another pilot coming to help us. This is a. I might just use my windows. Go ahead. Yes. OK. I'm getting some new video recording from the camera. Yep. OK. And will it show live? OK. It's not much diversity among these pilots. Oh, OK. Yeah, let's get a better angle. Let's make it that bigger. So can you get a better angle, Ben, so that we can see? And now what I normally have to do is drawing. Normally, I rub the pen a little bit to prime it, but you can see that it's. I'll take charge of this. So it's not very fast. But it does plot. As you can see, it's tracing out its wiggly line. Let's see if we can capture it from there. And it's drawing a long line right now. And the moment you see the pen is in the down position, when it's finished this line, that server will twitch and will lift the pen. There you are. It's going up and down. Can you see that well enough from where you're sitting? Yeah? So it's pretty simple. I mean, that's really the whole of it. And I'm kind of running out of time now. So I think we've, thank you very much. We've landed safely. That all means come and have a look at this afterwards. And maybe you've got some ideas about how to make Macbooks and Raspberry Pis talk more reliably when they're at conferences and not just before breakfast. I can probably leave this there, so it's still drawing. I just want to quickly go back and finish off here. So I'm always, it's a work in progress. I want to make this better. I've got another design now, which I think will be much simpler. And this is going to, instead of having a pantograph, we'll just have two arms, still the same number of motors, one, two, and three. This will have better reach. I think it will be simpler to make. I think it will have more mechanical advantage on the motors. So I think I'll get better results from this, but I haven't actually written the mathematics to drive that. So that's, and I think it'll be simpler, which is the important thing. Because for me, I don't mind that the lines are all quite wiggly on this. I think it's just part of the charm. So I don't want to make it more precise. I want to make it better, which means I want to make it simpler and cheaper and easier to build and reproduce. Because somebody who doesn't have success with it first time is going to give up. So I want to be able to make a kit or a set of instructions that almost anybody can do something with this. So I'm going to be sprinting on that, perhaps, on Saturday. Another reminder of that, please take a look. I'd be very grateful. And talk to me. Thank you very much. I don't know if we have time for questions, but I think we just about made it. We do have time for questions. Great. Thank you very much. Thank you. And we'll be 的下去できでき属于 Let's do that again. Will�我们必须做什么? Ed, please bring the seatbelt. Let's take a picture. Yes. Thank you. Thank you. Thank you for doing that. Thank you very much. Okay. Now, I just would like to thank David, for the interview caused. I can't think and hold the camera at the same time. Yeah. You definitely could. You just need motors powerful enough to do that. And I did have some larger motors that could draw bigger and were more accurate. Ironically, I found the cheapest motors, sorry, the volume is rather loud for me again. Danuka, could you turn it down a bit for me please? If you use digital server motors which are faster and stronger and more accurate, you just get lots of oscillations because they're trying to constantly correct. So this has got lots of dead spots in the movement. And that actually absorbs many of the problems that I had with digital motors. So cheapo actually worked better. But with a powerful motor, with rigid materials, yes, of course it could be scaled up. Could you do that at the time you were talking about the jittery? Could you do that at the time of mechanical compensator service, basically a suspension that stops it from jittery? I wasted a huge amount of time trying to make those better servos work. But I never, in the end, the cheap ones worked best. If you've got a few minutes and there are no more questions, please come and crowd around and have a look at it actually working because you'll get a much better sense of it when you're standing in front of it. And if you think of any questions, go ahead. Yes, let's close the session. Thanks, Danila. Thank you very much. Thank you all. And thank you for your patience. Yes. Thank you.
my hardware and software last night before I went connect them via a USB cable and the Raspberry Pi on my side rather than against me. Not like that we also host other things. So please come and new to their careers or to Python or to see it particularly in my African travels. So I'm are interested in is robotics. And there are all laboratories and so on. And most people don't build a pen plotter. This is an axial pen plotter mathematics. You don't need to worry too much educational thing, it's actually broken down as The total bill of materials, Raspberry Pi zero for $5, three servo motors for about $3 each, some stiff card, some wood glue which you need to buy, and a ballpoint pen which you can probably steal from somewhere. And then the tools are very simple. You need something to make some holes with. You need a knife to cut the card, a small screwdriver, a first aid kit. And to avoid getting into domestic trouble, then I recommend having a damp clothed white wood glue off the doing some. Now, this is going to be really And the captain called in other pilots who you what they look like, and you can come around with an axial plotter is very easy. You just move for that point to the position they need to be at into many, many smaller lines so that we can get adapted a library that I found called line draw that vectorizes bitmaps. And I adapted it to give got... There you are. So I'm going to take some not going to fill in the image. It makes it it makes this more accurate, but never mind that us. This is a. I might just use my windows. Go recording from the camera. Yep. OK. And will it Macbooks and Raspberry Pis talk more reliably that at the time of mechanical compensator