EM024 » Smart 3D printer using DE10-Nano HPS/FPGA
Purpose: to create a 3D printer that helps to prevent failures and problems during a printing progress, to have a user-friendly control interface (LCD display), an isolated body and a large printing area.
Applications: The scope of 3D printers application is wide. We use SoC to provide functioning of the printer with advanced features. SoC is used to generate signals for the mechanical parts of the printer, to realize high-level information processing algorithms, and to provide the interaction interface to users.
Target user: This product is a prototype of future 3D printers on SoC. At present, there are no similar products in the middle price segment. Our team presents a new concept of a printer control system which provides a convenient user interface with the possibility of further connection to smart home systems using IoT technology.
In the present-day world, additive manufacturing, known as 3D printing, is widespread. 3D prototypes production is used widely in many areas of human activities. The use of 3D printing is required in robotics, machinery, engineering and etc.
In modern 3D printers, such error situations as model detachment from the table or break of a plastic thread are known to exist. To reduce potential printer breakage or damage in such cases, a special operator for monitoring the printing process is required. There is a need for special monitoring devices which could be used for error detection and shutting down the device in relevant cases.
To reduce a possibility of error occurrence during a process of printing, we use SoC (System-on-Chip) in our project. Furthermore, the system is used to provide implementation of an autonomic user interface and the printing process error monitoring system. Moreover, with the help of a wireless access module, such level of self-sufficiency provides an opportunity to include the device to a smart home system based on the IoT technology. Therefore, neither a constantly monitoring operator nor a connected to the printing system personal computer are required for the device to function.
To create the 3D printer being developed, performing the following tasks is required:
Printer parts: Display, motor drivers, prithead.
LCD display implemented presets:
Figure 1 – HPS level interaction diagram
Figure 2 – Periphery, FPGA, and HPS interaction diagram
Figure 3 – HPS, FPGA, and screen interaction diagram
One of the most important advantages of the SoC DE10-Nano board is the FPGA and HPS available on a single chip. This connection provides an opportunity to implement high-level processing algorithms for 3D models preparation. IoT applications and displaying the information on a screen without using a third-part microcomputers are available due to the interaction of the Intel FPGA ARM & Linux and FPGA integrated into one scheme.
Using Intel FPGA provides an ability to quickly apply changes in the design of the system and modify the project.
The DE10-Nano board has a wide range of interfaces and tools which facilitate a design of such control units.
Creating a system for monitoring printing process on SoC allows a real-time execution of parallel data processing from sensors and provides a high-level accuracy and reliability of a printing process.
The developed device allows printing models up to 300x300x300mm in size. The presence of a closed housing protects the printed area from possible external effects of wind or drafts. The use of such a system makes it possible to reduce costs caused by a high percentage of defective models. This means that the system can be easily used when printing prototypes or ready-made models with subsequent refinement both at home and in laboratory conditions; the uttermost is currently in demand.
3D printer design is based on kinematics CoreXY  which carries out the movement of the carriage through the use of two interconnected stepper motors. Motion parameters are calculated according to the following equations:
∆x = ∆a/2 + ∆b/2,
∆y = ∆a/2 − ∆b/2,
where ∆a, ∆b – rotation value of the engines a and b, respectively;
∆x, ∆y – amount of movement of the carriage along axes X and Y.
The created system is able to minimize the effect of vibrations of the printing mechanism due to the rigidity of the housing structure.
The use of FPGAs significantly improves the performance of the data management system, making it possible to parallelize the calculations: to quickly process large data streams and to manage the entire periphery of the system. As a result, a printing quality is improved and the percentage of defective models is reduced. In addition to FPGAs, there is a Cortex-A9 processor on the board which via the Avalon-MM bridge exchanges data with FPGAs and ensures processing the G-code model file in C ++.
For convenient printer management and the ability to print models without using a computer the Nextion screen  is used. Communication with the screen is done using a universal asynchronous receiver-transmitter (UART). Two wires are sufficient for its operation: one is responsible for sending data, another is responsible for receiving it. The program is launched under Linux OS, where the port interacts at the lowest available level of the operating system using /dev directory, which stores a list of interfaces linked to real devices. Port operation is configured by using the termios structure from the header file containing the headers of all interfaces.
Nextion display device responses when one clicks on the interface button. A sequence of bytes is sent to the port that uniquely identifies the signal sender in the form of a screen number and an element. Each of these commands ends with three stop bytes and allows distinguishing between the commands. The received command is decoded and either redirected to a special class for processing or represented as changes on the screen.
The developed control system allows printing prepared 3D models using G-Code files. A typical model printing process is carried out in accordance with the following steps:
In the future, it is planned to supplement the system with a server running on HPS to remotely control the device and printing process as well as implement the work of the developed algorithms for HPS on FPGA.
The printer is capable of printing large parts up to 300 mm along each of the X, Y, and Z axes by utilizing the maximum available design space. The aluminum profile frame allows an access to the printer mechanics providing the necessary and sufficient rigidity of the device body. The latter allows reducing the effect of vibration on the printing process, which favorably affects the quality of the printed product.
De10-Nano board consists of two main blocks: FPGA and HPS. Our solution uses both to implement a management system. FPGA reads information from sensors in real time and generates control signals for peripheral devices. The latter, together with the parallel execution of FPGA modules, reduces the time for data processing and allows timely response to changes in the system. The combination of processor core and integrated circuit has great potential for making modifications. In the future, this provides an opportunity to make changes to program modules and add new components (sensors, servomotors, extruders, etc.) to the printer system with minimal efforts.
The user interacts with the system using the screen connected via the UART interface. RS-232 protocol  makes it possible to transfer the data between the screen and HPS at the speed up to 11.5 KB per second which is enough to handle the interaction with the screen.
The control system project consists of three main parts: screen, FPGA and HPS. Each of these parts corresponds to a section on GitHub : «Screen», «FPGA», «HPS».
“Screen” contains a folder with screenshots of the layouts of main interfaces, as well as a file project for the Nextion screen. FPGA consists of a .sof file for FPGA firmware and a section with a Quartus project. The project contains several basic modules:
In addition to the main modules, the project uses two files generated in qsys, which make it easy to add custom IP cores:
"HPS" section includes the subsections "mechanics", "printer”, and "screen" responsible for main functions of the device and "main.cpp", which is the entry point to the program.
In "mechanics", the connection between HPS and FPGA is realised, and the main methods used after parsing G-Code commands are implemented. “Printer” section is the main part, which describes the work of file manager, parses G-Code files and supports the connection of the three main components of the firmware. The last section describes the operation of UART, interaction of HPS and the screen and processing of data coming from it.
The result of our work is a developed 3D printer with a control system based on Intel System-on-Chip FPGA. Compared with control modules on microcontrollers, this solution improves the print quality of models due to the speed of SoC, possibility of parallelization of calculations and timely response to sensors activity. Expanding the functionality of the device by adding new modules can be performed using free logical components of FPGA and simple flashing of the board.
After testing the prototype test models were printed during several months and the data was obtained representing the effect of temperature on printing with ABS (Fig. 4) and PLA plas. Based on the experiments, the most suitable parameters were chosen, which allows to prevent and study errors that occur during printing as well as to correct them and minimize their impact and likelihood of their occurrence.
Figure 4 – An example of model printing
 “CoreXY.” [Online]. Available: http://corexy.com/theory.html. [Accessed: 11-Sep-2019].
 “NX4024K032 - Nextion.” [Online]. Available: https://nextion.tech/datasheets/nx4024k032/. [Accessed: 08-Sep-2019].
 “Terasic - SoC Platform - Cyclone - DE10-Nano Kit.” [Online]. Available: https://www.terasic.com.tw/cgi-bin/page/archive.pl?Language=English&No=1046. [Accessed: 11-Dec-2018].
 “What is RS232 Serial Communication Protocol? RS232 Basics, Working & Specifications.” [Online]. Available: https://circuitdigest.com/article/rs232-serial-communication-protocol-basics-specifications. [Accessed: 29-Sep-2019].
 “InnovateFPGA_3Dprinter.” [Online]. Available: https://github.com/Spieler12309/InnovateFPGA_3Dprinter. [Accessed: 29-Sep-2019].