PriNXT – Mindstorms NXT Printer

24 02 2012

All finished! It took a bit longer than expected (I’ve been tinkering around with some final upgrades and fine tuning for the past few days), but now, at last, it’s working! Check out this video I shot of PriNXT (clever name, I know) yesterday when it was drawing the epically awesome WilsonTech1:

Since this is a pretty long post, I’ve split it up into a few sections for you: Hardware/ Design, Image Processing, Programming, and Conclusion. How considerate of me.

Hardware/ Design – Motors

PriNXT has three motors: two control the X and Y motion, and the third lifts the pen.

The first motor, the one in the middle, is very straight forward – it has two long axes coming out of it that connect to two tiny gears that can drive around on a series of gear racks, moving the contraption about the Y axis. The second and third motor are a bit more complex, since they both point inward and have to move their power around a lot.

The left one, which controls motion on the X axis, basically just gears its power to a really long row of worm wheels, which, when spun, slowly move the part that holds the pen from left to right. The third motor similarly transfers its power to the outside, after which it moves a long rod up and down, pulling the pen along with it no matter where it is. For more details, see PriNXT’s very own Hardware Post.

Hardware/ Design – Sensors

The robot has a total of four sensors: two touch, one light, and one color.

The touch sensors serve the simple purpose to calibrate the robot – it blindly drives towards them until it registers that they’re pressed, which tells PriNXT where to start drawing. The color sensor is used as a signal light to show that the robot has finished calibrating.

The light sensor, only added two days ago, is used for moving the pen, which has actually been one of the hardest parts of this project. Because the beam that moves the pen up and down is slightly flexible, it had to be slightly higher or lower depending on how far to the right the pen was. When the pen would move, this would cause conflicts, so now, instead of being static, the pen now continuously moves up and down a bit to compensate for this movement. The light sensor guides it in this, reading its position and telling it to either go higher or lower.

For the design part, I mostly kept this project in my usual red/ white/ shades of gray color scheme, which I’m actually starting to enjoy using more and more.

Image Processing

A big part of PriNXT was to get it to draw complex shapes and pictures like the one in the picture below.

So this is how it works: first, I import the image into Paint.NET, where I make it black and white, and then edit it a bit to get a better looking result. Then, I export it as a .PBM file, which basically turns the whole picture into a bunch of 1′s and 0′s. Then, I import those 1′s and 0′s into NotePad++, where I reformat them to something my program will understand. Finally, I copy the results into a pre-made array in RobotC, fill in the height and width of gthe image, and I’m done!

For a more detailed description on how to do this, and on how to use this method to display detailed images on your NXT, see this post here: How To: Display Images on Your NXT using RobotC (JPEG, PNG, etc.)

Programming

Mostly, the code for PriNXT consists of the following (in order):

  • Calibration functions for the X and Y motors, which basically drive them both backwards until they hit their respective touch sensors, and then reset their encoders
  • A “moveLinear” function, which very niftily calculates the amount of degrees needed to get to the user specified position, and then calculates speeds for both that allow it to go there in a straight line (if one motor has to move a lot more than the other motor, the other motor slows itself down to help it keep up)
  • A “movePen” function, which.. moves the pen up and down
  • A “drawBinaryImage” function, which draws the image according to the 1′s and 0′s I copy into its 2D “imageToDraw” array using two for loops, one inside the other
  • A “controlPen” task, which keeps the pen at the right height even when the “movePen” function is not called
  • The main task, which controls the rest
Here’s a link to the program: PriNXT.c (SF Code Download)

Conclusion

So yeah, I really enjoyed doing this project, even if it was challenging at times. For even moar pictures and other stuff my robot printed, check out my Google Plus profile (heck, you could even circle me)

And yes, it also drew the text in the header. Go ahead, scroll up and take a look at it :)


Actions

Information

29 responses

28 02 2012
MAKE | PriNXT, a Functioning Lego Printer

[...] Lego hacker Leon Overwheel built this impressive Lego Mindstorms NXT printer, AKA PriNXT. PriNXT has three motors: two control the X and Y motion, and the third lifts the [...]

28 02 2012
PriNXT, a Functioning Lego Printer | House of Mods

[...] Lego hacker Leon Overwheel built this impressive Lego Mindstorms NXT printer, AKA PriNXT. PriNXT has three motors: two control the X and Y motion, and the third lifts the [...]

28 02 2012
PriNXT, a Functioning Lego Printer

[...] Lego hacker Leon Overwheel built this impressive Lego Mindstorms NXT printer, AKA PriNXT. PriNXT has three motors: two control the X and Y motion, and the third lifts the [...]

28 02 2012
Incredible LEGO Printer Invented by 14-Year-Old Boy! | Inhabitat - Green Design Will Save the World

[...] genius, Leon Overwheel, has used his skills to construct his very own LEGO printer! Dubbed the LEGO Mindstorms NXT printer (or PriNXT), the machine uses three motors to control an attached pen, which draws [...]

28 02 2012
Incredible LEGO Printer Invented by 14-Year-Old Boy! | Inhabitat - Green Design Will Save the World

[...] genius, Leon Overwheel, has used his skills to construct his very own LEGO printer! Dubbed the LEGO Mindstorms NXT printer (or PriNXT), the machine uses three motors to control an attached pen, which draws [...]

29 02 2012
High Technology » Blog Archive » PriNXT, a Functioning Lego Printer

[...] Lego hacker Leon Overwheel built this impressive Lego Mindstorms NXT printer, AKA [...]

29 02 2012
Incredible LEGO Printer Invented by 14-Year-Old Boy! | Adapttips

[...] genius, Leon Overwheel, has used his skills to construct his very own LEGO printer! Dubbed the LEGO Mindstorms NXT printer (or PriNXT), the machine uses three motors to control an attached pen, which draws [...]

29 02 2012
PriNXT, a Functioning Lego Printer | Free Plans Online

[...] Lego hacker Leon Overwheel built this impressive Lego Mindstorms NXT printer, AKA PriNXT. PriNXT has three motors: two control the X and Y motion, and the third lifts the [...]

3 03 2012
Drucken mit LEGO | ohlBlog

[...] Sensoren, um die Tinte korrekt aufs Papier zu bringen. In Sachen LEGO ist er allerdings kein unbeschriebenes Blatt. Irgendwie sahen meine Modelle damals anders aus [...]

3 03 2012
14-Year Old Kid Creates PriNXT A Printer Out of LEGO

[...] Source: World of Mindstorms __spr_config = { pid: '4e991d2b396cef0e4500030d', title: '14-Year Old Kid Creates PriNXT – A Printer Out of LEGO', ckw: 'PriNXT', chan: '', no_slide: '', slide_logo: false, pub: '2012-03-03 15:17:37', url: 'http%3A%2F%2Fwindowsera.com%2F14-year-old-kid-creates-prinxt-a-printer-out-of-lego', header: 'RECOMMENDED FOR YOU' }; var content = document.getElementById('simplereach-slide-tag').parentNode, loc; if (content.className){ loc = '.' + content.className; } if (content.id){ loc = '#' + content.id; } __spr_config.loc = loc || content; (function(){ var s = document.createElement('script'); s.async = true; s.type = 'text/javascript'; s.src = document.location.protocol + '//d8rk54i4mohrb.cloudfront.net/js/slide.js'; __spr_config.css = 'document.location.protocol + '//d8rk54i4mohrb.cloudfront.net/css/p/4e991d2b396cef0e4500030d.css'; var tg = document.getElementsByTagName('head')[0]; if (!tg) {tg = document.getElementsByTagName('body')[0];} if (tg) {tg.appendChild(s);} })(); Tags: PriNXT Related Posts [...]

3 03 2012
Púber de 14 años fabrica impresora Lego | Matuk.com

[...] Fuente: World of MindStorms [...]

3 03 2012
Púber de 14 años fabrica impresora Lego

[...] Fuente: World of MindStorms [...]

4 03 2012
14 year-old designs functioning Lego printer | TRAFFIC.MILLIONAIRE

[...] via World of MindStorms [...]

4 03 2012
Incredible LEGO Printer Invented by 14-Year-Old Boy! | CasasBonitasRemodeling.com

[...] genius, Leon Overwheel, has used his skills to construct his very own LEGO printer! Dubbed the LEGO Mindstorms NXT printer (or PriNXT), the machine uses three motors to control an attached pen, which draws [...]

6 03 2012
PriNXT :: impresora de LEGO | TRECOOL :: Diseño, Arte, Tecnología, Arquitectura, Gadgets, Ecología, Internet

[...] impresora PriNXT, tiene un par de motivos que la hace atractiva y particular. La primera que salta a la vista es que [...]

6 03 2012
Une imprimante en LEGO | Printf

[...] auriez pu comme chez Worldofmindstorms en faire une imprimante papier en état de marche ! L’imprimante PriNXT a trois moteurs, [...]

6 03 2012
reza@msn.com

hello what’s the music on that youtube video please?

7 03 2012
Die is goed met Lego | Dutch News

[...] printen met een resolutie van 120 bij 140 pixels. Hoe Leon de printer gebouwd heeft kun je op z’n weblog lezen en hoe de printer werkt zie je hier [...]

7 03 2012
PriNXT, a Functioning Lego Printer « vis a vis | visual mind

[...] Lego hacker Leon Overwheel built this impressive Lego Mindstorms NXT printer, AKA [...]

7 03 2012
Incredible LEGO Printer Invented by 14-Year-Old Boy! » ::  trasformateria  ::

[...] genius, Leon Overwheel, has used his skills to construct his very own LEGO printer! Dubbed the LEGO Mindstorms NXT printer (or PriNXT), the machine uses three motors to control an attached pen, which draws [...]

10 03 2012
LEGO Mindstorms NXT printer « gruntandsick

[...] /via/ Share this:TwitterFacebookLike this:LikeBe the first to like this post. Tags: control, geek part, lego, mindstorm, printer, robot, sensor Comments RSS feed [...]

10 03 2012
Lego Printer, created by a 14 yrs old Genius « KBO Collection

[...] more at World of Mindstorms, [...]

12 03 2012
PriNXT – LEGO® MINDSTORMS® Education printer | LEGOeducationUK

[...] article: World of MINDSTORMS. Share this:EmailTwitterFacebookLike this:LikeBe the first to like this post. This entry was [...]

14 03 2012
14-jarige bouwt werkende printer van lego - hetkanWel.nl

[...] Worldofmindstorms, [...]

16 03 2012
Druckerpatronen, Tinten & Toner Blog » tintenalarm.de

14-jähriger baut einen Drucker aus Lego…

Man sollte den Youngstern mehr zutrauen, als man auf den ersten Blick denkt. Einem Jugendlichen ist es gelungen, aus banalen LEGO-Bausteinen und einer Reihe von Motoren einen funktionierenden Drucker zu bauen! Der junge Mann heißt Leon Overweel u…

17 03 2012
Garoto de 14 anos constrói impressora utilizando peças de LEGO [vídeo] « Gamer

[...] PriNXT (Fonte da imagem: Reprodução/World of MindStorms) [...]

29 03 2012
Bemerkenswerte LEGO-Projekte « LEGO Mindstorms

[...] PriNXT – ein Drucker, entwickelt von einem 14-jährigen [...]

1 04 2012
Andere NXT-Blogs « LEGO Mindstorms

[...] PriNXT - ein Drucker, entwickelt von einem 14-jährigen [...]

17 05 2012
Richard Urwin

Nice project. I wish I was as clever. It’s as much as I can do to make something drive round and detect collisions.

You might like to check out “X bitmap” format. It would do all your work for you except re-compiling RobotC.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s




Follow

Get every new post delivered to your Inbox.

Join 34 other followers