technical Posted January 13, 2016 Posted January 13, 2016 (edited) This is an early proof of concept before rebuilding it completely: Running down the pen: I built this printer LEGO parts. It prints pretty well with markers. It prints in dot-matrix and line modes. I did this with an unmodified EV3. Some of the work was creating huge binary files to print from. Video: Edited January 13, 2016 by technical Quote
oracid Posted January 13, 2016 Posted January 13, 2016 Interesting ! Very interesting! Is it possible to go faster? Quote
technical Posted January 13, 2016 Author Posted January 13, 2016 Interesting ! Very interesting! Is it possible to go faster? Yes, the video I made was of the first revision. In subsequent versions, it prints faster, particularly when drawing lines rather than dots. Quote
roppie11 Posted January 13, 2016 Posted January 13, 2016 wow very nice. wasnt the programming a lot of work. how did you manage to get a 'picture' on the paper? i really really like it, especially since i'm very interested in computers. next step 3d printing Quote
kieran Posted January 13, 2016 Posted January 13, 2016 Nice work. The results speak for them selves Quote
technical Posted January 13, 2016 Author Posted January 13, 2016 (edited) wow very nice. wasnt the programming a lot of work. how did you manage to get a 'picture' on the paper? i really really like it, especially since i'm very interested in computers. next step 3d printing Well, it's a lot to explain, but I'll outline some of the procedure. First I determined the number of motor degrees of rotation from end to end of the printer, then split it up into 200 smaller slices. This is the number of horizontal pixels it can print. Then I fired up Photoshop with a 200x240px image, converted to 1-bit bitmap, and exported as PNG. I then wrote a PHP script to convert the PNG to pure binary. At the end of each line of the image, I also write a 9. So I end up with a file that defines when the printer will print (1) and when it will skip printing a pixel and move on (0). If it runs into a 9, it advances the paper, moves the print head to the left side, and starts the next sequence. This is what the letter "a" looks like in Arial font after exporting and converting to binary text: Zooming out, the text file looks like this: This is the PHP script I used to convert PNG images to binary text: I then found that Mindstorms EV3 will not read one character at a time; it can only read an entire line from a file. So, I had to insert a line break after every single character so that every line of the file contains only a 1, 0, or 9. I downloaded the print files to the EV3 and loop through each line and execute the command. Some of the images I printed were over 65,000 pixels long and spent 12 batteries. This is the main routine of the print program, not including a ton of MyBlocks I wrote to perform functions like initial calibration, screen UI, etc. You can see there are three main branches for each of the functions the printer could be commanded to perform: Edited January 14, 2016 by technical Quote
BusterHaus Posted January 14, 2016 Posted January 14, 2016 Nice job on the programming and execution. I really like the simplicity of it. Do you think it's possible to load a PNG or bitmap and have the EV3 brick read it line by line and execute a print loop every time it encountered a dark pixel? It would save some offline conversion time. Quote
technical Posted January 14, 2016 Author Posted January 14, 2016 (edited) BusterHaus: No, it is not possible to open a PNG or BMP on the EV3. It can only open text files and read them one line at a time. You can only program it using basic types of operations. Opening and processing an image file is far beyond its ability. The only way I could pull this off was to load these huge binary files on to it, with one number per line. I haven't discovered any better way. As far as simplicity; the main loop of the program I posted is just a small part of it. This part calls other programs I've written to do specific things. The LEGO Mindstorms EV3 software for Windows gets very slow when you're working with huge complex interconnected programs, so I had to break it up. Edited January 14, 2016 by technical Quote
BusterHaus Posted January 14, 2016 Posted January 14, 2016 I figured my suggestion would likely be impossible without some sort of file reader. I'm not sure about the structure of bitmaps and PNGs, but GIFs compress rows of same coloured pixels. It's far from being readable by human eyes. Your approach is very clever, thanks for sharing it. It's basically an uncompressed monochrome file. Have you thought of using numbers beyond 0 and 1 to convey extra information? Since it's a felt tip pen, you could use duration or pressure to make dots bigger or darker. Quote
oracid Posted January 14, 2016 Posted January 14, 2016 This achievement is really great! I dream of another, able to make very large posters with 3 RGB pens. Thank you for all this. Quote
filsawgood Posted January 14, 2016 Posted January 14, 2016 It's amazing! I admire the fact that you can make out of Lego! Probably not far off Lego 3D printers that print details Lego themselves Quote
The Ace Railgun Posted January 14, 2016 Posted January 14, 2016 This is really neat, now all you need to do is get that LEGO computer to go with it and you'll have a complete set. =P Quote
flyboy01 Posted January 19, 2016 Posted January 19, 2016 that is jawdropping amazing code. I am starting to progam, but this is still gibberish to me. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.