WO2022206214A1 - Controller and control system adapted to performing motor control - Google Patents

Controller and control system adapted to performing motor control Download PDF

Info

Publication number
WO2022206214A1
WO2022206214A1 PCT/CN2022/077106 CN2022077106W WO2022206214A1 WO 2022206214 A1 WO2022206214 A1 WO 2022206214A1 CN 2022077106 W CN2022077106 W CN 2022077106W WO 2022206214 A1 WO2022206214 A1 WO 2022206214A1
Authority
WO
WIPO (PCT)
Prior art keywords
processor
operating system
controller
cache
data
Prior art date
Application number
PCT/CN2022/077106
Other languages
French (fr)
Chinese (zh)
Inventor
贺岩
龚劭秋
钱进
冯赟
Original Assignee
实时侠智能控制技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 实时侠智能控制技术有限公司 filed Critical 实时侠智能控制技术有限公司
Publication of WO2022206214A1 publication Critical patent/WO2022206214A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H02GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
    • H02PCONTROL OR REGULATION OF ELECTRIC MOTORS, ELECTRIC GENERATORS OR DYNAMO-ELECTRIC CONVERTERS; CONTROLLING TRANSFORMERS, REACTORS OR CHOKE COILS
    • H02P29/00Arrangements for regulating or controlling electric motors, appropriate for both AC and DC motors
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/02Total factory control, e.g. smart factories, flexible manufacturing systems [FMS] or integrated manufacturing systems [IMS]

Definitions

  • the present invention generally relates to controllers, and more particularly to a controller and control system suitable for performing motor control.
  • Motion control and motor control are core technologies in the field of industrial automation.
  • the motion controller that realizes motion control and the motor controller that realizes motor control are the two key control components on devices that automatically perform complex work commonly in the field of automation.
  • other fields such as electric robots, CNC machine tools, electric multi-rotors, electric vehicles, mechanical prosthetics, robotic palms, electric mobile vehicles, controllers including motion control and motor control are also used.
  • the distributed control method is that a motion controller cooperates with multiple motor controllers. Communication between the motion controller and the motor controller and between the motor controller and the motor controller uses a bus, such as a fieldbus.
  • This distributed control approach has a number of known disadvantages. For example, a large number of hardware devices will result in high hardware cost and large space occupation. For another example, the bus communication method is easily disturbed, and there is a bottleneck in the data transmission volume and transmission speed.
  • the technical problem to be solved by the present application is to provide a controller and a control system suitable for performing motor control, which can meet the low delay requirement of motor control.
  • the present application provides a controller suitable for performing motor control, comprising: a first processor configured to run a first operating system and a motor control, wherein the motor control runs on the first In an interrupt service routine of a processor; coupled to a cache of the first processor; a cache controller for loading primitives of the first operating system into the cache, and locking the cache; Wherein the first processor, the cache and the cache controller are integrated in the same chip.
  • the first processor includes a single processing core, and the first processor is further configured to run motion planning.
  • the first processor includes a plurality of processing cores that run the first operating system in a symmetric multiprocessing mode and are further configured to run motion planning.
  • the controller further includes: a second processor configured to run a second operating system and motion control, the second operating system is different from the first operating system; wherein the first operating system A processor and the second processor are integrated in the same chip.
  • the first processor includes a first processing core combination
  • the second processor includes a second processing core combination
  • the first processing core combination and the second processing core combination Each includes one or more processing cores.
  • the controller further includes a programmable logic device, coupled to the first processor, and performing motor control in cooperation with the first processor.
  • the programmable logic device, the first processor and the second processor are integrated in the same chip.
  • the motor control includes current loop calculation, or includes a combination of current loop calculation and speed loop calculation and/or position loop calculation.
  • the programmable controller performs current loop calculations, and the first processor performs velocity loop calculations and/or position loop calculations.
  • the controller further includes at least a part of the first operating system, which includes: a code segment and a data segment, where the code segment and the data segment respectively correspond to a designated memory area; a first identifier, The first identifier is used to designate the linker to put the primitives of the first operating system into the code segment; the second identifier is used to designate the linker to put the access data of the primitives of the first operating system into the code segment. in the data segment; wherein the first operating system is configured to load the code segment and the data segment into the designated memory area after startup.
  • the step of loading the primitives of the first operating system into the cache by the cache controller includes: prohibiting the work of the cache; allowing a designated cache area to load data; accessing a designated memory area to load primitives and access data of the first operating system in the memory area into the cache area; and allowing the cache to function properly.
  • Another aspect of the present application provides a method of running motor control on a controller, the controller including a first processor, a cache controller, and a cache coupled to the first processor, and the first processor
  • a processor, the cache and the cache controller are integrated in the same chip, and the method includes the steps of: starting the first processor; running the first operating system on the first processor ; loading primitives of the first operating system into the cache by the cache controller, and locking the cache; and running motor control in an interrupt service routine of the first processor.
  • the first processor includes a single processing core, and the method further includes running motion planning on the first processor.
  • the first processor includes a plurality of processing cores, wherein the first operating system is run in a symmetric multiprocessing mode on the first processor, and motion planning is executed.
  • the controller further includes a second processor integrated with the first processor in the same chip, and the method further includes: starting the second processor; A second operating system and motion control run on the second processor, the second operating system being different from the first operating system.
  • the controller further includes a programmable logic device coupled to the first processor and integrated with the first processor and the second processor in the same chip , the method further comprises: performing motor control on the programmable logic device in cooperation with the first processor.
  • the first operating system includes: a code segment and a data segment, the code segment and data segment respectively correspond to a specified memory area; a first identifier, the first identifier is used to specify that the linker will Putting the primitives of the first operating system into the code segment; a second identifier, used to specify that the linker puts the access data of the primitives of the first operating system into the data segment; the method It also includes loading the code segment and the data segment into the designated memory area through the first operating system.
  • the method further includes: defining a code segment and a data segment in a link file, the code segment and data segment respectively corresponding to a specified memory area; in the source code of the first operating system , a first identifier is added when defining the primitive of the first operating system, and the first identifier is used to designate the linker to put the primitive of the first operating system into the code segment; in the first In the source code of the operating system, a second identifier is added when defining the access data of the primitives of the first operating system, and the first identifier is used to designate the linker to put the access data into the data segment;
  • the source code of the first operating system is described and linked as an executable program.
  • Another aspect of the present application proposes a control system including the controller as described above.
  • the present invention executes the strong real-time tasks required for motor control through the interrupt service routine of the processor. And the operating system primitives are loaded into the cache and locked, which reduces the execution time of this part of the operating system primitives, so that the operation of masking the interrupt service during execution will not cause the interrupt required for motor control to be delayed.
  • FIG. 1 is a logical structure of a controller according to an embodiment of the present invention.
  • FIG. 2 is a circuit block diagram of a controller according to the first embodiment of the present invention.
  • FIG. 3 is an example operation process of the controller according to the first embodiment of the present invention.
  • FIG. 4 is a circuit block diagram of a controller according to a second embodiment of the present invention.
  • FIG. 5 is an example operation process of the controller according to the second embodiment of the present invention.
  • FIG. 6 is a circuit block diagram of a controller according to a third embodiment of the present invention.
  • FIG. 7 is a circuit block diagram of a controller according to a fourth embodiment of the present invention.
  • FIG. 8 is an example operation process of the controller according to the fourth embodiment of the present invention.
  • FIG. 9 is a flowchart of a method of operating motor control according to an embodiment of the present invention.
  • FIG. 10 is a flowchart of a method for loading operating system primitives into a cache according to an embodiment of the present invention.
  • FIG. 1 is a logical structure of a controller according to an embodiment of the present invention.
  • the motion control function refers to calculating the action targets of all motor axes of the device over time according to specific application tasks.
  • the calculation steps, calculation objects and calculated parameter variables may also be different, but the ultimate purpose is to obtain the relationship between the motor set value and time, and to generate the corresponding "each axis motor set value— —Time” data stream (data information).
  • the given value of the motor may be, for example, any one or several of the angular position, rotational speed, and torque of the motor.
  • the motor given value will be delivered to the motor control function for execution on time at the corresponding time point.
  • the motor control function is to control the drive circuit according to the given value calculated by the motion control, so as to drive the motor to meet the requirements of the given value quickly and stably.
  • the calculation of "current loop”, "speed loop” and "position loop” will be involved in motor control.
  • the control loop that needs to be calculated varies according to the given value. In general, when the given value is the angle value, all three loops are calculated; when the given value is the speed value, the current loop and speed loop are calculated; when the given value is the torque, the current loop is calculated. So the most basic system will have at least a current loop.
  • the motor control function can receive and process the data information of the given value of the motor of each axis in real time and control the rotation of the motor. ), the resulting synthetic motion reflected in the terminal execution will be what the application task requires.
  • it is ideal to calculate and control all axes synchronously at the same time, so that the coordinated and synthesized end effector moves accurately.
  • the controller 10 may include a motion controller 11 and a motor controller 12 .
  • the motion controller 11 may perform the aforementioned motion control functions.
  • the motor controller 12 may perform the aforementioned motor control functions.
  • the teach pendant (Teach Pendant, TP) is the upper computer of the motion controller 11, and is used to send application task instructions to the motion controller 11, or edit the plan control.
  • the motion controller 11 receives commands from the teach pendant, performs motion planning accordingly, and sends motion control data, such as the aforementioned given values of each axis motor, to the motor controller 12 .
  • the motor controller 12 can accordingly generate a driving control signal (eg, a pulse width modulated PWM signal) to the motor driver 13, which drives the motor to run.
  • a driving control signal eg, a pulse width modulated PWM signal
  • the controller 10 can be applied to electric robots, numerically controlled machine tools, electric multi-rotor aircraft, electric vehicles, mechanical prostheses, robotic palms, electric mobile vehicles, etc., for various types of multi-axis, Computational control and motor control of motion tasks for motor-driven equipment with coordinated movements between axes.
  • the number of shafts of the motor is not limited, and it may be 6 shafts or 8 shafts, or less shafts, or more shafts.
  • a processing core is a central processing unit (CPU).
  • the central processing unit (CPU) may contain a cache, such as the first level cache (L1 Cache).
  • L1 Cache the first level cache
  • a cache (cache) is a memory that exists between main memory and the processor, which is much faster than main memory, close to on the speed of the processor.
  • the second level cache (L2 Cache) in the processor acts as an additional cache. Communication between CPUs can be implemented using L2 caches coupled to multiple CPUs.
  • FIG. 2 is a circuit block diagram of a controller according to the first embodiment of the present invention.
  • an integrated motion control and motor control controller 20 in this embodiment may include a processing core 21 , a cache controller 23 and a cache 24 .
  • the single processing core 21, as the first processor in this embodiment, is configured to run the first operating system, motion control and motor control.
  • the cache 24 is a second level cache between the processing core 21 and the memory. It will be appreciated that cache 24 may also be other levels of cache.
  • Cache 24 is coupled to processing core 21 .
  • the processing core 21, the cache controller 23 and the cache 24 are integrated in the same chip.
  • the processing core 21 runs an operating system and performs motion control and motor control tasks.
  • the operating system can manage the operation of the entire controller and complete basic functions such as network communication, file management, equipment management, task scheduling and system debugging.
  • Specific application tasks, such as motion control tasks, can run on the operating system.
  • the motion control task calculates the motion targets over time of all motor axes of the device where the controller is located.
  • Motion control tasks can be implemented in a variety of ways. For example, according to different application requirements, different specific planning algorithm modules can be selectively embedded, task analysis software can be developed, and various path planning and joint space transformations can be performed. The specific algorithms for path planning and joint space transformation can also vary greatly depending on the application.
  • industrial robots can use kinematics and their inverse solution algorithms, and drones can achieve suspension, forward path planning variables, and joint transformation algorithms by adjusting the motor speed of each axis.
  • Those skilled in the art can completely design the motion control function according to specific application requirements.
  • the operating system is a small strong real-time system, such as RTThread.
  • the processing core 21 can plan the position value, speed value, torque value or combination thereof at different times of each axis of the equipment controlled by the controller 20 as the motor given value. That is to say, the given value of the motor can be any one or several of the above three values.
  • the processing core 21 can perform motor control tasks, control the motor driver according to the motor given value calculated above, and drive the motor to meet the requirements of the motor given value quickly and stably.
  • the motor control 26 is executed in the interrupt service routine 25 of the processing core 21 .
  • a certain clock interrupt is designated as a high (eg highest) priority interrupt, which can preempt other interrupt service routines, and the strong real-time task of motor control runs in the interrupt service routine 25 . In this way, the strong real-time requirements of motor control can be met.
  • the control loop that needs to be calculated varies according to the given value of the motor.
  • the motor set value is the position value
  • all three loops are calculated; when the motor set value is the speed value, the current loop and the speed loop are calculated; when the motor set value is the torque, the current loop is calculated.
  • the motor control tasks of the processing core 21 may selectively perform current loop calculations, or a combination of current loop calculations and velocity loop calculations and/or position loop calculations.
  • the processing core 21 calculates the current required to drive the motor to achieve the required position, speed or torque of the required motor given value, and outputs a drive control signal (such as a PWM signal) according to the calculation result to IGBT or IPM or other types of power devices to drive the motor.
  • a drive control signal such as a PWM signal
  • Primitives are instructions that call kernel-level subroutines in the operating system.
  • the difference from general generalized instructions is that primitives are uninterruptible and always appear as a basic unit. It differs from general procedures in that they are "primitive or atomic action".
  • the so-called atomic operation means that all actions in an operation are either done or not done at all. In other words, a primitive is an indivisible basic unit and, therefore, cannot be interrupted during execution. Atomic operations are executed in tube state and reside in memory.
  • operating system primitives and the data they access are loaded into cache 24 to ensure that their execution time is sufficiently short.
  • cache controller 23 loads operating system primitive 24 a from memory 30 into cache 24 and locks cache 24 .
  • the operating system includes a code segment and a data segment, which respectively correspond to designated memory regions. For example: define the code segment name as "RTcode" and the data segment name as "RTdata".
  • the operating system also includes a first identifier and a second identifier.
  • the first flag is used to designate the linker to put the operating system primitive 24a into the aforementioned code segment, and its format is, for example, __attribute__((section(.RTcode"))).
  • the second flag is used to designate the linker to put the access data of the operating system primitives into the data segment, and its format is, for example, __attribute__((section(".RTdata”))).
  • the operating system source code is modified to include the aforementioned portions. Then, the operating system source code is compiled and linked into an executable program. The operating system is configured to load code segments and data segments into designated memory regions in memory 30 upon startup.
  • cache controller 23 loads operating system primitives into cache 24 .
  • the specific process includes: prohibiting the work of the cache 24; allowing the designated cache area to load data; accessing the designated memory area in the memory 30 to load the primitives and access data of the operating system in the memory area into the cache 24 designated Cache area; allows Cache 24 to function properly.
  • it is ensured that the code of the operating system primitive and the memory area where the accessed data is located are mapped to the cache 24 , and the code of the operating system primitive and the accessed data are also loaded into the cache 24 .
  • the cache controller 23 can lock the designated cache area so that the mapped memory address will not change, thereby preventing the controller from mapping the cache area to other addresses.
  • the execution time of an operation primitive is less than 1 microsecond ( ⁇ m).
  • a lock-free queue is used to reduce latency when data flows from non-real-time tasks to strong real-time motor control tasks.
  • the non-real-time tasks read the feedback data from the strong real-time motor control tasks and "write" the data.
  • FIG. 3 is an example operation process of the controller according to the first embodiment of the present invention.
  • the processing core 21 generates motion control data during the motion control process, performs motor control according to the motion control data, generates a drive control signal to the motor driver 31 , and the motor driver 31 outputs current to control the motor 32 to run.
  • Feedback data collected from the motor 32 can be fed back to the processing core 21 .
  • Feedback data may include some or all of position data, velocity data, torque data, and current data.
  • an integrated motion control and motor control controller 40 of this embodiment may further include a processing core 21 , a cache controller 23 , a cache 24 and a programmable logic device (PLD) 42 .
  • the processing core 21 is configured to execute the operating system, motion control and motor control.
  • the PLD 42 is coupled to the processing core 21 and cooperates with the processing core 21 to perform motor control.
  • the processing core 21, the cache controller 23, the cache 24 and the PLD 42 are integrated in the same processing chip.
  • this embodiment introduces a PLD 42, and the PLD 42 has the characteristics of fast parallel calculation, so when the number of motor shafts is large, this is an obvious advantage.
  • PLD 42 is coupled to processing core 21 for coordination.
  • the manner of coupling is realized, for example, through the interface 41 between the processor and the PLD.
  • SoC chips such as Altera's Cyclone V chip, provide such an interface.
  • the type of PLD 42 may be a Field Programmable Gate Array (FPGA).
  • the processing core 21 and the PLD 42 form a motor controller, which cooperates to perform motor control tasks, controls the motor driver 31 according to the motor given value calculated by the processing core 21, and drives the motor 32 to reach the motor quickly and stably. requirements for a given value.
  • motor control tasks may be distributed between processing core 21 and PLD 42 combined as a motor controller.
  • the way of assigning the motor control tasks is for example: the processing core 21 is responsible for the calculation of the current loop, and the PLD 42 is responsible for the calculation of the speed loop and the position loop. calculation; or the processing core 21 is responsible for the position loop calculation and the velocity loop calculation, and the PLD 42 is responsible for the current loop calculation.
  • the velocity loop calculation and the current loop calculation such as the velocity loop calculation and the current loop calculation
  • the assignment of tasks between the processing core 21 and the PLD 42 can be corresponding ground adjustment.
  • the processing core 21 is responsible for the speed loop calculation
  • the PLD 42 is responsible for the current loop calculation.
  • FIG. 5 is an example operation process of the controller according to the second embodiment of the present invention.
  • the processing core 21 may generate motion control data during the motion control process.
  • the processing core 21 and the PLD 42 can further perform motor control according to the motion control data, generate a drive control signal to the motor driver 31, and the motor driver 31 outputs current to control the operation of the motor 32.
  • the processing core 21 handles the position loop and velocity loop calculations, while the PLD 42 handles the current loop calculations.
  • Feedback data collected from the motor 32 can be fed back to the processing core 21 .
  • Feedback data may include some or all of position data, velocity data, torque data, and current data.
  • the controller 60 of this embodiment may include a first processor 61 composed of a plurality of processing cores, a PLD 62 and a cache 63 .
  • a plurality of processing cores including processing cores 1 to N are used as the first processor 61 to run the operating system in symmetric multiprocessing (SMP) mode.
  • SMP symmetric multiprocessing
  • the PLD 62 is coupled to the first processor 61 and cooperates with the first processor 61 to perform motor control. Referring to the first embodiment, the PLD 62 can be omitted, and only the first processor 61 performs motor control at this time.
  • the controller 70 of this embodiment may include a first processing core 21 , a second processing core 22 , a cache controller 23 , a cache (cache) 24 and a programmable logic device (PLD) 72 .
  • the first processing core 21 is configured to execute the first operating system and motor control.
  • the second processing core 22 is configured to execute a second operating system and motion control. The second operating system is different from the first operating system.
  • the cache 24 is coupled to the first processing core 21 and the second processing core 22 .
  • the first processing core 21 and the second processing core 22 are configured to exchange data through the cache 24 during motion control and motor control.
  • the programmable logic device (PLD) 72 is coupled to the first processing core 21 , and forms a motor controller with the first processing core 21 to perform motor control in cooperation.
  • the first processing core 21, the second processing core 22, the cache controller 23, the cache 24 and the PLD 72 are integrated in the same chip.
  • this embodiment introduces a second processing core 22 .
  • the second processing core 22 runs a general-purpose operating system, such as a Linux system with real-time patches. This kind of operating system is ecologically sound, and its real-time performance is weak.
  • the first processing core 21 still runs a small strong real-time system.
  • AMP asymmetric multiplexing structure
  • the first processing core 41 completes functions such as motion task analysis and host computer communication. Specifically, after the user program is edited on the human-computer interaction interface of the upper computer, the upper computer transmits the user program to the controller 70 through the network cable, and the analysis of the program is completed by the second processing core 22. Commands are parsed into commands that the motion controller can recognize.
  • the file management functions such as system backup and recovery, classification, recording and management of data files and log files are implemented in the second processing core 22 .
  • the state management module runs on the second processing core 22 .
  • the monitored states include the state of external devices, the state of the motion controller, and the state of the motor controller, etc.
  • the controller 70 with integrated drive and control will perform corresponding processing according to the status collected by the status management module, and will also transmit some status information to the upper computer through the network.
  • the second processing core 22 can plan the position value, speed value, torque value or combination thereof at different times of each axis of the device controlled by the controller 70 as the motor given value. That is to say, the given value of the motor can be any one or several of the above three values.
  • the second processing core 22 may output the corresponding motor given value to the first processing core 21 for execution at a predetermined time point (or a definite and definite amount of time in advance). In another embodiment, the first processing core 21 and the second processing core 22 coordinate to complete the motion planning task.
  • the first processing core 21 controls the motor driver according to the calculated motor given value, and drives the motor to meet the requirements of the motor given value quickly and stably.
  • Current loop calculations, velocity loop calculations and/or position loop calculations are involved in motor control.
  • the control loop that needs to be calculated varies according to the given value of the motor. In general, when the motor set value is the position value, all three loops are calculated; when the motor set value is the speed value, the current loop and the speed loop are calculated; when the motor set value is the torque, the current loop is calculated.
  • the motor control task of the motor controller can selectively perform current loop calculation, or current loop calculation and speed loop calculation, or current loop calculation and position loop calculation, or current loop calculation, speed loop calculation and position loop calculation. calculate.
  • the tasks between the first processing core 21 and the PLD 42 can be allocated in various possible ways, such as the position loop calculation is performed in the first processing core 21, other loops are performed in the PLD 42, or both the position loop and the velocity loop are calculated in the first. Processing core 21 is performed while current loop calculations are performed at PLD 42. This mainly depends on the requirements of the control loop calculation rate and the performance constraints of the hardware platform.
  • the first processing core 21 and the second processing core 22 use the AMP mode, they can share the cache 24 . That is, the first processing core 21 and the second processing core 2242 are configured to perform data interaction through the cache 24 during motion control and motor control. Specifically, during motion control, the first processing core 21 can write motion control data (eg, motor given values) into the cache 24 , and the second processing core 22 can read the motion control data from the cache 24 . As previously mentioned, in each instance, the motion control data includes position data, velocity data, torque data, and/or current data, depending on the assignment of tasks between the first processing core 21 and the second processing core 22 .
  • motion control data includes position data, velocity data, torque data, and/or current data, depending on the assignment of tasks between the first processing core 21 and the second processing core 22 .
  • the first processing core 21 can write the feedback data into the cache 24
  • the second processing core 22 reads the feedback data from the cache 43 .
  • the feedback data may include position data, velocity data, torque data and/or current data.
  • the feedback data when the motion control data is position data, the feedback data generally includes position data, and may also include speed data and current data.
  • the feedback data when the motion control data is speed data, the feedback data generally includes speed data, and may also include position data and current data. It will of course be appreciated that the feedback data may be independent of the motion control data.
  • the feedback data normally includes any one or more of position data, speed data, torque data and current data; it is even feasible to directly feed back the position or attitude data of the end effector to the motion control processor according to the application situation ( For example, the attitude and speed of a drone, or the attitude and speed of an electric car).
  • the number of the first processing cores 21 and/or the second processing cores 22 may be multiple, so as to be expanded into multi-core first processors and/or second processors respectively.
  • FIG. 8 is an example operation process of the controller according to the fourth embodiment of the present invention.
  • the second processing core 22 may generate motion control data to the first processing core 21 during the motion control process.
  • the first processing core 21 and the PLD 72 can control the motor according to the motion control data, generate a drive control signal to the motor driver 31 , and the motor driver 31 outputs current to control the motor 32 to run.
  • the first processing core 21 handles the position loop and velocity loop calculations, while the PLD 72 handles the current loop calculations.
  • the first feedback data collected from the motor 32 can be fed back to the first processing core 21 .
  • the first processing core 21 may feed back the second feedback data to the second processing core 22 .
  • the first feedback data may include some or all of position data, velocity data, torque data, and current data.
  • the second feedback data may be derived entirely from the first feedback data.
  • the second feedback data may also not come entirely from the first feedback data.
  • the second feedback data may include data generated by the first processing core 21 . According to application requirements, there may be no first feedback data or second feedback data at all, forming partial open-loop or full open-loop control, which will not affect the realization and performance of the basic functions of the entire control system.
  • FIG. 9 is a flowchart of a method of operating motor control according to an embodiment of the present invention. Referring to Figure 9, the method includes the following steps:
  • step 901 start the first processor
  • a first operating system is run on the first processor
  • step 903 the primitive of the first operating system is loaded into the cache by the cache controller, and the cache is locked;
  • step 904 motor control is run in the interrupt service routine of the first processor.
  • the first processor includes a single processing core 21 .
  • the method in step 902 further includes running the motion planning on the first processor.
  • the controller further includes a PLD 42, and at this time it also includes performing motor control on the PLD 42 in cooperation with the first processor.
  • the first processor includes a plurality of processing cores.
  • the first operating system is run in the symmetric multiprocessing mode on the first processor, and the motion planning is executed.
  • the controller further includes a second processor composed of the second processing core 22 .
  • the method further includes: starting the second processor in step 901, and running a second operating system and motion control on the second processor in step 902, where the second operating system is different from the first operating system.
  • the first operating system includes a code segment, a data segment, a first identifier and a second identifier, and is used to load operating system primitives and access data into a designated memory area.
  • the implementation method of this step is shown in Figure 10, and includes the following steps.
  • step 1001 a code segment and a data segment are defined in the link file, and the code segment and the data segment respectively correspond to the designated memory areas.
  • step 1002 in the source code of the first operating system, a first identifier is added when defining the primitives of the first operating system, and the first identifier is used to designate the linker to put the primitives of the first operating system into the code segment;
  • Step 1003 in the source code of the first operating system, add a second identifier when defining the access data of the primitive of the first operating system, and the first identifier is used to designate the linker to put the access data in the data segment.
  • step 1004 the source code of the first operating system is compiled and linked into an executable program.
  • step 1005 after the first operating system is started, the data segment and the code segment are loaded into the designated memory area.
  • the cache controller loads the data segment and the code segment from the designated memory area into the designated cache area. The flow of this step has been described above.
  • aspects of the present application may be performed entirely in hardware, entirely in software (including firmware, resident software, microcode, etc.), or in a combination of hardware and software.
  • the above hardware or software may be referred to as a "data block”, “module”, “engine”, “unit”, “component” or “system”.
  • the processor may be one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DAPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), processors , controller, microcontroller, microprocessor, or a combination thereof.
  • aspects of the present application may be embodied as a computer product comprising computer readable program code embodied in one or more computer readable media.
  • computer readable media may include, but are not limited to, magnetic storage devices (eg, hard disks, floppy disks, magnetic tapes, ...), optical disks (eg, compact disc CD, digital versatile disk DVD, ...), smart cards, and flash memory devices ( For example, cards, sticks, key drives).
  • a computer-readable medium may contain a propagated data signal with the computer program code embodied therein, for example, on baseband or as part of a carrier wave.
  • the propagating signal may take a variety of manifestations, including electromagnetic, optical, etc., or a suitable combination.
  • a computer-readable medium can be any computer-readable medium other than a computer-readable storage medium that can communicate, propagate, or transmit a program for use by being coupled to an instruction execution system, apparatus, or device.
  • Program code on a computer readable medium may be propagated by any suitable medium, including radio, cable, fiber optic cable, radio frequency signal, or the like, or a combination of any of the foregoing.

Landscapes

  • Engineering & Computer Science (AREA)
  • Power Engineering (AREA)
  • Control Of Electric Motors In General (AREA)

Abstract

Provided in the present invention are a controller and a control system which are adapted to performing motor control. The controller comprises: a first processor, which is configured to run a first operating system and motor control, wherein the motor control is run during an interrupt service routine of the first processor; a cache coupled to the first processor; and a cache controller, which is used for loading primitives of the first operating system to the cache and locking the cache. The first processor, the cache, and the cache controller are integrated into the same chip.

Description

适于执行电机控制的控制器和控制系统Controllers and control systems suitable for performing motor control 技术领域technical field
本发明主要涉及控制器,尤其涉及一种适于执行电机控制的控制器和控制系统。The present invention generally relates to controllers, and more particularly to a controller and control system suitable for performing motor control.
背景技术Background technique
运动控制和电机控制是工业自动化领域的核心技术。实现运动控制的运动控制器和实现电机控制的电机控制器,是目前自动化领域中常见的自动执行复杂工作的装置上的两个关键控制部件。在其他领域,例如电动机器人、数控机床、电动多旋翼飞行器、电动汽车、机械义肢、机械手掌、电动移动载具中,也会使用包括运动控制和电机控制的控制器。Motion control and motor control are core technologies in the field of industrial automation. The motion controller that realizes motion control and the motor controller that realizes motor control are the two key control components on devices that automatically perform complex work commonly in the field of automation. In other fields, such as electric robots, CNC machine tools, electric multi-rotors, electric vehicles, mechanical prosthetics, robotic palms, electric mobile vehicles, controllers including motion control and motor control are also used.
传统上,大多数的工业自动化系统(比如机器人、大型机床)采用的是分布式控制方式。分布式控制方式具体地说是一个运动控制器与多个电机控制器配合。运动控制器和电机控制器之间、电机控制器与电机控制器之间使用总线(例如现场总线)进行通信。Traditionally, most industrial automation systems (such as robots, large machine tools) use distributed control methods. Specifically, the distributed control method is that a motion controller cooperates with multiple motor controllers. Communication between the motion controller and the motor controller and between the motor controller and the motor controller uses a bus, such as a fieldbus.
这种分布式的控制方式具有很多已知的缺点。例如硬件器件多会导致硬件成本高、占用空间大。又如,总线通信方式容易受到干扰,且在数据传输量和传输速度方面存在瓶颈。This distributed control approach has a number of known disadvantages. For example, a large number of hardware devices will result in high hardware cost and large space occupation. For another example, the bus communication method is easily disturbed, and there is a bottleneck in the data transmission volume and transmission speed.
为此,业界提出了“驱控一体”的设想,期望实现集成了运动控制器、电机控制器等功能为一体的工业控制器。而同时实现运动控制和电机控制,需要有操作系统提供任务调度、文件管理和网络通信等基础服务。而且电机控制任务以固定的周期执行,为了保证电机控制的性能,此任务允许的延迟很小。To this end, the industry has put forward the idea of "integration of drive and control", expecting to realize an industrial controller that integrates functions such as motion controller and motor controller. To realize motion control and motor control at the same time, an operating system is required to provide basic services such as task scheduling, file management and network communication. Moreover, the motor control task is executed in a fixed period, in order to ensure the performance of the motor control, the delay allowed for this task is small.
发明内容SUMMARY OF THE INVENTION
本申请要解决的技术问题是提供适于执行电机控制的控制器和控制系统,可以满足电机控制的低延迟需求。The technical problem to be solved by the present application is to provide a controller and a control system suitable for performing motor control, which can meet the low delay requirement of motor control.
为解决上述技术问题,本申请提供了一种适于执行电机控制的控制器,包括:第一处理器,配置为运行第一操作系统和电机控制,其中所述电机控制运行于所述 第一处理器的中断服务程序中;耦接到所述第一处理器的高速缓存;缓存控制器,用于加载所述第一操作系统的原语到所述高速缓存,并锁定所述高速缓存;其中所述第一处理器、所述高速缓存和所述缓存控制器集成在同一芯片中。In order to solve the above technical problems, the present application provides a controller suitable for performing motor control, comprising: a first processor configured to run a first operating system and a motor control, wherein the motor control runs on the first In an interrupt service routine of a processor; coupled to a cache of the first processor; a cache controller for loading primitives of the first operating system into the cache, and locking the cache; Wherein the first processor, the cache and the cache controller are integrated in the same chip.
在本申请的一实施例中,所述第一处理器包括单个处理核心,且所述第一处理器还配置为运行运动规划。In an embodiment of the present application, the first processor includes a single processing core, and the first processor is further configured to run motion planning.
在本申请的一实施例中,所述第一处理器包括多个处理核心,所述多个处理核心以对称多处理模式运行所述第一操作系统,且还配置为运行运动规划。In an embodiment of the present application, the first processor includes a plurality of processing cores that run the first operating system in a symmetric multiprocessing mode and are further configured to run motion planning.
在本申请的一实施例中,控制器还包括:第二处理器,配置为运行第二操作系统和运动控制,所述第二操作系统不同于所述第一操作系统;其中所述第一处理器与所述第二处理器集成在所述同一芯片中。In an embodiment of the present application, the controller further includes: a second processor configured to run a second operating system and motion control, the second operating system is different from the first operating system; wherein the first operating system A processor and the second processor are integrated in the same chip.
在本申请的一实施例中,所述第一处理器包括第一处理核心组合,所述第二处理器包括第二处理核心组合,所述第一处理核心组合和所述第二处理核心组合分别包括一个或多个处理核心。In an embodiment of the present application, the first processor includes a first processing core combination, the second processor includes a second processing core combination, the first processing core combination and the second processing core combination Each includes one or more processing cores.
在本申请的一实施例中,控制器还包括可编程逻辑器件,耦接所述第一处理器,与所述第一处理器协同进行电机控制。In an embodiment of the present application, the controller further includes a programmable logic device, coupled to the first processor, and performing motor control in cooperation with the first processor.
在本申请的一实施例中,所述可编程逻辑器件与所述第一处理器和所述第二处理器集成在所述同一芯片中。In an embodiment of the present application, the programmable logic device, the first processor and the second processor are integrated in the same chip.
在本申请的一实施例中,所述电机控制包括电流环计算,或者包括电流环计算与速度环计算和/或位置环计算的组合。In an embodiment of the present application, the motor control includes current loop calculation, or includes a combination of current loop calculation and speed loop calculation and/or position loop calculation.
在本申请的一实施例中,所述可编程控制器执行电流环计算,所述第一处理器执行速度环计算和/或位置环计算。In an embodiment of the present application, the programmable controller performs current loop calculations, and the first processor performs velocity loop calculations and/or position loop calculations.
在本申请的一实施例中,控制器还包括所述第一操作系统的至少一部分,其包括:代码段和数据段,所述代码段和数据段分别对应指定的内存区域;第一标识,第一标识用于指定链接器将所述第一操作系统的原语放到所述代码段中;第二标识,用于指定链接器将所述第一操作系统的原语的访问数据放到所述数据段中;其中所述第一操作系统配置为在启动后将所述代码段和数据段加载到所述指定的内存区域。In an embodiment of the present application, the controller further includes at least a part of the first operating system, which includes: a code segment and a data segment, where the code segment and the data segment respectively correspond to a designated memory area; a first identifier, The first identifier is used to designate the linker to put the primitives of the first operating system into the code segment; the second identifier is used to designate the linker to put the access data of the primitives of the first operating system into the code segment. in the data segment; wherein the first operating system is configured to load the code segment and the data segment into the designated memory area after startup.
在本申请的一实施例中,所述缓存控制器加载所述第一操作系统的原语到所述高速缓存的步骤包括:禁止所述高速缓存的工作;允许指定的高速缓存区域加载 数据;访问指定的内存区域以将所述内存区域中的所述第一操作系统的原语和访问数据加载到所述高速缓存区域;以及允许所述高速缓存正常工作。In an embodiment of the present application, the step of loading the primitives of the first operating system into the cache by the cache controller includes: prohibiting the work of the cache; allowing a designated cache area to load data; accessing a designated memory area to load primitives and access data of the first operating system in the memory area into the cache area; and allowing the cache to function properly.
本申请的另一方面提出一种在控制器上运行电机控制的方法,所述控制器包括第一处理器、缓存控制器和耦接到所述第一处理器的高速缓存,且所述第一处理器、所述高速缓存和所述缓存控制器集成在同一芯片中,所述方法包括以下步骤:启动所述第一处理器;在所述第一处理器上运行所述第一操作系统;通过所述缓存控制器加载所述第一操作系统的原语到所述高速缓存,并锁定所述高速缓存;以及在所述第一处理器的中断服务程序中运行电机控制。Another aspect of the present application provides a method of running motor control on a controller, the controller including a first processor, a cache controller, and a cache coupled to the first processor, and the first processor A processor, the cache and the cache controller are integrated in the same chip, and the method includes the steps of: starting the first processor; running the first operating system on the first processor ; loading primitives of the first operating system into the cache by the cache controller, and locking the cache; and running motor control in an interrupt service routine of the first processor.
在本申请的一实施例中,所述第一处理器包括单个处理核心,且所述方法还包括在所述第一处理器运行运动规划。In an embodiment of the present application, the first processor includes a single processing core, and the method further includes running motion planning on the first processor.
在本申请的一实施例中,所述第一处理器包括多个处理核心,其中在所述第一处理器上以对称多处理模式运行所述第一操作系统,且运行运动规划。In an embodiment of the present application, the first processor includes a plurality of processing cores, wherein the first operating system is run in a symmetric multiprocessing mode on the first processor, and motion planning is executed.
在本申请的一实施例中,所述控制器还包括第二处理器,与所述第一处理器集成在同一芯片中,所述方法还包括:启动所述第二处理器;以及在所述第二处理器上运行第二操作系统和运动控制,所述第二操作系统不同于所述第一操作系统。In an embodiment of the present application, the controller further includes a second processor integrated with the first processor in the same chip, and the method further includes: starting the second processor; A second operating system and motion control run on the second processor, the second operating system being different from the first operating system.
在本申请的一实施例中,所述控制器还包括可编程逻辑器件,耦接所述第一处理器且与所述第一处理器和所述第二处理器集成在所述同一芯片中,所述方法还包括:在所述可编程逻辑器件上与所述第一处理器协同进行电机控制。In an embodiment of the present application, the controller further includes a programmable logic device coupled to the first processor and integrated with the first processor and the second processor in the same chip , the method further comprises: performing motor control on the programmable logic device in cooperation with the first processor.
在本申请的一实施例中,所述第一操作系统包括:代码段和数据段,所述代码段和数据段分别对应指定的内存区域;第一标识,第一标识用于指定链接器将所述第一操作系统的原语放到所述代码段中;第二标识,用于指定链接器将所述第一操作系统的原语的访问数据放到所述数据段中;所述方法还包括通过所述第一操作系统将所述代码段和数据段加载到所述指定的内存区域。In an embodiment of the present application, the first operating system includes: a code segment and a data segment, the code segment and data segment respectively correspond to a specified memory area; a first identifier, the first identifier is used to specify that the linker will Putting the primitives of the first operating system into the code segment; a second identifier, used to specify that the linker puts the access data of the primitives of the first operating system into the data segment; the method It also includes loading the code segment and the data segment into the designated memory area through the first operating system.
在本申请的一实施例中,所述方法还包括:在链接文件里定义代码段和数据段,所述代码段和数据段分别对应指定的内存区域;在所述第一操作系统的源码中,定义所述第一操作系统的原语时添加第一标识,所述第一标识用于指定链接器将所述第一操作系统的原语放到所述代码段中;在所述第一操作系统的源码中,定义所述第一操作系统的原语的访问数据时添加第二标识,所述第一标识用于指定链接器将所述访问数据放到所述数据段中;编译所述第一操作系统的源码并链接为可执行 程序。In an embodiment of the present application, the method further includes: defining a code segment and a data segment in a link file, the code segment and data segment respectively corresponding to a specified memory area; in the source code of the first operating system , a first identifier is added when defining the primitive of the first operating system, and the first identifier is used to designate the linker to put the primitive of the first operating system into the code segment; in the first In the source code of the operating system, a second identifier is added when defining the access data of the primitives of the first operating system, and the first identifier is used to designate the linker to put the access data into the data segment; The source code of the first operating system is described and linked as an executable program.
本申请的另一方面提出一种控制系统,包括如上所述的控制器。Another aspect of the present application proposes a control system including the controller as described above.
与现有技术相比,本发明通过处理器的中断服务程序来运行电机控制所需的强实时任务。并且操作系统原语加载到高速缓存并锁定,降低这部分操作系统原语的执行时间,使其在执行时屏蔽中断服务的操作不会导致电机控制所需的中断被延迟。Compared with the prior art, the present invention executes the strong real-time tasks required for motor control through the interrupt service routine of the processor. And the operating system primitives are loaded into the cache and locked, which reduces the execution time of this part of the operating system primitives, so that the operation of masking the interrupt service during execution will not cause the interrupt required for motor control to be delayed.
附图概述BRIEF DESCRIPTION OF THE DRAWINGS
包括附图是为提供对本申请进一步的理解,它们被收录并构成本申请的一部分,附图示出了本申请的实施例,并与本说明书一起起到解释本申请原理的作用。附图中:The accompanying drawings are included to provide a further understanding of the application, are incorporated in and constitute a part of this application, illustrate embodiments of the application, and together with the description serve to explain the principles of the application. In the attached picture:
图1是根据本发明一实施例的控制器的逻辑结构。FIG. 1 is a logical structure of a controller according to an embodiment of the present invention.
图2是根据本发明第一实施例的控制器的电路框图。FIG. 2 is a circuit block diagram of a controller according to the first embodiment of the present invention.
图3是根据本发明第一实施例的控制器的示例运行过程。FIG. 3 is an example operation process of the controller according to the first embodiment of the present invention.
图4是根据本发明第二实施例的控制器的电路框图。4 is a circuit block diagram of a controller according to a second embodiment of the present invention.
图5是根据本发明第二实施例的控制器的示例运行过程。FIG. 5 is an example operation process of the controller according to the second embodiment of the present invention.
图6是根据本发明第三实施例的控制器的电路框图。6 is a circuit block diagram of a controller according to a third embodiment of the present invention.
图7是根据本发明第四实施例的控制器的电路框图。7 is a circuit block diagram of a controller according to a fourth embodiment of the present invention.
图8是根据本发明第四实施例的控制器的示例运行过程。FIG. 8 is an example operation process of the controller according to the fourth embodiment of the present invention.
图9是根据本发明一实施例的运行电机控制的方法流程图。9 is a flowchart of a method of operating motor control according to an embodiment of the present invention.
图10是根据本发明一实施例的加载操作系统原语到高速缓存的方法流程图。10 is a flowchart of a method for loading operating system primitives into a cache according to an embodiment of the present invention.
本发明的较佳实施方式Preferred Embodiments of the Invention
为了更清楚地说明本申请的实施例的技术方案,下面将对实施例描述中所需要使用的附图作简单的介绍。显而易见地,下面描述中的附图仅仅是本申请的一些示例或实施例,对于本领域的普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图将本申请应用于其他类似情景。除非从语言环境中显而易见或另做说明,图中相同标号代表相同结构或操作。In order to illustrate the technical solutions of the embodiments of the present application more clearly, the following briefly introduces the accompanying drawings that are used in the description of the embodiments. Obviously, the accompanying drawings in the following description are only some examples or embodiments of the present application. For those of ordinary skill in the art, without any creative effort, the present application can also be applied to the present application according to these drawings. other similar situations. Unless obvious from the locale or otherwise specified, the same reference numbers in the figures represent the same structure or operation.
如本申请和权利要求书中所示,除非上下文明确提示例外情形,“一”、 “一个”、“一种”和/或“该”等词并非特指单数,也可包括复数。一般说来,术语“包括”与“包含”仅提示包括已明确标识的步骤和元素,而这些步骤和元素不构成一个排它性的罗列,方法或者设备也可能包含其他的步骤或元素。As shown in this application and in the claims, unless the context clearly dictates otherwise, the words "a", "an", "an" and/or "the" are not intended to be specific in the singular and may include the plural. Generally speaking, the terms "comprising" and "comprising" only imply that the clearly identified steps and elements are included, and these steps and elements do not constitute an exclusive list, and the method or apparatus may also include other steps or elements.
除非另外具体说明,否则在这些实施例中阐述的部件和步骤的相对布置、数字表达式和数值不限制本申请的范围。同时,应当明白,为了便于描述,附图中所示出的各个部分的尺寸并不是按照实际的比例关系绘制的。对于相关领域普通技术人员已知的技术、方法和设备可能不作详细讨论,但在适当情况下,所述技术、方法和设备应当被视为授权说明书的一部分。在这里示出和讨论的所有示例中,任何具体值应被解释为仅仅是示例性的,而不是作为限制。因此,示例性实施例的其它示例可以具有不同的值。应注意到:相似的标号和字母在下面的附图中表示类似项,因此,一旦某一项在一个附图中被定义,则在随后的附图中不需要对其进行进一步讨论。The relative arrangement of the components and steps, the numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present application unless specifically stated otherwise. Meanwhile, it should be understood that, for the convenience of description, the dimensions of various parts shown in the accompanying drawings are not drawn in an actual proportional relationship. Techniques, methods, and devices known to those of ordinary skill in the relevant art may not be discussed in detail, but where appropriate, such techniques, methods, and devices should be considered part of the authorized description. In all examples shown and discussed herein, any specific value should be construed as illustrative only and not as limiting. Accordingly, other examples of exemplary embodiments may have different values. It should be noted that like numerals and letters refer to like items in the following figures, so once an item is defined in one figure, it does not require further discussion in subsequent figures.
此外,需要说明的是,使用“第一”、“第二”等词语来限定零部件,仅仅是为了便于对相应零部件进行区别,如没有另行声明,上述词语并没有特殊含义,因此不能理解为对本申请保护范围的限制。此外,尽管本申请中所使用的术语是从公知公用的术语中选择的,但是本申请说明书中所提及的一些术语可能是申请人按他或她的判断来选择的,其详细含义在本文的描述的相关部分中说明。此外,要求不仅仅通过所使用的实际术语,而是还要通过每个术语所蕴含的意义来理解本申请。In addition, it should be noted that the use of words such as "first" and "second" to define components is only for the convenience of distinguishing corresponding components. Unless otherwise stated, the above words have no special meaning and therefore cannot be understood to limit the scope of protection of this application. In addition, although the terms used in this application are selected from well-known and common terms, some terms mentioned in the specification of this application may be chosen by the applicant at his or her judgment, and the detailed meanings of which are set forth herein. described in the relevant section of the description. Furthermore, it is required that the application be understood not only by the actual terms used, but also by the meaning implied by each term.
应当理解,当一个部件被称为“在另一个部件上”、“连接到另一个部件”、“耦接于另一个部件”或“接触另一个部件”时,它可以直接在该另一个部件之上、连接于或耦接于、或接触该另一个部件,或者可以存在插入部件。相比之下,当一个部件被称为“直接在另一个部件上”、“直接连接于”、“直接耦接于”或“直接接触”另一个部件时,不存在插入部件。同样的,当第一个部件被称为“电接触”或“电耦接于”第二个部件,在该第一部件和该第二部件之间存在允许电流流动的电路径。该电路径可以包括电容器、耦接的电感器和/或允许电流流动的其它部件,甚至在导电部件之间没有直接接触。It will be understood that when an element is referred to as being "on," "connected to," "coupled to," or "contacting" another element, it can be directly on the other element On, connected to or coupled to, or in contact with the other component, or intervening components may be present. In contrast, when an element is referred to as being "directly on," "directly connected to," "directly coupled to," or "directly in contact with" another element, there are no intervening elements present. Likewise, when a first component is referred to as being "in electrical contact" or "electrically coupled to" a second component, there is an electrical path between the first component and the second component that allows current to flow. The electrical path may include capacitors, coupled inductors, and/or other components that allow current to flow, even without direct contact between conductive components.
本发明的实施例描述包含运动控制和电机控制功能的控制器。图1是根据 本发明一实施例的控制器的逻辑结构。如本领域技术人员所理解的,运动控制功能指的是根据具体的应用任务,将设备所有电机轴随着时间的动作目标计算出来。根据具体应用的不同,计算步骤、计算对象和计算的参数变量可能也会不同,但其最终目的都是为了得到电机给定值和时间的关系,并产生对应的“各轴电机给定值——时间”数据流(数据信息)。电机给定值例如可以是电机的转角位置、转速、转矩中的任意一种或几种。Embodiments of the present invention describe a controller that includes motion control and motor control functions. FIG. 1 is a logical structure of a controller according to an embodiment of the present invention. As understood by those skilled in the art, the motion control function refers to calculating the action targets of all motor axes of the device over time according to specific application tasks. Depending on the specific application, the calculation steps, calculation objects and calculated parameter variables may also be different, but the ultimate purpose is to obtain the relationship between the motor set value and time, and to generate the corresponding "each axis motor set value— —Time” data stream (data information). The given value of the motor may be, for example, any one or several of the angular position, rotational speed, and torque of the motor.
电机给定值会在对应的时间点上准时地被下发给电机控制功能执行。电机控制功能是根据运动控制计算出的给定值去控制驱动电路,从而驱动电机又快又稳地达到给定值的要求。电机控制中会涉及到“电流环”、“速度环”和“位置环”计算。根据给定值不同所需要计算的控制环也不同。一般情况下,给定值为角度值时,计算所有三个环;给定值为速度值时,计算电流环、速度环;给定值为力矩时,计算电流环。因此最基本的系统都会至少有电流环。电机控制功能可以实时地接收并处理各轴电机给定值的数据信息并控制电机的转动,当所有轴在规定的时间点到达规定的给定值(可能是角度值、也可能是速度或力矩),则最终反应在终端执行上的合成运动就会是应用任务所需要的样子。对于一个需要各轴动作协调的设备或系统来说,最理想的是同时同步地计算和控制所有轴,使得各轴协调合成出来的终端执行器运动准确。The motor given value will be delivered to the motor control function for execution on time at the corresponding time point. The motor control function is to control the drive circuit according to the given value calculated by the motion control, so as to drive the motor to meet the requirements of the given value quickly and stably. The calculation of "current loop", "speed loop" and "position loop" will be involved in motor control. The control loop that needs to be calculated varies according to the given value. In general, when the given value is the angle value, all three loops are calculated; when the given value is the speed value, the current loop and speed loop are calculated; when the given value is the torque, the current loop is calculated. So the most basic system will have at least a current loop. The motor control function can receive and process the data information of the given value of the motor of each axis in real time and control the rotation of the motor. ), the resulting synthetic motion reflected in the terminal execution will be what the application task requires. For a device or system that requires coordination of actions of all axes, it is ideal to calculate and control all axes synchronously at the same time, so that the coordinated and synthesized end effector moves accurately.
参考图1所示,根据本发明一实施例的控制器10可包括运动控制器11和电机控制器12。运动控制器11可执行前述的运动控制功能。电机控制器12可执行前述的电机控制功能。示教器(Teach Pendant,TP)是运动控制器11的上位机,用于给运动控制器11发送应用任务指令,或者进行计划控制的编辑。运动控制器11从示教器接收命令,据此进行运动规划,发送运动控制数据,如前述的各轴电机给定值给电机控制器12。电机控制器12可以据此产生驱动控制信号(如脉冲宽度调制PWM信号)给电机驱动器13,由后者驱动电机运转。Referring to FIG. 1 , the controller 10 according to an embodiment of the present invention may include a motion controller 11 and a motor controller 12 . The motion controller 11 may perform the aforementioned motion control functions. The motor controller 12 may perform the aforementioned motor control functions. The teach pendant (Teach Pendant, TP) is the upper computer of the motion controller 11, and is used to send application task instructions to the motion controller 11, or edit the plan control. The motion controller 11 receives commands from the teach pendant, performs motion planning accordingly, and sends motion control data, such as the aforementioned given values of each axis motor, to the motor controller 12 . The motor controller 12 can accordingly generate a driving control signal (eg, a pulse width modulated PWM signal) to the motor driver 13, which drives the motor to run.
在本发明的各实施例中,控制器10可以应用于电动机器人、数控机床、电动多旋翼飞行器、电动汽车、机械义肢、机械手掌、电动移动载具等场合,用于各类多轴的、轴之间须动作协调的、电机驱动的设备的运动任务计算控制和电机控制。In various embodiments of the present invention, the controller 10 can be applied to electric robots, numerically controlled machine tools, electric multi-rotor aircraft, electric vehicles, mechanical prostheses, robotic palms, electric mobile vehicles, etc., for various types of multi-axis, Computational control and motor control of motion tasks for motor-driven equipment with coordinated movements between axes.
在本发明的各实施例中,对电机的轴数不做限定,可以是6轴或8轴,也可以是更少的轴,或者更多的轴。In each embodiment of the present invention, the number of shafts of the motor is not limited, and it may be 6 shafts or 8 shafts, or less shafts, or more shafts.
在本申请的上下文中,处理核心为中央处理器(CPU)。中央处理器(CPU)中可包含高速缓存,如一级缓存(L1 Cache)。在本申请的上下文中,高速缓存(高速缓冲存储器)如本领域技术人员所通常理解的,是存在于主存储器(memory)与处理器之间的存储器,其速度比主存储器高得多,接近于处理器的速度。处理器中的二级缓存(L2 Cache)可作为额外的高速缓存。可使用和多个CPU耦接的二级缓存,实现CPU之间的通讯。In the context of this application, a processing core is a central processing unit (CPU). The central processing unit (CPU) may contain a cache, such as the first level cache (L1 Cache). In the context of this application, a cache (cache), as commonly understood by those skilled in the art, is a memory that exists between main memory and the processor, which is much faster than main memory, close to on the speed of the processor. The second level cache (L2 Cache) in the processor acts as an additional cache. Communication between CPUs can be implemented using L2 caches coupled to multiple CPUs.
图2是根据本发明第一实施例的控制器的电路框图。参考图2所示,本实施例的一种集成运动控制和电机控制的控制器20可包括处理核心21、缓存控制器23和高速缓存(cache)24。单个处理核心21作为本实施例中的第一处理器,配置为运行第一操作系统、运动控制和电机控制。高速缓存24是处理核心21和内存之间的二级缓存。可以理解,高速缓存24也可以是其他级别的缓存。高速缓存24耦接到处理核心21。处理核心21、缓存控制器23和高速缓存(cache)24集成在同一芯片中。FIG. 2 is a circuit block diagram of a controller according to the first embodiment of the present invention. Referring to FIG. 2 , an integrated motion control and motor control controller 20 in this embodiment may include a processing core 21 , a cache controller 23 and a cache 24 . The single processing core 21, as the first processor in this embodiment, is configured to run the first operating system, motion control and motor control. The cache 24 is a second level cache between the processing core 21 and the memory. It will be appreciated that cache 24 may also be other levels of cache. Cache 24 is coupled to processing core 21 . The processing core 21, the cache controller 23 and the cache 24 are integrated in the same chip.
在此实施例中,处理核心21运行了操作系统,并且执行运动控制和电机控制任务。操作系统可以管理整个控制器的运作,完成网络通信、文件管理、设备管理、任务调度和系统调试等基础功能。操作系统上可以运行具体的应用任务,例如运动控制任务。运动控制任务可将控制器所在设备的所有电机轴随着时间的动作目标计算出来。运动控制任务的实现方式可以是多种多样的。例如根据应用需求不同,可以选择性嵌入不同的具体规划算法模块,开发任务解析软件,进行各种路径规划和关节空间转化。路径规划和关节空间转化的具体算法还可根据应用情况不同而有很大区别。例如工业机器人可使用运动学及其反解算法,无人机可通过调节各轴电机转速来实现悬浮、前进的路径规划变量和关节转化算法。本领域技术人员完全可以根据具体应用需求来设计运动控制功能。In this embodiment, the processing core 21 runs an operating system and performs motion control and motor control tasks. The operating system can manage the operation of the entire controller and complete basic functions such as network communication, file management, equipment management, task scheduling and system debugging. Specific application tasks, such as motion control tasks, can run on the operating system. The motion control task calculates the motion targets over time of all motor axes of the device where the controller is located. Motion control tasks can be implemented in a variety of ways. For example, according to different application requirements, different specific planning algorithm modules can be selectively embedded, task analysis software can be developed, and various path planning and joint space transformations can be performed. The specific algorithms for path planning and joint space transformation can also vary greatly depending on the application. For example, industrial robots can use kinematics and their inverse solution algorithms, and drones can achieve suspension, forward path planning variables, and joint transformation algorithms by adjusting the motor speed of each axis. Those skilled in the art can completely design the motion control function according to specific application requirements.
在本实施例中,操作系统是小型强实时系统,例如RTThread。In this embodiment, the operating system is a small strong real-time system, such as RTThread.
处理核心21通过运行运动控制任务,可以规划出控制器20所控制的设备的各个轴在不同时间的位置值、速度值、转矩值或其组合,作为电机给定值。 也就是说,电机给定值可以是前述3个值中的任意一种或几种。By running the motion control task, the processing core 21 can plan the position value, speed value, torque value or combination thereof at different times of each axis of the equipment controlled by the controller 20 as the motor given value. That is to say, the given value of the motor can be any one or several of the above three values.
处理核心21可以执行电机控制任务,根据前文计算出的电机给定值控制电机驱动器,驱动电机又快又稳地达到电机给定值的要求。在本实施例中,在处理核心21的中断服务程序25中执行电机控制26。具体而言,指定某个时钟中断为高(例如最高)优先级中断,该中断可以抢占其他中断服务程序,电机控制的强实时任务运行于中断服务程序25中。通过这一方式,可以满足电机控制的强实时要求。The processing core 21 can perform motor control tasks, control the motor driver according to the motor given value calculated above, and drive the motor to meet the requirements of the motor given value quickly and stably. In the present embodiment, the motor control 26 is executed in the interrupt service routine 25 of the processing core 21 . Specifically, a certain clock interrupt is designated as a high (eg highest) priority interrupt, which can preempt other interrupt service routines, and the strong real-time task of motor control runs in the interrupt service routine 25 . In this way, the strong real-time requirements of motor control can be met.
电机控制中会涉及到电流环计算、速度环计算和/或位置环计算。根据电机给定值不同所需要计算的控制环也不同。一般情况下,当电机给定值为位置值时,计算所有三个环;当电机给定值为速度值时,计算电流环和速度环;当电机给定值为力矩时,计算电流环。由此,处理核心21的电机控制任务可以选择性地进行电流环计算,或者进行电流环计算与速度环计算和/或位置环计算的组合。处理核心21计算驱动电机达到所需电机给定值要求位置、速度或力矩所需的电流,根据计算结果输出驱动控制信号(如PWM信号)给IGBT或IPM或其他类型的功率器件来驱动电机。Current loop calculations, velocity loop calculations and/or position loop calculations are involved in motor control. The control loop that needs to be calculated varies according to the given value of the motor. In general, when the motor set value is the position value, all three loops are calculated; when the motor set value is the speed value, the current loop and the speed loop are calculated; when the motor set value is the torque, the current loop is calculated. Thus, the motor control tasks of the processing core 21 may selectively perform current loop calculations, or a combination of current loop calculations and velocity loop calculations and/or position loop calculations. The processing core 21 calculates the current required to drive the motor to achieve the required position, speed or torque of the required motor given value, and outputs a drive control signal (such as a PWM signal) according to the calculation result to IGBT or IPM or other types of power devices to drive the motor.
在处理核心21所运行的小型强实时系统的核心部分中,有需要屏蔽中断的关键代码段——操作系统原语。原语是在操作系统中调用核心层子程序的指令。与一般广义指令的区别在于原语是不可中断的,而且总是作为一个基本单位出现。它与一般过程的区别在于:它们是“原子操作(primitive or atomic action)”。所谓原子操作,是指一个操作中的所有动作要么全做,要么全不做。换言之,原语是一个不可分割的基本单位,因此,在执行过程中不允许被中断。原子操作在管态下执行,常驻内存。在本实施例中,将操作系统原语及其访问(读和/或写)的数据载入到高速缓存24中以确保其执行时间足够短。参考图2所示,缓存控制器23将操作系统原语24a从内存30加载到高速缓存24,并锁定高速缓存24。In the core part of the small strong real-time system run by the processing core 21, there is a key code segment that needs to shield interrupts - operating system primitives. Primitives are instructions that call kernel-level subroutines in the operating system. The difference from general generalized instructions is that primitives are uninterruptible and always appear as a basic unit. It differs from general procedures in that they are "primitive or atomic action". The so-called atomic operation means that all actions in an operation are either done or not done at all. In other words, a primitive is an indivisible basic unit and, therefore, cannot be interrupted during execution. Atomic operations are executed in tube state and reside in memory. In this embodiment, operating system primitives and the data they access (read and/or write) are loaded into cache 24 to ensure that their execution time is sufficiently short. Referring to FIG. 2 , cache controller 23 loads operating system primitive 24 a from memory 30 into cache 24 and locks cache 24 .
在一个实施例中,操作系统包括代码段和数据段,分别对应指定的内存区域。例如:定义代码段名为“RTcode”,数据段名字为“RTdata”。操作系统还包括第一标识及第二标识。第一标识用于指定链接器将操作系统原语24a放到前述代码段中,其格式例如为__attribute__((section(".RTcode")))。第二标 识用于指定链接器将操作系统原语的访问数据放到数据段中,其格式例如为__attribute__((section(".RTdata")))。在一个实施例中,对操作系统源码进行修改以包含上述部分。然后,对操作系统源码编译并链接为可执行程序。操作系统配置为在启动后将代码段和数据段加载到内存30中指定的内存区域。In one embodiment, the operating system includes a code segment and a data segment, which respectively correspond to designated memory regions. For example: define the code segment name as "RTcode" and the data segment name as "RTdata". The operating system also includes a first identifier and a second identifier. The first flag is used to designate the linker to put the operating system primitive 24a into the aforementioned code segment, and its format is, for example, __attribute__((section(".RTcode"))). The second flag is used to designate the linker to put the access data of the operating system primitives into the data segment, and its format is, for example, __attribute__((section(".RTdata"))). In one embodiment, the operating system source code is modified to include the aforementioned portions. Then, the operating system source code is compiled and linked into an executable program. The operating system is configured to load code segments and data segments into designated memory regions in memory 30 upon startup.
程序启动后的初始化阶段,缓存控制器23加载操作系统原语到高速缓存24。具体过程包括:禁止高速缓存24的工作;允许指定的高速缓存区域加载数据;访问内存30中指定的内存区域以将该内存区域中的操作系统的原语和访问数据加载到高速缓存24中指定的高速缓存区域;允许高速缓存24正常工作。这些步骤完成后,保证了操作系统原语的代码和访问数据所在的内存区域映射到了高速缓存24,操作系统原语的代码和访问的数据也被加载到高速缓存24。之后,缓存控制器23可锁定指定的高速缓存区域,使其所映射的内存地址不会发生改变,从而避免控制器将高速缓存区域映射到其他地址。In the initialization phase after program startup, cache controller 23 loads operating system primitives into cache 24 . The specific process includes: prohibiting the work of the cache 24; allowing the designated cache area to load data; accessing the designated memory area in the memory 30 to load the primitives and access data of the operating system in the memory area into the cache 24 designated Cache area; allows Cache 24 to function properly. After these steps are completed, it is ensured that the code of the operating system primitive and the memory area where the accessed data is located are mapped to the cache 24 , and the code of the operating system primitive and the accessed data are also loaded into the cache 24 . After that, the cache controller 23 can lock the designated cache area so that the mapped memory address will not change, thereby preventing the controller from mapping the cache area to other addresses.
在一些实施例中,操作操作原语的执行时间小于1微秒(μm)。In some embodiments, the execution time of an operation primitive is less than 1 microsecond (μm).
在一实施例中,数据流从非实时任务流向强实时电机控制任务时,使用无锁队列,从而降低延迟。反过来,非实时任务读取强实时电机控制任务的反馈数据,并对数据进行“写”控制。In one embodiment, a lock-free queue is used to reduce latency when data flows from non-real-time tasks to strong real-time motor control tasks. In turn, the non-real-time tasks read the feedback data from the strong real-time motor control tasks and "write" the data.
图3是根据本发明第一实施例的控制器的示例运行过程。参考图3所示,处理核心21在运动控制过程中产生运动控制数据,并根据运动控制数据进行电机控制,产生驱动控制信号给电机驱动器31,由电机驱动器31输出电流控制电机32运转。从电机32处采集的反馈数据,可反馈到处理核心21。反馈数据可包括位置数据、速度数据、力矩数据和电流数据中的一部分或全部。FIG. 3 is an example operation process of the controller according to the first embodiment of the present invention. Referring to FIG. 3 , the processing core 21 generates motion control data during the motion control process, performs motor control according to the motion control data, generates a drive control signal to the motor driver 31 , and the motor driver 31 outputs current to control the motor 32 to run. Feedback data collected from the motor 32 can be fed back to the processing core 21 . Feedback data may include some or all of position data, velocity data, torque data, and current data.
图4是根据本发明第二实施例的控制器的电路框图。参考图4所示,本实施例的一种集成运动控制和电机控制的控制器40可进一步包括处理核心21、缓存控制器23、高速缓存(cache)24和可编程逻辑器件(PLD)42。处理核心21,配置为执行操作系统、运动控制和电机控制。PLD 42耦接处理核心21,与处理核心21协同进行电机控制。在此实施例中,处理核心21、缓存控制器23、高速缓存24和PLD 42集成在同一个处理芯片中。4 is a circuit block diagram of a controller according to a second embodiment of the present invention. Referring to FIG. 4 , an integrated motion control and motor control controller 40 of this embodiment may further include a processing core 21 , a cache controller 23 , a cache 24 and a programmable logic device (PLD) 42 . The processing core 21 is configured to execute the operating system, motion control and motor control. The PLD 42 is coupled to the processing core 21 and cooperates with the processing core 21 to perform motor control. In this embodiment, the processing core 21, the cache controller 23, the cache 24 and the PLD 42 are integrated in the same processing chip.
与前一实施例不同的是,本实施例引入了PLD 42,PLD 42具有并行计算快速的特点,因此当电机轴数多时,这是一个明显的优势。PLD 42与处理核 心21耦接以实现协调。在此,耦接的方式例如是通过处理器与PLD之间的接口41来实现。一些SoC芯片,如Altera公司的Cyclone V芯片提供了这样的接口。在各实施例中,PLD 42的类型可以是现场可编程门阵列(Field Programmable Gate Array,FPGA)。Different from the previous embodiment, this embodiment introduces a PLD 42, and the PLD 42 has the characteristics of fast parallel calculation, so when the number of motor shafts is large, this is an obvious advantage. PLD 42 is coupled to processing core 21 for coordination. Here, the manner of coupling is realized, for example, through the interface 41 between the processor and the PLD. Some SoC chips, such as Altera's Cyclone V chip, provide such an interface. In various embodiments, the type of PLD 42 may be a Field Programmable Gate Array (FPGA).
在一实施例中,处理核心21与PLD 42组成电机控制器,协同执行电机控制任务,根据处理核心21计算出的电机给定值去控制电机驱动器31,驱动电机32又快又稳地达到电机给定值的要求。In one embodiment, the processing core 21 and the PLD 42 form a motor controller, which cooperates to perform motor control tasks, controls the motor driver 31 according to the motor given value calculated by the processing core 21, and drives the motor 32 to reach the motor quickly and stably. requirements for a given value.
在各实施例中,可在组合为电机控制器的处理核心21和PLD 42之间分配电机控制任务。当处理核心21和PLD 42的组合协同负责位置环计算、速度环计算和电流环计算时,分配电机控制任务的方式例如是:处理核心21负责电流环计算,PLD 42负责速度环计算和位置环计算;或者处理核心21负责位置环计算和速度环计算,PLD 42负责电流环计算。当处理核心21和PLD 42的组合仅协同负责位置环计算、速度环计算和电流环计算中的一部分,例如速度环计算和电流环计算时,任务在处理核心21和PLD 42间的分配可相应地调整。例如处理核心21负责速度环计算、PLD 42负责电流环计算。本实施例的其他细节可参考第一实施例,在此不再展开。In various embodiments, motor control tasks may be distributed between processing core 21 and PLD 42 combined as a motor controller. When the combination of the processing core 21 and the PLD 42 is responsible for the calculation of the position loop, the calculation of the speed loop and the calculation of the current loop, the way of assigning the motor control tasks is for example: the processing core 21 is responsible for the calculation of the current loop, and the PLD 42 is responsible for the calculation of the speed loop and the position loop. calculation; or the processing core 21 is responsible for the position loop calculation and the velocity loop calculation, and the PLD 42 is responsible for the current loop calculation. When the combination of the processing core 21 and the PLD 42 is only responsible for a part of the position loop calculation, the velocity loop calculation and the current loop calculation, such as the velocity loop calculation and the current loop calculation, the assignment of tasks between the processing core 21 and the PLD 42 can be corresponding ground adjustment. For example, the processing core 21 is responsible for the speed loop calculation, and the PLD 42 is responsible for the current loop calculation. For other details of this embodiment, reference may be made to the first embodiment, which will not be described here.
图5是根据本发明第二实施例的控制器的示例运行过程。参考图5所示,处理核心21在运动控制过程中可产生运动控制数据。处理核心21和PLD 42进一步可根据运动控制数据进行电机控制,产生驱动控制信号给电机驱动器31,由电机驱动器31输出电流控制电机32运转。在此,假设处理核心21处理位置环和速度环计算,而PLD 42处理电流环计算。从电机32处采集的反馈数据,可反馈到处理核心21。反馈数据可包括位置数据、速度数据、力矩数据和电流数据中的一部分或全部。根据应用需求,也可以完全没有反馈数据,形成局部开环或全开环控制,这不会影响整个控制系统的基本功能的实现及其性能。本实施例的其他细节可参考第一实施例和第二实施例,在此不再展开。FIG. 5 is an example operation process of the controller according to the second embodiment of the present invention. Referring to FIG. 5 , the processing core 21 may generate motion control data during the motion control process. The processing core 21 and the PLD 42 can further perform motor control according to the motion control data, generate a drive control signal to the motor driver 31, and the motor driver 31 outputs current to control the operation of the motor 32. Here, it is assumed that the processing core 21 handles the position loop and velocity loop calculations, while the PLD 42 handles the current loop calculations. Feedback data collected from the motor 32 can be fed back to the processing core 21 . Feedback data may include some or all of position data, velocity data, torque data, and current data. According to the application requirements, there can be no feedback data at all to form partial open-loop or full open-loop control, which will not affect the realization and performance of the basic functions of the entire control system. For other details of this embodiment, reference may be made to the first embodiment and the second embodiment, which will not be described here.
图6是根据本发明第三实施例的控制器的电路框图。参考图6所示,本实施例的控制器60可包括由多个处理核心组成的第一处理器61、PLD 62和高速缓存63。与第二实施例不同的是,本实施例中,包括处理核心1至N(N为正整数)的多个处理核心作为第一处理器61,以对称多处理(SMP)模式运行操 作系统。6 is a circuit block diagram of a controller according to a third embodiment of the present invention. Referring to FIG. 6 , the controller 60 of this embodiment may include a first processor 61 composed of a plurality of processing cores, a PLD 62 and a cache 63 . Different from the second embodiment, in this embodiment, a plurality of processing cores including processing cores 1 to N (N is a positive integer) are used as the first processor 61 to run the operating system in symmetric multiprocessing (SMP) mode.
对第一处理器61来说,操作系统和运动控制任务的运行可以在多个处理核心间分配。PLD 62耦接第一处理器61,与第一处理器61协同进行电机控制。参考第一实施例可知,PLD 62可以省略,此时仅由第一处理器61进行电机控制。For the first processor 61, the execution of the operating system and motion control tasks may be distributed among multiple processing cores. The PLD 62 is coupled to the first processor 61 and cooperates with the first processor 61 to perform motor control. Referring to the first embodiment, the PLD 62 can be omitted, and only the first processor 61 performs motor control at this time.
图7是根据本发明第四实施例的控制器的电路框图。参考图7所示,本实施例的的控制器70可包括第一处理核心21、第二处理核心22、缓存控制器23、高速缓存(cache)24和可编程逻辑器件(PLD)72。第一处理核心21,配置为执行第一操作系统和电机控制。第二处理核心22,配置为执行第二操作系统和运动控制。第二操作系统和第一操作系统不同。高速缓存24耦接到第一处理核心21和第二处理核心22。第一处理核心21和第二处理核心22配置为在运动控制和电机控制期间,通过高速缓存24进行数据交互。可编程逻辑器件(PLD)72耦接第一处理核心21,与第一处理核心21组成电机控制器,协同进行电机控制。第一处理核心21、第二处理核心22、缓存控制器23、高速缓存(cache)24和PLD72集成在同一芯片中。7 is a circuit block diagram of a controller according to a fourth embodiment of the present invention. Referring to FIG. 7 , the controller 70 of this embodiment may include a first processing core 21 , a second processing core 22 , a cache controller 23 , a cache (cache) 24 and a programmable logic device (PLD) 72 . The first processing core 21 is configured to execute the first operating system and motor control. The second processing core 22 is configured to execute a second operating system and motion control. The second operating system is different from the first operating system. The cache 24 is coupled to the first processing core 21 and the second processing core 22 . The first processing core 21 and the second processing core 22 are configured to exchange data through the cache 24 during motion control and motor control. The programmable logic device (PLD) 72 is coupled to the first processing core 21 , and forms a motor controller with the first processing core 21 to perform motor control in cooperation. The first processing core 21, the second processing core 22, the cache controller 23, the cache 24 and the PLD 72 are integrated in the same chip.
与第二实施例不同的是,本实施例引入了第二处理核心22。第二处理核心22运行通用操作系统,例如有实时补丁的Linux系统。这类操作系统生态完善,实时性偏弱。第一处理核心21仍然运行小型强实时系统。根据第一处理核心21和第二处理核心22的配置,二者常态地形成非对称多路处理结构(AMP)。第一处理核心41完成运动任务解析、上位机通信等功能。具体而言,用户程序在上位机的人机交互界面编辑好后,上位机通过网线把用户程序传输到控制器70,程序的解析由第二处理核心22完成,第二处理核心22会把用户指令解析成运动控制器能够识别的指令。Different from the second embodiment, this embodiment introduces a second processing core 22 . The second processing core 22 runs a general-purpose operating system, such as a Linux system with real-time patches. This kind of operating system is ecologically sound, and its real-time performance is weak. The first processing core 21 still runs a small strong real-time system. According to the configuration of the first processing core 21 and the second processing core 22, both normally form an asymmetric multiplexing structure (AMP). The first processing core 41 completes functions such as motion task analysis and host computer communication. Specifically, after the user program is edited on the human-computer interaction interface of the upper computer, the upper computer transmits the user program to the controller 70 through the network cable, and the analysis of the program is completed by the second processing core 22. Commands are parsed into commands that the motion controller can recognize.
系统的备份和恢复、数据文件和日志文件的分类记录和管理等文件管理功能在第二处理核心22里实现。The file management functions such as system backup and recovery, classification, recording and management of data files and log files are implemented in the second processing core 22 .
状态管理模块运行在第二处理核心22。监控的状态包括外部设备的状态、运动控制器的状态和电机控制器的状态等。驱控一体的控制器70会根据状态管理模块收集的状态作出相应的处理,还会把一些状态信息通过网络传输给上位机。The state management module runs on the second processing core 22 . The monitored states include the state of external devices, the state of the motion controller, and the state of the motor controller, etc. The controller 70 with integrated drive and control will perform corresponding processing according to the status collected by the status management module, and will also transmit some status information to the upper computer through the network.
第二处理核心22通过运行运动控制任务,可以规划出控制器70所控制的设备的各个轴在不同时间的位置值、速度值、转矩值或其组合,作为电机给定值。也就是说,电机给定值可以是前述3个值中的任意一种或几种。第二处理核心22可在预定的时间点(或提前一个确定、明确的时间量)上将对应的电机给定值输出给第一处理核心21执行。在另一实施例中,第一处理核心21和第二处理核心22协调完成运动规划任务。By running the motion control task, the second processing core 22 can plan the position value, speed value, torque value or combination thereof at different times of each axis of the device controlled by the controller 70 as the motor given value. That is to say, the given value of the motor can be any one or several of the above three values. The second processing core 22 may output the corresponding motor given value to the first processing core 21 for execution at a predetermined time point (or a definite and definite amount of time in advance). In another embodiment, the first processing core 21 and the second processing core 22 coordinate to complete the motion planning task.
第一处理核心21根据计算出的电机给定值控制电机驱动器,驱动电机又快又稳地达到电机给定值的要求。电机控制中会涉及到电流环计算、速度环计算和/或位置环计算。根据电机给定值不同所需要计算的控制环也不同。一般情况下,当电机给定值为位置值时,计算所有三个环;当电机给定值为速度值时,计算电流环和速度环;当电机给定值为力矩时,计算电流环。由此,电机控制器的电机控制任务可以选择性地进行电流环计算,或者进行电流环计算与速度环计算,或者电流环计算与位置环计算,或者进行电流环计算、速度环计算与位置环计算。第一处理核心21和PLD 42之间的任务可以进行各种可能的分配,如位置环计算在第一处理核心21进行,其他环在PLD 42进行,或者位置环和速度环计算都在第一处理核心21进行,而电流环计算在PLD 42进行。这主要取决于控制环路计算速率的要求和硬件平台的性能限制。The first processing core 21 controls the motor driver according to the calculated motor given value, and drives the motor to meet the requirements of the motor given value quickly and stably. Current loop calculations, velocity loop calculations and/or position loop calculations are involved in motor control. The control loop that needs to be calculated varies according to the given value of the motor. In general, when the motor set value is the position value, all three loops are calculated; when the motor set value is the speed value, the current loop and the speed loop are calculated; when the motor set value is the torque, the current loop is calculated. Thereby, the motor control task of the motor controller can selectively perform current loop calculation, or current loop calculation and speed loop calculation, or current loop calculation and position loop calculation, or current loop calculation, speed loop calculation and position loop calculation. calculate. The tasks between the first processing core 21 and the PLD 42 can be allocated in various possible ways, such as the position loop calculation is performed in the first processing core 21, other loops are performed in the PLD 42, or both the position loop and the velocity loop are calculated in the first. Processing core 21 is performed while current loop calculations are performed at PLD 42. This mainly depends on the requirements of the control loop calculation rate and the performance constraints of the hardware platform.
在本实施例中,第一处理核心21和第二处理核心22虽然使用AMP模式,但是可以共享高速缓存24。即第一处理核心21和第二处理核心2242配置为在运动控制和电机控制期间,通过高速缓存24进行数据交互。具体地说,在运动控制期间,第一处理核心21可以将运动控制数据(如电机给定值)写入高速缓存24中,第二处理核心22则可以从高速缓存24读取运动控制数据。如前所述,在各实例中,运动控制数据包括位置数据、速度数据、力矩数据和/或电流数据,根据第一处理核心21和第二处理核心22之间的任务分配而定。相应地,第一处理核心21可将反馈数据写入高速缓存24中,第二处理核心22从高速缓存43读取反馈数据。相应于运动控制数据的类型,反馈数据可包括位置数据、速度数据、力矩数据和/或电流数据。例如当运动控制数据是位置数据时,反馈数据一般包括位置数据,也可包括速度数据、电流数据。当运动控制数据是速度数据时,反馈数据一般包括速度数据,也可包括位置数据、电 流数据。当然可以理解,反馈数据可以与运动控制数据无关。例如反馈数据常态地包括位置数据、速度数据、力矩数据和电流数据中的任意一种或几种;甚至根据应用场合需要直接反馈终端执行器的位置或姿态数据给运动控制处理器也是可行的(例如无人机的姿态、速度,或者电动汽车的姿态、速度)。In this embodiment, although the first processing core 21 and the second processing core 22 use the AMP mode, they can share the cache 24 . That is, the first processing core 21 and the second processing core 2242 are configured to perform data interaction through the cache 24 during motion control and motor control. Specifically, during motion control, the first processing core 21 can write motion control data (eg, motor given values) into the cache 24 , and the second processing core 22 can read the motion control data from the cache 24 . As previously mentioned, in each instance, the motion control data includes position data, velocity data, torque data, and/or current data, depending on the assignment of tasks between the first processing core 21 and the second processing core 22 . Accordingly, the first processing core 21 can write the feedback data into the cache 24 , and the second processing core 22 reads the feedback data from the cache 43 . Corresponding to the type of motion control data, the feedback data may include position data, velocity data, torque data and/or current data. For example, when the motion control data is position data, the feedback data generally includes position data, and may also include speed data and current data. When the motion control data is speed data, the feedback data generally includes speed data, and may also include position data and current data. It will of course be appreciated that the feedback data may be independent of the motion control data. For example, the feedback data normally includes any one or more of position data, speed data, torque data and current data; it is even feasible to directly feed back the position or attitude data of the end effector to the motion control processor according to the application situation ( For example, the attitude and speed of a drone, or the attitude and speed of an electric car).
在图未示的实施例中,第一处理核心21和/或第二处理核心22的数量可以是多个,从而分别扩展成多核的第一处理器和/或第二处理器。In the embodiment not shown in the figure, the number of the first processing cores 21 and/or the second processing cores 22 may be multiple, so as to be expanded into multi-core first processors and/or second processors respectively.
图8是根据本发明第四实施例的控制器的示例运行过程。参考图8所示,第二处理核心22在运动控制过程中可产生运动控制数据给第一处理核心21。第一处理核心21和PLD72可根据运动控制数据进行电机控制,产生驱动控制信号给电机驱动器31,由电机驱动器31输出电流控制电机32运转。在此,假设第一处理核心21处理位置环和速度环计算,而PLD 72处理电流环计算。从电机32处采集的第一反馈数据,可反馈到第一处理核心21。第一处理核心21可向第二处理核心22反馈第二反馈数据。第一反馈数据可包括位置数据、速度数据、力矩数据和电流数据中的一部分或全部。第二反馈数据可以是完全来自第一反馈数据。第二反馈数据也可以不是完全来自第一反馈数据。例如第二反馈数据可以包括第一处理核心21产生的数据。根据应用需求,也可以完全没有第一反馈数据或第二反馈数据,形成局部开环或全开环控制,这不会影响整个控制系统的基本功能的实现及其性能。FIG. 8 is an example operation process of the controller according to the fourth embodiment of the present invention. Referring to FIG. 8 , the second processing core 22 may generate motion control data to the first processing core 21 during the motion control process. The first processing core 21 and the PLD 72 can control the motor according to the motion control data, generate a drive control signal to the motor driver 31 , and the motor driver 31 outputs current to control the motor 32 to run. Here, it is assumed that the first processing core 21 handles the position loop and velocity loop calculations, while the PLD 72 handles the current loop calculations. The first feedback data collected from the motor 32 can be fed back to the first processing core 21 . The first processing core 21 may feed back the second feedback data to the second processing core 22 . The first feedback data may include some or all of position data, velocity data, torque data, and current data. The second feedback data may be derived entirely from the first feedback data. The second feedback data may also not come entirely from the first feedback data. For example, the second feedback data may include data generated by the first processing core 21 . According to application requirements, there may be no first feedback data or second feedback data at all, forming partial open-loop or full open-loop control, which will not affect the realization and performance of the basic functions of the entire control system.
图9是根据本发明一实施例的运行电机控制的方法流程图。参考图9所示,此方法包括如下步骤:9 is a flowchart of a method of operating motor control according to an embodiment of the present invention. Referring to Figure 9, the method includes the following steps:
在步骤901,启动第一处理器;In step 901, start the first processor;
在步骤902,在第一处理器上运行第一操作系统;At step 902, a first operating system is run on the first processor;
在步骤903,通过缓存控制器加载第一操作系统的原语到高速缓存,并锁定高速缓存;In step 903, the primitive of the first operating system is loaded into the cache by the cache controller, and the cache is locked;
在步骤904,在第一处理器的中断服务程序中运行电机控制。At step 904, motor control is run in the interrupt service routine of the first processor.
根据前述第一实施例的架构,第一处理器包括单个处理核心21。此时方法在步骤902中还包括在第一处理器运行运动规划。According to the architecture of the aforementioned first embodiment, the first processor includes a single processing core 21 . At this point the method in step 902 further includes running the motion planning on the first processor.
根据前述第二实施例的架构,控制器还包括PLD 42,此时还包括在PLD 42上与第一处理器协同进行电机控制。According to the architecture of the aforementioned second embodiment, the controller further includes a PLD 42, and at this time it also includes performing motor control on the PLD 42 in cooperation with the first processor.
根据前述第三实施例的架构,第一处理器包括多个处理核心。此时在步骤902中,在第一处理器上以对称多处理模式运行第一操作系统,且运行运动规划。According to the architecture of the aforementioned third embodiment, the first processor includes a plurality of processing cores. At this point in step 902, the first operating system is run in the symmetric multiprocessing mode on the first processor, and the motion planning is executed.
根据前述第四实施例的架构,控制器还包括由第二处理核心22组成的第二处理器。此时方法还包括:在步骤901启动第二处理器,在步骤902中在第二处理器上运行第二操作系统和运动控制,第二操作系统不同于第一操作系统。According to the architecture of the aforementioned fourth embodiment, the controller further includes a second processor composed of the second processing core 22 . At this time, the method further includes: starting the second processor in step 901, and running a second operating system and motion control on the second processor in step 902, where the second operating system is different from the first operating system.
如前文所述,第一操作系统包括代码段、数据段、第一标识和第二标识,用于将将操作系统原语和访问数据加载到指定的内存区域。这一步骤的实现方法如图10所示,包括以下步骤。在步骤1001,在链接文件里定义代码段和数据段,所代码段和数据段分别对应指定的内存区域。在步骤1002,在第一操作系统的源码中,定义第一操作系统的原语时添加第一标识,第一标识用于指定链接器将第一操作系统的原语放到代码段中;在步骤1003,在第一操作系统的源码中,定义第一操作系统的原语的访问数据时添加第二标识,第一标识用于指定链接器将访问数据放到数据段中。在步骤1004,编译第一操作系统的源码并链接为可执行程序。在步骤1005,第一操作系统启动后会将数据段和代码段加载到指定的内存区域。在步骤1006,缓存控制器将数据段和代码段从指定的内存区域加载到指定的缓存区域。这一步骤的流程已经于前文描述。As mentioned above, the first operating system includes a code segment, a data segment, a first identifier and a second identifier, and is used to load operating system primitives and access data into a designated memory area. The implementation method of this step is shown in Figure 10, and includes the following steps. In step 1001, a code segment and a data segment are defined in the link file, and the code segment and the data segment respectively correspond to the designated memory areas. In step 1002, in the source code of the first operating system, a first identifier is added when defining the primitives of the first operating system, and the first identifier is used to designate the linker to put the primitives of the first operating system into the code segment; Step 1003 , in the source code of the first operating system, add a second identifier when defining the access data of the primitive of the first operating system, and the first identifier is used to designate the linker to put the access data in the data segment. In step 1004, the source code of the first operating system is compiled and linked into an executable program. In step 1005, after the first operating system is started, the data segment and the code segment are loaded into the designated memory area. At step 1006, the cache controller loads the data segment and the code segment from the designated memory area into the designated cache area. The flow of this step has been described above.
本申请中使用了流程图用来说明根据本申请的实施例的系统所执行的操作。应当理解的是,前面或下面操作不一定按照顺序来精确地执行。相反,可以按照倒序或同时处理各种步骤。同时,或将其他操作添加到这些过程中,或从这些过程移除某一步或数步操作。Flow diagrams are used in this application to illustrate operations performed by a system according to an embodiment of the application. It should be understood that the preceding or following operations are not necessarily performed in exact order. Rather, the various steps may be processed in reverse order or concurrently. At the same time, other actions are either added to these processes, or a step or steps are removed from these processes.
上文已对基本概念做了描述,显然,对于本领域技术人员来说,上述发明披露仅仅作为示例,而并不构成对本申请的限定。虽然此处并没有明确说明,本领域技术人员可能会对本申请进行各种修改、改进和修正。该类修改、改进和修正在本申请中被建议,所以该类修改、改进、修正仍属于本申请示范实施例的精神和范围。The basic concept has been described above. Obviously, for those skilled in the art, the above disclosure of the invention is only an example, and does not constitute a limitation to the present application. Although not explicitly described herein, various modifications, improvements, and corrections to this application may occur to those skilled in the art. Such modifications, improvements, and corrections are suggested in this application, so such modifications, improvements, and corrections still fall within the spirit and scope of the exemplary embodiments of this application.
同时,本申请使用了特定词语来描述本申请的实施例。如“一个实施例”、“一实施例”、和/或“一些实施例”意指与本申请至少一个实施例相关的某一特征、结构或特点。因此,应强调并注意的是,本说明书中在不同位置两次 或多次提及的“一实施例”或“一个实施例”或“一替代性实施例”并不一定是指同一实施例。此外,本申请的一个或多个实施例中的某些特征、结构或特点可以进行适当的组合。Meanwhile, the present application uses specific words to describe the embodiments of the present application. Such as "one embodiment," "an embodiment," and/or "some embodiments" means a certain feature, structure, or characteristic associated with at least one embodiment of the present application. Therefore, it should be emphasized and noted that two or more references to "an embodiment" or "one embodiment" or "an alternative embodiment" in different places in this specification are not necessarily referring to the same embodiment . Furthermore, certain features, structures or characteristics of the one or more embodiments of the present application may be combined as appropriate.
本申请的一些方面可以完全由硬件执行、可以完全由软件(包括固件、常驻软件、微码等)执行、也可以由硬件和软件组合执行。以上硬件或软件均可被称为“数据块”、“模块”、“引擎”、“单元”、“组件”或“系统”。处理器可以是一个或多个专用集成电路(ASIC)、数字信号处理器(DSP)、数字信号处理器件(DAPD)、可编程逻辑器件(PLD)、现场可编程门阵列(FPGA)、处理器、控制器、微控制器、微处理器或者其组合。此外,本申请的各方面可能表现为位于一个或多个计算机可读介质中的计算机产品,该产品包括计算机可读程序编码。例如,计算机可读介质可包括,但不限于,磁性存储设备(例如,硬盘、软盘、磁带……)、光盘(例如,压缩盘CD、数字多功能盘DVD……)、智能卡以及闪存设备(例如,卡、棒、键驱动器……)。Some aspects of the present application may be performed entirely in hardware, entirely in software (including firmware, resident software, microcode, etc.), or in a combination of hardware and software. The above hardware or software may be referred to as a "data block", "module", "engine", "unit", "component" or "system". The processor may be one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DAPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), processors , controller, microcontroller, microprocessor, or a combination thereof. Furthermore, aspects of the present application may be embodied as a computer product comprising computer readable program code embodied in one or more computer readable media. For example, computer readable media may include, but are not limited to, magnetic storage devices (eg, hard disks, floppy disks, magnetic tapes, ...), optical disks (eg, compact disc CD, digital versatile disk DVD, ...), smart cards, and flash memory devices ( For example, cards, sticks, key drives...).
计算机可读介质可能包含一个内含有计算机程序编码的传播数据信号,例如在基带上或作为载波的一部分。该传播信号可能有多种表现形式,包括电磁形式、光形式等等、或合适的组合形式。计算机可读介质可以是除计算机可读存储介质之外的任何计算机可读介质,该介质可以通过连接至一个指令执行系统、装置或设备以实现通讯、传播或传输供使用的程序。位于计算机可读介质上的程序编码可以通过任何合适的介质进行传播,包括无线电、电缆、光纤电缆、射频信号、或类似介质、或任何上述介质的组合。A computer-readable medium may contain a propagated data signal with the computer program code embodied therein, for example, on baseband or as part of a carrier wave. The propagating signal may take a variety of manifestations, including electromagnetic, optical, etc., or a suitable combination. A computer-readable medium can be any computer-readable medium other than a computer-readable storage medium that can communicate, propagate, or transmit a program for use by being coupled to an instruction execution system, apparatus, or device. Program code on a computer readable medium may be propagated by any suitable medium, including radio, cable, fiber optic cable, radio frequency signal, or the like, or a combination of any of the foregoing.
同理,应当注意的是,为了简化本申请披露的表述,从而帮助对一个或多个发明实施例的理解,前文对本申请实施例的描述中,有时会将多种特征归并至一个实施例、附图或对其的描述中。但是,这种披露方法并不意味着本申请对象所需要的特征比权利要求中提及的特征多。实际上,实施例的特征要少于上述披露的单个实施例的全部特征。Similarly, it should be noted that, in order to simplify the expressions disclosed in the present application and thus help the understanding of one or more embodiments of the invention, in the foregoing description of the embodiments of the present application, various features are sometimes combined into one embodiment, in the drawings or descriptions thereof. However, this method of disclosure does not imply that the subject matter of the application requires more features than those mentioned in the claims. Indeed, there are fewer features of an embodiment than all of the features of a single embodiment disclosed above.
一些实施例中使用了描述成分、属性数量的数字,应当理解的是,此类用于实施例描述的数字,在一些示例中使用了修饰词“大约”、“近似”或“大体上”来修饰。除非另外说明,“大约”、“近似”或“大体上”表明所述数字允许有±20%的变化。相应地,在一些实施例中,说明书和权利要求中使用的 数值参数均为近似值,该近似值根据个别实施例所需特点可以发生改变。在一些实施例中,数值参数应考虑规定的有效数位并采用一般位数保留的方法。尽管本申请一些实施例中用于确认其范围广度的数值域和参数为近似值,在具体实施例中,此类数值的设定在可行范围内尽可能精确。Some examples use numbers to describe quantities of ingredients and attributes, it should be understood that such numbers used to describe the examples, in some examples, use the modifiers "about", "approximately" or "substantially" to retouch. Unless stated otherwise, "about", "approximately" or "substantially" means that a variation of ±20% is allowed for the stated number. Accordingly, in some embodiments, the numerical parameters set forth in the specification and claims are approximations that can vary depending upon the desired characteristics of individual embodiments. In some embodiments, the numerical parameters should take into account the specified significant digits and use a general digit reservation method. Notwithstanding that the numerical fields and parameters used in some embodiments of the present application to confirm the breadth of their ranges are approximations, in particular embodiments such numerical values are set as precisely as practicable.
虽然本申请已参照当前的具体实施例来描述,但是本技术领域中的普通技术人员应当认识到,以上的实施例仅是用来说明本申请,在没有脱离本申请精神的情况下还可作出各种等效的变化或替换,因此,只要在本申请的实质精神范围内对上述实施例的变化、变型都将落在本申请的权利要求书的范围内。Although the present application has been described with reference to the current specific embodiments, those skilled in the art should recognize that the above embodiments are only used to illustrate the present application, and can be made without departing from the spirit of the present application. Various equivalent changes or substitutions, therefore, as long as the changes and modifications to the above-mentioned embodiments within the spirit and scope of the present application, all fall within the scope of the claims of the present application.

Claims (19)

  1. 一种适于执行电机控制的控制器,包括:A controller adapted to perform motor control, comprising:
    第一处理器,配置为运行第一操作系统和电机控制,其中所述电机控制运行于所述第一处理器的中断服务程序中;a first processor configured to run a first operating system and a motor control, wherein the motor control runs in an interrupt service routine of the first processor;
    耦接到所述第一处理器的高速缓存;以及a cache coupled to the first processor; and
    缓存控制器,用于加载所述第一操作系统的原语到所述高速缓存,并锁定所述高速缓存;a cache controller for loading primitives of the first operating system into the cache and locking the cache;
    其中所述第一处理器、所述高速缓存和所述缓存控制器集成在同一芯片中。Wherein the first processor, the cache and the cache controller are integrated in the same chip.
  2. 根据权利要求1所述的控制器,其特征在于,所述第一处理器包括单个处理核心,且所述第一处理器还配置为运行运动规划。The controller of claim 1, wherein the first processor comprises a single processing core, and wherein the first processor is further configured to execute motion planning.
  3. 根据权利要求1所述的控制器,其特征在于,所述第一处理器包括多个处理核心,所述多个处理核心以对称多处理模式运行所述第一操作系统,且还配置为运行运动规划。The controller of claim 1, wherein the first processor includes a plurality of processing cores that run the first operating system in a symmetric multiprocessing mode and are further configured to run exercise planning.
  4. 根据权利要求1所述的控制器,其特征在于,还包括:The controller of claim 1, further comprising:
    第二处理器,配置为运行第二操作系统和运动控制,所述第二操作系统不同于所述第一操作系统;a second processor configured to run a second operating system and motion control, the second operating system being different from the first operating system;
    其中所述第一处理器与所述第二处理器集成在所述同一芯片中。Wherein the first processor and the second processor are integrated in the same chip.
  5. 根据权利要求4所述的控制器,其特征在于,所述第一处理器包括第一处理核心组合,所述第二处理器包括第二处理核心组合,所述第一处理核心组合和所述第二处理核心组合分别包括一个或多个处理核心。5. The controller of claim 4, wherein the first processor includes a first combination of processing cores, the second processor includes a second combination of processing cores, the first combination of processing cores and the The second processing core groups each include one or more processing cores.
  6. 根据权利要求1-5任一项所述的控制器,其特征在于,还包括可编程逻辑器件,耦接所述第一处理器,与所述第一处理器协同进行电机控制。The controller according to any one of claims 1-5, further comprising a programmable logic device, coupled to the first processor, and performing motor control in cooperation with the first processor.
  7. 根据权利要求6所述的控制器,其特征在于,所述可编程逻辑器件与所述第一处理器和所述第二处理器集成在所述同一芯片中。The controller of claim 6, wherein the programmable logic device is integrated with the first processor and the second processor in the same chip.
  8. 根据权利要求1所述的控制器,其特征在于,所述电机控制包括电流环计算,或者包括电流环计算与速度环计算和/或位置环计算的组合。The controller of claim 1, wherein the motor control includes a current loop calculation, or a combination of a current loop calculation and a speed loop calculation and/or a position loop calculation.
  9. 根据权利要求6所述的控制器,其特征在于,所述可编程控制器执行电流环计算,所述第一处理器执行速度环计算和/或位置环计算。6. The controller of claim 6, wherein the programmable controller performs current loop calculations, and the first processor performs velocity loop calculations and/or position loop calculations.
  10. 根据权利要求1所述的控制器,其特征在于,还包括所述第一操作系统的 至少一部分,其包括:The controller of claim 1, further comprising at least a portion of the first operating system, comprising:
    代码段和数据段,所述代码段和数据段分别对应指定的内存区域;A code segment and a data segment, the code segment and the data segment respectively correspond to the specified memory area;
    第一标识,第一标识用于指定链接器将所述第一操作系统的原语放到所述代码段中;a first identifier, where the first identifier is used to specify that the linker puts the primitive of the first operating system into the code segment;
    第二标识,用于指定链接器将所述第一操作系统的原语的访问数据放到所述数据段中;The second identifier is used to specify that the linker puts the access data of the primitive of the first operating system into the data segment;
    其中所述第一操作系统配置为在启动后将所述代码段和数据段加载到所述指定的内存区域。The first operating system is configured to load the code segment and the data segment into the designated memory area after being started.
  11. 根据权利要求1所述的控制器,其特征在于,所述缓存控制器加载所述第一操作系统的原语到所述高速缓存的步骤包括:The controller of claim 1, wherein the step of the cache controller loading the primitives of the first operating system into the cache comprises:
    禁止所述高速缓存的工作;disable the operation of the cache;
    允许指定的高速缓存区域加载数据;Allows the specified cache area to load data;
    访问指定的内存区域以将所述内存区域中的所述第一操作系统的原语和访问数据加载到所述高速缓存区域;以及accessing a designated memory area to load primitives and access data of the first operating system in the memory area into the cache area; and
    允许所述高速缓存正常工作。The cache is allowed to function properly.
  12. 一种在控制器上运行电机控制的方法,所述控制器包括第一处理器、缓存控制器和耦接到所述第一处理器的高速缓存,且所述第一处理器、所述高速缓存和所述缓存控制器集成在同一芯片中,所述方法包括以下步骤:A method of running motor control on a controller, the controller including a first processor, a cache controller, and a cache coupled to the first processor, and the first processor, the cache The cache and the cache controller are integrated in the same chip, and the method includes the following steps:
    启动所述第一处理器;starting the first processor;
    在所述第一处理器上运行所述第一操作系统;running the first operating system on the first processor;
    通过所述缓存控制器加载所述第一操作系统的原语到所述高速缓存,并锁定所述高速缓存;以及Loading, by the cache controller, primitives of the first operating system into the cache and locking the cache; and
    在所述第一处理器的中断服务程序中运行电机控制。Motor control is run in an interrupt service routine of the first processor.
  13. 根据权利要求12所述的方法,其特征在于,所述第一处理器包括单个处理核心,且所述方法还包括在所述第一处理器运行运动规划。13. The method of claim 12, wherein the first processor comprises a single processing core, and wherein the method further comprises running motion planning on the first processor.
  14. 根据权利要求12所述的方法,其特征在于,所述第一处理器包括多个处理核心,其中在所述第一处理器上以对称多处理模式运行所述第一操作系统,且运行运动规划。13. The method of claim 12, wherein the first processor includes a plurality of processing cores, wherein the first operating system is run in a symmetric multiprocessing mode on the first processor and a motion is executed planning.
  15. 根据权利要求12所述的方法,其特征在于,所述控制器还包括第二处理 器,与所述第一处理器集成在同一芯片中,所述方法还包括:The method according to claim 12, wherein the controller further comprises a second processor integrated with the first processor in the same chip, the method further comprising:
    启动所述第二处理器;以及starting the second processor; and
    在所述第二处理器上运行第二操作系统和运动控制,所述第二操作系统不同于所述第一操作系统。A second operating system and motion control run on the second processor, the second operating system being different from the first operating system.
  16. 根据权利要求12-15任一项所述的方法,其特征在于,所述控制器还包括可编程逻辑器件,耦接所述第一处理器且与所述第一处理器和所述第二处理器集成在所述同一芯片中,所述方法还包括:在所述可编程逻辑器件上与所述第一处理器协同进行电机控制。The method according to any one of claims 12-15, wherein the controller further comprises a programmable logic device coupled to the first processor and communicating with the first processor and the second processor The processor is integrated in the same chip, and the method further includes: performing motor control in cooperation with the first processor on the programmable logic device.
  17. 如权利要求12所述的方法,其特征在于,所述第一操作系统包括:The method of claim 12, wherein the first operating system comprises:
    代码段和数据段,所述代码段和数据段分别对应指定的内存区域;A code segment and a data segment, the code segment and the data segment respectively correspond to the specified memory area;
    第一标识,第一标识用于指定链接器将所述第一操作系统的原语放到所述代码段中;a first identifier, where the first identifier is used to specify that the linker puts the primitive of the first operating system into the code segment;
    第二标识,用于指定链接器将所述第一操作系统的原语的访问数据放到所述数据段中;The second identifier is used to specify that the linker puts the access data of the primitive of the first operating system into the data segment;
    所述方法还包括通过所述第一操作系统将所述代码段和数据段加载到所述指定的内存区域。The method also includes loading, by the first operating system, the code segment and the data segment into the designated memory area.
  18. 如权利要求12所述的方法,其特征在于,所述方法还包括:The method of claim 12, wherein the method further comprises:
    在链接文件里定义代码段和数据段,所述代码段和数据段分别对应指定的内存区域;A code segment and a data segment are defined in the link file, and the code segment and the data segment respectively correspond to the specified memory areas;
    在所述第一操作系统的源码中,定义所述第一操作系统的原语时添加第一标识,所述第一标识用于指定链接器将所述第一操作系统的原语放到所述代码段中;In the source code of the first operating system, a first identifier is added when defining the primitives of the first operating system, and the first identifier is used to designate the linker to place the primitives of the first operating system in all in the above code segment;
    在所述第一操作系统的源码中,定义所述第一操作系统的原语的访问数据时添加第二标识,所述第一标识用于指定链接器将所述访问数据放到所述数据段中;In the source code of the first operating system, a second identifier is added when defining the access data of the primitives of the first operating system, and the first identifier is used to designate the linker to place the access data in the data segment;
    编译所述第一操作系统的源码并链接为可执行程序。The source code of the first operating system is compiled and linked into an executable program.
  19. 一种控制系统,包括如权利要求1-11任一项所述的控制器。A control system comprising the controller of any one of claims 1-11.
PCT/CN2022/077106 2021-03-31 2022-02-21 Controller and control system adapted to performing motor control WO2022206214A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110348872.7A CN113067527A (en) 2021-03-31 2021-03-31 Controller and control system adapted to perform motor control
CN202110348872.7 2021-03-31

Publications (1)

Publication Number Publication Date
WO2022206214A1 true WO2022206214A1 (en) 2022-10-06

Family

ID=76565184

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/077106 WO2022206214A1 (en) 2021-03-31 2022-02-21 Controller and control system adapted to performing motor control

Country Status (2)

Country Link
CN (1) CN113067527A (en)
WO (1) WO2022206214A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113067527A (en) * 2021-03-31 2021-07-02 实时侠智能控制技术有限公司 Controller and control system adapted to perform motor control

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140025930A1 (en) * 2012-02-20 2014-01-23 Samsung Electronics Co., Ltd. Multi-core processor sharing li cache and method of operating same
CN103744342A (en) * 2014-01-22 2014-04-23 大连理工计算机控制工程有限公司 PAC (programmable automatic controller) real-time control system based on dual-core processor
CN109240191A (en) * 2018-04-25 2019-01-18 上海福赛特控制技术有限公司 The controller and control system of integrated motion control and motor control
CN110312997A (en) * 2016-12-15 2019-10-08 优创半导体科技有限公司 Atom primitive is realized using cache lines locking
CN110842920A (en) * 2019-11-12 2020-02-28 佛山智能装备技术研究院 Control and drive integrated system architecture of single processing chip
CN113067527A (en) * 2021-03-31 2021-07-02 实时侠智能控制技术有限公司 Controller and control system adapted to perform motor control

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140025930A1 (en) * 2012-02-20 2014-01-23 Samsung Electronics Co., Ltd. Multi-core processor sharing li cache and method of operating same
CN103744342A (en) * 2014-01-22 2014-04-23 大连理工计算机控制工程有限公司 PAC (programmable automatic controller) real-time control system based on dual-core processor
CN110312997A (en) * 2016-12-15 2019-10-08 优创半导体科技有限公司 Atom primitive is realized using cache lines locking
CN109240191A (en) * 2018-04-25 2019-01-18 上海福赛特控制技术有限公司 The controller and control system of integrated motion control and motor control
CN110842920A (en) * 2019-11-12 2020-02-28 佛山智能装备技术研究院 Control and drive integrated system architecture of single processing chip
CN113067527A (en) * 2021-03-31 2021-07-02 实时侠智能控制技术有限公司 Controller and control system adapted to perform motor control

Also Published As

Publication number Publication date
CN113067527A (en) 2021-07-02

Similar Documents

Publication Publication Date Title
JP6864664B2 (en) Controller that integrates motion control and motor control
US10452605B2 (en) Method and apparatus for task scheduling on heterogeneous multi-core reconfigurable computing platform
CN108958235B (en) Robot motion planning
WO2022206214A1 (en) Controller and control system adapted to performing motor control
Lloyd et al. Extending the RCCL programming environment to multiple robots and processors
CN103226344B (en) A kind of motion control on-chip system
JPS62229359A (en) Information processor
CN111427310A (en) Industrial robot controller operation system
CN103901822A (en) Multi-shaft linkage motion control system
WO2023165105A1 (en) Load balancing control method and apparatus, electronic device, storage medium, and computer program
US20110265093A1 (en) Computer System and Program Product
CN104903800A (en) Motion controller and robot control system using the same
EP4318221A1 (en) Driving control instruction generation method, heterogeneous computing method, related apparatuses and system
CN114690767A (en) Robot trajectory planning method and system and robot
CN203849591U (en) Multi-shaft linkage motion control system
CN105824270A (en) Multi-shaft motion controller and control method of closed-loop PWM pulse
CN201945835U (en) Embedded control system used for carton proofing machine
CN112148035A (en) Multi-unmanned aerial vehicle track optimization method and device, storage medium and computer equipment
CN113534744A (en) Software architecture and hardware architecture for forming numerical control system
EP4060487A1 (en) Electronic control unit, vehicle comprising the electronic control unit and computer-implemented method
WO2022143019A1 (en) Heterogeneous computing system and related device
CN114265578A (en) Embedded robot software framework and implementation method thereof
CN111199084B (en) Method and device for accessing dynamic model
WO2020147347A1 (en) Control device, control system and control method
CN116185921B (en) Log output method, system, equipment and medium for heterogeneous multi-core multi-domain

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22778399

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE