 First of all, I apologise 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. 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 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 ear. Thank you. I work at DVO. We have a web cloud hosting platform built in Python and Django and four 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 actually 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 travel. 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 programme. You 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 hackspaces 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 where the pens 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 except of 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 it uses the arm of the servo to do that. I had to call in to play all my high school mathematics, which is from a very long time ago because I'm probably older than you think I am. So I had to relearn a certain amount of trigonometry. 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... Not on a tram, on a train 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. 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 five dollars, three server motors for about three dollars 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, but it is very incomplete and I'm not doing a very good job at updating it. Right, 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 Cayman 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 you know 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 uncapture device, that's it, and I assume I need to. 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's 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 keyword, can you show me where the brackets are please? No, no, what do you call the embraces? Paranthoses. Paranthoses, yes, yes, yes. You've heard you've heard, yes, so this is new to me. Shift, yes. Good. You open that and close them. No, I didn't mean to close it now too. Okay, so if I've done the right thing. Oh, there you are. Did you see the pen? Oh, you haven't seen the pen has moved but the video hasn't. Oh, there you are. Okay, so good. And I can do pg for pantograph.pen.up. Can you show me again where there's a shift? Shift function and see it's on the end. Shift, oh my goodness. Okay, like so. And that will, I mistype 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 to him? 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. PG.PEN.UP and then the parentheses. There you are. Okay, now. 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 round and have a look. Any minute I'll be on the screen. So there you are. So this is the kind of output we can get. It makes me look like a narcissist that has pictures of me. Do this picture instead. 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 millimetre 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. 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, let me make this, a library that I found called LineDraw that vectorises 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 LineDraw, 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 I'm not in the right directory, where am I? CDLineDraw.Mac. Probably need to make it a little bit bigger. What line draw? Oh, thank you very much. OK. So, OK, thank you very much. But don't go too far. So what I've got, I've got that crane image and I'm going to do LineDraw. I've probably got, there you are. So, I'm going to take some input. Can you see that well enough, I hope? There's the crane jpeg. I'm going to put it out as a 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... 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. OK, 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. So that's what 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 go ahead over... You're good at typing, aren't you? I've got to remember now. It's... Yes, let's switch this. Let's do this. That's probably better. And then we can always switch back to the camera afterwards. OK, so actually if you just go up that will be his one I made earlier. If it's remembered the command. I was experimenting with some stuff. There we are. No, don't make it plot me. Make it plot the crane.json, please. And now, go ahead. Fire. OK, can you exit from there? Let's have a look at the... Are you aware in the right place? There is no crane there. OK, never mind. We'll print another image instead. Let's... OK, go back into Python and can you do from... pantograph... Sorry, from... Oh, God. Yep. OK. Let's go and find the... from... I want 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... OK, OK, let's... OK, let's... So, pg.plot underscore file. No, yes, correct. Sorry, correct. Parentheses, quotes, and other quotes. Yep. And it's ep19.json. And this is the logo of EuroPython. Let's try that. OK. I will... Let's go so we can see... It's going to take a while, go ahead. Great, so you can see it's... You need to switch back. Yep, 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 obscene 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... Sorry, we're trying to get the video, but it's very laggy. This is another pilot coming to help us. This is... Go ahead, yes. OK. Yep, OK. And will it show live? OK. OK. Let's get a better angle. Let's make it that bigger. Can you get a better angle, Ben, so that we can see? And... Now what I normally have to do... It's drawing. Normally I rub the pen a little bit to prime it, but you can see that it's... I'll take... 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... Catch 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 servo 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. By 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. I think it will be simpler, which is the important thing. 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. Thank you, Donila. I think we can let a plot while we have questions and answers. Would you mind getting to a microphone? Ben, could I ask you to hold the camera again while it's drawing? I can't think and hold the camera at the same time. You definitely could. You just need motors powerful enough to do that. I did have some larger motors that could draw bigger and were more accurate. Ironically, I found that the cheapest motors sorry, the volume is rather loud for me again. Donuka, could you turn it down a bit for me please? If you use digital servo 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. A powerful motor with rigid materials, yes, of course it could be scaled up. I wasted a huge amount of time trying to make those better servos work. But 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. If you think of any questions, go ahead. Let's close the session. Thank you very much. Thank you for your patience.