Diy inkjet PC software

Powder and inkjet printing
Post Reply
davidk
Posts: 69
Joined: Sun Mar 12, 2017 6:48 pm

Diy inkjet PC software

Post by davidk » Mon Mar 27, 2017 3:32 pm

I started to experiment with xaar128 printhead. I wonder, after building my setup, how would I send the bitmap data to the printhead. I'll use an Arduino due to control the printhead because of its large native RAM (96kB).
I started to build the arduino firmware and now I need a nethod to transfer the bitmap into its memory. Do you know a ready-made windows software?

I started working in Labwindows CVI as I know how to deal with usb com ports on this C ide/compiler. But it's quite hard to build the binary array for one xaar 128 nozzle swathe.

User avatar
dragonator
Site Admin
Posts: 412
Joined: Fri Aug 14, 2015 4:48 pm
Location: The Nethelands
Contact:

Re: Diy inkjet PC software

Post by dragonator » Mon Mar 27, 2017 7:04 pm

I have not yet done a lot of looking, but I haven't found something yet. I will get to a point where I will make something if nothing is available in the future, but for now I have different priorities. If I'd make something it would either be in Python or in QT.

Jurif
Posts: 6
Joined: Mon Aug 15, 2016 10:38 am

Re: Diy inkjet PC software

Post by Jurif » Tue Mar 28, 2017 9:26 pm

Try doing some sort of run length encoding. You could send single pass like this n[a;b;c;d], where n is padded nozzle number and a, b, c, d are run lengths so this would make a nozzle not fire for a times then fire for b times then not fire for c times and then fire for d times. Of course you could put in more run lengths. Also firmware is very simple as it is just counting. So basically you only need current nozzle data (two arrays of eight bits) run length array (this is where you store all of your data sent from pc) and nozzle count array and some other variables needed for for loops. Take a look at the attached arduino file and python snippet used to send data. Do note that this is still very unstable code and it is made mostly for debugging my current 3dp printing endeavors
Best Regards, JP
Attachments
printer_driver.zip
(36.48 KiB) Downloaded 299 times

davidk
Posts: 69
Joined: Sun Mar 12, 2017 6:48 pm

Re: Diy inkjet PC software

Post by davidk » Wed Mar 29, 2017 6:16 am

Thanks! This isn't quite as intuitive as sending raw data, but it's a very good ideea to start! I'll have a look into it!

Wonko
Posts: 85
Joined: Sat Aug 15, 2015 8:13 pm

Re: Diy inkjet PC software

Post by Wonko » Thu Mar 30, 2017 8:40 am

For my controller, I wrote a simple language that includes primitive compression. The host software would write a stream to an SD card, and the controller would read the commands from the same card, controlling the motors and filling the buffers as described.

This was my original ad hoc command set, which is enough to print a 3D model. 1 to 3 automatically advance X. All in all, this is a lot more efficient than just storing raw data. Some rows can be stored in very few bytes. Empty rows and row parts need no storage at all.

I wrote a slicer that stores uncompressed images of every layer on disk. A compiler then reads those images and converts them into a command sequence. In a last step, an uploader pumps the command list into the SD card in the Arduino.

The Arduino has a screen and a menu system. One menu allows the user to choose any uploaded program and run it. SD Card reading times is unpredictable. The trick is to read all commands for a single horizontal row first, and then print it without further reads to the SD card, then interpret the next row.

Code: Select all

// 1: FirePattern, followed by a number of bytes where a 1bit fires a nozzle and a 0bit does not
// 2: FirePatternN, fire n patterns like in 1
// 3: FireSamePatternN, fire the same pattern multiple times
// 144: GotoX(void*)
// 145: MoveX(void*)
// 146: HomeX(void*)
// 147: GotoY(void*)
// 148: MoveY(void*)
// 149: HomeY(void*)
// 157: clean the roller on the squeegie: CleanRoller(void*)
// 158: dz is int 100th mm: spread a new layer of powder
// 159: number of layers in total: to dislay progress

moriarty
Posts: 4
Joined: Fri Feb 17, 2017 10:58 pm

Re: Diy inkjet PC software

Post by moriarty » Thu Mar 30, 2017 9:49 am

theres some basic info on how to do low level thermal bitmap printing on Arduino at Adafruit
- the hackng section talks about the memory limitations

https://learn.adafruit.com/mini-thermal ... p-printing
https://learn.adafruit.com/mini-thermal ... er/hacking

more complex CUPS (common unix printing system) is also covered on raspberry-pi at Adafruit

https://learn.adafruit.com/networked-th ... spberry-pi

User avatar
dragonator
Site Admin
Posts: 412
Joined: Fri Aug 14, 2015 4:48 pm
Location: The Nethelands
Contact:

Re: Diy inkjet PC software

Post by dragonator » Fri Mar 31, 2017 6:07 am

Once it reaches the microcontrollers RAM memory, you want to have it basically uncompressed. With the max dataflow required for inkjet, you don't want to decompress every pixel while printing. As for the SD card reading I agree with Wonko. Read an entire sweep, move it to RAM memory, and print it. Don't bother with transferring data to the head while printing if you can help it.

The challenge is getting the data from the PC to the microcontroller. For 3DP purposes Jurifs idea of running length encoding seems most compact. Once you add different inkjet densities in every sweep, you'll need something better, or just send it raw. Patterns can be interesting, but I always thought that you'd need too many patterns to make it practical. What you can do is slightly alter the pattern after each trigger. Most of the times, only a few pixels change in a pattern. If you can just say: "These 12 pixels changed", you'd safe a lot of space. Another thought is not reading a pixel format, but reading something vector based. This works for Oasis, but is a fairly narrow application.

I am currently working on an improved controller that supports a Teensy 3.6 as a backpack. Once I have that I either might invest some time in creating software for universal inkjet control or help someone else with it.

Post Reply