Skip to content

This is an extension to the final project for Tec de Monterrey's F1013B course: Computational Modeling of Electrical Systems. The project consists on simulating an Inkjet printer, which charges ink droplets electrically so that they get deflected by 2 electric plates and land on a desired location on a piece of paper.

License

Notifications You must be signed in to change notification settings

JoaquinBadillo/InkjetSimulation

Repository files navigation

Printing Simulation using Electric Fields

This is an extension to the final project for Tec de Monterrey's F1013B course: Computational Modeling of Electrical Systems. The project consists on simulating an Inkjet printer, which charges ink droplets electrically so that they get deflected by 2 electric plates and land on a desired location on a piece of paper.

The project consisted on simulating a single droplet of ink or a relatively simple bitmap; however, once my team and I finished the required program we decided to take this idea further and print any relatively small image we desired. This expansion is a really memory hungry program, since we had to sacrifice memory to optimize our time complexity and also due to the nature of MATLAB's figures.

Our teacher invited us to the university's Engineering Exposition, which was a huge achievement for us, due to the fact that we just wanted to expand the project for the fun of it.

Some Optimizations

Printing images pixel by pixel in MATLAB is not a fast process (and this is an understatement); solving a differential equation numerically to do so makes things even worse. For the program to take a reasonable amount of time to run we plot the points using plot instead of scatter, which we can do by adding a row of NaN to the arrays, which was way faster. We also noticed that we could solve the differential equation once with a really precise Runge Kutta 4 integrator and save the results in a file, avoiding to solve the same ODE each time. For the animation we did sacrifice some precision since we required multiple values of the ODE solution and in the file we only save the last vertical position (when the droplet hits the paper); thus we use Euler's method with a relatively small step size.

Using the program

The executable programs are animation.m, print.m and rkPrint.m, the other ones are modules required for these to run. To execute them just type the file name (without the extension) in the MATLAB console (Octave is not yet supported). The first program shows an animation of each droplet of ink getting deflected and landing on the piece of paper, it then shows the image it was printing (its a simple image since the animation takes some time). The second program prints the file image.png, you may use your own PNG file but use a small one, otherwise you will use a lot of resources (including time). The last program is the Runge Kutta integrator used to solve the ODE; you may decide to modify the code and run it to change the precision (changing the precision will change the amount of memory and time required for the program to run).

What is the purpose of the simulation?

Printing images in MATLAB is not really the point of the project, it looks great and fun but its rather inefficient to print like this; the real idea behind the project was for us to determine how much charge should an ink droplet get to land on a desired location in a piece of paper. Our struggles to optimize the code also suggest possible ideas to create and improve a printer design; we could, for instance, take a divide and conquer approach: having multiple dispenser and plates to print in different locations at the same time (this is inspired upon the vectorized optimization of plot vs scatter), however the movement of charged particles might bring some trouble with magnetic fields. Another important consideration is that we used RGB due to the usage of a display however printers use CMYK and we could find some difficulties when converting to preserve the color quality.

About

This is an extension to the final project for Tec de Monterrey's F1013B course: Computational Modeling of Electrical Systems. The project consists on simulating an Inkjet printer, which charges ink droplets electrically so that they get deflected by 2 electric plates and land on a desired location on a piece of paper.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages