Software Open Access

# symbiolab/Vitaprint_calibration: Vitaprint calibration v1.0

bostjanvihar; Luka Banovic

### Dublin Core Export

<?xml version='1.0' encoding='utf-8'?>
<oai_dc:dc xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/oai_dc/ http://www.openarchives.org/OAI/2.0/oai_dc.xsd">
<dc:creator>bostjanvihar</dc:creator>
<dc:creator>Luka Banovic</dc:creator>
<dc:date>2017-08-11</dc:date>
<dc:description>General calibration of the Vitaprint extruder
Introduction
Being tansferrable, the Vitaprint extruder is capable of printing structures, sliced by various free and open software, such as Slic3r or Cura. To allow this, however, certain settings need to be adjusted.

Basic extrusion calculation
Introduction
Materials
Procedure

Basic extrusion calculation &lt;a id="CALC"&gt;&lt;/a&gt;
The first approximation of extrusion settings can be calculated theoretically, based on some simple assumptions. Due to its mechanical, piston driven nature, extrusion can be precisely controlled by motorized displacement of the piston (rotation vs thread, both of which is specified) and depends on the difference between the inner diameters of the syringe r&lt;sub&gt;s&lt;/sub&gt; and the nozzle r&lt;sub&gt;n&lt;/sub&gt;. If we assume non-elastic behavior and laminar flow, the displaced volume in the syringe should equal the extruded volume through the nozzle. If the printed stroke takes the cross-sectional shape of the nozzle, the length of the printed path can be calculated as follows:
&lt;img src="http://latex.codecogs.com/gif.latex?E%20%3D%20%5Cfrac%7Br_n%5E2%7D%7Br_s%5E2%7D%5Ccdot%20l_%7Bpath%7D" alt="table"&gt;
Where E equals the extrusion value (= displacement of the piston) and l&lt;sub&gt;path&lt;/sub&gt; the length of the printed filament. This is useful for determining the amount of extrusion for custom designed geometries. When using slicing software Cura, the calculation differs somewhat, as certain parameters are calculated differently. We have determined an experimental nozzle width and correction factor for the use of a 5ml syringe with a G21 needle (inner diameter 0.4mm). The calculation can be found in the accompanied xls file titled "vitaprint_cura_filament_calc".
Extrusion adjustment by drawing &lt;a id="DRAWING"&gt;&lt;/a&gt;
Introduction &lt;a id="intro"&gt;&lt;/a&gt;
Certain simplifications in the calculation cause small, yet significant discrepancies between the theoretical and real system. Therefore additional tuning is required. To do this, we developed a simple "pen and paper" protocol, to evaluate the characteristics of the printed path. It can be used to adjust extrusion, feedrate, layer height and material polymerization time upon deposition.

Materials &lt;a id="mat"&gt;&lt;/a&gt;

Basic Vitaprint set-up
5ml syringe (optional with luer lock)
blunt-end needle (e.g. G21 with 0.4mm inner diameter)
printing material (e.g. gelatin-alginate composite, see Vitaprint_methods) with colored dye (e.g. Pelikan 4001 blue ink)
sheet of thick white paper

Procedure &lt;a id="proc"&gt;&lt;/a&gt;
A syringe containing the desired material with added coloring is mounted on the extruder.
Step 1 - Rough calibration of material extrusion, where E determines the position change of the piston in mm.

RUN "01_calE1.gcode"
EVALUATE created sample (Is it a full line? Is the line thickness even across the length? optional - use stereomicroscope/magnifying glass)
MODIFY "01_calE1.gcode" and repeat
CHOOSE the best value for E and 4 values for F and modify "02_calE-F.gcode"

Step 2 - Fine calibration F for optimum E+F properties

RUN "02_calE-F.gcode"
REPEAT "STEP 2", choose optimum value for F
Choose best values for E + F and modify "03_cal_tdry.gcode"

Step 3 - Determining material polymerization time and rough layer height.

RUN "03_cal_tdry.gcode"
EVALUATE created mesh to evaluate line drying time. The line is well dry when the needle doesn't make a smear while crossing it. Use table to calculate polymerization time. A time unit is calculated from:

[1min (60s) for 1mm of covered way]. The double line represents the extrusion step (phase 1), the single line represents the scratching step (phase 2). The numbers show the distance in mm from extrusion to scratch.
&lt;pre&gt;          --------      --------      --------      --------
|      |      |      |      |      |      |      |
||== 230 == 220 == 210 == 200 == 190 == 180 == 170 == 160 ==||
||    |      |      |      |      |      |      |      |    ||
-- 240 ----      --------      --------      --------      ---- 150 --
|   ||                                                          ||   |
|   ||                                                          ||   |
-- 250 ----                                                ---- 140 --
||    |                                                |    ||
||    |                                                |    ||
-- 260 ----                                                ---- 130 --
|   ||                                                          ||   |
|   ||                                                          ||   |
-- 270 ----                                                ---- 120 --
||    |                                                |    ||
||    |                                                |    ||
-- 280 ----                                                ---- 110 --
|   ||                                                          ||   |
|   ||                                                          ||   |
-- 290 ----                                                ---- 100 --
||    |                                                |    ||
||    |                                                |    ||
-- 300 ----                                                ---- 90 --
|   ||                                                          ||   |
|   ||                                                          ||   |
-- 310 ---/      --------      --------      --------      ---- 80 --
||   /       |      |      |      |      |      |      |    ||
||  /        |      |      |      |      |      |      |    ||
|_00_|   ===== 10 === 20 === 30 === 40 === 50 === 60 === 70 ==||
|     |      |      |      |      |      |      |
|     |      |      |      |      |      |      |
-------      --------      --------      -------- &lt;/pre&gt;

Calculate layer height (h = "z" shift), which is roughly approximated as follows: From evaluation in "step 2", measure line width (d), line length (l) equals 50mm, and the extrusion volume (V) is determined as:

Where r&lt;sub&gt;s&lt;/sub&gt; equals the inner syringe radius (= 6mm). This concludes h = 2.26E/d.

Move to layerS 2-4 and repeat (runs automatically)

Step 4 - Fine adjustment of h (the solidification process can alter the basic layer height)

MODIFY "04_cal_h.gcode" using previous parameters and the calculated h from "STEP 3", and define 4 new height parameters which use old h +/- 0.005-0.01mm.
RUN "04_cal_h.gcode"

Backlash calibration PART 1 - Latency Determination
Introduction
When extruding materials with medium to high viscosity it can be observed that when the plunger movement is terminated the material still keeps flowing out of the syringe for some time. This happens due to mechanically elastic components in the system (air bubbles inside the material,  syringe seal, plunger deformation under higher forces etc.).
The removal of this phenomenon is not very feasible therefore we can compensate it with backlash. Thereby, the plunger not only stops when it's told to but instead it moves slightly backwards such that it pulls some of the material back into the syringe. The idea is to pull enough material back in that the outflow is stopped as soon as possible and yet, care must be taken not to pull the plunger so far back that the air comes into the syringe through the needle.
&lt;img src="https://user-images.githubusercontent.com/14543226/28709089-0618cc52-737f-11e7-99ce-4116df990e8d.png" alt="table" width="400" height="300"&gt;
Figure 1: showing the displacement step and the observed outflow as a function of time. System latency is shown in red.

Equipment
Data Acquisition
Data Processing
Important Notes and Tips

Equipment &lt;a id="EQUIP"&gt;&lt;/a&gt;

weighing scale with a serial output to PC
a PC equipped with:
software for RS232 terminal reading. If it came with the weighing scale, use the original software. If not, several appropriate are available online like Termite, PuTTy etc. (download Termite here)
CNC machine and control
Python 3 environment (Spyder or similar) to run the g-code generator (download here)

A glass beaker
sunflower oil

Data Acquisition &lt;a id="DATA_ACQUISITION"&gt;&lt;/a&gt;
&lt;b&gt; 1. Connect the serial output of the weighing scale to the computer USB port and get the communication working &lt;/b&gt;

check the data sheet  of the weighing scale for baud rate, data bits, parity etc.)
make sure all the settings in the software match the values in the data sheet. If they do, the values on the computer terminal monitor should match the one you can read on the weighing scale screen
if the software enables it, select the option for the data be written into a .txt file

&lt;b&gt; 2. Generate the testing protocol g-code &lt;/b&gt;

Download the VITAPRINT_latency_test_protocol.py file from GitHub and open it in the preferred Python environment
read the instructions in the heading of the file to familiarise yourself with the parameters you can manipulate
Run the programme. Now, a file named '[TODAYSDATE-your_specified_filename].gcode' should be generated in your working directory.
Open this file in your CNC control software and see if it is working

&lt;b&gt; 3. Prepare the apparatus &lt;/b&gt;

Fill the glass beaker with sunflower oil
place it onto the weighing scale and press "Tare"
Mount your extruder over the vessel
mount the syringe, filled with material with needle attached onto the extruder (G21 needle used in our case)
extrude some material so that it starts flowing out and wait for the outflow to stop

&lt;b&gt; 4. Start recording the mass &lt;/b&gt;
&lt;b&gt; 5. Run the g-code in your CNC controller &lt;/b&gt;
&lt;img src="https://user-images.githubusercontent.com/14543226/28709225-bcf81004-737f-11e7-87f6-de00855973e0.png" alt="table" width="600" height="400"&gt;
Figure 2: The apparatus for latency measurement
Data Processing &lt;a id="DATA_PROCESSING"&gt;&lt;/a&gt;
How does it work?
It is important to understand the workflow of the data processing. The raw data may contain some high frequency noise usually originating from the building vibration (people walking, door closing etc.). The raw data are therefore first low-pass filtered. Then they are blocked up in cycles (each cycles contains a dataset of mass values associated to one displacement step). Then, an exponential fit of a form f = aexp(-bx) + cexp(-dx) is fitted to each dataset. At the end, a 95% point is found in every dataset and taken as the system latency.
&lt;img src="https://user-images.githubusercontent.com/14543226/28709282-f95c79ea-737f-11e7-98ef-ab8b1ba6b248.png" alt="table" width="600" height="150"&gt;

you can see the output signal after every stage in the Appendix below, for easier visualisation.

Procedure

Copy the .txt file with your acquired data into the same folder as the data processing file.

Run the code
the Latency values should appear in your python command prompt as the programme output

Important Notes and Tips &lt;a id="NOTES"&gt;&lt;/a&gt;
In our setup this method proved to be repeatable and robust. However, depending on the hardware it may not be so. It is advisable to repeat this procedure several times to investigate whether you can rely on it.
APENDIX &lt;a id="APPENDIX"&gt;&lt;/a&gt;
Visualisation of the signal outputs
&lt;img src="https://user-images.githubusercontent.com/14543226/28709489-ced8ae0e-7380-11e7-803d-e01f97767026.png" alt="table" width="400" height="300"&gt;
Figure 1: raw data
Figure 2: Low-pass filtered data
&lt;img src="https://user-images.githubusercontent.com/14543226/28709570-25460d2c-7381-11e7-8b38-caa05d4a9cc6.png" alt="table" width="400" height="300"&gt;
Figure 3: Aligned blocks of data
&lt;img src="https://user-images.githubusercontent.com/14543226/28709600-3b892a2e-7381-11e7-80f3-782edbf2f10a.png" alt="table" width="400" height="300"&gt;
Figure 4: Exponential fit lines added.</dc:description>
<dc:identifier>https://zenodo.org/record/841394</dc:identifier>
<dc:identifier>10.5281/zenodo.841394</dc:identifier>
<dc:identifier>oai:zenodo.org:841394</dc:identifier>
<dc:relation>url:https://github.com/symbiolab/Vitaprint_calibration/tree/vita_cal_v1.0</dc:relation>
<dc:relation>doi:10.5281/zenodo.841393</dc:relation>
<dc:rights>info:eu-repo/semantics/openAccess</dc:rights>
<dc:title>symbiolab/Vitaprint_calibration: Vitaprint calibration v1.0</dc:title>
<dc:type>info:eu-repo/semantics/other</dc:type>
<dc:type>software</dc:type>
</oai_dc:dc>

65
11
views