Disclosure of Invention
In view of this, embodiments of the present application provide a method and an apparatus for controlling multi-axis motion, which can quickly and efficiently implement multi-axis linkage control, and provide a solution with low cost, high efficiency, and high precision for multi-axis motion automation.
In one aspect, an embodiment of the present application provides an on-vehicle multi-axis motion control method, which is applied to a multi-axis motion device including a first processor and at least one second processor, and includes:
acquiring a control instruction of target motion axis motion of the multi-axis motion equipment;
controlling the first processor to carry out instruction look-ahead on the control instruction;
and controlling the target motion axis to move through the second processor based on a plurality of motion state instructions obtained by instruction look-ahead.
Further, the controlling the first processor to perform an instruction look-ahead on the control instruction includes:
controlling the first processor to analyze the control instruction;
splitting the control instruction based on the result of analyzing the control instruction;
and determining a plurality of motion state instructions for controlling the motion of the target motion axis based on the split result of the control instruction.
Further, the motion state command includes at least one of a motion direction, a motion distance, an entrance velocity, an acceleration, a target velocity, a removal acceleration distance, a deceleration distance, and a motion pattern.
Further, after the controlling the first processor to make an instruction look-ahead of the control instruction, the method comprises:
storing a plurality of motion state instructions obtained after instruction look-ahead into a target cache region, wherein the motion state instructions stored into the target cache region preferentially read;
controlling the second processor to read the plurality of motion state instructions.
Further, the controlling, by the second processor, the motion of the target motion axis based on the plurality of motion state commands obtained by command look-ahead includes:
identifying, by the second processor, the plurality of motion state instructions;
generating a pulse control command corresponding to each motion state command based on the plurality of motion state commands;
sending, by the second processor, a plurality of pulsed control command controls to the target axis of motion;
and controlling the target motion axis to move according to the plurality of pulse control instructions.
Further, after the controlling, by the second processor, the movement of the target movement axis based on the stored plurality of movement state instructions, the method includes:
detecting a motion deviation of the target motion axis;
determining whether the motion deviation is within a preset deviation threshold;
and if the motion deviation is within the preset deviation threshold value, compensating the motion of the target motion axis based on the motion deviation.
Further, after the determining whether the motion deviation is within a preset deviation threshold, the method includes:
if the motion deviation exceeds the preset deviation threshold value, controlling the second processor to interrupt the acquisition of the motion state instructions;
detecting motion information of the target motion axis and sending the motion information to the first processor;
and controlling the first processor to carry out command look-ahead of control commands again on the target motion axis based on the motion information.
In another aspect, an embodiment of the present application further provides a multi-axis motion control apparatus, which includes a first processor and at least one second processor, and includes:
the acquisition module is used for acquiring a control instruction of the movement of a target movement axis of the multi-axis movement equipment;
the first control module is used for controlling the first processor to carry out instruction foresight on the control instruction;
and the second control module is used for controlling the movement of the target movement axis through the second processor based on a plurality of movement state instructions obtained by instruction foresight.
Further, the first control module is specifically configured to:
controlling the first processor to analyze the control instruction;
splitting the control instruction based on the result of analyzing the control instruction;
and determining a plurality of motion state instructions for controlling the motion of the target motion axis based on the split result of the control instruction.
Further, the motion state command includes at least one of a motion direction, a motion distance, an entrance velocity, an acceleration, a target velocity, a removal acceleration distance, a deceleration distance, and a motion pattern.
Further, the multi-axis motion control apparatus includes:
the storage module is used for storing a plurality of motion state instructions obtained after instruction look-ahead into a target cache region, wherein the motion state instructions stored into the target cache region preferentially read;
and the reading module is used for controlling the second processor to read the plurality of motion state instructions.
Further, the second control module is specifically configured to:
identifying, by the second processor, the plurality of motion state instructions;
generating a pulse control command corresponding to each motion state command based on the plurality of motion state commands;
sending, by the second processor, a plurality of pulsed control command controls to the target axis of motion;
and controlling the target motion axis to move according to the plurality of pulse control instructions.
Further, the multi-axis motion control apparatus includes:
the first detection module is used for detecting the motion deviation of the target motion axis;
a determining module for determining whether the motion deviation is within a preset deviation threshold;
and the compensation module is used for compensating the motion of the target motion axis based on the motion deviation if the motion deviation is within the preset deviation threshold value.
Further, the multi-axis motion control apparatus further includes:
the third control module is used for controlling the second processor to interrupt the acquisition of the plurality of motion state instructions if the motion deviation exceeds the preset deviation threshold;
the second detection module is used for detecting the motion information of the target motion axis and sending the motion information to the first processor;
and the fourth control module is used for controlling the first processor to carry out command look-ahead of a control command on the target motion axis based on the motion information.
On the other hand, an embodiment of the present application further provides an electronic device, including: a processor, a memory and a bus, the memory storing machine readable instructions executable by the processor, the processor and the memory communicating over the bus when the electronic device is operating, the machine readable instructions when executed by the processor performing the steps of the multi-axis motion control method as described above.
On the other hand, the embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored, and the computer program is executed by a processor to perform the steps of the multi-axis motion control method as described above.
According to the multi-axis motion control method and device, the control instruction of the motion of the target motion axis of the multi-axis motion device is obtained; controlling the first processor to carry out instruction look-ahead on the control instruction; and controlling the target motion axis to move through the second processor based on a plurality of motion state instructions obtained by instruction look-ahead. Therefore, the control instruction is subjected to instruction foresight through the first processor in the equipment, and then the second processor controls the target motion axis to execute the motion state instruction obtained by the instruction foresight, so that the control instruction can be subjected to step-by-step processing and control in a modularized mode, multi-axis linkage control is quickly and efficiently realized, a low-cost, high-efficiency and high-precision solution is provided for multi-axis motion automation, modular control can be realized, the expansion is easy, and the realization of high-efficiency communication and the real-time performance are facilitated.
Detailed Description
In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it should be understood that the drawings in the present application are for illustrative and descriptive purposes only and are not used to limit the scope of protection of the present application. Additionally, it should be understood that the schematic drawings are not necessarily drawn to scale. The flowcharts used in this application illustrate operations implemented according to some embodiments of the present application. It should be understood that the operations of the flow diagrams may be performed out of order, and steps without logical context may be performed in reverse order or simultaneously. One skilled in the art, under the guidance of this application, may add one or more other operations to, or remove one or more operations from, the flowchart.
In addition, the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. The components of the embodiments of the present application, generally described and illustrated in the figures herein, can be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present application, presented in the accompanying drawings, is not intended to limit the scope of the claimed application, but is merely representative of selected embodiments of the application. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present application without making any creative effort, shall fall within the protection scope of the present application.
Referring to fig. 1, fig. 1 is a flowchart of a multi-axis motion control method according to an embodiment of the present disclosure. The method is applied to a multi-axis motion device comprising at least a first processor and a second processor. As shown in fig. 1, the method comprises:
step 101, obtaining a control instruction of the movement of a target movement axis of the multi-axis movement equipment.
In this step, when the multi-axis motion device needs to move through the motion axis on the multi-axis motion device to process parts, such as processing machine tools and the like, or the multi-axis motion device needs to move through the motion axis on the multi-axis motion device to realize, such as a robot and the like, the control instruction of the target motion axis motion of the multi-axis motion device can be obtained first.
Wherein the target motion axis is any one of a plurality of motion axes on the multi-axis motion device.
The control instruction may refer to a G instruction or a G code in a numerical control program, and the G instruction or the G code may be used to implement procedures such as fast positioning, inverse circle interpolation, forward circle interpolation, middle point arc interpolation, radius programming, skip machining, and the like.
The control instruction may be acquired by receiving, by the multi-axis motion device, an operation instruction input by a user in real time, determining a control instruction corresponding to the operation instruction, and then sending the determined control instruction to the first processor for execution, or may be acquired by storing, in advance, a program instruction for controlling an operation of the multi-axis motion device in the multi-axis motion device, and acquiring, by the first processor, the corresponding control instruction from the program instruction stored in advance when the multi-axis motion device is executed.
And 102, controlling the first processor to carry out instruction look-ahead on the control instruction.
In this step, after the multi-axis motion device acquires the control instruction, the control instruction may be identified and planned, etc. to determine how to control the target motion axis to move, specifically, the first processor may be controlled to identify the control instruction by using an identification and look-ahead algorithm, and then perform instruction look-ahead on the control instruction, thereby implementing analysis on the control instruction.
The first processor may be a microprocessor such as an ARM processor.
The instruction look-ahead of the control instruction may refer to analysis of G codes and speed look-ahead, where the speed look-ahead has a main function of calculating each G code and splitting each G code into different data blocks, each data block is an independent unit and stores motion data of a current line of G codes, such as a motion direction (dir), a motion distance (L), an entry speed (Vi), an acceleration (a), a target speed (Vm), an acceleration-removal distance (accele _ except), a deceleration distance (decele _ only), and a motion Mode (Mode) of a 1 st data block of the line of G codes.
Therefore, the ARM processor only realizes partial functions, pulse and input/output control related to hardware are realized by the FPGA, after the processor finishes the prospective control of the G code, the FPGA automatically carries out acceleration and deceleration planning according to the analysis of the current state, and then outputs corresponding pulse to each axis driver according to the planned speed curve and the interpolation algorithm, so that the motion control of the motion axis in the multi-axis motion equipment is realized. In addition, the scheme uses the functional block processing and can realize the expansion of the FPGA through the FIFO interface, thereby avoiding the problem that the data processing cannot be processed or the processing is slow because the number of the motion axes of the multi-axis motion equipment is too large.
According to the multi-axis motion control method provided by the embodiment of the application, a control instruction of the motion of a target motion axis of multi-axis motion equipment is obtained; controlling the first processor to carry out instruction look-ahead on the control instruction; and controlling the target motion axis to move through the second processor based on a plurality of motion state instructions obtained by instruction look-ahead. Therefore, the control instruction is subjected to instruction foresight through the first processor in the equipment, and then the second processor controls the target motion axis to execute the motion state instruction obtained by the instruction foresight, so that the control instruction can be subjected to step-by-step processing and control in a modularized mode, multi-axis linkage control is quickly and efficiently realized, a low-cost, high-efficiency and high-precision solution is provided for multi-axis motion automation, modular control can be realized, the expansion is easy, and the realization of high-efficiency communication and the real-time performance are facilitated.
Referring to fig. 2, fig. 2 is a flowchart of a multi-axis motion control method according to another embodiment of the present application. The method is applied to a multi-axis motion device comprising at least a first processor and a second processor. As shown in fig. 2, the method includes:
step 201, obtaining a control instruction of the movement of a target movement axis of the multi-axis movement equipment.
Step 202, controlling the first processor to perform instruction look-ahead on the control instruction.
And 203, controlling the target motion axis to move through the second processor based on a plurality of motion state instructions obtained by instruction look-ahead.
And step 204, detecting the motion deviation of the target motion axis.
In this step, when the second processor controls the target motion axis to move according to the motion state instructions, the motion condition of the target motion axis may be detected in real time to detect whether the target motion axis moves according to the motion information corresponding to the motion state instructions or whether a large motion deviation occurs.
Wherein the detecting of the motion deviation may be detecting a motion state of the target motion axis by the second processor, thereby determining the motion deviation.
Step 205, determining whether the motion deviation is within a preset deviation threshold value.
In this step, after detecting that the motion deviation occurs to the target motion axis, the motion deviation of the threo search axis may be compared with a preset deviation threshold to see whether the motion deviation of the target motion axis is too large, so as to determine whether the target motion axis needs to be corrected.
The preset deviation threshold may be set according to the motion accuracy of the multi-axis motion device or the processing progress of the component.
And step 206, if the motion deviation is within the preset deviation threshold, compensating the motion of the target motion axis based on the motion deviation.
In this step, if it is determined that the motion deviation is within the preset deviation threshold, it is considered that the motion deviation of the target motion axis is not large, and is within an acceptable range, and it may be that the target motion axis returns to the motion state corresponding to the plurality of motion state commands through motion compensation, at this time, the motion of the target motion axis may be compensated according to the detected motion deviation and in combination with the motion state that the target motion axis corresponding to the plurality of motion state commands should originally be in, so as to correct the motion deviation.
The descriptions of step 201 to step 203 may refer to the descriptions of step 101 to step 103, and the same technical effects may be achieved, which are not described again.
Optionally, after step 206, the method includes:
if the motion deviation exceeds the preset deviation threshold value, controlling the second processor to interrupt the acquisition of the motion state instructions; detecting motion information of the target motion axis and sending the motion information to the first processor; and controlling the first processor to carry out command look-ahead of control commands again on the target motion axis based on the motion information.
In this step, if it is determined that the motion deviation exceeds the preset deviation threshold, it is determined that the motion deviation generated by the target motion axis is large and the multi-axis motion device cannot continue to move, the multi-axis motion device may control the second processor to terminate the acquisition of the plurality of motion state instructions, so as to control the target motion axis to stop moving, may detect an actual motion situation of the target motion axis, to determine actual motion information of the target motion axis, and then send the motion information to the first processor, and may control the first processor to look ahead the target motion axis with an instruction of a control instruction again by combining the motion information and the newly acquired control instruction of the target motion axis.
Specifically, in one embodiment, the number of pulse signals of the target motion axis may be detected in real time, and when the difference between the pulse sent by the target motion axis and the encoder fed back is within a permissible range, the FPGA may automatically compensate several pulses again to perform motion compensation on the target motion axis; when the difference value between the two is too large, the FPGA generates interruption and informs the ARM processor that the motor moves away at present; if the data are equal, the FPGA directly exits, and the pulse FIFO continues to be read until the data processing is finished.
Optionally, step 202 includes:
controlling the first processor to analyze the control instruction; splitting the control instruction based on the result of analyzing the control instruction; and determining a plurality of motion state instructions for controlling the motion of the target motion axis based on the split result of the control instruction.
In this step, after the multi-axis motion device obtains the control instruction, the first processor may be controlled to analyze the control instruction to identify the control instruction, so as to determine which indication is provided for the motion information of the target motion axis in the control instruction, and then, according to a result of analyzing the control instruction, the control instruction may be split according to different motion states or motion modes, so as to obtain different motion state instructions corresponding to different split results, and further determine a plurality of motion state instructions for controlling the motion of the target motion axis.
The splitting processing of the control instruction may be performed by the first processor itself, or may be performed by a speed curve state machine module in the multi-axis motion device controlled by the first processor. For example, if the G code is split, the speed curve state machine module may plan the current line of G code into different curve forms of 7, that is, only uniform speed, deceleration after uniform speed, only acceleration, uniform speed after acceleration, deceleration after acceleration, uniform speed again after acceleration, and only deceleration motion.
In an embodiment, the process of splitting the G code may be a fixed unit time (time _ loop) motion, and the speed of the target motion axis at the next time and the motion distance of the target motion axis at this time are obtained according to the acceleration, the distance and the current speed, and the motion state of the target motion axis at the next time is obtained according to the relationship between the remaining distance and the distance that is only decelerated, and if the motion distance is less than the minimum step set by the apparatus, the motion may be circulated by adding one unit time. As shown in fig. 3, fig. 3 is a diagram of the velocity between two data blocks, taking a velocity look-ahead calculation as an example, the velocity look-ahead calculation proactively calculates the data block entry velocity of the optimal velocity plan without calculating the data block internal velocity. When the speeds in two data blocks are connected, the exit speed of the previous data block is the entrance speed of the next data block, so the exit speed does not need to be calculated.
For example, in this embodiment, when splitting the G code, the G code may be split into four split states, namely an acceleration split state, a deceleration split state, a uniform speed split state, and a preferential deceleration split state according to a "motion pattern of the 1 st data block of the G code".
Referring to fig. 4, fig. 4 is a schematic diagram of an acceleration split state in G code splitting, and for the acceleration split state (acceleration a, distance L, only deceleration distance decele _ only, distance except acceleration acele _ except, current speed present _ speed, and remaining distance mm _ rest), there are three conditions during motion of the acceleration state, that is, only acceleration, uniform speed after acceleration, and deceleration after acceleration. The method can be specifically used for splitting through the following steps:
first, according to the fixed time interval time _ loop of the acceleration motion, the remaining distance mm _ rest ═ L- (present _ speed +0.5 a ═ time _ loop) is calculated.
And then judging the size of the remaining distance mm _ rest and the distance accele _ except for acceleration, if mm _ rest > accele _ except, accelerating the motion at the interval of time _ loop all the time, otherwise, judging the size of the remaining distance and the deceleration distance decele _ only.
And if the residual distance mm _ rest is equal to the deceleration distance decele _ only, entering a deceleration state, otherwise, entering a constant speed state.
If the state of the split state machine of the multi-axis motion equipment enters a deceleration state, the state of the split state machine of the multi-axis motion equipment can be controlled to be a deceleration state; and if the multi-axis motion equipment enters the constant speed state, controlling the state of the splitting state machine of the multi-axis motion equipment to be in the constant speed state.
Referring to fig. 5, fig. 5 is a schematic diagram of a uniform speed splitting state in G code splitting, and for the uniform speed splitting state (target speed Vm, deceleration distance decele _ only, distance L, and remaining distance mm _ rest), the splitting may be specifically performed through the following steps:
firstly, moving according to a fixed time interval time _ loop of uniform motion, and calculating a residual distance mm _ rest ═ L-time _ loop Vm.
And then judging the sizes of the residual distance mm _ rest and the deceleration distance decele _ only, if the mm _ rest is less than the decele _ only, starting to enter a deceleration state, and otherwise, constantly moving at a constant speed at the interval of time _ loop.
If the state of the split state machine of the multi-axis motion device enters the deceleration state, the state of the split state machine of the multi-axis motion device can be controlled to be the deceleration state.
Referring to fig. 6, fig. 6 is a schematic diagram of a deceleration splitting state in G code splitting, and for the deceleration splitting state (current speed _ speed, acceleration a, and remaining distance mm _ rest), the splitting may be specifically performed through the following steps:
first, the device moves at a fixed time interval time _ loop according to the deceleration motion, and calculates the remaining distance mm _ rest, mm _ rest _ time _ loop (present _ speed-0.5 a _ time _ loop).
Then the current speed present _ speed can be compared with a time loop, if present _ speed > a time loop, the speed is reduced at the interval of time loop, otherwise, the speed is reduced forcibly when the speed is moved to the end of the data block.
Referring to fig. 7, fig. 7 is a schematic diagram of a preferential deceleration splitting state in G code splitting, and for the preferential deceleration splitting state (the maximum speed is max _ speed, i.e., the target speed, the deceleration distance decel _ only, the current speed present _ speed, and the acceleration a), there are two cases: the deceleration state and the uniform speed state are prioritized. The method can be specifically used for splitting through the following steps:
the preferential deceleration motion can be a motion in a fixed time interval time _ loop, the difference value of present _ speed-max _ speed is compared with the size of a time _ loop, if the difference value is larger than the a time _ loop, the preferential deceleration motion is always performed in the interval of the time _ loop, otherwise, the preferential deceleration motion is performed to the last time _ loop, and the uniform speed state is achieved.
And if the multi-axis motion equipment enters the constant speed state, controlling the state of the splitting state machine of the multi-axis motion equipment to be in the constant speed state.
In one embodiment, specifically, (1) performing a velocity look-ahead calculation by an ARM, calculating a motion direction (dir), a motion distance (L), an entry velocity (Vi), an acceleration (a), a target velocity (Vm), an acceleration-removal distance (accele _ except), a deceleration distance (decele _ only), and a motion Mode (Mode) of a 1 st data block of the line G code in the multi-axis motion device, and storing corresponding data into a data block structure; (2) judging whether the block data is empty or not, and if the block data is empty, ending the movement; otherwise, the movement is continued, and one block data is read from the block data structure; (3) controlling a splitting state machine to split the block data, judging whether the splitting of the block data is finished or not, and if not, storing the motion time _ loop and the motion distance mm _ distance of the split data in a pulse FIFO (first in first out); otherwise, continuously taking out one block data from the block data, and circulating (3) until the block data is empty, and ending the movement; (4)
the FPGA takes pulse FIFO data and adopts DDA algorithm to transmit pulses. And circulating the processes of the steps 1 to 4 to realize the closed-loop control of the G code.
Optionally, after step 202, the method includes:
storing a plurality of motion state instructions obtained after instruction look-ahead into a target cache region, wherein the motion state instructions stored into the target cache region preferentially read; controlling the second processor to read the plurality of motion state instructions.
In this step, the first processor performs instruction lookahead on the control instruction, determines a plurality of motion state instructions, may control to store the plurality of motion state instructions obtained after the instruction lookahead into a target cache region, and may control the second processor to read the plurality of motion state instructions from the target cache region.
And preferentially reading the motion state instruction preferentially stored in the target cache region. Preferably, the storage mode used by the target cache region is FIFO storage, the FIFO storage is a first-in first-out buffer region and is built by a DPRAM in an FPGA, the function of the memory is similar to that of a chip IDT7203, and the memory is an asynchronous communication mechanism. I.e., the speed of writing to the FIFO, may not coincide with the speed of reading. Therefore, the invention ensures the continuity of the writing G code of the processor and the continuous stable output of the pulse.
Optionally, step 203 includes:
identifying, by the second processor, the plurality of motion state instructions; generating a pulse control command corresponding to each motion state command based on the plurality of motion state commands; sending, by the second processor, a plurality of pulsed control command controls to the target axis of motion; and controlling the target motion axis to move according to the plurality of pulse control instructions.
In this step, after the first processor performs instruction lookahead on the control instruction to obtain a plurality of motion state instructions, the second processor may be controlled to read the plurality of motion state instructions, identify the plurality of motion state instructions to identify motion information and the like that the target motion axis needs to be controlled to move, generate a pulse control instruction corresponding to each motion state instruction, and control and send the plurality of pulse control instructions to the target motion axis through the second processor, so as to control the target motion axis to move according to the plurality of pulse control instructions.
According to the multi-axis motion control method provided by the embodiment of the application, a control instruction of the motion of a target motion axis of multi-axis motion equipment is obtained; controlling the first processor to carry out instruction look-ahead on the control instruction; controlling the target motion axis to move through the second processor based on a plurality of motion state instructions obtained by instruction look-ahead; detecting a motion deviation of the target motion axis; determining whether the motion deviation is within a preset deviation threshold; and if the motion deviation is within the preset deviation threshold value, compensating the motion of the target motion axis based on the motion deviation.
Therefore, the control instruction is subjected to instruction foresight through the first processor in the equipment, and then the second processor controls the target motion axis to execute the motion state instruction obtained by the instruction foresight, so that the control instruction can be subjected to step-by-step processing and control in a modularized mode, multi-axis linkage control is realized quickly and efficiently, a low-cost, high-efficiency and high-precision solution is provided for multi-axis motion automation, modular control can be realized, the expansion is easy, high-efficiency communication and real-time performance are convenient to realize, resources are saved, the time for the processor to split the arc into line segments is reduced, more efficient interpolation is carried out, the real-time motion condition of the target motion axis can be detected through the second processor, motion abnormality is found in time, and interrupt processing is realized.
Referring to fig. 8 and 9, fig. 8 is a first structural diagram of a multi-axis motion control apparatus according to an embodiment of the present application, and fig. 9 is a second structural diagram of the multi-axis motion control apparatus according to the embodiment of the present application. The multi-axis motion control device 800 may implement the steps performed by the multi-axis motion control method described above. The multi-axis motion control device 800 includes a first processor and at least one second processor. As shown in fig. 8, the multi-axis motion control apparatus 800 includes:
and an obtaining module 810, configured to obtain a control instruction of a target movement axis movement of the multi-axis movement device.
The first control module 820 is configured to control the first processor to perform instruction look-ahead on the control instruction.
And a second control module 830, configured to control, by the second processor, the motion of the target motion axis based on a plurality of motion state instructions obtained by instruction look-ahead.
Optionally, the first control module 820 is specifically configured to:
controlling the first processor to analyze the control instruction;
splitting the control instruction based on the result of analyzing the control instruction;
and determining a plurality of motion state instructions for controlling the motion of the target motion axis based on the split result of the control instruction.
Optionally, the motion state instruction includes at least one of a motion direction, a motion distance, an entrance velocity, an acceleration, a target velocity, a removal acceleration distance, a deceleration distance, and a motion pattern.
Alternatively, as shown in fig. 9, the multi-axis motion control apparatus 800 includes:
the storage module 840 is configured to store a plurality of motion state instructions obtained after instruction look-ahead into a target cache region, where the motion state instructions preferentially stored in the target cache region are preferentially read.
A reading module 850, configured to control the second processor to read the plurality of motion state instructions.
Optionally, the second control module 830 is specifically configured to:
identifying, by the second processor, the plurality of motion state instructions;
generating a pulse control command corresponding to each motion state command based on the plurality of motion state commands;
sending, by the second processor, a plurality of pulsed control command controls to the target axis of motion;
and controlling the target motion axis to move according to the plurality of pulse control instructions.
Alternatively, as shown in fig. 9, the multi-axis motion control apparatus 800 includes:
a first detection module 860 for detecting a motion deviation of the target motion axis.
A determining module 870 for determining whether the motion deviation is within a preset deviation threshold.
A compensation module 880, configured to compensate for the motion of the target motion axis based on the motion deviation if the motion deviation is within the preset deviation threshold.
Optionally, as shown in fig. 9, the multi-axis motion control apparatus 800 further includes:
a third control module 801, configured to control the second processor to interrupt acquiring the motion state instructions if the motion deviation exceeds the preset deviation threshold;
a second detection module 802, configured to detect motion information of the target motion axis, and send the motion information to the first processor;
a fourth control module 803, configured to control, based on the motion information, the first processor to perform instruction look-ahead of a control instruction on the target motion axis.
According to the multi-axis motion control equipment provided by the embodiment of the application, a control instruction of the motion of a target motion axis of the multi-axis motion equipment is obtained; controlling the first processor to carry out instruction look-ahead on the control instruction; and controlling the target motion axis to move through the second processor based on a plurality of motion state instructions obtained by instruction look-ahead.
Therefore, the control instruction is subjected to instruction foresight through the first processor in the equipment, and then the second processor controls the target motion axis to execute the motion state instruction obtained by the instruction foresight, so that the control instruction can be subjected to step-by-step processing and control in a modularized mode, multi-axis linkage control is quickly and efficiently realized, a low-cost, high-efficiency and high-precision solution is provided for multi-axis motion automation, modular control can be realized, the expansion is easy, and the realization of high-efficiency communication and the real-time performance are facilitated.
An embodiment of the present application further provides an electronic device, which includes: the processor and the memory communicate with each other through the bus when the electronic device runs, and the machine-readable instructions are executed by the processor to perform the steps of the multi-axis motion control method in the method embodiments shown in fig. 2 and fig. 3, which can achieve the same technical effects.
An embodiment of the present application further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the multi-axis motion control method in the method embodiments shown in fig. 2 and fig. 3 may be executed, and the same technical effect may be achieved.
The modules may be connected or in communication with each other via a wired or wireless connection. The wired connection may include a metal cable, an optical cable, a hybrid cable, etc., or any combination thereof. The wireless connection may comprise a connection over a LAN, WAN, bluetooth, ZigBee, NFC, or the like, or any combination thereof. Two or more modules may be combined into a single module, and any one module may be divided into two or more units.
It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the system and the apparatus described above may refer to corresponding processes in the method embodiments, and are not described in detail in this application. In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. The above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is merely a logical division, and there may be other divisions in actual implementation, and for example, a plurality of modules or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of devices or modules through some communication interfaces, and may be in an electrical, mechanical or other form.
The modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a non-volatile computer-readable storage medium executable by a processor. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a U disk, a removable hard disk, a ROM, a RAM, a magnetic disk, or an optical disk.
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.