High-power motor servo drive software architecture and construction method thereof
By designing a high-power motor servo drive software architecture, the problems of poor scalability and insufficient independence caused by high coupling in the existing technology are solved, and the software is decoupled and hierarchical design is realized, which improves the scalability, flexibility and performance.
Patent Information
- Application Number
- CN202411216500.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-31
- Publication Date
- 2025-02-07
AI Technical Summary
The existing servo drive software architecture has high coupling problems, resulting in poor software scalability and insufficient independence between functional modules. Modifying the software may cause chain reactions, reduce development and testing efficiency, and cannot effectively support low-cost and high-efficiency domestic products. Chemical design.
A high-power motor servo drive software architecture is designed, which is layered from the hardware configuration layer to the scheduling management layer in turn, and the layers are fully decoupled. Calling is realized through the API interface, hardware details are hidden, hardware registers are directly accessed, and data is realized. Unification of format and communication protocol.
Through decoupling design, the scalability and flexibility of the software are improved, the duplicate development of functions is reduced, the reusability and development efficiency are improved, the system task execution and resource allocation are optimized, and the system performance and stability are improved.
Smart Images

Figure CN119396089A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of motor servo control, and in particular relates to a high-power motor servo drive software architecture and a construction method thereof. Background Art
[0002] In modern industrial applications, high-power motors are widely used in various key equipment and systems, such as automated production lines in manufacturing, regulation devices in power systems, and electric vehicles in transportation. To ensure the efficient and stable operation of these devices, servo drive systems play a vital role. With the advancement of technology, the functions of these systems are becoming more and more complex, and they need to handle the speed, position and torque control of the motors while responding to various feedback signals. However, the existing servo drive software architecture often has the problem of high coupling, which makes the software scalability poor and the independence between functional modules insufficient. High coupling leads to a chain reaction of software modifications, and small adjustments may introduce new risks, thereby reducing development and testing efficiency. In order to ensure system stability, repeated testing is usually required, resulting in longer development cycles and increased costs. This inefficient workflow is not suitable for the growing redundancy requirements and rapidly changing design requirements.
[0003] In addition, the existing software architecture cannot effectively support the requirements of low-cost, high-efficiency, and purely domestically produced design of drive hardware. There is an urgent need for a new servo drive software architecture to decouple software and hardware circuits, improve the scalability and flexibility of the system, and thus meet the needs of modern industry for rapid software iteration. Summary of the invention
[0004] The purpose of the present invention is to overcome the deficiencies in the prior art and to provide a high-power motor servo drive software architecture and a construction method thereof.
[0005] To achieve the above object, the present invention is implemented by adopting the following technical solutions:
[0006] On the one hand, the present invention provides a high-power motor servo drive software architecture, which includes a hardware configuration layer, an interface platform layer, a protocol abstraction layer, an application layer, and a scheduling management layer from the bottom layer to the top layer, and the layers are fully decoupled and independent of each other. Calls are implemented through API interfaces, and upper-layer services can call lower-layer services, but lower-layer services cannot call upper-layer services, and services in the same layer cannot call each other.
[0007] The hardware configuration layer is configured to hide hardware specific details from upper layer services and configure hardware peripheral working modes and parameters and initialization services;
[0008] The interface platform layer is configured to directly access all hardware registers and directly obtain register data or output data to the registers;
[0009] The protocol abstraction layer is configured to convert data from the upper layer application into a data format that can be matched and used by the lower layer according to the agreed protocol or standard, and to convert the lower layer data back into a data format that can be understood by the upper layer application;
[0010] The application layer is configured to respectively implement the high-power motor servo drive control algorithm, the system fault monitoring and processing algorithm, and the system business logic;
[0011] The scheduling management layer is configured to manage system resources, coordinate the priorities and execution order of tasks at each layer, and monitor extreme faults in real time and handle them in a timely manner.
[0012] Further, the hardware configuration layer at least includes an internal ADC register configuration module, a GPIO register configuration module, a CAN register configuration module, a PWM register configuration module, an MCBSP configuration module, an SCI configuration module, an SPI configuration module and an I2C configuration module;
[0013] The interface platform layer at least includes an AD data acquisition update module, a DI data acquisition update module, an MCBSP data update module, an SPI data update module, a DO output data update module, a PWM data output module, a CAN data receiving module, a CAN data sending module, an SCI data receiving module, an SCI data sending module, an I2C data sending module and an I2C data receiving module;
[0014] The protocol abstraction layer comprises a CAN protocol abstract receiving module, a CAN protocol abstract sending module, an SCI protocol abstract receiving module, an SCI protocol abstract sending module, an I2C protocol abstract receiving module and an I2C protocol abstract sending module.
[0015] Furthermore, the CAN protocol abstract receiving module, CAN protocol abstract sending module, SCI protocol abstract receiving module, SCI protocol abstract sending module, I2C protocol abstract receiving module, and I2C protocol abstract sending module of the protocol abstraction layer respectively call the CAN data receiving module, CAN data sending module, SCI data receiving module, SCI data sending module, I2C data sending module, and I2C data receiving module of the interface platform layer through the protocols or standards corresponding to the modules to achieve data abstraction and encapsulation.
[0016] Furthermore, the application layer includes a motor servo drive control module, a fault monitoring and processing module and a business logic module;
[0017] The motor servo drive module comprises the following components: a three-phase current data processing unit, a position data processing unit, a speed solving unit, a position instruction management unit, a position controller unit, a speed instruction management unit, a speed controller unit, a current instruction management unit, a current controller unit and an SVPWM algorithm unit;
[0018] The fault monitoring and processing module includes a fault monitoring unit and a fault processing unit;
[0019] The business logic module includes a limit logic processing unit and an emergency stop business logic processing unit.
[0020] Furthermore, the business logic module performs logical judgment and processing according to system requirements:
[0021] In the limit logic processing unit, when the system limit is detected, the brake is immediately controlled and the timing is started, the speed is reduced at the maximum acceleration, and after the timing reaches 500ms, the drive is cut off and only the movement instruction in the opposite direction of the limit is responded;
[0022] In the emergency stop business logic processing unit, after the emergency stop signal is detected, the brake is immediately controlled, and after a timing wait of 500ms, the drive enable is cut off.
[0023] Furthermore, the scheduling management layer is at the top level of the software architecture, responsible for system resource management and task scheduling of lower-level services, including initialization process and main loop module, high real-time cycle module, medium real-time cycle module, low real-time cycle module and extreme fault handling module;
[0024] The initialization process module calls each service module of the hardware configuration layer and the initialization of the hardware system;
[0025] The high real-time cycle module includes sequential planning and calling of each unit of the motor servo drive module of the application layer, calling of the AD acquisition data update module of the interface platform layer, calling of the MCBSP data update module of the interface platform layer, and calling of the PWM data output module of the interface platform layer;
[0026] The real-time periodic module includes calling the fault monitoring and processing module of the application layer, calling the business logic module of the application layer, calling the service modules of the protocol abstraction layer, and calling the SPI data update module of the interface platform layer;
[0027] The low real-time cycle module includes calling the DI data acquisition update module of the interface platform layer and calling the DO output data update module of the interface platform layer.
[0028] On the other hand, the present invention provides a method for building a high-power motor servo drive software architecture, comprising the following steps:
[0029] Step S1: Initialize the hardware configuration layer, configure the hardware peripheral working mode and parameters, and hide the specific hardware details from the upper layer service. The configuration includes but is not limited to the initialization of the ADC register configuration module, GPIO register configuration module, CAN register configuration module, PWM register configuration module, MCBSP configuration module, SCI configuration module, SPI configuration module, and I2C configuration module;
[0030] Step S2: constructing an interface platform layer, with functions of directly accessing all hardware registers and directly obtaining register data or outputting data to registers, including AD acquisition data update module, DI acquisition data update module, MCBSP data update module, SPI data update module, DO output data update module, PWM data output module, CAN data receiving module, CAN data sending module, SCI data receiving module, SCI data sending module, I2C data sending module, and I2C data receiving module;
[0031] Step S3: Establish a protocol abstraction layer, and implement the conversion of data from the upper layer application to the data format that can be matched and used by the lower layer according to the agreed protocol or standard, and the function of converting the lower layer data back to the data format that can be understood by the upper layer application, including CAN protocol abstract receiving and sending modules, SCI protocol abstract receiving and sending modules, and I2C protocol abstract receiving and sending modules;
[0032] The decapsulation process is processed in the CAN protocol abstract receiving module, the SCI protocol abstract receiving module, and the I2C protocol abstract receiving module; the encapsulation process is processed in the I2C protocol abstract sending module, the CAN protocol abstract sending module, and the SCI protocol abstract sending module;
[0033] Step S4: construct an application layer to mainly run high-power servo motor control algorithms, monitor and handle faults of the drive system and motor, and run corresponding control logic according to the business needs of the system. It is configured with three modules: motor servo drive control module, fault monitoring and processing module, and business logic module;
[0034] The motor servo drive module includes the following units related to the motor control algorithm: a three-phase current data processing unit, a position data processing unit, a speed solving unit, a position instruction management unit, a position controller unit, a speed instruction management unit, a speed controller unit, a current instruction management unit, a current controller unit, and an SVPWM algorithm unit;
[0035] The fault monitoring and processing module monitors and performs subsequent logical action processing on the drive system faults such as hardware overcurrent and overvoltage, motor overspeed, motor overtemperature, etc. The fault monitoring and processing module includes a fault monitoring unit and a fault processing unit;
[0036] Step S5: Construct a scheduling management layer, which is responsible for managing system resources, coordinating the priority and execution order of tasks at each layer, and monitoring extreme faults in real time and handling them in time. The configuration includes an initialization process and a main loop module, a high real-time cycle module, a medium real-time cycle module, a low real-time cycle module, and an extreme fault handling module;
[0037] Step S6: Conduct architecture integration testing. Calls are made between layers through API interfaces. Upper-layer services can call lower-layer services, but lower-layer services cannot call upper-layer services. Services in the same layer cannot call each other. This ensures that modules at each layer work together to meet the control requirements of high-power motor servo drives. The stability and reliability of the system are verified by simulating faults and business logic scenarios.
[0038] Furthermore, the CAN protocol abstract receiving module, CAN protocol abstract sending module, SCI protocol abstract receiving module, SCI protocol abstract sending module, I2C protocol abstract receiving module and I2C protocol abstract sending module of the protocol abstraction layer respectively implement abstraction and encapsulation through the protocols or standards corresponding to the modules, and respectively call the CAN data receiving module of the interface platform layer, the CAN data sending module of the interface platform layer, the SCI data receiving module of the interface platform layer, the SCI data sending module of the interface platform layer, the I2C data sending module of the interface platform layer and the I2C data receiving module of the interface platform layer.
[0039] Furthermore, the initialization process of the scheduling management layer calls the initialization of the hardware system and each service module of the hardware configuration layer;
[0040] The high real-time cycle module is realized by establishing a 100μs timing interrupt, the medium real-time cycle module is realized by establishing a 1ms timing interrupt, and the low real-time cycle module is realized by establishing 10 cumulative counts in the medium real-time module. The extreme fault handling module is realized by TZ interrupt;
[0041] In the 100μs timing interrupt, the AD data acquisition update module of the interface platform layer, the MCBSP data update module of the interface platform layer, the motor servo drive module units of the application layer, the three-phase current data processing unit, the position data processing unit, the speed calculation unit, the position instruction management unit, the position controller unit, the speed instruction management unit, the speed controller unit, the current instruction management unit, the current controller unit, and the SVPWM algorithm unit are sequentially called, and the PWM data output module of the interface platform layer is called;
[0042] In the 1ms timing interrupt, the application layer fault monitoring and processing module is called, the application layer business logic module is called, the service modules of the protocol abstraction layer are called, and the interface platform layer SPI data update module is called.
[0043] Furthermore, the business logic module performs logical judgment and processing according to system requirements:
[0044] In the limit logic processing unit, when the system limit is detected, the brake is immediately controlled and the timing is started, the speed is reduced at the maximum acceleration, and after the timing reaches 500ms, the drive is cut off and only the movement command in the opposite direction of the limit is responded;
[0045] In the emergency stop business logic processing unit, after the emergency stop signal is detected, the brake is immediately controlled, and after a timer wait of 500ms, the drive enable is cut off.
[0046] Compared with the prior art, the present invention has the following beneficial effects:
[0047] The high-power motor servo drive software architecture and construction method provided by the present invention are hardware configuration layer, interface platform layer, protocol abstraction layer, application layer and scheduling management layer from bottom to top, and the layers are fully decoupled and independent of each other. Calling is realized through API interface. The upper layer service can call the lower layer service, while the lower layer service cannot call the upper layer service. Services in the same layer cannot call each other. It can adapt to the difference changes of current products, reduce the repeated development of the same function, and improve the reusability and development efficiency of the software. The software is refined and layered to reduce the coupling degree between modules, and the functions are independent and clear, which is convenient for maintenance management and function expansion. It allows the performance optimization of a specific layer, making the debugging process more efficient and convenient for debugging and optimization.
[0048] Through the coordination of the scheduling management layer, the system task execution and resource allocation are optimized, ensuring the rapid response of high real-time tasks and improving the system performance and stability; and through the design of the protocol abstraction layer, the data format and communication protocol are unified, ensuring the consistency of data between different levels, improving data exchange efficiency, and simplifying the complexity of cross-layer communication. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] Figure 1 A high-power motor servo drive software architecture diagram disclosed in a specific embodiment of the present invention.
[0050] Figure 2 This is a schematic diagram of the hardware configuration layer composition.
[0051] Figure 3 This is a schematic diagram of the interface platform layer composition.
[0052] Figure 4 This is a schematic diagram of the composition of the protocol abstraction layer and its relationship with the interface platform layer.
[0053] Figure 5 This is a schematic diagram of the application layer composition.
[0054] Figure 6 This is a schematic diagram of the scheduling management layer composition and scheduling relationships.
[0055] Figure 7 Initialize the flow chart for the scheduling management layer. DETAILED DESCRIPTION
[0056] The present invention will be further described below in conjunction with the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solution of the present invention, and cannot be used to limit the protection scope of the present invention.
[0057] Example
[0058] With the increasing complexity of servo drive software functions and redundancy requirements, software modifications may trigger a series of chain reactions, resulting in poor scalability. The high degree of coupling in the code is not conducive to the reuse of functions. Even small modifications may bring significant risks and often require repeated testing, resulting in reduced development and testing efficiency. In order to meet the needs of hardware optimization and revision, low-cost design and purely domestic design, it is urgent to decouple software code from hardware circuit design.
[0059] In order to solve the problems existing in the prior art, an embodiment of the present invention provides a high-power motor servo drive software architecture, and the specific technical solution is as follows.
[0060] like Figure 1 As shown, an embodiment of a high-power motor servo drive software architecture is provided. In this embodiment, the software architecture is composed of a hardware configuration layer, an interface platform layer, a protocol abstraction layer, an application layer, and a scheduling management layer from the bottom to the top, with a total of five layers. The layers are called through API interfaces. The upper layer service can call the lower layer service, but the lower layer service cannot call the upper layer service. Services in the same layer cannot call each other.
[0061] The hardware configuration layer hides the hardware details from the upper layer services, including the configuration and initialization services of the hardware peripheral working mode and parameters;
[0062] The interface platform layer includes direct access to all hardware registers, directly obtaining register data or outputting data to registers;
[0063] The protocol abstraction layer converts data from the upper layer application into a format that can be used by the lower layer according to the agreed protocol or standard, and converts the lower layer data back into a format that can be understood by the upper layer application;
[0064] The application layer includes the implementation of high-power motor servo drive control algorithm, system fault monitoring and processing algorithm, and system business logic;
[0065] The scheduling management layer is responsible for managing system resources, coordinating the priority and execution order of tasks at each layer, and monitoring extreme faults in real time and handling them in a timely manner.
[0066] In this embodiment, if Figure 2 As shown, the hardware configuration layer is strongly related to the hardware design circuit and system control requirements. The hardware configuration layer configures the registers of each functional module of the embedded control chip according to the hardware circuit design principles and system requirements.
[0067] In the internal ADC register configuration module, the registers related to the ADC module's clock frequency, sampling frequency, working mode, interrupt mode, etc. are configured.
[0068] In the GPIO register configuration module, the registers for selecting the multiplexing function of the GPIO port, GPIO direction, enabling or disabling internal pull-up, etc. are configured.
[0069] In the CAN register configuration module, the relevant registers about the communication mailbox, transmission rate, communication interruption, etc. are configured.
[0070] In the PWM register configuration module, the registers related to PWM frequency, time base counting mode, time base counting synchronization mode, time action, waveform dead zone, ADC start SOCA timing, interrupt function, fault capture, etc. are configured.
[0071] In the MCBSP configuration module, the relevant registers such as clock frequency, frame synchronization mode, data clock signal polarity, data delay, data unit length, etc. are configured.
[0072] In the SCI module configuration module, the relevant registers regarding data format, communication baud rate, FIFO queue, idle line multiprocessor mode, etc. are configured.
[0073] In the SPI module configuration module, the relevant registers regarding the master-slave working mode, data transmission baud rate, data length, clock scheme, etc. are configured.
[0074] In the I2C configuration module, the relevant registers regarding the module clock, data transmission format, address bits, etc. are configured.
[0075] In this embodiment, if Figure 3 As shown, the interface platform layer is used to directly obtain the valid data in the registers of each functional module and directly output the valid data.
[0076] In the AD data acquisition update module, the motor current sensor signal data, temperature sensor signal data, voltage signal data, etc. can be directly obtained.
[0077] In the DI data acquisition update module, various input button signals, switch sensor signals, external step trigger signals, etc. can be obtained.
[0078] In the MCBSP data update module, the angle sensor data can be obtained; in the SPI data update module, the communication receiving data and sending data can be obtained.
[0079] In the DO output data update module, the status flag is assigned to the GPIO data register for output.
[0080] In the PWM data output module, the calculated duty cycle data is assigned to the comparison register for output.
[0081] In the CAN data receiving module, a packet of communication data can be obtained in the specified receiving mailbox.
[0082] In the CAN data sending module, a packet of transmission data is assigned to the sending mailbox register for sending.
[0083] In the SCI data receiving module, a packet of communication data can be obtained.
[0084] In the SCI data transmission module, a packet of transmission data is assigned to the transmission register for output.
[0085] The I2C data receiving module obtains a packet of data from the register.
[0086] In the I2C data transmission module, the write data is placed in the output register for output.
[0087] In this embodiment, if Figure 4As shown in the figure, the protocol abstraction layer, according to the requirements of the actual situation, decapsulates the received data packets, performs a series of processes such as splitting, shifting, and combining, and obtains data with practical significance. On the other hand, it will need to output the abstract encapsulation, split, shift, and combine the actual data, and arrange and package them in the manner specified by the protocol.
[0088] The decapsulation process is processed in the CAN protocol abstract receiving module, the SCI protocol abstract receiving module, and the I2C protocol abstract receiving module; the encapsulation process is processed in the I2C protocol abstract sending module, the CAN protocol abstract sending module, and the SCI protocol abstract sending module.
[0089] In this embodiment, if Figure 5 As shown in the figure, the application layer mainly runs high-power servo motor control algorithms, monitors and handles faults in the drive system and motor, and runs corresponding control logic according to the business needs of the system. There are mainly three modules: motor servo drive control module, fault monitoring and processing module, and business logic module.
[0090] The motor servo drive module includes the following units related to the motor control algorithm: three-phase current data processing unit, position data processing unit, speed calculation unit, position command management unit, position controller unit, speed command management unit, speed controller unit, current command management unit, current controller unit, and SVPWM algorithm unit.
[0091] The fault monitoring and processing module monitors and performs subsequent logical action processing on the drive system faults such as hardware overcurrent and overvoltage, motor overspeed, motor overtemperature, etc. The fault monitoring and processing module includes a fault monitoring unit and a fault processing unit.
[0092] In this embodiment, the business logic module performs logic judgment and processing according to system requirements.
[0093] In the limit logic processing unit, when the system limit is detected, the brake is immediately controlled and the timing is started, the speed is reduced at the maximum acceleration, and after the timing reaches 500ms, the drive is disconnected and only the movement command in the opposite direction of the limit is responded.
[0094] In the emergency stop business logic processing unit, after the emergency stop signal is detected, the brake is immediately controlled, and after a timer wait of 500ms, the drive enable is cut off.
[0095] In this embodiment, if Figure 6As shown, the scheduling management layer is at the top level of the software architecture proposed in the present invention, and is responsible for system resource management and task scheduling of lower-level services, including an initialization process and a main loop module, a high real-time cycle module, a medium real-time cycle module, a low real-time cycle module, and an extreme fault handling module. The low real-time cycle module includes a call to the DI data acquisition update module of the interface platform layer and a call to the DO output data update module of the interface platform layer.
[0096] Specifically, a high real-time cycle module is implemented by establishing a 100μs timing interrupt, a medium real-time cycle module is implemented by establishing a 1ms timing interrupt, a low real-time cycle module is implemented by establishing 10 cumulative counts in the medium real-time module, and an extreme fault handling module is implemented through TZ interrupt.
[0097] The initialization process of the scheduling management layer calls the initialization of the hardware system and the service modules of the hardware configuration layer.
[0098] In the 100μs timing interrupt, the AD data acquisition update module of the interface platform layer, the MCBSP data update module of the interface platform layer, the motor servo drive module units of the application layer, the three-phase current data processing unit, the position data processing unit, the speed calculation unit, the position command management unit, the position controller unit, the speed command management unit, the speed controller unit, the current command management unit, the current controller unit, and the SVPWM algorithm unit are called sequentially, and the PWM data output module of the interface platform layer is called.
[0099] In the 1ms timing interrupt, the application layer fault monitoring and processing module is called, the application layer business logic module is called, the service modules of the protocol abstraction layer are called, and the interface platform layer SPI data update module is called.
[0100] like Figure 7 As shown, the scheduling management layer initialization process is as follows: initialize system registers, disable CPU interrupts, initialize PIE registers, enable PIE interrupt vector table, initialize PIE vector table, assign interrupt function address to interrupt vector, initialize Flash, configure peripheral hardware, enable PIE interrupts, enable global interrupts and real-time interrupts, initialize global interrupts, and wait in a loop.
[0101] The embodiment of the present invention also provides a method for building a high-power motor servo drive software architecture, comprising the following steps:
[0102] Step S1: Initialize the hardware configuration layer, configure the hardware peripheral working mode and parameters, and hide the specific hardware details from the upper-layer services. The configuration includes but is not limited to the initialization of the ADC register configuration module, GPIO register configuration module, CAN register configuration module, PWM register configuration module, MCBSP configuration module, SCI configuration module, SPI configuration module, and I2C configuration module.
[0103] Step S2: Build an interface platform layer, which has the functions of directly accessing all hardware registers and directly obtaining register data or outputting data to registers. It is configured with an AD data acquisition update module, a DI data acquisition update module, an MCBSP data update module, an SPI data update module, a DO output data update module, a PWM data output module, a CAN data receiving module, a CAN data sending module, an SCI data receiving module, an SCI data sending module, an I2C data sending module, and an I2C data receiving module.
[0104] Step S3: Establish a protocol abstraction layer, and implement the conversion of data from the upper layer application to the data format that can be matched and used by the lower layer according to the agreed protocol or standard, as well as the function of converting the lower layer data back to the data format that can be understood by the upper layer application, including the CAN protocol abstract receiving and sending module, the SCI protocol abstract receiving and sending module, and the I2C protocol abstract receiving and sending module.
[0105] The decapsulation process is processed in the CAN protocol abstract receiving module, the SCI protocol abstract receiving module, and the I2C protocol abstract receiving module; the encapsulation process is processed in the I2C protocol abstract sending module, the CAN protocol abstract sending module, and the SCI protocol abstract sending module.
[0106] Among them, the CAN protocol abstract receiving module, CAN protocol abstract sending module, SCI protocol abstract receiving module, SCI protocol abstract sending module, I2C protocol abstract receiving module and I2C protocol abstract sending module of the protocol abstraction layer respectively implement abstraction and encapsulation through the protocols or standards corresponding to the modules, and respectively call the CAN data receiving module of the interface platform layer, the CAN data sending module of the interface platform layer, the SCI data receiving module of the interface platform layer, the SCI data sending module of the interface platform layer, the I2C data sending module of the interface platform layer and the I2C data receiving module of the interface platform layer.
[0107] Step S4: construct an application layer to mainly run high-power servo motor control algorithms, monitor and handle faults of the drive system and motor, and run corresponding control logic according to the business needs of the system. It is configured with three modules: motor servo drive control module, fault monitoring and processing module, and business logic module;
[0108] The motor servo drive module includes the following units related to the motor control algorithm: three-phase current data processing unit, position data processing unit, speed solving unit, position command management unit, position controller unit, speed command management unit, speed controller unit, current command management unit, current controller unit, SVPWM algorithm unit;
[0109] The fault monitoring and processing module monitors and performs subsequent logical action processing on the drive system faults such as hardware overcurrent and overvoltage, motor overspeed, motor overtemperature, etc. The fault monitoring and processing module includes a fault monitoring unit and a fault processing unit.
[0110] The business logic module performs logical judgment and processing according to system requirements:
[0111] In the limit logic processing unit, when the system limit is detected, the brake is immediately controlled and the timing is started, the speed is reduced at the maximum acceleration, and after the timing reaches 500ms, the drive is cut off and only the movement command in the opposite direction of the limit is responded;
[0112] In the emergency stop business logic processing unit, after the emergency stop signal is detected, the brake is immediately controlled, and after a timer wait of 500ms, the drive enable is cut off.
[0113] Step S5: Construct a scheduling management layer, which is responsible for managing system resources, coordinating the priority and execution order of tasks at each layer, and monitoring extreme faults in real time and handling them in a timely manner. It is configured with an initialization process and a main loop module, a high real-time cycle module, a medium real-time cycle module, a low real-time cycle module and an extreme fault handling module.
[0114] The initialization process of the scheduling management layer calls the initialization of the hardware system and the service modules of the hardware configuration layer;
[0115] The high real-time cycle module is realized by establishing a 100μs timing interrupt, the medium real-time cycle module is realized by establishing a 1ms timing interrupt, and the low real-time cycle module is realized by establishing 10 cumulative counts in the medium real-time module. The extreme fault handling module is realized by TZ interrupt;
[0116] In the 100μs timing interrupt, the AD data acquisition update module of the interface platform layer, the MCBSP data update module of the interface platform layer, the motor servo drive module units of the application layer, the three-phase current data processing unit, the position data processing unit, the speed calculation unit, the position instruction management unit, the position controller unit, the speed instruction management unit, the speed controller unit, the current instruction management unit, the current controller unit, and the SVPWM algorithm unit are sequentially called, and the PWM data output module of the interface platform layer is called;
[0117] In the 1ms timing interrupt, the application layer fault monitoring and processing module is called, the application layer business logic module is called, the service modules of the protocol abstraction layer are called, and the interface platform layer SPI data update module is called.
[0118] Step S6: Conduct architecture integration testing. Calls are made between layers through API interfaces. Upper-layer services can call lower-layer services, but lower-layer services cannot call upper-layer services. Services in the same layer cannot call each other. This ensures that modules at each layer work together to meet the control requirements of high-power motor servo drives. The stability and reliability of the system are verified by simulating faults and business logic scenarios.
[0119] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the technical principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A high-power motor servo drive software architecture, characterized in that: From the bottom to the top, they are the hardware configuration layer, interface platform layer, protocol abstraction layer, application layer and scheduling management layer. The layers are fully decoupled and independent of each other. Calls are made through API interfaces. The upper layer service can call the lower layer service, but the lower layer service cannot call the upper layer service. Services in the same layer cannot call each other. The hardware configuration layer is configured to hide hardware specific details from upper layer services and configure hardware peripheral working modes and parameters and initialization services; The interface platform layer is configured to directly access all hardware registers and directly obtain register data or output data to the registers; The protocol abstraction layer is configured to convert data from the upper layer application into a data format that can be matched and used by the lower layer according to the agreed protocol or standard, and to convert the lower layer data back into a data format that can be understood by the upper layer application; The application layer is configured to respectively implement the high-power motor servo drive control algorithm, the system fault monitoring and processing algorithm, and the system business logic; The scheduling management layer is configured to manage system resources, coordinate the priorities and execution order of tasks at each layer, and monitor extreme faults in real time and handle them in a timely manner.
2. The high-power motor servo drive software architecture according to claim 1 is characterized in that: The hardware configuration layer at least includes an internal ADC register configuration module, a GPIO register configuration module, a CAN register configuration module, a PWM register configuration module, an MCBSP configuration module, an SCI configuration module, an SPI configuration module and an I2C configuration module; The interface platform layer at least includes an AD data acquisition update module, a DI data acquisition update module, an MCBSP data update module, an SPI data update module, a DO output data update module, a PWM data output module, a CAN data receiving module, a CAN data sending module, an SCI data receiving module, an SCI data sending module, an I2C data sending module and an I2C data receiving module; The protocol abstraction layer comprises a CAN protocol abstract receiving module, a CAN protocol abstract sending module, an SCI protocol abstract receiving module, an SCI protocol abstract sending module, an I2C protocol abstract receiving module and an I2C protocol abstract sending module.
3. The high-power motor servo drive software architecture according to claim 2 is characterized in that: The CAN protocol abstract receiving module, CAN protocol abstract sending module, SCI protocol abstract receiving module, SCI protocol abstract sending module, I2C protocol abstract receiving module and I2C protocol abstract sending module of the protocol abstract layer respectively call the CAN data receiving module, CAN data sending module, SCI data receiving module, SCI data sending module, I2C data sending module and I2C data receiving module of the interface platform layer through the protocols or standards corresponding to the modules to realize data abstraction and encapsulation.
4. The high-power motor servo drive software architecture according to claim 1, characterized in that: The application layer includes a motor servo drive control module, a fault monitoring and processing module and a business logic module; The motor servo drive module comprises the following components: a three-phase current data processing unit, a position data processing unit, a speed solving unit, a position instruction management unit, a position controller unit, a speed instruction management unit, a speed controller unit, a current instruction management unit, a current controller unit and an SVPWM algorithm unit; The fault monitoring and processing module includes a fault monitoring unit and a fault processing unit; The business logic module includes a limit logic processing unit and an emergency stop business logic processing unit.
5. The high-power motor servo drive software architecture according to claim 4 is characterized in that: The business logic module performs logical judgment and processing according to system requirements: In the limit logic processing unit, when the system limit is detected, the brake is immediately controlled and the timing is started, the speed is reduced at the maximum acceleration, and after the timing reaches 500ms, the drive is cut off and only the movement instruction in the opposite direction of the limit is responded; In the emergency stop business logic processing unit, after the emergency stop signal is detected, the brake is immediately controlled, and after a timing wait of 500ms, the drive enable is cut off.
6. The high-power motor servo drive software architecture according to claim 1, characterized in that: The scheduling management layer is at the top level of the software architecture and is responsible for system resource management and task scheduling of lower-level services, including initialization process and main loop module, high real-time cycle module, medium real-time cycle module, low real-time cycle module and extreme fault handling module; The initialization process module calls each service module of the hardware configuration layer and the initialization of the hardware system; The high real-time cycle module includes sequential planning and calling of each unit of the motor servo drive module of the application layer, calling of the AD acquisition data update module of the interface platform layer, calling of the MCBSP data update module of the interface platform layer, and calling of the PWM data output module of the interface platform layer; The real-time periodic module includes calling the fault monitoring and processing module of the application layer, calling the business logic module of the application layer, calling the service modules of the protocol abstraction layer, and calling the SPI data update module of the interface platform layer; The low real-time cycle module includes calling the DI data acquisition update module of the interface platform layer and calling the DO output data update module of the interface platform layer.
7. A method for building a high-power motor servo drive software architecture, characterized in that: The steps include: Step S1: Initialize the hardware configuration layer, configure the hardware peripheral working mode and parameters, and hide the specific hardware details from the upper layer service. The configuration includes but is not limited to the initialization of the ADC register configuration module, GPIO register configuration module, CAN register configuration module, PWM register configuration module, MCBSP configuration module, SCI configuration module, SPI configuration module, and I2C configuration module; Step S2: constructing an interface platform layer, with functions of directly accessing all hardware registers and directly obtaining register data or outputting data to registers, including AD acquisition data update module, DI acquisition data update module, MCBSP data update module, SPI data update module, DO output data update module, PWM data output module, CAN data receiving module, CAN data sending module, SCI data receiving module, SCI data sending module, I2C data sending module, and I2C data receiving module; Step S3: Establish a protocol abstraction layer, and implement the conversion of data from the upper layer application to the data format that can be matched and used by the lower layer according to the agreed protocol or standard, and the function of converting the lower layer data back to the data format that can be understood by the upper layer application, including CAN protocol abstract receiving and sending modules, SCI protocol abstract receiving and sending modules, and I2C protocol abstract receiving and sending modules; The decapsulation process is processed in the CAN protocol abstract receiving module, SCI protocol abstract receiving module, and I2C protocol abstract receiving module; The encapsulation process is processed in the I2C protocol abstract sending module, the CAN protocol abstract sending module, and the SCI protocol abstract sending module; Step S4: construct an application layer to mainly run high-power servo motor control algorithms, monitor and handle faults of the drive system and motor, and run corresponding control logic according to the business needs of the system. It is configured with three modules: motor servo drive control module, fault monitoring and processing module, and business logic module; The motor servo drive module includes the following units related to the motor control algorithm: a three-phase current data processing unit, a position data processing unit, a speed solving unit, a position instruction management unit, a position controller unit, a speed instruction management unit, a speed controller unit, a current instruction management unit, a current controller unit, and an SVPWM algorithm unit; The fault monitoring and processing module monitors and performs subsequent logical action processing on the drive system faults such as hardware overcurrent and overvoltage, motor overspeed, motor overtemperature, etc. The fault monitoring and processing module includes a fault monitoring unit and a fault processing unit; Step S5: Construct a scheduling management layer, which is responsible for managing system resources, coordinating the priority and execution order of tasks at each layer, and monitoring extreme faults in real time and handling them in time. The configuration includes an initialization process and a main loop module, a high real-time cycle module, a medium real-time cycle module, a low real-time cycle module, and an extreme fault handling module; Step S6: Conduct architecture integration testing. Calls are made between layers through API interfaces. Upper-layer services can call lower-layer services, but lower-layer services cannot call upper-layer services. Services in the same layer cannot call each other. This ensures that modules at each layer work together to meet the control requirements of high-power motor servo drives. The stability and reliability of the system are verified by simulating faults and business logic scenarios.
8. The method for constructing a high-power motor servo drive software architecture according to claim 7, characterized in that: The CAN protocol abstract receiving module, CAN protocol abstract sending module, SCI protocol abstract receiving module, SCI protocol abstract sending module, I2C protocol abstract receiving module and I2C protocol abstract sending module of the protocol abstraction layer respectively implement abstraction and encapsulation through the protocols or standards corresponding to the modules, and respectively call the CAN data receiving module of the interface platform layer, the CAN data sending module of the interface platform layer, the SCI data receiving module of the interface platform layer, the SCI data sending module of the interface platform layer, the I2C data sending module of the interface platform layer and the I2C data receiving module of the interface platform layer.
9. The method for constructing a high-power motor servo drive software architecture according to claim 7, characterized in that: The initialization process of the scheduling management layer calls the initialization of the hardware system and each service module of the hardware configuration layer; The high real-time cycle module is realized by establishing a 100μs timing interrupt, the medium real-time cycle module is realized by establishing a 1ms timing interrupt, and the low real-time cycle module is realized by establishing 10 cumulative counts in the medium real-time module. The extreme fault handling module is realized by TZ interrupt; In the 100μs timing interrupt, the AD data acquisition update module of the interface platform layer, the MCBSP data update module of the interface platform layer, the motor servo drive module units of the application layer, the three-phase current data processing unit, the position data processing unit, the speed calculation unit, the position instruction management unit, the position controller unit, the speed instruction management unit, the speed controller unit, the current instruction management unit, the current controller unit, and the SVPWM algorithm unit are sequentially called, and the PWM data output module of the interface platform layer is called; In the 1ms timing interrupt, the application layer fault monitoring and processing module is called, the application layer business logic module is called, the service modules of the protocol abstraction layer are called, and the interface platform layer SPI data update module is called.
10. The method for constructing a high-power motor servo drive software architecture according to claim 7, characterized in that: The business logic module performs logical judgment and processing according to system requirements: In the limit logic processing unit, when the system limit is detected, the brake is immediately controlled and the timing is started, the speed is reduced at the maximum acceleration, and after the timing reaches 500ms, the drive is cut off and only the movement command in the opposite direction of the limit is responded; In the emergency stop business logic processing unit, after the emergency stop signal is detected, the brake is immediately controlled, and after a timer wait of 500ms, the drive enable is cut off.
Citation Information
Patent Citations
Reconfigurable servo device based on component technology
CN103135445A
Fault tolerant proportional coordinated control method for multi-motor servo drive system under coupling control structure
CN108233823A
Remote communication control system based on embedded equipment
CN112671898A
Component type control system simulation platform and method based on soft bus
CN114625024A
Cooperative control device suitable for intelligent ship
CN115766900A
Cited By
Rail transit vehicle air conditioner software architecture and software development method
CN120045165A