Control System in Open-Source FPGA for a Self-Balancing Robot
Abstract
:1. Introduction
2. Related Works
2.1. FPGA in Robotics
- A high technological integration level is not recommended;
- Robots must be sociable and fun;
- Programming frameworks should not be complex, their functionality should be limited to a certain extent, and they must attract students’ attention and make them feel comfortable in the context;
- It is important for the robot to have a series of sensors and actuators, as well as inputs and outputs so that the results are visual.
2.2. Open FPGAs
- 12 MHz oscillator;
- On/off switch to enable or disable digital pins;
- 20 Input/Output 5 V pins;
- 8 Input/Output 3.3 V pins;
- Micro-B USB to program FPGA from PC;
- Reset button;
- Eight general-purpose LEDs;
- TX/RX LEDs;
- 4 analog inputs available through i2c;
- 8 K memory;
- Possibility of powering through LIPO battery.
2.3. Inverted Pendulum
3. Self-Balancing Robot
3.1. Design
3.2. Perception
3.3. Arduino-FPGA Connection
- When a byte transmission starts;
- When a byte transmission ends;
- When a bit can be captured;
- When the necessary bits are saved in a buffer until the byte is complete.
- IDLE: The process remains in this state until the transmission starts, which will then lead to the next state (START);
- START: The serial transmission protocol begins with a start condition, and this state will allow recognition of when this condition ends in order to start saving bits in the buffer;
- DATA: Since the transmission speed is already known and the condition of START in the previous state has been recognized, in this state a flag will change its value when the bit is ready to be stored in the buffer, of which Process 2 will be in charge of this storage;
- STOP: In addition to a START condition, the serial transmission protocol used in Arduino has a STOP condition. This state allows recognition of the time Arduino takes to carry out this last condition—it will then return to the first state until a new transaction begins.
- Wait until the sensibility list is activated—this will indicate that a bit can be captured;
- Bits will be stored in a buffer forming a byte, which will represent the integer or decimal part of the angle at that moment;
- When the byte is prepared to be captured by two consecutive modules, a channel will be on. Both the outputs and the buffer with the 8 bits and the “byte_ready” channel will be available.
3.4. PD Control in FPGA
- Both the integer part and the decimal part are represented as 8-bit data without a sign. In order to give greater importance to the integer part, there is the option of dividing the decimal part by 100 (Figure 10) or of multiplying the integer part by 100. The first option does not provide good behavior due to the digital treatment of the floating comma. Thus, the second option is preferable.
- The two integer and decimal components are added, and then it is multiplied by a constant, defined as a parameter which can be dynamically changed.
3.5. Motor Block in FPGA
4. Experiments
4.1. Physical Robot
4.1.1. IceZum Alhambra Board
4.1.2. Arduino Nano-Processor
4.1.3. MPU6050
4.1.4. Motor Driver
4.1.5. PCB Shield
4.2. Inverted Pendulum
4.3. Final Results
4.4. Alternative Design without Arduino
5. Conclusions
Author Contributions
Funding
Acknowledgments
Conflicts of Interest
References
- Nickolls, J.; Dally, W.J. The GPU Computing Era. IEEE Micro. 2010, 30, 56–69. [Google Scholar] [CrossRef]
- Alkhafaji, F.S.; Hasan, W.Z.; Isa, M.; Sulaiman, N. Robotic Controller: ASIC versus FPGA—A Review. J. Comput. Theor. Nanosci. 2018, 15, 1–25. [Google Scholar] [CrossRef]
- Sharma, A.K. Programmable Logic Handbook: PLDs, CPLDs and FPGAs; McGraw-Hill Handbooks: New York, NY, USA, 1998. [Google Scholar]
- Brown, S.D.; Francis, R.J.; Rose, J.; Vranesic, Z.G. Field-Programmable Gate Arrays; The Springer International Series in Engineering and Computer Science; Springer: Berlin, Germany, 1992. [Google Scholar]
- Semiconductor, L. FPGA Lattice. Available online: https://www.latticesemi.com/ (accessed on 10 September 2018).
- Xilinx. 2018. Available online: https://www.xilinx.com/ (accessed on 20 September 2018).
- Intel. 2018. Available online: https://www.intel.es/content/www/es/es/fpga/devices.html (accessed on 21 December 2018).
- Intel. Stratix 10 GX/SX Device Overview. Available online: https://www.altera.com/content/dam/altera-www/global/en_US/pdfs/literature/hb/stratix-10/s10-overview.pdf (accessed on 20 September 2018).
- Xilinx. Zynq-7000 All Programmable SoC Data Sheet: Overview. Available online: https://www.xilinx.com/support/documentation/data_sheets/ds190-Zynq-7000-Overview.pdf (accessed on 23 October 2017).
- Altera. Nios II Gen2 Processor Reference Guide. Available online: https://www.altera.com/content/dam/altera-www/global/en_US/pdfs/literature/hb/nios2/n2cpu-nii5v1gen2.pdf (accessed on 20 June 2018).
- Xilinx. Using the MicroBlaze Processor to Accelerate Cost-Sensitive Embedded System Development. Available online: https://www.xilinx.com/support/documentation/white_papers/wp469-microblaze-for-cost-sensitive-apps.pdf (accessed on 4 September 2018).
- RISC-V. Available online: https://riscv.org/ (accessed on 25 December 2018).
- Mi-V RISC-V Ecosystem. Available online: https://www.microsemi.com/product-directory/fpga-soc/5210-mi-v-embedded-ecosystem (accessed on 13 November 2018).
- Dennis, D.K.; Priyam, A.; Virk, S.S.; Agrawal, S.; Sharma, T.; Mondal, A.; Ray, K.C. Single cycle RISC-V micro architecture processor and its FPGA prototype. In Proceedings of the 2017 7th International Symposium on Embedded Computing and System Design (ISED), Durgapur, India, 18–20 December 2017; pp. 1–5. [Google Scholar]
- Freund, K. Microsoft: FPGA Wins Versus Google TPUs For AI. Available online: https://www.forbes.com/sites/moorinsights/2017/08/28/microsoft-fpga-wins-versus-google-tpus-for-ai/ (accessed on 24 March 2018).
- Ghosh, S. Hardware Description Languages: Concepts and Principles; IEEE Computer Society Press: New York, NY, USA, 2000. [Google Scholar]
- Nane, R.; Sima, V.M.; Pilato, C.; Choi, J.; Fort, B.; Canis, A.; Chen, Y.T.; Hsiao, H.; Brown, S.; Ferrandi, F.; et al. A survey and evaluation of FPGA high-level synthesis tools. IEEE Trans. Comput.-Aided Des. Integr. Circuits Syst. 2016, 35, 1591–1604. [Google Scholar] [CrossRef]
- Chu, P.P. RTL Hardware Design Using VHDL: Coding for Efficiency, Portability, and Scalability; John Wiley & Sons: Hoboken, NJ, USA, 2006. [Google Scholar]
- Donald Thomas, P.M. The Verilog® Hardware Description Language; Springer Science & Business Media: Berlin, Germany, 2008. [Google Scholar]
- SpinalHDL User Guide. Available online: https://spinalhdl.github.io/SpinalDoc/ (accessed on 10 November 2017).
- Raj, M.D.; Gogul, I.; Thangaraja, M.; Kumar, V.S. Static gesture recognition based precise positioning of 5-DOF robotic arm using FPGA. In Proceedings of the 2017 Trends in Industrial Measurement and Automation (TIMA), Chennai, India, 6–8 January 2017; pp. 1–6. [Google Scholar] [CrossRef]
- Zhang, Z.; Xin, Y.; Liu, B.; Li, W.X.Y.; Lee, K.H.; Ng, C.F.; Stoyanov, D.; Cheung, R.C.C.; Kwok, K.W. FPGA-Based High-Performance Collision Detection: An Enabling Technique for Image-Guided Robotic Surgery. Front. Robot. AI 2016, 3, 51. [Google Scholar] [CrossRef]
- Vachhani, L.; Mahindrakar, A.D.; Sridharan, K. Mobile Robot Navigation Through a Hardware-Efficient Implementation for Control-Law-Based Construction of Generalized Voronoi Diagram. IEEE/ASME Trans. Mechatron. 2011, 16, 1083–1095. [Google Scholar] [CrossRef]
- Eteokleous, N.; Ktoridou, D. Educational robotics as learning tools within the teaching and learning practice. In Proceedings of the 2014 IEEE Global Engineering Education Conference (EDUCON), Istanbul, Turkey, 3–5 April 2014; pp. 1055–1058. [Google Scholar] [CrossRef]
- Khatib, B.S.O. Springer Handbook of Robotics; Springer: Berlin, Germany, 2016. [Google Scholar]
- Kung, Y.S.; Shu, G.S. Development of a FPGA-based motion control IC for robot arm. In Proceedings of the 2005 IEEE International Conference on Industrial Technology, Hong Kong, China, 14–17 December 2005; pp. 1397–1402. [Google Scholar] [CrossRef]
- Nema, R.; Thakur, R.; Gupta, R. Design & Implementation of PID Controller Based On FPGA with PWM Modulator. Int. J. Soft Comput. Eng. IJSCE 2013, 3, 2231–2307. [Google Scholar]
- Linares, J.C.; Barrientos, A.; Márquez, E.M. Hybrid Bio-Inspired Architecture for Walking Robots Through Central Pattern Generators Using Open Source FPGAs. In Proceedings of the 2018 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), Madrid, Spain, 1–5 October 2018; pp. 7071–7076. [Google Scholar] [CrossRef]
- Arduino. Available online: https://www.arduino.cc/ (accessed on 26 May 2017).
- Romanov, A.; Bogdan, S. Open source tools for model-based FPGA design. In Proceedings of the 2015 International Siberian Conference on Control and Communications (SIBCON), Omsk, Russia, 21–23 May 2015; pp. 1–6. [Google Scholar]
- Wolf, C.; Lasser, M. Project Icestorm. Available online: http://www.clifford.at/icestorm (accessed on 15 January 2018).
- Tarjeta IceZum Alhambra II. Available online: https://alhambrabits.com/alhambra/ (accessed on 20 January 2018).
- IceStudio. Available online: https://icestudio.readthedocs.io/en/latest/ (accessed on 20 January 2018).
- Romanov, A.; Romanov, M.; Kharchenko, A. FPGA-based control system reconfiguration using open source software. In Proceedings of the 2017 IEEE Conference of Russian Young Researchers in Electrical and Electronic Engineering (EIConRus), St. Petersburg, Russia, 1–3 February 2017; pp. 976–981. [Google Scholar] [CrossRef]
- Pathak, K.; Franch, J.; Agrawal, S.K. Velocity and position control of a wheeled inverted pendulum by partial feedback linearization. IEEE Trans. Robot. 2005, 21, 505–513. [Google Scholar] [CrossRef]
- Orozco, L.M.L.; Lomeli, G.R.; Moreno, J.G.R.; Perea, M.T. Identification Inverted Pendulum System using Multilayer and Polynomial Neural Networks. IEEE Latin Am. Trans. 2015, 13, 1569–1576. [Google Scholar] [CrossRef]
- Yu, L.H.; Jian, F. An Inverted Pendulum Fuzzy Controller Design and Simulation. In Proceedings of the 2014 International Symposium on Computer, Consumer and Control, Taichung, Taiwan, 10–12 June 2014; pp. 557–559. [Google Scholar] [CrossRef]
- Altium Designer. Available online: https://www.altium.com/altium-designer/ (accessed on 19 June 2018).
- SolidWorks. Available online: https://www.solidworks.com/es (accessed on 25 October 2018).
© 2019 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).
Share and Cite
Ordóñez Cerezo, J.; Castillo Morales, E.; Cañas Plaza, J.M. Control System in Open-Source FPGA for a Self-Balancing Robot. Electronics 2019, 8, 198. https://doi.org/10.3390/electronics8020198
Ordóñez Cerezo J, Castillo Morales E, Cañas Plaza JM. Control System in Open-Source FPGA for a Self-Balancing Robot. Electronics. 2019; 8(2):198. https://doi.org/10.3390/electronics8020198
Chicago/Turabian StyleOrdóñez Cerezo, Juan, Encarnación Castillo Morales, and José María Cañas Plaza. 2019. "Control System in Open-Source FPGA for a Self-Balancing Robot" Electronics 8, no. 2: 198. https://doi.org/10.3390/electronics8020198
APA StyleOrdóñez Cerezo, J., Castillo Morales, E., & Cañas Plaza, J. M. (2019). Control System in Open-Source FPGA for a Self-Balancing Robot. Electronics, 8(2), 198. https://doi.org/10.3390/electronics8020198