Architecture method and control device for synchronizing control function of servo controller

By encapsulating the motor and peripheral circuit control process into modules and tasks, and optimizing task scheduling with EPWM interrupt service, the problem of poor real-time and scalability in the synchronous servo controller scheduling architecture is solved, and control efficiency and system stability are improved.

CN119298731APending Publication Date: 2025-01-10BEIJING INST OF SPACE LAUNCH TECH
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411356434.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-27
Publication Date
2025-01-10

AI Technical Summary

Technical Problem

The scheduling architecture of existing synchronous servo controllers results in low real-time, poor versatility and scalability of the control process, and the interrupt service run time may exceed the interrupt cycle, resulting in the system being out of control.

Method used

By encapsulating the motor control process into a motor control module, the peripheral circuit control process is encapsulated as a business task, the EPWM interrupt service is used to trigger the execution of interrupt service count statistics, forming a task scheduling cycle, and forming a task scheduling process through the main control process to optimize task scheduling Execution of the process.

Benefits of technology

It improves the efficiency, versatility and scalability of the control process of the synchronous servo controller, shortens the running time of interrupted service programs, reduces the risk of system out of control, and improves the accuracy of the task scheduling cycle.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119298731A_ABST
    Figure CN119298731A_ABST
Patent Text Reader

Abstract

The invention provides an architecture method and a control device for a control function of a synchronous servo controller, and solves the technical problems of poor efficiency, universality and expandability of a control process of an existing synchronous servo controller. The method comprises the following steps: packaging a control process for a motor body to form a motor control module, and packaging a control process for a peripheral circuit to form a service task; the execution of the control module is triggered through the EPWM interrupt service, and counting statistics of the interrupt service is carried out in the execution process; task scheduling cycles are formed according to counting statistics of the interrupt services, all the task scheduling cycles are coordinated to form a task scheduling process, and repeated execution of the task scheduling process is formed through a main control process. The running time of the interrupt service program is shortened, and the risk that the running time of the interrupt program exceeds the interrupt period is reduced. A scheduling architecture for executing the control process in a time slice polling manner is formed, and the operation efficiency, universality and expandability of control software of the synchronous servo controller are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of synchronous servo controllers, and in particular to an architecture method and a control device for a synchronous servo controller control function. Background Art

[0002] In the prior art, the synchronous servo controller of the motor realizes a variety of control functions in combination with the integrated peripheral circuits. With the changes in the circuit integration environment and application occasions, new control function requirements will continue to emerge.

[0003] Each control function is scheduled by a control program running on the synchronous servo controller. The control program is compiled according to the control tasks (such as subroutines, processes and services, etc.) that divide the specific functional control process and the control task scheduling process combined with the execution characteristics of the controller. Traditionally, the control tasks of a single-core embedded digital signal processor (DSP) chip usually adopt a scheduling architecture in which the foreground and background are executed sequentially. The control process needs to be continuously added and modified to adapt to the application occasions and functional requirements, resulting in poor versatility and scalability of the corresponding subroutines. Moreover, the scheduling architecture causes each control process in the large loop of the main function of the corresponding program to have low real-time performance, and there is a delay of more or less milliseconds, which will lead to low time accuracy of the control process that needs to be executed periodically. For occasions where real-time status information is frequently used for speed and position control, the system control performance is seriously affected. At the same time, due to the limited computing speed of the DSP chip used by the synchronous servo controller, the control process will run for too long and the operating efficiency will be low. At the same time, the task scheduling management process of the scheduling architecture is deployed in the interrupt service, which will occupy the interrupt service time. It is possible that the interrupt service running time exceeds the interrupt cycle, resulting in system out of control.

[0004] For embedded digital signal processors (DSPs), it is necessary to improve the real-time control function and computing resource efficiency of synchronous servo controllers. Summary of the invention

[0005] In view of the above problems, an embodiment of the present invention provides an architecture method and a control device for a synchronous servo controller control function, which solve the technical problems of poor efficiency, versatility and scalability of the existing synchronous servo controller control process.

[0006] The architecture method of the synchronous servo controller control function of the embodiment of the present invention includes:

[0007] The control process of the motor body is packaged to form a motor control module, and the control process of the peripheral circuit is packaged to form a business task;

[0008] The execution of the control module is triggered by the EPWM interrupt service, and the interrupt service counting statistics are performed during the execution process;

[0009] A task scheduling cycle is formed according to the counting statistics of the interrupt service, each task scheduling cycle is coordinated to form a task scheduling process, and the repeated execution of the task scheduling process is formed through the main control process.

[0010] In one embodiment of the present invention, the control process for the motor body is packaged to form a motor control module, and the control process for the peripheral circuit is packaged to form a business task, including:

[0011] The single control process of the motor body is formed into a functional function under a dedicated processing framework;

[0012] A motor control module that meets the motor working conditions is formed through functional functions, and the motor control module is used as a service module for EPWM interruption;

[0013] Forming a subset of control programs under a general processing framework according to the control requirements of functional circuits;

[0014] Business tasks corresponding to peripheral circuit functions are formed through subroutines.

[0015] In one embodiment of the present invention, the execution of the control module is triggered by the EPWM interrupt service, and counting of the interrupt service during the execution process includes:

[0016] Set the timing counter to record the number of interrupts when the EPWM interrupt is triggered, and form a timing cycle based on the number of interrupts;

[0017] The motor control module is executed according to the EPWM interrupt trigger.

[0018] In one embodiment of the present invention, forming a task scheduling cycle according to the count statistics of the interrupt service, coordinating each task scheduling cycle to form a task scheduling process, and forming repeated execution of the task scheduling process through the main control process includes:

[0019] The timing cycle is formed through the counting statistics of the interrupted services, and the time consumption of the business tasks is quantified through the timing cycle to determine the scheduling cycle of the business tasks;

[0020] The task scheduling process is formed according to the polling of the scheduling cycle of the business tasks and the priority of the execution sorting;

[0021] An automatic cycle of task scheduling process is formed in the motor main control process.

[0022] In one embodiment of the present invention, the task scheduling process formed according to the polling of the scheduling period of the business task and the priority of the execution order includes:

[0023] Determine the task type and task quantity, assign priority according to task type, sort tasks according to task quantity, assign task numbers and establish task scheduling sequence;

[0024] In the process of polling the task scheduling sequence, the scheduling period of each business task is decremented according to the timing period, and the business task with the scheduling period reset to zero is executed, and the execution order is adjusted according to the priority.

[0025] The control device of the synchronous servo controller control function of the embodiment of the present invention comprises:

[0026] A memory for storing program codes corresponding to the processing of the architecture method of the control function of the synchronous servo controller;

[0027] A processor is used to execute the program code.

[0028] The control device of the synchronous servo controller control function of the embodiment of the present invention comprises:

[0029] A function planning sub-device, used to encapsulate the control process for the motor body to form a motor control module, and to encapsulate the control process for the peripheral circuit to form a business task;

[0030] An interrupt control sub-device, used to trigger the execution of the control module through the EPWM interrupt service, and to count the interrupt services during the execution process;

[0031] The task control sub-device is used to form a task scheduling cycle according to the counting statistics of the interrupt service, coordinate each task scheduling cycle to form a task scheduling process, and form repeated execution of the task scheduling process through the main control process.

[0032] In one embodiment of the present invention, the function planning sub-device includes:

[0033] A first encapsulation module is used to form a single control process of the motor body into a functional function under a dedicated processing framework;

[0034] A first control forming module is used to form a motor control module that meets the motor working condition through a function function, and use the motor control module as a service module for EPWM interruption;

[0035] A second encapsulation module is used to form a control program subset under a general processing framework according to the control requirements of the functional circuit;

[0036] The second control forming module is used to form a business task corresponding to the peripheral circuit function through a subroutine.

[0037] In one embodiment of the present invention, the interrupt control sub-device includes:

[0038] A parallel statistics module is used to set a timing counter to record the number of interruptions when the EPWM interrupt is triggered, and to form a timing cycle according to the number of interruptions;

[0039] The service execution module is used to trigger the execution of the motor control module according to the EPWM interrupt.

[0040] In one embodiment of the present invention, the task control sub-device includes:

[0041] A statistical conversion module is used to form a timing cycle through the counting statistics of the interrupt service, quantify the time consumption of the business task through the timing cycle, and determine the scheduling cycle of the business task;

[0042] A scheduling formation module is used to form a task scheduling process according to the polling of the scheduling cycle of the business tasks and the priority of the execution sorting;

[0043] The control loop module is used to form an automatic loop of the task scheduling process in the motor main control process.

[0044] The architecture method and control device of the control function of the synchronous servo controller of the embodiment of the present invention optimizes the control process of the synchronous servo controller in terms of the real-time performance of the motor control and the adaptability of the business function, uses the interrupt characteristics of EPWM to form an effective decoupling of the motor control process and the business function implementation, implements the motor control process separately in the hardware interrupt link, and deploys the business control process and the business scheduling process in the control main program. At the same time, the interrupt cycle count is used to construct the basic timing time slice of the task scheduling cycle, and a task scheduling process with application and function targeting is formed according to the operation cycle and priority. The running time of the interrupt service program is shortened, and the risk of the interrupt program running time exceeding the interrupt cycle is reduced. By counting the number of interrupt cycles passed by the business task, the accuracy of the task scheduling cycle is improved. A scheduling architecture that executes the control process by time slice polling is formed, which improves the operating efficiency, versatility and scalability of the synchronous servo controller control software. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] Figure 1 FIG. 1 is a schematic diagram of an architecture method for synchronizing the control function of a servo controller according to an embodiment of the present invention.

[0046] Figure 2 FIG. 1 is a flow chart of triggering an EPWM interrupt service program in a method for structuring the control function of a synchronous servo controller according to an embodiment of the present invention.

[0047] Figure 3 FIG. 1 is a flow chart of a main control process in a method for synchronizing control functions of a servo controller according to an embodiment of the present invention.

[0048] Figure 4 FIG. 1 is a flow chart of a task scheduling process in a method for synchronizing control functions of a servo controller according to an embodiment of the present invention.

[0049] Figure 5 FIG. 1 is a schematic diagram showing the structure of a control device for controlling functions of a synchronous servo controller according to an embodiment of the present invention. DETAILED DESCRIPTION

[0050] In order to make the purpose, technical solution and advantages of the present invention clearer and more understandable, the present invention is further described below in conjunction with the accompanying drawings and specific implementation methods. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0051] The architecture method of the synchronous servo controller control function according to an embodiment of the present invention is as follows Figure 1 As shown. Figure 1 In this embodiment, the present invention includes:

[0052] Step 100: encapsulate the control process for the motor body to form a motor control module, and encapsulate the control process for the peripheral circuit to form a business task.

[0053] Those skilled in the art can understand that the control process for the motor body includes but is not limited to the key control processes such as the analog-to-digital conversion process required for control, the motor angle / speed information calculation process, the current given value calculation process in the two-phase coordinate system, the voltage calculation process in the two-phase coordinate system, and SVPWM modulation; the control process for the peripheral circuit includes but is not limited to the main control processes such as the periodic upload process of the motor rotor status information during the motor control process, the fault information processing process, the CAN communication command receiving process, the IO signal acquisition process, the pre-charging control process, the braking control process, and the indicator light control process. A single key control process can be encapsulated in the form of a functional function and combined to form a motor control module according to business needs. A single main control process can be encapsulated in a subroutine process and combined to form a business task of corresponding function according to circuit configuration and business needs.

[0054] Step 200: triggering the execution of the control module through the EPWM interrupt service, and performing interrupt service counting statistics during the execution process.

[0055] Those skilled in the art will appreciate that the EPWM (enhanced pulse width modulation) module of the DSP chip provides general functions such as clock, timing, counting, interrupt and event triggering. The EPWM module can be used to form basic parameters of the control process such as interrupt triggering, interrupt counting and cycle setting. For example, the ADC (analog-to-digital conversion) control process triggered by the EPWM interrupt can form signal alignment of subsequent parallel sampling sequences, which is beneficial to improve the synchronization of current sampling and position sampling, and improve the control accuracy of the motor when it is running at high speed. The EPWM interrupt service has a fixed frequency. The EPWM counter is used to count the interrupt frequency and number, which can form a benchmark for time slice polling and quantify the task cycle length. The EPWM interrupt can be used to schedule the motor control accuracy and processor workload, and adjust the utilization efficiency of computing resources.

[0056] Step 300: forming a task scheduling cycle according to the count statistics of the interrupt service, coordinating the task scheduling cycles to form a task scheduling process, and forming repeated execution of the task scheduling process through the main control process.

[0057] The periodic count of the EPWM interrupt service is used to measure the time of the task scheduling cycle. The required scheduling cycle and task urgency are measured according to the characteristics of each business task to plan the business sequence and duration, thereby forming a task scheduling process for all business tasks. The task scheduling process is further formed into a periodic automatic execution through the main control process to meet the continuity of business functions.

[0058] The architecture method of the control function of the synchronous servo controller of the embodiment of the present invention optimizes the control process of the synchronous servo controller in terms of the real-time performance of the motor control and the adaptability of the business function, uses the interrupt characteristics of EPWM to form an effective decoupling of the motor control process and the business function implementation, implements the motor control process separately in the hardware interrupt link, and deploys the business control process and the business scheduling process in the control main program. At the same time, the interrupt cycle count is used to construct the basic timing time slice of the task scheduling cycle, and a task scheduling process with application and function targeting is formed according to the operating cycle and priority. The running time of the interrupt service program is shortened, and the risk of the interrupt program running time exceeding the interrupt cycle is reduced. By counting the number of interrupt cycles passed by the business task, the accuracy of the task scheduling cycle is improved. A scheduling architecture that executes the control process by time slice polling is formed, which improves the operating efficiency, versatility and scalability of the synchronous servo controller control software.

[0059] like Figure 1 As shown, in one embodiment of the present invention, step 100 includes:

[0060] Step 110: forming a single control process of the motor body into a functional function under a dedicated processing framework.

[0061] Those skilled in the art can understand that the dedicated processing framework refers to a program compilation environment that complies with the DSP chip operating procedures. The functional functions formed by a single control process include but are not limited to: power module fault flag assignment function, motor enable judgment function, current, voltage, temperature and other signal analog-to-digital conversion processing function, motor angle information calculation function, motor speed information calculation function, current measured value coordinate transformation function, given current value IdqRef calculation function in two-phase rotating coordinate system, weak magnetic control function, voltage given UdqRef calculation function in two-phase stationary coordinate system, voltage given value UαβRef calculation function in two-phase rotating coordinate system, SVPWM algorithm function, motor shutdown function, etc.

[0062] Step 120: forming a motor control module that meets the motor working condition through a functional function, and using the motor control module as a service module for the EPWM interrupt.

[0063] The function function is used to form the control logic that meets the continuous operation condition of the motor, and the motor control module is formed after compilation to meet the real-time nature of the motor control. The motor control module is associated with the EPWM interrupt service, and the motor control module is triggered by the EPWM interrupt. The full operation time of the motor control module meets the interrupt operation cycle.

[0064] Step 130: forming a control program subset under a general processing framework according to the control requirements of the functional circuits.

[0065] Those skilled in the art can understand that the general processing framework refers to a general program compilation environment that can form a running subroutine with programming APIs for various functional circuits. A control program subset of the corresponding functional circuit is formed under the general processing framework according to the control requirements of the specific functional circuit, and the control data and control process are adapted according to the circuit characteristics of the functional circuit.

[0066] Step 140: Forming a business task corresponding to the peripheral circuit function through a subroutine.

[0067] The functions of the peripheral circuits are realized through specific business tasks. The control logic is realized through the corresponding subroutines and control scheduling according to the required peripheral circuit functions, forming business tasks that can be called by the main function of the program. Business tasks include but are not limited to periodic information upload tasks, fault information processing tasks, CAN communication data reception and processing tasks, IO port signal acquisition tasks, pre-charging control tasks, brake control tasks, indicator light control tasks, etc.

[0068] The architecture method of the control function of the synchronous servo controller of the embodiment of the present invention ensures the balance between the real-time performance of the motor control and the universality and scalability of the power supply circuit through the interrupted control module and the business tasks of the main program.

[0069] The process of triggering the EPWM interrupt service program is as follows Figure 2 As shown. Combined Figure 1 As shown, in one embodiment of the present invention, step 200 includes:

[0070] Step 210: Set a timing counter to record the number of interruptions when the EPWM interrupt is triggered, and form a timing cycle according to the number of interruptions.

[0071] Those skilled in the art can understand that the triggering of EPWM interrupts can form a fixed periodicity according to the hardware mechanism, and the periodic interrupt triggering can form a continuous and stable real-time control of the motor. The timing and counting functions provided by the EPWM module form a timing counter to record the number of periodic interrupt triggers, and the set number of interrupts is used to form the necessary time slice duration information.

[0072] Step 220: Execute the motor control module according to the EPWM interrupt trigger.

[0073] like Figure 2 As shown, in one embodiment of the present invention, the control process of the motor control module realizes motor vector control by sequentially executing functional functions. It includes:

[0074] The power module fault flag bit assignment function is used to determine the state of the motor power module and mark the state in the hardware register flag bit;

[0075] The motor enable judgment function is used to judge the motor enable status according to the motor hardware register;

[0076] The analog-to-digital conversion processing function of voltage / current / temperature and other signals is used to form the analog-to-digital conversion of the current working condition information of the motor in parallel;

[0077] The motor angle information calculation function is used to calculate the motor rotor angle information based on the current working condition information;

[0078] The motor speed information calculation function is used to calculate the motor rotor speed information according to the current working condition information;

[0079] When the motor is successfully enabled according to the motor enable flag, execute:

[0080] The current measured value coordinate transformation function, the given current value IdqRef calculation function in the two-phase rotating coordinate system, the weak magnetic control function, the voltage given UdqRef calculation function in the two-phase stationary coordinate system, the voltage given value UαβRef calculation function in the two-phase rotating coordinate system and the SVPWM algorithm function are used to form the control parameters of the three-phase current and voltage of the synchronous motor and the controlled space vector pulse width modulation process.

[0081] When the motor enable flag is used to determine that the motor enable fails, execute:

[0082] Motor shutdown function, used to turn off PWM pulses, clear control variables, etc.

[0083] The mature motor control functions are encapsulated into fixed static library files to achieve universal and scalable design of the program.

[0084] The architecture method of the synchronous servo controller control function of the embodiment of the present invention utilizes a motor control module formed by standardized function functions to respond to EPWM interrupt triggers, utilizes function functions to reduce system resource scheduling overhead, ensures that the complete cycle of motor control is effectively limited to the interrupt cycle, and avoids control system loss of control.

[0085] The main control process is as follows Figure 3 As shown. Combined Figure 1 As shown, in one embodiment of the present invention, step 300 includes:

[0086] Step 310: A timing cycle is formed through counting statistics of interrupted services, and the time consumption of the business task is quantified through the timing cycle to determine the scheduling cycle of the business task.

[0087] The number of EPWM interrupts is measured by a set counter, and a fixed interrupt time interval is used to form a timing cycle, which is used as the timing basis for scheduling business tasks based on time slice polling. The number of counts is used as an adjustable parameter to adjust the length of the time slice. A more generous scheduling cycle for each business task is formed based on the reasonable time consumption of the complete control process (function) of the specific business task, the time overhead of switching between control processes (functions), and the time overhead of the interaction of control processes (functions). The length of the scheduling cycle is measured by the number of timing cycles, and time polling is performed through the timing cycle.

[0088] Step 320: forming a task scheduling process according to the polling of the scheduling period of the business task and the priority of the execution sorting.

[0089] For each clear business task, the task is sorted in two dimensions: in the time dimension, the task order is sorted according to the scheduling cycle of each business task, and in the processing priority dimension, the task concurrency is sorted according to the preset task priority, thus forming a complete task scheduling process.

[0090] Step 330: forming an automatic loop of the task scheduling process in the motor main control process.

[0091] Those skilled in the art can understand that the motor main control process uses a main function such as a main function to form the call of each control process and subroutine. By deploying the call process of the task scheduling process in the main function, the business function in the continuous control process of the motor can be realized.

[0092] The architecture method of the synchronous servo controller control function of the embodiment of the present invention forms a complete scheduling process of the business function by forming a time slice polling and priority mechanism, which not only ensures the time response accuracy of task scheduling but also solves potential task conflicts.

[0093] The task scheduling process is as follows Figure 4 As shown. Combined Figure 1 As shown, in one embodiment of the present invention, in step 320, forming a task scheduling process includes:

[0094] Step 321: Determine the task type and task quantity, assign priority according to the task type, sort the tasks according to the task quantity, assign task numbers and establish a task scheduling sequence.

[0095] Step 322: during the polling process of the task scheduling sequence, the scheduling period of each business task is decremented according to the timing period, the business task whose scheduling period is reset to zero is executed, and the execution order is adjusted according to the priority.

[0096] The architecture method of the synchronous servo controller control function of the embodiment of the present invention forms the basic parameters of polling scheduling by combining type, quantity, priority, sequence number and scheduling cycle. The task execution order is determined by decrementing the time slice to zero, so as to meet the efficiency and timeliness of task scheduling.

[0097] like Figure 4 As shown, in one embodiment of the present invention, the task scheduling process includes:

[0098] Initialize the task scheduling process: obtain the total number of scheduled tasks N, set the default scheduling priority to 0, and assign the interrupt count value that forms the timing cycle to the temporary variable timerCnt of the scheduling time slice;

[0099] A task scheduling loop is established based on the total number of scheduled tasks N. In each task scheduling loop:

[0100] When the timed update is triggered, the period count value variable delayCnt[i] of the scheduling period of all business tasks is decremented according to the temporary variable timerCnt;

[0101] When the cycle count value variable delayCnt[i] of a business task in the business task is zero or less than the set threshold, the task sequence number of the business task is returned;

[0102] The architecture method of the synchronous servo controller control function of the embodiment of the present invention effectively improves the control flexibility and versatility of the function realization by forming a task scheduling process based on time slice polling. By using time slice scheduling and adjusting the execution order and efficiency of each business task, it is ensured that the scalability adjustment of business tasks and the accuracy adjustment of task scheduling cycle can be met when the control function changes.

[0103] The task scheduling process is as follows Figure 4 As shown. Combined Figure 1 As shown, in one embodiment of the present invention, in step 320, for a business task with concurrent upload of periodic information, the specific execution process includes:

[0104] Step 323: sort the upload durations of the concurrent cycle information in ascending order to determine the shortest upload duration.

[0105] The reasonable forwarding duration of each periodic information can be quantified according to the forwarding mechanism, and the effective upload duration can be quantified according to factors such as the forwarding frame format, the number of encapsulated bytes, the buffer mechanism, and the verification mechanism. The upload duration corresponding to the periodic information type can be clearly identified to achieve upload duration comparison.

[0106] Step 324: Divide the shortest upload duration equally according to the number of concurrent period information to form an interval duration scheduling unit.

[0107] A time scheduling unit for concurrent periodic information scheduling is formed using the shortest upload duration.

[0108] Step 325: According to the ascending order, an ascending upload interval duration is formed between the concurrent cycle information through the interval duration scheduling unit.

[0109] According to the increasing sorting, the interval duration scheduling unit is used to form an increasing equal interval duration between the concurrent period information, so as to ensure that the concurrent scheduling is adapted to the specific upload duration of the period information.

[0110] The architectural method of the synchronous servo controller control function of the embodiment of the present invention ensures the reasonable use of peripheral limited circuit resources by scheduling the upload interval duration between concurrent periodic information, avoids blocking, competition and data discard, and improves the information scheduling efficiency within the business task.

[0111] In one embodiment of the present invention, for a specific periodic information upload service task, the specific execution process includes:

[0112] In the business task, concurrent cycle information includes concurrent information such as heartbeat data, several status information and alarm data. The upload duration corresponding to each cycle information is quantified and sorted in ascending order to determine the shortest upload duration T1; the shortest upload duration T1 is evenly divided according to the number of concurrent cycle information to form an interval duration scheduling unit; the interval duration scheduling unit is used to form an increasing upload interval duration between increasing cycle information. This avoids CAN bus congestion caused by the simultaneous upload of concurrent cycle information.

[0113] A control device for a synchronous servo controller control function according to an embodiment of the present invention comprises:

[0114] A memory, used to store program codes corresponding to the processing process of the architecture method of the synchronous servo controller control function of the above embodiment;

[0115] The processor is used to execute the program code corresponding to the architectural method processing process of the synchronous servo controller control function of the above embodiment.

[0116] The processor may be a DSP (Digital Signal Processor) digital signal processor, an FPGA (Field-Programmable Gate Array) field programmable gate array, an MCU (Microcontroller Unit) system board, a SoC (system on a chip) system board, or a PLC (Programmable Logic Controller) minimum system including I / O.

[0117] A control device according to an embodiment of the present invention is as follows Figure 5 As shown. Figure 5 In this embodiment, the present invention includes:

[0118] The function planning sub-device 10 is used to encapsulate the control process for the motor body to form a motor control module, and to encapsulate the control process for the peripheral circuit to form a business task;

[0119] The interrupt control sub-device 20 is used to trigger the execution of the control module through the EPWM interrupt service, and count the interrupt services during the execution process;

[0120] The task control sub-device 30 is used to form a task scheduling cycle according to the counting statistics of the interrupt service, coordinate each task scheduling cycle to form a task scheduling process, and form repeated execution of the task scheduling process through the main control process.

[0121] like Figure 5 As shown, in one embodiment of the present invention, the function planning sub-device 10 includes:

[0122] The first encapsulation module 11 is used to form a single control process of the motor body into a functional function under a dedicated processing framework;

[0123] A first control forming module 12, used to form a motor control module that meets the motor working condition through a function function, and use the motor control module as a service module for EPWM interruption;

[0124] The second encapsulation module 13 is used to form a control program subset under a general processing framework according to the control requirements of the functional circuit;

[0125] The second control forming module 14 is used to form a business task corresponding to the peripheral circuit function through a subroutine.

[0126] like Figure 5 As shown, in one embodiment of the present invention, the interrupt control sub-device 20 includes:

[0127] A parallel statistics module 21 is used to set a timing counter to record the number of interruptions when the EPWM interrupt is triggered, and to form a timing cycle according to the number of interruptions;

[0128] The service execution module 22 is used to trigger the execution of the motor control module according to the EPWM interrupt.

[0129] like Figure 5 As shown, in one embodiment of the present invention, the task control sub-device 30 includes:

[0130] A statistical conversion module 31 is used to form a timing cycle through the counting statistics of the interrupted service, quantify the time duration of the business task through the timing cycle, and determine the scheduling cycle of the business task;

[0131] A scheduling forming module 32, for forming a task scheduling process according to the polling of the scheduling cycle of the business task and the priority of the execution sorting;

[0132] The control loop module 33 is used to form an automatic loop of the task scheduling process in the motor main control process.

[0133] like Figure 5 As shown, in one embodiment of the present invention, the scheduling forming module 32 includes:

[0134] The scheduling initialization submodule 32a is used to determine the task type and task quantity, assign priorities according to the task type, sort the tasks according to the task quantity, and assign task numbers to establish a task scheduling sequence;

[0135] The scheduling process submodule 32b is used to decrement the scheduling period of each business task according to the timing period during the polling process of the task scheduling sequence, execute the business task whose scheduling period is reset to zero, and adjust the execution order according to the priority.

[0136] like Figure 5 As shown, in one embodiment of the present invention, the scheduling forming module 32 further includes:

[0137] The concurrent duration confirmation submodule 32c is used to sort the upload durations of the concurrent cycle information in ascending order to determine the shortest upload duration;

[0138] A concurrent duration benchmark submodule 32d is used to divide the shortest upload duration according to the number of concurrent cycle information to form an interval duration scheduling unit;

[0139] The concurrent duration scheduling submodule 32e is used to form an increasing upload interval duration between concurrent cycle information through an interval duration scheduling unit according to the increasing order.

[0140] The above is only a preferred specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed by the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

Claims

1. A method for structuring the control function of a synchronous servo controller, characterized in that: include: The control process of the motor body is packaged to form a motor control module, and the control process of the peripheral circuit is packaged to form a business task; The execution of the control module is triggered by the EPWM interrupt service, and the interrupt service counting statistics are performed during the execution process; A task scheduling cycle is formed according to the counting statistics of the interrupt service, each task scheduling cycle is coordinated to form a task scheduling process, and the repeated execution of the task scheduling process is formed through the main control process.

2. The architecture method of the synchronous servo controller control function as claimed in claim 1, characterized in that: The control process of the motor body is packaged to form a motor control module, and the control process of the peripheral circuit is packaged to form a business task, including: The single control process of the motor body is formed into a functional function under a dedicated processing framework; A motor control module that meets the motor working conditions is formed through functional functions, and the motor control module is used as a service module for EPWM interruption; Forming a subset of control programs under a general processing framework according to the control requirements of functional circuits; Business tasks corresponding to peripheral circuit functions are formed through subroutines.

3. The architecture method of the synchronous servo controller control function as claimed in claim 1, characterized in that: The execution of the control module is triggered by the EPWM interrupt service, and the counting statistics of the interrupt service are performed during the execution process, including: Set the timing counter to record the number of interrupts when the EPWM interrupt is triggered, and form a timing cycle based on the number of interrupts; The motor control module is executed according to the EPWM interrupt trigger.

4. The architecture method of the synchronous servo controller control function as claimed in claim 1, characterized in that: The forming of the task scheduling cycle according to the counting statistics of the interrupt service, coordinating the task scheduling cycles to form the task scheduling process, and forming the repeated execution of the task scheduling process through the main control process include: The timing cycle is formed through the counting statistics of the interrupted services, and the time consumption of the business tasks is quantified through the timing cycle to determine the scheduling cycle of the business tasks; The task scheduling process is formed according to the polling of the scheduling cycle of the business tasks and the priority of the execution sorting; An automatic cycle of task scheduling process is formed in the motor main control process.

5. The architecture method of the synchronous servo controller control function as claimed in claim 4, characterized in that: The task scheduling process formed according to the polling of the scheduling cycle of the business task and the priority of the execution sorting includes: Determine the task type and task quantity, assign priority according to task type, sort tasks according to task quantity, assign task numbers and establish task scheduling sequence; In the process of polling the task scheduling sequence, the scheduling period of each business task is decremented according to the timing period, and the business task with the scheduling period reset to zero is executed, and the execution order is adjusted according to the priority.

6. A control device for a synchronous servo controller control function, characterized in that: include: A memory, used to store program codes corresponding to the processing process of the architecture method of the synchronous servo controller control function as claimed in any one of claims 1 to 5; A processor is used to execute the program code.

7. A control device for a synchronous servo controller control function, characterized in that: include: A function planning sub-device, used to encapsulate the control process for the motor body to form a motor control module, and to encapsulate the control process for the peripheral circuit to form a business task; An interrupt control sub-device, used to trigger the execution of the control module through the EPWM interrupt service, and to count the interrupt services during the execution process; The task control sub-device is used to form a task scheduling cycle according to the counting statistics of the interrupt service, coordinate each task scheduling cycle to form a task scheduling process, and form repeated execution of the task scheduling process through the main control process.

8. The control device for the synchronous servo controller control function according to claim 7, characterized in that: The function planning sub-device comprises: A first encapsulation module is used to form a single control process of the motor body into a functional function under a dedicated processing framework; A first control forming module is used to form a motor control module that meets the motor working condition through a function function, and use the motor control module as a service module for EPWM interruption; A second encapsulation module is used to form a control program subset under a general processing framework according to the control requirements of the functional circuit; The second control forming module is used to form a business task corresponding to the peripheral circuit function through a subroutine.

9. The control device for the synchronous servo controller control function according to claim 7, characterized in that: The interrupt control sub-device comprises: A parallel statistics module is used to set a timing counter to record the number of interruptions when the EPWM interrupt is triggered, and to form a timing cycle according to the number of interruptions; The service execution module is used to trigger the execution of the motor control module according to the EPWM interrupt.

10. The control device for the synchronous servo controller control function according to claim 7, characterized in that: The task control sub-device comprises: A statistical conversion module is used to form a timing cycle through the counting statistics of the interrupt service, quantify the time consumption of the business task through the timing cycle, and determine the scheduling cycle of the business task; A scheduling formation module is used to form a task scheduling process according to the polling of the scheduling cycle of the business tasks and the priority of the execution sorting; The control loop module is used to form an automatic loop of the task scheduling process in the motor main control process.

Citation Information

Cited By

  • Motor function safety monitoring method and device, electronic equipment and storage medium

    CN120546553A