106 Construction of Vertical Scanner for Laser Analysis of Gel Samples Jiří Pech1, Milan Novák2, Ladislav Ptáček3, Jana Kalová4 Faculty of Science, University of South Bohemia, Branišovská 1760, 370 05 České Budějovice, Czech Republic, e- mail: pechj@prf.jcu.cz1, novis@prf.jcu.cz2, lptacek@prf.jcu.cz3, jkalova@prf.jcu.cz4 Abstract: This paper is focused on the construction of The single-board computer Raspberry Pi with the attached vertical scanner with linear translation used for gel touch display is used as the control computer. The control samples analysis via laser. Scanner construction is based program is written in the Python language. on the construction of RepRap 3D printer. The paper It means, that this article describes the applied research. describes the process of choosing this type of construction and then the construction itself. Advantages and II. TASK disadvantages of this solution are recorded too. Institute of Physics and Biophysics [1] assigned us Keywords: Industry 4.0, 3D prints, Arduino, Raspberry Pi, following task: “Design a vertical scanner with linear G-Code. translation that will be used for gel samples analysis via laser. The scanner has to consist of a frame, which will be moving in I. INTRODUCTION two directions: left - right and up - down. But in the direction This paper describes the design, the construction and the backwards – forwards it will be stable. Next task is to cover testing of the vertical scanner, which was built for the Institute the sample fully and to not stop at any position.” The of the Physic and Biophysics [1] Physicists searched the Internet, but they haven’t found any The construction is based on the construction of the 3D satisfying solution. Only one of the found solutions was little printer Rep Rap Rebelix (figure 1) founded on the Rambo bit fair but it was very expensive (about 1000 Euro). In motherboard, supported by the Marlin firmware. All of the addition, this scanner’s recommended working position is components are open software or open hardware, so we could horizontal, and we need the vertical working position because use them and modify them as we needed. our lasers have horizontal rays. Fig. 1. 3D printer Rep Rap Rebelix with the control computer Raspberry Pi (on the right side). So, it was clear, that if we want to satisfy them, we have to available linear motors are very expensive. So, we decided to design absolutely new construction. use a motor with a screw-thread. We have the 3D printer Rep Rap RepRap model Rebelix [2] III. METHODS at our department. Its construction enables precise movement After the acceptance of this challenge, we started thinking of the instrument in three dimensions. The extruder of the about the construction of the scanner. First, we thought about filament represents the instrument in this case. using linear motor, but we discovered the fact that all of the We had the idea, that we have similar problem, but we need to move only in two dimensions – left - right and up - down. ACIT 2018, June 1-3, 2018, Ceske Budejovice, Czech Republic 107 So, we decided, that we base the project solution on this 3D delivery from the USA was the longest waiting period during printer construction. This was not a problem because the the construction. Rebelix printer is designed as the open hardware. It also means The Mini-Rambo is as a matter of fact Arduino Mega with that the list of the parts used is available on the Internet. included drivers for the five motors. So, the advantage of this We prepared the initial scheme of a scanner and ordered all board is the possibility to use Arduino IDE to program it. First, the needed parts. As the control board we have chosen the we thought, that we would write completely new program to Mini-Rambo [3] board, the new version 1.3 (Figure 2). Its Fig. 2. Control board Mini-Rambo 1.3. control our scanner. Later we decided to use the original 3D printer 3 years ago, we had simpler task because there are firmware, which is used to control 3D printers. Again, it was motors with connected screw-thread available now, so it is not not a problem, because it is open-source software. needed to join screw-thread to motor. This means, that we control this board by the G-Code 1 Next, we needed the parts printed by 3D printer. We used commands. We needed leading computer, which would send some parts directly from 3D printer, but we also needed to the G-Code commands to the board. prepare and print some new parts. We made them by the online support CAD software Tinkercad [6]. Then we printed all the IV. CONSTRUCTION parts on our printer. After arrival of all the parts (except the board) we began the Then it was necessary to write a code to send desired G- construction. With the help of our technicians we prepared Code to the control board. It was required to cover the entire stake, threads and sockets. In comparison to construction of frame with gel by laser ray by moving the scanner. So, we decided to use Lissajous curve for the movement of the frame. 1 G-Code is the language for the digitally controlled machines. I will show an example of the G-Code later. ACIT 2018, June 1-3, 2018, Ceske Budejovice, Czech Republic 108 As the programming language we selected Python for its We had to test the developed program, which generated G- simplicity and good portability and as the operating system for Code, carefully. First, we used relative coordinates but finally the control computer we used Linux. The computer is we used absolute coordinates to eliminate rounding induced connected by USB cable type A. errors. Here is an example of the source code and example of The advantage of the presented solution was that we could the generated G-code. test the first versions of our program on the 3D printer. It was important because we had all construction complete except for VI. EXAMPLE OF THE SOURCE CODE the board, which arrived two months later. import serial Finally, three months later, we had the construction ramecek = complete (Figure 3 and 4) and we could test it. The meanings serial.Serial("/dev/ttyACM0",baudrate=115 of the items in the figure 3 are: 200, timeout=0) 1. Stepper motor for the movement of the frame in the x axis ramecek.write("G21\n".encode()) direction. XS = 80 2. Stepper motor for the movement of the frame in the z axis ZS= 40 direction. stred="G0 X"+str(XS)+" Z"+str(ZS)+"\n" 3. Coulisse for the screw-threads. ramecek.write("G90\n".encode()) 4. Screw-threads. ramecek.write("M92 X100 Z390\n".encode()) 5. Leading threads. ramecek.write("G28 X Z\n".encode()) 6. Coulisse for the leading threads. ramecek.write(stred.encode()) 7. Gear transmission for the movement of the frame. 8. Frame for the holding of the sample. This code sets up a communication between computer and 9. Aluminum profile for the stability of construction. control board and then sends G-Code commands via USB cable. The whole program is much bigger and complicated and has about 320 lines of the code. VI. EXAMPLE OF THE G-CODE And here is the example of the G-Code for the moving frame of the scanner: G0 X71.601 Z32.191 G0 X73.018 Z31.602 G0 X74.09 Z30.734 G0 X74.694 Z29.738 These are the commands for the movement of the frame along the x axis (right - left direction) and along z axis (up - down direction). For the matter of the interest there are about 2000 G-Code commands for one complete covering of the frame with Lissajous curve. Fig. 3. Scheme of the scanner. VII. PROBLEMS AND CALIBRATION The biggest problem presents the requirement to make small V. TESTING AND TUNING pauses between commands. It is not possible to send a All the problems, which we solved during testing the command after a command without the pauses because the scanner, are described in this chapter. control computer generates the commands faster than the First big problem was the selection of the correct firmware scanner can perform them. The duration of the pauses depends for the Mini-Rambo board. First, we tried the Marlin firmware, on four variables – two dimensions of the sample and two but we had a problem with end-stops 2. So, we tried alternate parameters of the Lissajous curve. If the pauses are too small, firmware RAMPS, but it was even worse. So, we used the the control board can't correctly process G-Code to the scanner development version of the Marlin finally and we had to make in time or the scanner can't execute (more precisely finish) all some changes in the source code. For example, we needed to the commands. In opposite, if the pause is too big, the disable setting for unused y axis (forwards – backwards movement is abrupt and then the scanner shakes. direction). We had to change level of the current for motors So, we have made the algorithms in which the system is because with the original settings the motors are overheated. learning itself. First, we estimate the duration of the pauses according to all enumerated parameters and then the 2 End-stops are the tools which prevent the moving parts from getting out of the leading bars ACIT 2018, June 1-3, 2018, Ceske Budejovice, Czech Republic 109 calibration starts. Control computer tries to work with commands without any error five times. When there appears estimated pauses and reads answers from the control board. If no error during all the calibration, the pauses are cut by 30 % there is any error, the system stops for a while and prolongs and calibration repeats. the pause. First calibration ends when the system passes all the Fig. 4. Final form of the scanner. After this first calibration or calibrations there comes the partly fulfils the standards of the Industry 4.0 because it is self- second calibration. The whole program runs once more with learning. It would have to read the dimension and the position the same conditions as during the real use later. The system of the sample itself to meet the standards completely. watches for the errors again and if any appear, the appropriate The Lissajouse scanner is used for moving of this kind of pause is prolonged. Again, the process ends when no error the sample where is necessary to excite the researched appears five times. molecules so that no previous history of the sample (e.g. After second calibration computer notifies the user that illumination) has any meaning. (e.g. the gel situated in the everything is ready to run, and user can start the lasers. test-glass) The excited molecules in the sample are researched During all the development we worked on the normal PC, with the methods called pump-and-probe, which is common but we prepared one-board computer Raspberry Pi 2 with in the scope femtosecond optical spectroscopy. attached touch display as the control computer for the real use. We got very valuable experiences during this project and these experiences can be used in following constructions. We will be very pleased if it helps anybody to make any similar construction. REFERENCES [1] Institute of Physics and Biophysics [online]. České Budějovice, 2017 [cit. 2017-04-03]. Available from: http://www.prf.jcu.cz/en/ufy/ [2] Marlin - RepRapWiki [online]. 2016 [cit. 2017-04- 03]. Available from: http://reprap.org/wiki/Marlin [3] Mini-Rambo 1.3 - Ultimachine [online]. 2017 [cit. 2017-04-03]. Available from: https://ultimachine.com/products/mini-rambo-1-3 [4] Raspberry Pi - Teach, Learn and Make with RaspBerry Pi [online]. Raspberry Pi Foundation, 2017 [cit. 2017-04-03]. Available from: https://www.raspberrypi.org/ Fig. 5. The scanner on the working position. [5] Rebelix - 3D tiskárna [online]. Praha, 2017 [cit. 2017-04-03]. Available from: http://reprap4u.cz/rebelix/ VIII. CONCLUSION [6] Tinkercad: Create 3D digital designs with online We managed to make the required scanner, which was CAD [online]. Autodesk, 2017 [cit. 2017-04-04]. Available named the Lissajouse scanner. The submitter is satisfied with from: https://www.tinkercad.com our work and scanner will serve to the research. The system ACIT 2018, June 1-3, 2018, Ceske Budejovice, Czech Republic