Design and Implementation of Open Robot Controller
2026-04-06 04:55:03··#1
Abstract: Open-source robot controllers represent the future direction of robot controller development. This paper, based on a summary of the shortcomings of traditional robot controllers, proposes a novel open-source robot controller structure and introduces the specific implementation methods of this structure from both hardware and software perspectives. The controller has completed hardware and software debugging in our laboratory. Finally, the advantages and disadvantages of this controller are summarized. Keywords: Robot; Open-source; Controller; PC Currently, most commercially available robot systems adopt closed-structure dedicated controllers: using a dedicated computer as the upper-level main control computer, a dedicated robot language as the offline programming tool, a dedicated controller for joint servo control, and the control algorithm is embedded in ROM. Such closed systems are difficult (or impossible) to modify. Furthermore, commercially available robot systems lack network functionality. However, modern industrial production and robot research increasingly demand open-source robot controllers. In recent years, the research and use of open-source robot controllers has become an urgent need and a research hotspot. Current research on open-source robot control mainly focuses on defining the robot structure, modularizing system components, standardizing interfaces, improving the reusability, efficiency, maintainability, correctness, and readability of software code, and providing users with convenient task descriptions and programming environments. William E-Ford summarized the main ideas of open robot controllers: (1) Use a development system based on a non-dedicated computer platform (such as PC, SUN). (2) Use standard operating systems (such as Windows, Unix) and standard control languages (such as C/C++, VB). (3) The hardware is based on a standard bus structure (such as ISA, PC/104, STD) and can interface with various peripheral devices and sensors. (4) Use a network strategy to realize remote communication and allow remote operation of the robot. An open robot controller can be designed based on the above ideas, and modularity should be achieved as much as possible during the design process. 1. Design of Open Robot Controller Structure The robot control system is a complex system. The method to deal with complexity is to define a structure, decompose the complex system into several manageable modules, and each module provides a simple interface to external behavior, ignoring or simplifying internal behavior to some extent. Research in this area focuses on defining an abstract model that is independent of the implementation platform. Our laboratory designs the robot controller structure according to functional modularity and proposes an open robot controller structure as shown in Figure 1. The structure consists of the following functional modules: robot body module, motion control module, local operation module and network operation module. The modules are arranged hierarchically from bottom to top, forming a functionally independent structure. The robot body module constitutes the controlled object of the robot control system. The motion control module performs servo control of the controlled object. The local operation module provides a given position input, the body module provides feedback such as position and velocity, and the motion control module forms a closed loop based on the input and feedback to complete the servo control of the controlled object. The local operation module completes local operation tasks, including motion operation, algorithm operation, and device operation. Motion operation refers to providing a human-machine interface, enabling users to perform operations related to robot motion. Algorithm operation refers to operations that modify or replace the motion control algorithm. Device operation refers to operations on I/O devices, sensor devices, etc. within the system. The network operation module completes the robot's network operation functions, such as LAN robot operation and Internet robot operation. 2. Implementation of the Open Robot Controller The structural design of the robot controller is an abstract model independent of the implementation platform; it only describes the controller at the functional level. After the structural design is completed, it can be implemented through specific hardware and software. The following section introduces the implementation of this controller structure in our laboratory. 2.1 Hardware Implementation and Discussion Currently, open robot controller hardware platforms can be roughly divided into two categories: PC bus-based systems and VME bus-based systems. PC bus systems have a series of advantages, such as low cost, good openness, complete software development environment and rich software resources, good communication functions, and a wide user base, thus becoming the main development direction in the future. The implementation of the controller in this laboratory adopts a PC/104 bus-based system. PC/104 is a standard PC bus, and the pin signals are completely equivalent to the ISA bus, but the arrangement is more compact than ISA, and it is widely used in embedded systems. The following hardware devices were mainly used in this laboratory system: (1) PCM3610 embedded PC from Taiwan ACM Technology Co., Ltd., PC/104 bus, with dual Ethernet ports. (2) One set of PMAC2PC/104 multi-axis motion control card from Delta Tau Corporation (including DPRAM). (3) Six sets of Yaskawa SGDM servo amplifiers and SGMPH motors (including absolute position encoders). (4) One Siasun teach pendant (RS232 interface). (5) Siasun robot body. (6) Several I/O cards, A/D cards, and D/A cards. The specific hardware implementation is shown in Figure 2. 2.1.1 Robot Body Module The robot body module consists of a Siasun robot body, Yaskawa AC servo motors, and absolute position encoders. They constitute the controlled objects of the robot control system. 2.1.2 Motion Control Module The motion control module mainly consists of a Yaskawa AC servo amplifier, a PMAC card, and a DPRAM (built into the PMAC). The PMACPC/104 is an open motion control card produced by Delta Electronics, Inc. of the United States. It uses the PC/104 bus and is based on a Motorola DSP. It can be used with various types of servo amplifiers and provides a user servo algorithm interface. The Yaskawa AC servo amplifier can work in multiple modes through parameter settings and jumpers, such as position input mode, speed input mode, and torque input mode. This laboratory completed the signal connection between the PMAC and the servo amplifier, as well as the logic control of each I/O signal in the system, through a self-made circuit board. The motion control module completes the servo control of each motor. The system's motion control closed loops are all located within this module, comprising the position loop, velocity loop, and current loop. Since the current and torque in a motor are proportional, the current loop can also be called the torque loop. For open systems, when the controlled object changes or the motion control module is modified, the system must be able to easily adjust to form the required control system and functions without affecting the upper-level modules. This system, through the combined use of a PMAC card and a Yaskawa servo amplifier, along with a well-designed system wiring and circuit board, can achieve three control modes using only jumpers and parameter settings, as shown in Figure 3. In mode one, the position loop, velocity loop, and current loop are all within the servo amplifier; the motion control card has no closed loop and only functions as a transmission intermediary, which can be understood as a proportional gain. When this proportional gain is 1, the motion control card can be directly removed from the system. In this case, the local operation module directly sends the given position to the servo amplifier, which then performs the motion control. Most commercial robots use this type of host computer plus servo amplifier control system. Because the servo algorithm is embedded in ROM and calculated by a dedicated CPU within the servo amplifier, users cannot modify the motion control module or servo algorithm in this method. In Method 2, the position loop is in the motion control card, while the velocity and current loops are in the servo amplifier. The motion control card receives the position command and performs position control, then sends the velocity command to the servo amplifier, which closes the velocity and current loops. In this method, the servo amplifier provides high velocity loop stiffness and anti-interference capability. Due to these high gains, the position loop only needs a small proportional gain Pp to achieve position control. However, since most of the velocity loop stiffness comes from the velocity integral gain Iv, and the integral gain causes a hysteresis, increasing the velocity loop settling time, the system is slow to respond to position commands. Therefore, it is not suitable for systems with rapid start and stop. When used for robot control, the velocity loop integral gain can be reduced or set to 0. In Method 2, the position loop control algorithm is open to the user. The user can write the servo algorithm using Motorola DSP assembly language, compile and convert it, and then download it through the interface provided by DELTA. In Method 3, the position and velocity loops are in the motion control card, while the current loop is in the servo amplifier. The motion control card receives the given position and performs position and velocity control, then sends the given torque to the servo amplifier, which closes the torque/current loop. Since the performance of the torque-mode servo amplifier is not significantly affected by error integral control, which can lead to response lag, this method performs well in systems requiring rapid acceleration or deceleration. Our laboratory has achieved good results using this method when implementing robot control. In Method 3, the position and velocity loop control algorithms are open to users. Users can write servo algorithms using Motorola DSP assembly language, compile and convert them, and then download them through the interface provided by DELTA. 2.1.3 Local Operation Module The local operation module consists of a PC/104 embedded PC, a Siasun teach pendant, and other PC/104 bus devices. It uses the Windows 2000 operating system and VB and VC as development tools. The teach pendant connects to the PC via an RS232 serial port. Bus devices such as the PMAC, I/O card, A/D card, and D/A card connect to the PC via the PC/104 bus. The PC connects to the Ethernet network via an integrated network card. This module completes local operation tasks, including motion operation, algorithm operation, device operation, and robot network operation services. Robot motion operation refers to the process of first obtaining the motion task through the teach pendant or robot language, then obtaining a trajectory point sequence through task planning, trajectory planning, and trajectory interpolation, and finally sending the trajectory point sequence to the motion control module, which then performs robot motion control matching the trajectory point sequence. In this laboratory robot system, the PC and the PMAC card can communicate in two ways: DPRAM and bus. In DPRAM mode, the PC and motion control card exchange data by accessing the same cell within the DPRAM. DPRAM mode enables high-speed data exchange, and the transmission of trajectory point sequences uses this method. In bus mode, the motion control card behaves like other bus devices, and the PC accesses it via address and data lines. The algorithm operation includes modifying the built-in PID algorithm parameters of the motion control card and implementing the user servo algorithm. Modifying the built-in PID algorithm parameters is achieved by calling dynamic link library functions from DELTA. The user servo algorithm is implemented through the PMAC user servo algorithm interface and is written in Motorola DSP assembly language. To ensure the normal operation of the robot system and meet system expansion requirements, the robot system needs to control some I/O quantities, such as alarms, servo enable, and brake release. The robot system also needs to acquire some sensor signals, such as current and voltage. The local operation module handles the operation of these I/O devices and sensor devices. Because a standard PC and standard bus are used, any peripheral conforming to the PC/104 specification can be easily added to this controller, such as I/O boards, A/D cards, D/A cards, and image acquisition cards. Furthermore, since the PC uses the Windows operating system, it enjoys widespread driver support from various peripheral manufacturers, providing great convenience to users. The PC in the local operation module is connected to a HUB or switch via an integrated Ethernet card, thus realizing the connection between the robot controller and the network. Through this connection, the local operation module provides network operation services to the network operation module. 2.1.4 Network Operation Module The network operation module consists of a web server, a LAN operation client, and an Ethernet operation client. This module completes the robot network operation functions, including LAN robot operation and web-based internet remote robot operation. Currently, most process control systems use fieldbus technology. However, a fundamental drawback of fieldbus is that its openness is conditional and not complete. Due to the high speed of Ethernet (reaching 100 Mb/s or even higher) and its excellent compatibility and widespread adoption, fieldbus control networks have gradually shifted to Ethernet control networks, and the Ethernet + TCP/IP protocol model is gradually entering the field of programmable logic controllers (PLC). Simultaneously, because Ethernet and the internet can be easily interconnected, using Ethernet combined with the internet is an ideal method for robot network operation. The Common Object Request Broker Architecture (CORBA) is an emerging object-oriented distributed computing technology. Using the CORBA architecture, application systems with different operating systems, programming languages, and network protocols can easily interoperate and be integrated together. This laboratory system utilizes CORBA technology for network operation. The PC in the local operation module acts as a CORBA server, providing CORBA services for robot network operation. Other PCs within the local area network (LAN) act as CORBA clients, calling CORBA services to achieve LAN-based robot operation. Internet remote robot operation employs a two-level calling strategy. The web server within the LAN provides web services on the internet and simultaneously acts as a CORBA client within the LAN. The internet remote operation client first sends a remote operation request to the web server via the web service. Then, the web server, based on the request, sends a LAN operation request to the CORBA server, thus enabling Internet robot operation. 2.2 Software Implementation and Discussion This laboratory uses a modular design approach to develop the software system. Modules employ an object-oriented port design method. The internal state and methods of objects are hidden from other modules; only the object's port is visible to other objects. Modules exchange information through a global state information database mechanism. This system uses the Windows 2000 operating system and VB language. The software structure is shown in Figure 5. First, a function library is established based on the motion control card and other device drivers. This function library provides a set of standard services to the application program, allowing users to complete the required functions. Simultaneously, this function library isolates the application program from the underlying hardware and software. In this structure, the software modules based on the function library are categorized as follows: motion operation, algorithm operation, bus device operation, and network service. 2.2.1 Motion Operation Class The motion operation class implements the software for robot motion operations. The teaching module obtains the motion task through playback teaching, and the robot language input and interpretation module obtains the motion task through robot language. The motion task includes information such as target point, motion speed, and interpolation method. The planning and interpolation module completes task planning, trajectory planning, and trajectory interpolation based on the motion task, obtaining a sequence of robot trajectory playback points. Finally, the playback module starts the motion control card playback program and sequentially sends the playback point sequence to the PMAC for PMAC to read and control the robot to complete the corresponding motion. The position, velocity, and acceleration acquisition module completes the acquisition and display of position, velocity, and acceleration information for each axis or end effector of the robot. 2.2.2 Algorithm Operation Class This operation class includes a built-in PID parameter modification module and a user servo algorithm module. The PID parameter modification module calls dynamic link library functions provided by Delta, providing a graphical human-machine interface that allows users to adjust the parameters of the PID algorithm on the PMAC card in real time. The user servo algorithm module implements the user algorithm in the system. First, the user algorithm is written in Motorola DSP assembly language, then compiled and converted to generate an object file, and finally downloaded to the motion control card through the interface provided by PAMC. Delta also provides a user algorithm evaluation package, which allows for real-time evaluation of system performance, greatly facilitating users. 2.2.3 Bus Device Operation Class The I/O device operation module completes the reading and writing of I/O quantities and logic control within the system, such as alarms, power-on enable, running lights, relay control, etc. The sensor device control module completes the acquisition of sensor signals within the system, such as current, voltage, etc. Other bus device operation modules complete the operation of other extended bus devices. 2.2.4 Network Service Class The network operation CORBA service module is an independent class. This module provides CORBA-compliant network robot operation services. The specific implementation is described in another article from our laboratory, which presents the CORBA server and CORBA client as an independent whole, detailing the software development and description. 3. Conclusion This controller conforms to the main principles of an open robot controller. Furthermore, both the hardware and software design adopt a modular approach, with each module having relatively independent and complete functions. Currently, our laboratory has completed the hardware and software debugging of the robot system, achieving the required control functions and fully verifying the correctness and openness of this design. Compared with traditional closed controllers, our laboratory's robot system exhibits many advantages: (1) It can be replaced or modified by users or third-party developers, allowing users to modify the robot controller as needed, thus broadening the application range of the robot system. (2) The hardware and software combination easily integrates external sensors, operation interfaces (such as force reflection), new servo control laws, etc. (3) The controller adopts modular technology, allowing the use of tested and high-performance subsystem modules during robot system development. The reuse of functional modules reduces development costs, improves system quality and safety performance, ensures the controller meets requirements, avoids unexpected fatal errors, and reliably guarantees the safety performance of the robot system. The use of general modules greatly reduces repetitive development work, simplifies programming, and thus reduces the time and cost of the entire system development. (4) It achieves standardization of platform, operating system and user interface, and has the prospect of reducing training needs, reducing system support needs and reducing maintenance costs. (5) The open approach to hardware and software implementation allows any third-party hardware and software packages that conform to the interface standard to be added to the system or replace components with the same function, thereby stimulating competition among system suppliers. Through competition, on the one hand, users can obtain richer hardware and software resources and reduce implementation costs, and on the other hand, it accelerates the transformation from research system to operating system, thus shortening the cycle from research to commercial product. Although this controller has many advantages, there are still many issues that need to be improved, such as providing better real-time processing capabilities and providing a convenient graphical development environment. With the solution of these issues, open robot systems will inevitably be more widely used.