A Python-powered pantographic plotter
This is a modal window.
The media could not be loaded, either because the server or network failed or because the format is not supported.
Formal Metadata
Title |
| |
Subtitle |
| |
Alternative Title |
| |
Title of Series | ||
Number of Parts | 118 | |
Author | ||
License | CC Attribution - NonCommercial - ShareAlike 3.0 Unported: You are free to use, adapt and copy, distribute and transmit the work or content in adapted or unchanged form for any legal and non-commercial purpose as long as the work is attributed to the author in the manner specified by the author or licensor and the work or content is shared also in adapted form only under the conditions of this | |
Identifiers | 10.5446/44755 (DOI) | |
Publisher | ||
Release Date | ||
Language |
Content Metadata
Subject Area | ||
Genre | ||
Abstract |
| |
Keywords |
EuroPython 2019116 / 118
2
7
8
15
20
30
33
36
39
40
45
49
51
55
57
58
63
64
66
68
69
71
74
77
78
80
82
96
98
105
107
108
110
113
115
00:00
PantographPlotterPersonal digital assistantProjective planeComputer programmingMereologySpacetimeHacker (term)Universe (mathematics)VideoconferencingProcess (computing)Event horizonHydraulic motorMathematicsRegular graphComputing platformBitSoftware developerCore dumpPentagonWave packetPoint cloudArmLattice (order)PlotterInformationPantographMultiplication signVolume (thermodynamics)TriangleWeb 2.0Flow separationMechanism designSoftwareConnected spaceKeyboard shortcutComputer hardwareIterationRevision controlRoboticsCASE <Informatik>TrigonometryPower (physics)Musical ensembleAsynchronous Transfer ModeFrame problemException handlingComputer animation
06:57
MathematicsAngleVertical directionDegree (graph theory)PlastikkarteTrigonometryTotal S.A.TriangleStudent's t-testHydraulic motorServer (computing)Computer animation
07:17
PlastikkartePlastikkarteHydraulic motorSoftware development kitMereologySlide ruleDampingTable (information)Arithmetic progressionVirtual machineRepository (publishing)CodeProcess (computing)Lecture/ConferenceComputer animation
08:48
Hydraulic motorComputer hardwarePantographSoftwareWeightTouchscreenComputer animationEngineering drawing
09:23
WeightBitPressureMotion captureHydraulic motorSoftwareOpen setGame controllerEngineering drawingComputer animation
10:36
PlotterComputer hardwarePoisson-KlammerRadical (chemistry)Keyboard shortcutPlot (narrative)Computer animation
11:07
PlanningMoment (mathematics)PlotterFunction (mathematics)Point (geometry)Line (geometry)Hydraulic motorTouchscreenRaster graphicsBitLibrary (computing)BuildingPantographVideoconferencingRotationNumerical analysisCurveShift operatorPosition operatorGame controllerMetreDigital photographyCrash (computing)Personal identification numberWhiteboardType theoryComputer animation
16:03
LoginPhysical systemComputer fileLocal ringAddress spaceComputer programCone penetration testSource codeDefault (computer science)Data typeInformationActive contour modelSoftwarePantographDistribution (mathematics)Term (mathematics)Open sourcePentagramModule (mathematics)outputLine (geometry)Directory serviceMedical imagingProgrammer (hardware)Active contour modelComputer animation
17:43
Active contour modelPoint (geometry)SequenceSource codeData typeModule (mathematics)Error messageComputer-generated imageryComputer fileInformationMultiplication signPlotterMusical ensembleFunction (mathematics)Disk read-and-write headComputer animation
18:43
Graph (mathematics)PantographComputer filePlot (narrative)BuildingModule (mathematics)Directory serviceElectronic signatureTriangleInformationQuicksortStaff (military)Plot (narrative)Medical imagingComputer fileFerry CorstenLetterpress printingGodLine (geometry)Computer animationSource codeJSON
21:00
Moment (mathematics)Position operatorAngleBroadcasting (networking)Line (geometry)Plot (narrative)BitVideoconferencing2 (number)Group actionComputer animation
22:47
Multiplication signArithmetic meanPiComputer animationLecture/Conference
23:23
TriangleCAN busBuildingArithmetic progressionHydraulic motorArmPantographMathematicsMultiplication signSoftware development kitMereologySet theoryNumerical analysisLine (geometry)ResultantLecture/ConferenceComputer animation
24:48
Hydraulic motorMultiplication signLecture/Conference
25:34
Hydraulic motorBitVolume (thermodynamics)Power (physics)OscillationMaterialization (paranormal)Lecture/ConferenceComputer animation
26:22
Multiplication signServer (computing)1 (number)Lecture/Conference
26:45
Lecture/Conference
Transcript: English(auto-generated)
00:03
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
00:20
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 and so I think the actual problem is my macbook that the networking between the
00:42
macbook and the Raspberry Pi is not working as it should 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 to the well in this case to a macbook that's as well as providing power is also connecting to it
01:04
with a network connection so this means I'm have to do a bit of swapping typing on an unfamiliar keyboard there might still be a problem with the pie 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
01:21
some people were rather unkind so this is me I'm Daniela that's what I like on television and as you can see I am Python software and I work at I tell can we turn the volume down a little bit because I'm getting it rather loud in my ear thank you I work at Devio we have a web cloud
01:46
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
02:01
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
02:23
I love going to these events I love meeting people and what happens at these events is this kind of valuable friendly magic of euro pythons and pythons 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
02:48
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
03:02
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
03:23
several others there's also a regular PyCon in South Africa but that's can run under its own steam so we've got 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 the organizing part of the organizing
03:41
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 well you probably know where to find me here but you can also find me online so when I go to conferences for
04:11
example in Namibia and one of the things people are in people are interested in is robotics and there are all kinds of robotics projects you can
04:23
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
04:43
pen plotter this is an axial pen plotter where the pens move on 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 you'll have I've got a camera here so I can also show you some more video but here it is
05:02
here's the 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 a
05:25
conference if you you know 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 uses the
05:40
arm of the servo to do that and I had to call in to play all my high school mathematics which is from a very long time ago because I'm older than you think I am and so I had to relearn a certain amount of trigonometry and this is how it how it works it's a pantograph which is the
06:05
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 to the wires so we have two motors at the top that that rotate and there are two there's a yellow and red driving
06:20
arm and a green and a blue following arm so it forms a pentagon there are 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 and this is the mathematics you don't need
06:42
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 the bill of
07:02
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 a Raspberry Pi Zero for five dollars three server motors for about
07:22
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
07:42
avoid getting into domestic trouble then I recommend having a damp cloth 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
08:00
I not doing a very good job at updating it right so that was the 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
08:23
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 gonna just oh well that is quite a delay I know there we are I think that's so you can't see it why can't
08:43
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
09:04
you know I'm pushing my luck here with hardware and software so this is the this is the pantograph so we've got hell's bells there really is a delay there maybe it seems to stop okay well you can see that so you can
09:21
see the two motors and the forearms you can see a weight on top of the 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 and I'm gonna just try
09:45
that again so I need to open capture device that's it and I assume I need to
10:07
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
10:22
software's running on that I've got a little wiring loom that I sold it together to make it easier and here is the and it stopped again and there is the the the control for the pen so let me just leave that there Ben could I have a helper pleased with the camera I'm going to try doing some now
10:43
this is going to be really difficult because I'm gonna be typing blind into a terminal because we had that hardware issue so I'm just going to show you the plot of moving its pen up and down PG dot pen dot down now for the
11:05
gentleman who lent me this keyword can you show me where the brackets are please no no what do you call them braces parentheses parentheses yes yes
11:27
yes yes yes good you opened and closed them okay so if I've done the right thing oh there you are do you see the pen oh you haven't seen the pen has moved but the video hasn't oh yeah there you are okay okay so good and I
11:45
can do PG for pantograph dot pen dot up I can you show me again with shift shift oh my goodness okay like so yeah and that will I mistype something there so that's PG dot pen do you know what's going to mmm well
12:07
then we can't have both can we yes my god and in the 1970s there's a
12:21
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 remaining 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
12:45
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
13:01
wind and the plane actually somersaulted but they saved most of the lives of the people on that plane so this is not as as heroic but I'm very grateful that we've got some pilots on board so PG do PG dot pen dot
13:23
up and then the parentheses hey there you are okay now wait so I'm going to switch back to this here and I'm going to show you how how it well Ben perhaps you can shine the camera on one of those so you can paint draw little
13:44
pictures like like so oh I've got them on here I can show you what what they 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 this is the kind of output we can get oh it makes me look like a narcissist that is pictures of me do this picture instead there you are so there's a little boy held
14:02
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
14:21
very easy you just move the pen down one of the axes on this the only movement that I have is is rotation so if my point my XY point is over here and my 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
14:45
they need to be at for that point to the position they need to be at for that point what I'll get it's 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
15:00
break it down into lots of small pieces so I break it down into tenths of one tenth of a millimeter you know as if I'm gonna 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
15:26
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 line draw that vectorizes bitmaps and I
15:44
adapted it to give me some JSON output that I can feed into the plotter so for example this morning I 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 open
16:04
CV so although it does work it is rather slow so am I in the I'm not in the right directory where am I okay so what I've got I've got that crane image and
16:56
line so I'm going to take some input can you see that well enough I hope yeah
17:07
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
17:29
I'm such a bad programmer I always do it from him 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
17:45
that's the rendition of that but if I did it without any simplification it will do it reasonably quickly and give me a reasonably accurate output so has it
18:03
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 I earlier I sent that over to the Raspberry Pi and I think
18:25
we'll go head over you're good at typing aren't you and so I've got to be I've got to remember now it's um yes let's switch this to this do this
18:44
that's probably better and then we can always switch back to the camera afterwards okay so actually if you just go up that will be here's one I made earlier if it's remembered the command I was experimenting with some stuff there we are just can you instead of no don't make it plot me make
19:04
it plot the crane dot Jason please okay and now there go ahead fire oh okay
19:21
can you exit from there let's have a look at the you where we're in the right place there is no crane there okay that's okay never mind we'll print another image instead let's okay go back into Python and can you do from
19:43
pantograph sorry from oh god yeah okay let's go find the from p.g.m. plus and I wanted to show you some the calibration routines so that makes this
20:03
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 okay okay let's just okay let's say so PG dot plot underscore file oh no yes correct sorry quote some
20:31
parentheses quotes and other quotes yep and it's EP 19 dot Jason and this is the logo of euro Python let's try that okay I will but let's let's just
20:45
let's get let this go so you can see it's gonna take a while go ahead yeah great so you can see it's yeah I'm going to so you can see it's what is it's looping all over the lines in that Jason and now you'll get the delayed
21:02
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
21:24
camera Martin would you know sorry we're trying to get the video but it's it's very laggy this is see there's another pilot coming to help us this is a go ahead yes see okay yep okay and would it show live okay oh okay
21:54
yeah let's get a better angle that's let's make that bigger so can you get
22:01
a better angle Ben so that we can see and now what I normally have to do it's drawing normally I I rub the pen a little bit to prime it but you can see that it's so it's not very fast but it does plot as you can see it's
22:24
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 servo will twitch and will
22:41
lift the pen there you are this is going up and now 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 thank you welcome
23:04
safely means come and have a look at this afterwards and maybe you've got some ideas about how to make Mac books 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 still drawing and I just want to
23:23
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 will just have two arms still the same number of motors one two and three this
23:44
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 to drive that so that's and I think it'll be simpler which is the important
24:03
thing because for me that 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
24:23
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 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
24:41
questions but I think we just about made it we do have time for questions great thank you very much thank you thank you Danilo I think we can let it clutch while we have questions and answers so if you have a question would you mind getting to a microphone I'm Ben
25:09
could I ask you to hold the camera again so while it while it's drawing so I can't think and hold a camera at the same time yeah you definitely could
25:34
you just need motors powerful enough to to do that and I did have some larger motors that were could draw bigger and were more accurate ironically
25:45
I found the cheapest motors sorry the volumes rather loud for me again Danuka could you turn it down a bit for me please and if you use digital servo motors which are faster and stronger more accurate you just get lots of
26:00
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 work better but with powerful motor with rigid materials yes of course it could be scaled up I wasted
26:32
a huge amount of time trying to make those better servos work but I never in the end that the cheap ones worked best if you please come have I mean
26:45
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 so and if you think of any questions go ahead yeah yes let's close the session thanks to me thank you very much thank you all and thank you for your patience