Academic Journal of Science and Technology ISSN: 2771-3032 | Vol. 9, No. 3, 2024 274 Research on the Driving and Control of an Intelligent Book Robot Xingyu Wang College of Electrical Engineering, Southwest Minzu University, Chengdu, Sichuan 610225, China Abstract: Based on the theoretical foundation provided by kinematic simulations under various parameter conditions using Adams for robots' control, this paper designs a dual-closed-loop drive control system for the robot. It constructs the drive speed control hardware circuit and simulates the step response of positional PID, incremental PID, and fuzzy PID in Simulink. Positional PID is selected as the velocity control algorithm due to its fast response characteristics and ease of implementation. The drive circuit and control algorithm are jointly simulated using Proteus to verify the speed control effect of the robot's drive. Keywords: Robot, PID, Driving and Control, Simulink Simulation. 1. Introduction In China, the construction process of smart libraries has already been initiated. In 2016, the National Development and Reform Commission issued the notice 'On Organizing and Promoting the Practical Evaluation of New Smart City Development to Facilitate Healthy and Rapid Development of New Smart Cities' [1]. The 'Thirteenth Five-Year Plan for Education Informatization' formulated by the Ministry of Education in 2017 sets the goal for higher education institutions to achieve basic completion of smart campus construction by the end of 2020 [2]. As of 2023, the total number of universities and public libraries in China has exceeded 6,000. According to incomplete statistics, each library holds from several hundred thousand to over a million physical books, and these collections are continuously expanding [3-4]. Therefore, the imperative for intelligent and informatized development of libraries is evident. The trend of using robots to replace library personnel for the tedious tasks of book organization is emerging as a future direction for library development. This paper investigates the driving and control of an intelligent book robot, which holds practical significance for the intelligent construction of libraries. The paper designs a dual-closed-loop drive control system for the robot, constructs a drive speed regulation hardware circuit, and conducts simulation analyses on traditional digital PID and fuzzy PID using the Simulink module in MATLAB. Positional PID, characterized by favorable response characteristics and ease of implementation, is selected as the speed control algorithm. The results indicate that the overshoot of speed adjustment is 7%, the adjustment time is 2.5 ms, and the steady-state error is 0, meeting the requirements for intelligent control of motor speed. 2. Research on the Driving and Control of Robot 2.1. Transfer Function of the DC Motor System When an electric motor is used within a rapidly changing operational range, its dynamic performance can be assessed using a transfer function. The term 'transfer function' refers to the ratio of the Laplace transforms of the output and input signals of the electric motor. Figure 1. Laplace Transform of the Electric Motor Based on Fig. 1, it can be observed that by applying a Laplace transform to the signal, i.e., transforming the function of time 't' into a function with 's' as a variable, the transfer function of the electric motor is defined as follows: (1) Figure 2. Equivalent Circuit of the Armature Winding The principles of the armature winding equivalent circuit in the above Fig. 2 lead to the following formula. (1) Voltage balance equation (i.e., describing the electrical portion of the model): 275 (2) In Eq. (2), represents the armature voltage, is the armature resistance, is the armature current, is the armature inductance, and is the back electromotive force. (2) Torque balance equation (i.e., describing the mechanical portion of the model): (3) In Eq. (3), represents the motor output torque, is the angular displacement of the motor shaft, is the equivalent moment of inertia, and is the equivalent friction coefficient. (3) Coupling relationship: The coupling between the mechanical and electrical components involves two aspects: the electrical influence on the mechanical part, manifested in the linear variation of torque on the motor shaft with the armature current; and the mechanical influence on the electrical part, manifested in the proportionality between the back electromotive force of the motor and its angular velocity. (4) (5) In Eq. (4), Eq. (5), represents the motor current-torque constant, and is the back electromotive force coefficient. By simultaneously applying a Laplace transform to both sides of Eq. (3) to Eq. (5) and combining them, the transfer function from armature voltage to motor shaft angular displacement is obtained as: (6) Similarly, it can be derived that the transfer function of motor speed relative to input voltage is: (7) In Eq. (7), is the mechanical time constant, is the electrical time constant, and is the motor electromotive force coefficient. Based on the derived mathematical model and referencing engineering empirical formulas [5-6], the transfer function of the DC motor can be estimated. Furthermore, the motor parameters for the DC geared motor MG513 are provided in Table 1. It is noteworthy that the motor model 'MG' represents the DC brushed motor series, '513' is the motor model, and 'P30' indicates a gear ratio of 1:30. Table 1. DC Geared Motor MG513 Specifications Motor type Rated voltage (V) Rated current (A) Lock-rotor current (A) No-load speed (rpm) Rated speed (rpm) Rated torque (kg.cm) No-load torque (kg.cm) MG513P10 12 0.36 3.2 1100±132 850±102 0.5 1.9 MG513P20 12 0.36 3.2 549±40 439±32 0.66 3.8 MG513P30 12 0.36 3.2 366±26 293±21 1 4.5 MG513P60 12 0.36 3.2 183±13 146±10 2 9 Therefore, by substituting the parameter values of the selected motor MG513P30, an approximate transfer function for motor speed relative to input voltage can be obtained as: (8) 2.2. PID control algorithm 2.2.1. PID control principles The PID control, from its establishment to development, has become highly mature and is characterized by its simplicity, ease of understanding, independence from the need for mathematical modeling, and strong robustness [7]. As a result, it has found widespread applications, and the classic control structure is illustrated in the following figure. Figure 3. Typical Structure of PID Control As indicated in the above Fig. 3, the differential equation representation of the analog signal PID is: (9) In Eq. (9), represents the difference between the setpoint and the actual value, is the setpoint, is 276 the actual value, is the control signal directly affecting the controlled object, is the proportional gain, represents the ratio of the integral gain to the integral time, defined as the integral gain , represents the product of the proportional gain and the derivative time, defined as the derivative time . The main functions of each component are as follows: the proportional component provides a rapid response to the current error value. In general, a larger value of leads to steeper control, but it should not be excessively large, as it may cause the controlled object to oscillate above and below the setpoint. It should also not be too small, as it may result in the controlled object never reaching the setpoint and stabilizing. The integral component considers the influence of historical errors on the controlled object, aiming to eliminate steady-state errors between the setpoint and the actual value. However, it may counteract the control effectiveness of the proportional component and slow down the response speed of the controlled object. The derivative component takes into account the future trend of error changes, with a stronger effect when the error change is larger. It helps eliminate oscillations in the controlled object but is susceptible to interference from noise signals. The adjustment effects of the above three components are conflicting, and therefore, it is necessary to rationally tune the parameters of PID based on the actual application to achieve control with rapid response, low steady-state error, and minimal overshoot. With the advent of computers, the principles of analog PID control have gradually gained widespread application. Based on the computer's continuous sampling mechanism, various digital PID control methods have evolved. The following sections introduce the control principles of traditional digital PID and fuzzy PID, respectively. 2.2.2. Traditional digital PID control Due to the inability of digital signals to provide continuous output like analog signals, it is necessary to make an approximation for the integral and derivative components for their utilization. Typically, the following discretization process is employed. With a computer sampling period of and the sequence value of the acquired signal as , the discrete relationships for the various physical quantities in the analog PID are: (10) The final expression for the discrete digital PID is: (11) In Eq. (11), represents the sequence value of the acquired signal (k=0,1,2…), denotes the output value of the control signal at the k times sampling, is the deviation value at the k times sampling, represents the initial value of the control signal at the beginning of control. In principle, as long as the sampling period is small enough, the control effect obtained should closely match that of analog PID, resulting in sufficiently accurate control outcomes. The control methods mentioned above are based on positional PID, meaning the control is applied directly to the numerical values of physical quantities that induce changes in the controlled object. However, if this control method fails, there is an immediate risk of system imbalance, potentially leading to engineering accidents. Therefore, there is also the control method of incremental PID, which controls the increment of the numerical values of physical quantities that directly cause changes in the controlled object. By recursively applying Eq. (11) and combining, we can obtain: (12) In Eq. (12), , . Since incremental PID controls only the increment of relevant quantities, it reduces the impact scope in case of system control failure. Additionally, as is only related to the deviations from the most recent three samplings, less data is required, leading to relatively lower hardware requirements. 2.3. Fuzzy PID control algorithm 2.3.1. Fuzzy PID control principles Figure 4. Fuzzy PID Control Structure As shown in Fig. 4, the structure of the fuzzy PID control involves , representing the real-time deviation between the setpoint and the actual value, and , the real-time rate of change of the deviation. The fuzzy controller takes these two signals as inputs and, through a series of internal fuzzy rules, outputs three increments for the parameters of the traditional PID controller. This enables real-time corrections, leading to enhanced system stability. 2.3.2. Fuzzy controller 277 Figure 5. Internal Structure of the Fuzzy Controller In Fig. 5, the internal structure of the fuzzy controller is depicted. Typically, the input consists of one or more explicit physical quantities. In this design, the inputs are and . When utilizing a fuzzy controller, the first step is to perform fuzzy quantization on the inputs, obtaining the corresponding fuzzy vectors. Subsequently, based on an extensive set of human knowledge rules, fuzzy reasoning is applied to derive the fuzzy set for the output. Finally, a defuzzification process is employed to obtain the actual output value of the fuzzy control [8]. 2.3.3. Fuzzifications Process Fuzzification is the process of transforming precise physical quantities with actual meanings into fuzzy vectors with membership degrees between 0 and 1 on a certain fuzzy set. The choice of the membership function will determine the resulting vector in which fuzzy space. Commonly used membership functions include triangular membership function (trimf), trapezoidal membership function (trapmf), Gaussian membership function (gaussmf), generalized bell- shaped membership function (gbellmf), etc. In this paper, the gaussmf-type membership function is chosen for precise fuzzy quantization. As shown in Fig. 6, it illustrates the membership function corresponding to used in this study. Figure 6. Membership Function Graph of 2.3.4. Fuzzy Inference Fuzzy inference relies on a set of fuzzy control rules, where the rules essentially take the form of numerous 'IF-THEN' statements, expressing statements based on human knowledge and expert experience. An example rule from the ruleset in this paper is: The corresponding physical interpretation is that if the error is significantly negative and the rate of change of the error is significantly positive, the three adjustment quantities correspondingly are zero, zero, and significantly positive. It is important to note that before performing inference, the determined physical quantities must be normalized to a predefined domain. According to engineering experience [8-9], employing empirical induction to obtain fuzzy control rules, the correction rules for the three PID parameters correspond to the following table of fuzzy control rules. Table 2. Fuzzy Control Rule for EC E NB NM NS Z0 PS PM PB NB PB PB PM PM PS Z0 Z0 NM PB PB PM PS PS Z0 NS NS PM PM PM PS Z0 NS NS Z0 PM PM PS Z0 NS NM NM PS PS PS Z0 NS NS NM NM PM PS Z0 NM NM NM NM NB PB Z0 Z0 NM NM NM NB NB Table 3. Fuzzy Control Rule for EC E NB NM NS Z0 PS PM PB NB NB NB NM NM NS Z0 Z0 NM NB NB NM NS NS Z0 Z0 NS NB NM NS NS Z0 PS PS Z0 NM NM NS Z0 PS PM PM PS NM NS Z0 PS PS PM PB PM Z0 Z0 PS PS PM PB PB PB Z0 Z0 PS PM PM PB PB 278 Table 4. Fuzzy Control Rule for EC E NB NM NS Z0 PS PM PB NB PS NS PM NB NB NM PS NM PS NS NB NM NM NS Z0 NS Z0 NS NM NM NS NS Z0 Z0 Z0 NS NS NS NS NS Z0 PS Z0 Z0 Z0 Z0 Z0 Z0 Z0 PM PB NS PS PS PS PS PB PB PB PM PM PS PS PS PB From Table 2 to Table 3, it is evident that for any input pair of E and EC, a 7x7 membership matrix will be generated. Therefore, we only need 49 fuzzy statements to fully describe the fuzzy control rules for the three tables. Corresponding memberships and fuzzy meanings together constitute the final fuzzy set. Summing the memberships with the same fuzzy meaning yields the final fuzzy vector. 2.3.5. Defuzzification After fuzzy inference, the result is still a fuzzy vector, and therefore, a conversion is required to obtain a precise value that can directly affect the controlled object. This process is called defuzzification and can be understood as the inverse process of fuzzification. To achieve this, it is necessary to define basic domains and fuzzy sets for the output variable. In this paper, the centroid method is used for defuzzification, and its calculation formula can be expressed as: (13) In Eq. (13), represents the precise value after defuzzification, denotes the values corresponding to the seven fuzzy meanings in the control variable domain (i.e., the values corresponding to the seven meanings in the output variable), is the membership degree of . 3. Simulation Analysis of Motor Response using Simulink 3.1. Traditional digital PID model construction Figure 7. Simulink Models of Position and Incremental PID Control Based on the principles of traditional digital PID, a simulation model was constructed in the Simulink module of MATLAB, as shown in the simulation model depicted in Fig. 7. Various modules, including Gain, Step Signal, Delay, Transfer Function, and Oscilloscope, were utilized in the construction. 3.2. Fuzzy PID model construction Firstly, it is necessary to define the fuzzy controller based on the workflow of fuzzy PID. In MATLAB, the fuzzy logic designer can be opened by using the 'fuzzy' command. The design of the fuzzy controller mainly includes two parts: the selection of membership functions for input and output variables, determination of the domain values, and the addition of fuzzy rules. The first step involves establishing a two-dimensional fuzzy control structure as shown in Fig. 8. Then, define the domain values for both input and output variables as {-1, -2/3, 279 -1/3, 0, 1/3, 2/3, 1}. For two input variables, use the gaussmf Gaussian membership function, and for three output variables, use the trimf triangular membership function. In the second step, add corresponding fuzzy relationships according to the control rule tables provided in Table 2 to Table 4. A total of 49 rules needs to be added, as shown in the fuzzy rule inference result in Fig. 9. Subsequently, export and generate the fuzzy control structure file with the .fis suffix. Finally, observe the geometric shapes corresponding to each rule in the observer, as illustrated in the following figure. Figure 8. Two-Dimensional Fuzzy Control Structure Figure 9. Inference Results of Fuzzy Rules Figure 10. Fuzzy Relationships between Input Variables and 280 Figure 11. Fuzzy Relationships between Input Variables and Figure 12. Fuzzy Relationships between Input Variables and Similar to the traditional digital PID model, a fuzzy PID simulation model was constructed in Simulink by invoking modules such as Fuzzy Logic Controller, Zero-Order Holder, Numeric Compute, Constant, Integrator, and Derivative, according to the corresponding principles. The resulting simulation model is shown in Fig. 13. Figure 13. Simulink Model of Fuzzy PID Control 3.3. PID tuning and simulation With a step value set to 1 and a simulation time of 0.02s, , , , the simulation curves for the position-based PID are as shown in Fig. 14. Performance metrics were measured in the Scope module, resulting in an adjustment time of 2.5ms, a steady-state error of 0, and an overshoot of 7%. 281 Figure 14. Simulation Results of Position PID Similarly, with the simulation parameters set , , , the simulation results for the incremental PID are shown in Fig. 15. The overshoot is 18%, the adjustment time is 12.5ms, and the steady-state error is 0. Figure 15. Simulation Results of Incremental PID The fuzzy PID performs real-time corrections on the traditional PID through fuzzy control rules. To accelerate the simulation speed, a zero-order holder is added before the fuzzy controller, , , are set to -4, 0.1, and 0.05, respectively. The response curve is obtained as shown in Fig. 16. Figure 16. Simulation Results of Fuzzy PID From the simulation curve of the fuzzy PID in Fig. 16, it can be observed that the overshoot is 8%, the adjustment time is 2.3ms, and the steady-state error is 0. In order to compare the advantages and disadvantages between traditional PID and fuzzy PID control under the same conditions, parameters , , are set to the same values for both controllers. They are then placed in the same scope for observation, and the output response curves are shown in Fig. 17. The simulation performance parameters are summarized in Table 5. Figure 17. Simulation Results of Traditional PID and Fuzzy PID Table 5. Performance Metrics for Traditional PID and Fuzzy PID Controller Overshoot (%) Stabilization Time (ms) Steady-state Error Traditional PID 7.8 2.5 0 Fuzzy PID 2.3 3.0 0 From Fig. 17 and Table 5, it can be observed that fuzzy PID, while ensuring response speed, reduces the overshoot of the motor response, shortens the system's stabilization time, and provides a smoother output response curve, demonstrating more stable control characteristics. 4. Conclusion This paper mainly introduces the drive and control of a robot omnidirectional mobile platform. Through the analysis of the motor's equivalent circuit, the system transfer function of the DC motor is derived in detail. After substituting the motor parameters, the mathematical model of the motor's speed relative to the armature voltage is obtained, laying the groundwork for later MATLAB simulation. Then, based on the principles of traditional PID and fuzzy PID, corresponding controllers are designed. Simulations are conducted using Simulink for various PID controllers, and comparative analysis reveals that fuzzy PID exhibits superior control characteristics compared to traditional PID. Acknowledgment This project is supported by the Graduate Innovative Research Project of Southwest Minzu University (Project No. ZY2022650). 282 References [1] Liu T.L., Zhang H.W., Zhao J.H., et al. "Interpretation of the Guidelines for the Application of E-valuation Indicators and Standards System for National New Smart City" [J]. Information Techn-ology and Standardization, 2017(10):17- 20+29. [2] Zhai X.S., Shi C.C. "Implementation Status, Challenges, and Prospects of the Ten-Year Develop-ment Plan for Educational Informatization (2011-2020)" [J]. Modern Educational Technology, 2020, 30(12):20-27. [3] Wu H.H., Wang B. "Basic Statistical Data Report on Chinese University Libraries in 2020" [J]. J-ournal of University Libraries, 2021, 39(04):5-11. [4] Chinese Library Association, National Library of China. "China Library Yearbook 2020" [M]. B-eijing: National Library Press, 2021:45. [5] Liu S. et al. "Modern Servo System Design" [M]. Harbin: Harbin Engineering University Press, 2001:357. [6] Zhang L.S., Hu Y.D., Xu L.X., eds. "Principles and Design of Servo Systems, 3rd Edition" [M]. Beijing: Beijing Institute of Technology Press, 2006:230. [7] Liu Y., Xia R.Q., Lu Y. "Research on Composite PID Controller Applied to Precision Beam Poin-ting System" [J]. Laser Technology, 2018,42(06):868-872. [8] Zhang Z.D., Xu X.L., Yang Y., et al. "Design of Hydraulic Cylinder Test Bench Loading System Based on Fuzzy PID Control Strategy" [J]. Journal of Nanjing University of Science and Technology, 2019,43(01):78-85. [9] Lu G.M. "Research on Temperature Control System of Electric Boiler Based on Fuzzy PID Cont-rol" [D]. Harbin University of Science and Technology, 2008.