CN112034765A - Control code generation method and device - Google Patents
Control code generation method and device Download PDFInfo
- Publication number
- CN112034765A CN112034765A CN202010950243.7A CN202010950243A CN112034765A CN 112034765 A CN112034765 A CN 112034765A CN 202010950243 A CN202010950243 A CN 202010950243A CN 112034765 A CN112034765 A CN 112034765A
- Authority
- CN
- China
- Prior art keywords
- module
- control
- control instruction
- instruction
- motor
- Prior art date
- Legal status (The legal status 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 status listed.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05B—CONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
- G05B19/00—Programme-control systems
- G05B19/02—Programme-control systems electric
- G05B19/04—Programme control other than numerical control, i.e. in sequence controllers or logic controllers
- G05B19/042—Programme control other than numerical control, i.e. in sequence controllers or logic controllers using digital processors
- G05B19/0428—Safety, monitoring
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05B—CONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
- G05B2219/00—Program-control systems
- G05B2219/20—Pc systems
- G05B2219/26—Pc applications
- G05B2219/2612—Data acquisition interface
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Automation & Control Theory (AREA)
- Control Of Electric Motors In General (AREA)
Abstract
The application provides a control code generation method and device, and relates to the technical field of motor control. The method comprises the following steps: receiving a control instruction input according to a preset function module, wherein the control instruction comprises at least one selected function module, and the preset function module comprises a plurality of function modules corresponding to different functions; and sending a control instruction to the target motor according to the control instruction, wherein the control instruction is used for instructing the target motor to execute driving according to the selected at least one functional module. The method realizes that the motor control system can be combined again to complete driving according to the pre-prepared functional modules without independently compiling codes according to each specific function, greatly improves the working efficiency and reduces the control cost.
Description
Technical Field
The invention relates to the technical field of motor control, in particular to a method and a device for generating a control code.
Background
The motor is one of indispensable components on mechanical equipment, has various product types, is widely applied to various industries such as lifting, air compressors, machine tools, electric vehicles, printing and packaging, metallurgy, petroleum, chemical engineering, metal processing, stone processing, wood processing, ceramics, plastics, washing machines and the like, even can exist in moving places, and can be divided into various motors according to different parameters such as models, specifications, power, shaft extension, insulation, encoders, rotating speed switches, thermosensitive elements, heating belts and the like.
At present, in a conventional motor control system, writing of a motor program is often realized by manually writing codes.
However, the prior art is labor-consuming and time-consuming, and the working efficiency is greatly reduced.
Disclosure of Invention
The present invention is directed to provide a control code generation method and apparatus for improving work efficiency.
In order to achieve the above purpose, the technical solutions adopted in the embodiments of the present application are as follows:
in a first aspect, an embodiment of the present application provides a method for generating a control code, where a control instruction input according to a preset function module is received, where the control instruction includes at least one selected function module, and the preset function module includes a plurality of function modules corresponding to different functions;
and sending a control instruction to a target motor according to the control instruction, wherein the control instruction is used for instructing the target motor to execute driving according to the selected at least one functional module.
Optionally, before receiving the control instruction input according to the preset function module, the method further includes:
generating engineering files corresponding to the function modules according to the preset function modules;
and sending a writing instruction of the project file to the target motor.
Optionally, the functional modules include at least four of: the device comprises a control algorithm module, a basic function module, a logic module and a communication module.
Optionally, when the target motor is a dc motor, the functional module includes the control algorithm module, the basic functional module, the logic module and the communication module corresponding to the dc motor;
when the target motor is an alternating current motor, the functional module comprises the control algorithm module, the basic functional module, the logic module and the communication module which correspond to the alternating current motor.
Optionally, the control algorithm module comprises: an open-loop control module and a closed-loop control module.
In a second aspect, an embodiment of the present application further provides a method for generating a control code, where the method includes:
receiving a control instruction sent by an upper computer, wherein the control instruction is generated according to an input control instruction and is used for instructing a target motor to execute driving according to at least one functional module selected by the control instruction;
and generating a driving instruction to drive the load according to the control instruction.
Optionally, before receiving the control instruction sent by the upper computer, the method further includes:
receiving a write-in instruction sent by the upper computer, wherein the write-in instruction comprises: project files corresponding to the functional modules;
and writing the engineering file according to the writing instruction.
Optionally, the generating a driving instruction to drive a load according to the control instruction includes:
calling at least one target engineering file indicated by the control instruction according to the control instruction;
and generating the driving instruction driving load according to the target project file.
In a third aspect, an embodiment of the present application further provides an apparatus for generating a control code, where the apparatus includes: a receiving module and a sending module;
the receiving module is used for receiving a control instruction input according to a preset function module, wherein the control instruction comprises at least one selected function module, and the preset function module comprises a plurality of function modules corresponding to different functions;
and the sending module is used for sending a control instruction to a target motor according to the control instruction, and the control instruction is used for instructing the target motor to execute driving according to the selected at least one functional module.
Optionally, the apparatus further comprises: a generation module;
the generating module is used for generating the project files corresponding to the function modules according to the preset function modules;
and the sending module is used for sending a writing instruction of the engineering file to the target motor.
Optionally, the functional modules include at least four of: the device comprises a control algorithm module, a basic function module, a logic module and a communication module.
Optionally, when the target motor is a dc motor, the functional module includes the control algorithm module, the basic functional module, the logic module and the communication module corresponding to the dc motor;
when the target motor is an alternating current motor, the functional module comprises the control algorithm module, the basic functional module, the logic module and the communication module corresponding to the direct current motor.
Optionally, the control algorithm module comprises: an open-loop control module and a closed-loop control module.
In a fourth aspect, an embodiment of the present application further provides an apparatus for generating a control code, where the apparatus includes: a receiving module and a generating module;
the receiving module is used for receiving a control instruction sent by an upper computer, and the control instruction is generated according to an input control instruction and is used for instructing a target motor to execute driving according to at least one functional module selected by the control instruction;
and the generating module is used for generating a driving instruction to drive the load according to the control instruction.
Optionally, the apparatus further comprises: a write module;
the receiving module is further used for receiving a writing instruction sent by the upper computer, and the writing instruction comprises: project files corresponding to the functional modules;
and the writing module is used for writing the engineering file according to the writing instruction.
Optionally, the generating module is specifically configured to:
calling at least one target engineering file indicated by the control instruction according to the control instruction;
and generating the driving instruction driving load according to the target project file.
In a fifth aspect, an embodiment of the present application further provides a controller, including: a processor, a storage medium and a bus, the storage medium storing program instructions executable by the processor, the processor and the storage medium communicating via the bus when the controller is running, the processor executing the program instructions to perform the steps of the method provided by the second aspect.
The beneficial effect of this application is:
the application provides a control code generation method and a control code generation device, wherein the method comprises the following steps: receiving a control instruction input according to a preset function module, wherein the control instruction comprises at least one selected function module, and the preset function module comprises a plurality of function modules corresponding to different functions; and sending a control instruction to the target motor according to the control instruction, wherein the control instruction is used for instructing the target motor to execute driving according to the selected at least one functional module. The upper computer receives a control instruction input according to a preset function module, and then the controller can send a control instruction to the target motor according to the received control instruction, so that the target motor can execute driving according to at least one selected function module, the motor control system can complete driving by combining the preset function modules again, codes do not need to be written independently according to specific functions, the working efficiency is greatly improved, and the control cost is reduced.
In addition, the upper computer generates engineering files corresponding to the function modules according to the preset function modules, and sends writing instructions of the engineering files to the target motor, so that the target motor can write the engineering files corresponding to the function modules into the controller through the simulator, a subsequent controller can receive control instructions sent by the upper computer, the target engineering files corresponding to the control instructions can be selected from the written engineering files, driving instruction driving loads are further generated according to the target engineering files, the motor is controlled to complete corresponding actions, motor driving operation is achieved, codes are effectively generated through the prestored engineering files in the motor control system, codes do not need to be written according to specific functions, working efficiency is improved, and control cost is reduced.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained according to the drawings without inventive efforts.
Fig. 1 is a schematic structural diagram of a motor control system according to an embodiment of the present disclosure;
fig. 2 is a schematic flowchart of a method for generating a control code according to an embodiment of the present application;
fig. 3 is a schematic flowchart of another control code generation method according to an embodiment of the present application;
fig. 4 is a schematic flowchart of a further control code generation method according to an embodiment of the present application;
fig. 5 is a schematic flowchart of another control code generation method according to an embodiment of the present application;
fig. 6 is a schematic flowchart of a further control code generation method according to an embodiment of the present application;
fig. 7 is an interaction flow diagram of a method for generating a control code according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of a control code generation apparatus according to an embodiment of the present application;
fig. 9 is a schematic structural diagram of another control code generation apparatus provided in an embodiment of the present application;
fig. 10 is a schematic structural diagram of a controller according to an embodiment of the present application.
Icon: 100-a motor control system; 101-an upper computer; 102-a motor; 103-a controller; 104-a driver; 105-motor load; 1001-processor; 1002-memory.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention.
The present application provides a plurality of embodiments described below to realize automatic generation of control codes in a motor control system, so as to improve work efficiency and reduce control cost. This is explained below by means of a number of examples.
First, a motor control system to which the control code generation method of the present application is applied will be briefly described.
Fig. 1 is a schematic structural diagram of a motor control system according to an embodiment of the present disclosure; as shown in fig. 1, the motor control system 100 may include: host computer 101 and motor 102, wherein motor 102 includes: controller 103, driver 104, motor load 105, etc.
The upper computer 101 generally refers to a computer that can directly issue a control instruction. The upper computer 101, the controller 103, and the driver 104 are sequentially connected in a communication manner, and the driver 104 is electrically connected to the motor load 105. Optionally, the upper computer 101 realizes data transmission with the controller 103 through serial port communication, so that the upper computer 101 can receive an output signal fed back by the controller 103 to the motor load 105, and the controller 103 can send a control instruction to the driver 104 according to the control instruction sent by the upper computer 101 to realize drive control of the motor load 105, so as to complete drive operation of the motor load 105.
Fig. 2 is a schematic flowchart of a method for generating a control code according to an embodiment of the present application, where the method is applied to an upper computer in a motor control system, and optionally, as shown in fig. 2, the method may include:
s201, receiving a control instruction input according to a preset function module.
The function module can be selected through an interface of the upper computer so as to realize the input of control instructions. The control instruction comprises at least one selected functional module, wherein the preset functional module comprises a plurality of functional modules corresponding to different functions.
In some embodiments, for example, the preset function module may include: a type module of the target motor, a control algorithm module and the like.
For example, the function modules corresponding to a plurality of different functions may be determined according to the actual requirements of the project, for example, if the rotating speed of the target motor is required to be high and the control precision is high, the high-speed rotating speed in the corresponding rotating speed function module and the closed-loop vector control in the control algorithm module may be input by the upper computer, so that the upper computer may receive the control instruction input according to the preset function module.
And S202, sending a control command to the target motor according to the control instruction.
And the control instruction is used for instructing the target motor to execute driving according to the selected at least one functional module.
In some embodiments, after receiving a control instruction input according to a preset function module, the upper computer sends a corresponding control instruction to the controller in the target motor according to the control instruction, so that the target motor can execute driving according to at least one selected function module, and the motor is controlled to complete a corresponding action.
To sum up, an embodiment of the present application provides a control code generation method, including: receiving a control instruction input according to a preset function module, wherein the control instruction comprises at least one selected function module, and the preset function module comprises a plurality of function modules corresponding to different functions; and sending a control instruction to the target motor according to the control instruction, wherein the control instruction is used for instructing the target motor to execute driving according to the selected at least one functional module. According to the method, the upper computer receives the control instruction input according to the preset function module, then the controller can send the control instruction to the target motor according to the received control instruction, so that the target motor can execute driving according to the selected at least one function module, the motor control system can complete driving by combining the preset function modules again, codes do not need to be written independently according to each specific function, the working efficiency is greatly improved, and the control cost is reduced.
Fig. 3 is a schematic flowchart of another control code generation method according to an embodiment of the present application; as shown in fig. 3, in step S201: before receiving a control instruction input according to a preset function module, the method may further include:
s301, generating engineering files corresponding to the function modules according to the preset function modules.
In some embodiments, the engineering files corresponding to the function modules may be generated in advance according to preset function modules, for example, the engineering files for closed-loop control may be generated according to a closed-loop control algorithm in the control algorithm module.
And S302, sending a writing instruction of the project file to the target motor.
Optionally, after the engineering files corresponding to the function modules are generated according to the preset function modules, the writing instruction of the engineering files is sent to the target motor, so that the engineering files corresponding to the function modules can be written into the controller through the simulator, a subsequent controller can receive the control instruction sent by the upper computer, the target engineering files corresponding to the control instruction can be selected from the engineering files written in advance, the driving instruction driving load is further generated according to the target engineering files, and the motor is controlled to complete corresponding actions, so that the motor driving operation is realized.
Optionally, the functional module comprises at least four of: the device comprises a control algorithm module, a basic function module, a logic module and a communication module.
It is understood that the above functional modules are independent of each other. In addition, the functional module can also comprise a target motor type module so as to adapt to motors with different models, and the universality and the practicability of the control code generation method are improved.
The control algorithm module can be an algorithm used for realizing the control of the target motor, for example, closed-loop control, open-loop control and the like, and a corresponding control algorithm can be selected according to the actual requirements of the project so as to improve the control precision of the target motor.
The basic function module refers to development of a control function that can be performed using inherent resources of a controller in a motor control system, and may include: d/a (a/D) conversion, clock configuration, etc.
For example, data conversion may be realized by converting a digital signal into an analog signal (converting the analog signal into the digital signal) by D/a (a/D) conversion.
The logic module may be configured to generate a sequence of operation of the engineering files corresponding to each of the function modules according to the preset function module, that is, if the target motor is to realize the specified function, the sequence of execution of the engineering files is determined first.
The communication module can realize analog-to-digital conversion between a software part and hardware to realize data transmission, namely, the upper computer can send various control instructions to the controller through the communication module to realize control on a target motor.
Optionally, when the target motor is a dc motor, the functional module includes a control algorithm module, a basic functional module, a logic module, and a communication module corresponding to the dc motor.
When the target motor is an alternating current motor, the functional module comprises a control algorithm module, a basic functional module, a logic module and a communication module which correspond to the alternating current motor.
In general, the motor types may include: stepper motors, brushed dc motors, brushless dc motors, permanent magnet synchronous motors, etc. It will be appreciated that the control algorithm modules, logic modules and communication modules required for different motor types are different.
For example, when the target motor selected according to the project requirement is a dc motor, the functional modules may include: a control algorithm module, a logic module, a communication module and the like corresponding to the direct current motor; for another example, when the target motor selected according to the project requirement is an ac motor, the functional modules may include: a control algorithm module, a logic module and a communication module corresponding to the alternating current motor.
For example, if the project requires a high target motor speed and a high control accuracy, a high-speed motor and a closed-loop vector control program are adopted; for another example, if the target motor for project requirement only realizes the rotation function, but does not require the precision, the direct current motor and the conventional open loop control can be adopted.
Optionally, the control algorithm module comprises: an open-loop control module and a closed-loop control module.
The control algorithm module can be an algorithm used for realizing motor control, for example, when the requirement on the running precision of a target motor is not high, open-loop control can be adopted; when the requirement on the running precision of the target motor is higher, closed-loop control can be adopted.
For another example, when the requirement on the rotation speed fluctuation of the target motor is high, two closed-loop control of the rotation speed and the current can be adopted; and when the position precision requirement of the target motor is higher, three closed-loop control of position, rotating speed and current is adopted.
Fig. 4 is a schematic flowchart of a further control code generation method according to an embodiment of the present application; the method is applied to a controller in a motor control system, and as shown in fig. 4, the method may include:
and S401, receiving a control command sent by the upper computer.
And the control instruction is generated according to the input control instruction and is used for instructing the target motor to execute driving according to at least one functional module selected by the control instruction.
In some embodiments, for example, after determining that the target motor corresponds to a plurality of function modules corresponding to different functions according to project requirements, the control instruction of each function module is input into a preset function module of the upper computer, so that the upper computer sends a corresponding control instruction to the target motor according to the received control instruction.
And S402, generating a driving command to drive the load according to the control command.
In some embodiments, after receiving the control instruction sent by the upper computer, the controller generates a corresponding driving instruction according to the control instruction, and can send the driving instruction to the driver so as to drive the motor to complete corresponding actions according to project requirements, thereby effectively improving the accuracy of controlling the target motor.
Fig. 5 is a schematic flowchart of another control code generation method according to an embodiment of the present application; as shown in fig. 5, in step S401: before receiving the control instruction that the host computer sent, still include:
and S501, receiving a writing instruction sent by the upper computer.
Wherein the write command comprises: and engineering files corresponding to the functional modules.
In some embodiments, before receiving the control instruction sent by the upper computer, the controller may generate, in the upper computer in advance, the engineering files corresponding to the function modules according to the preset function modules, and then send the write-in instruction of the plurality of engineering files to the target motor, so that the controller may receive the write-in instruction sent by the upper computer in time.
And S502, writing the engineering file according to the writing command.
In some embodiments, after receiving a write-in instruction sent by an upper computer, the controller writes the engineering file corresponding to the function module into the controller through the simulator, so that the subsequent upper computer can complete control of the target motor by only selecting the corresponding preset function module according to project requirements, accurate generation of control instruction codes in the motor control system is effectively achieved, and various writing errors of handwritten control instruction codes are avoided.
Fig. 6 is a schematic flowchart of a further control code generation method according to an embodiment of the present application; as shown in fig. 6, the above step S402: according to the control command, generating a driving command to drive the load, specifically comprising:
s601, calling at least one target project file indicated by the control instruction according to the control instruction.
In some embodiments, after receiving the control instruction sent by the upper computer, the controller may also call, according to the control instruction, at least one target engineering file corresponding to the control instruction in the engineering files corresponding to the functional modules written in advance.
And S602, generating a driving instruction to drive the load according to the target project file.
In some embodiments, after the controller calls at least one target engineering file indicated by the control instruction according to the control instruction, and generates a driving instruction driving load according to the called corresponding target engineering file, wherein the called target engineering files may be combined according to a logic sequence of logic modules in the control instruction to generate a driving instruction recognizable by the motor load, for example, to generate a complete code, and the like.
And then send the drive instruction to the driver through the controller for the driver can realize the drive control to the target motor according to the drive instruction, has improved the control efficiency to the target motor greatly.
Fig. 7 is an interaction flow diagram of a method for generating a control code according to an embodiment of the present application; alternatively, as shown in fig. 7, the method may include:
and S701, generating engineering files corresponding to the functional modules by the upper computer according to the preset functional modules.
S702, the upper computer sends a writing instruction of the project file to the controller of the target motor.
And S703, writing the engineering file into the controller according to the writing instruction.
And S704, the upper computer receives a control instruction input according to the preset function module.
And S705, the upper computer sends a control instruction to the controller of the target motor according to the control instruction.
S706, the controller calls at least one target engineering file indicated by the control instruction according to the control instruction.
And S707, the controller generates a driving instruction to drive the load according to the target project file.
Optionally, specific implementation steps and beneficial effects of the interaction method have been described in detail in the foregoing specific embodiments, and are not described in detail here.
The following describes a generation apparatus, a controller, and the like for executing the control code provided in the present application, and specific implementation procedures and technical effects thereof are referred to above, and will not be described again below.
Fig. 8 is a schematic structural diagram of a control code generation apparatus according to an embodiment of the present application; as shown in fig. 8, the apparatus includes: a receiving module 801 and a sending module 802.
A receiving module 801, configured to receive a control instruction input according to a preset function module, where the control instruction includes at least one selected function module, and the preset function module includes a plurality of function modules corresponding to different functions;
a sending module 802, configured to send a control instruction to the target motor according to the control instruction, where the control instruction is used to instruct the target motor to execute driving according to the selected at least one function module.
Optionally, the apparatus further comprises: a generation module;
the generating module is used for generating engineering files corresponding to the functional modules according to the preset functional modules;
the sending module 802 is configured to send a writing instruction of the project file to the target motor.
Optionally, the functional module comprises at least four of: the device comprises a control algorithm module, a basic function module, a logic module and a communication module.
Optionally, when the target motor is a direct current motor, the functional module includes a control algorithm module, a basic functional module, a logic module and a communication module corresponding to the direct current motor;
when the target motor is an alternating current motor, the functional module comprises a control algorithm module, a basic functional module, a logic module and a communication module which correspond to the direct current motor.
Optionally, the control algorithm module comprises: an open-loop control module and a closed-loop control module.
Fig. 9 is a schematic structural diagram of another control code generation apparatus provided in an embodiment of the present application, and as shown in fig. 9, the apparatus includes: a receiving module 901 and a generating module 902.
The receiving module 901 is configured to receive a control instruction sent by an upper computer, where the control instruction is generated according to an input control instruction and is used to instruct a target motor to execute driving according to at least one function module selected by the control instruction;
and a generating module 902, configured to generate a driving instruction to drive the load according to the control instruction.
Optionally, the apparatus further comprises: a write module;
the receiving module 901 is further configured to receive a write instruction sent by the upper computer, where the write instruction includes: engineering files corresponding to the functional modules;
and the writing module is used for writing the engineering file according to the writing instruction.
Optionally, the generating module 902 is specifically configured to:
calling at least one target engineering file indicated by the control instruction according to the control instruction;
and generating a driving instruction to drive the load according to the target engineering file.
The above-mentioned apparatus is used for executing the method provided by the foregoing embodiment, and the implementation principle and technical effect are similar, which are not described herein again.
These above modules may be one or more integrated circuits configured to implement the above methods, such as: one or more Application Specific Integrated Circuits (ASICs), or one or more microprocessors (DSPs), or one or more Field Programmable Gate Arrays (FPGAs), among others. For another example, when one of the above modules is implemented in the form of a Processing element scheduler code, the Processing element may be a general-purpose processor, such as a Central Processing Unit (CPU) or other processor capable of calling program code. For another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).
Fig. 10 is a schematic structural diagram of a controller according to an embodiment of the present application, where the controller may be integrated in a control device or a chip of the control device, and the control device may be a computing device with a data processing function.
The controller includes: a processor 1001 and a memory 1002.
The memory 1002 is used for storing programs, and the processor 1001 calls the programs stored in the memory 1002 to execute the above-mentioned method embodiments. The specific implementation and technical effects are similar, and are not described herein again.
Optionally, the invention also provides a program product, for example a computer-readable storage medium, comprising a program which, when being executed by a processor, is adapted to carry out the above-mentioned method embodiments.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units 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 through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units 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 invention 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 integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit.
The integrated unit implemented in the form of a software functional unit may be stored in a computer readable storage medium. The software functional unit is stored in a storage medium and includes several instructions to enable a computer device (which may be a personal computer, a server, or a network device) or a processor (processor) to execute some steps of the methods according to the embodiments of the present invention. And the aforementioned storage medium includes: a U disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
Claims (10)
1. A method for generating control codes, the method comprising:
receiving a control instruction input according to a preset function module, wherein the control instruction comprises at least one selected function module, and the preset function module comprises a plurality of function modules corresponding to different functions;
and sending a control instruction to a target motor according to the control instruction, wherein the control instruction is used for instructing the target motor to execute driving according to the selected at least one functional module.
2. The method according to claim 1, wherein before receiving the control instruction input according to the preset function module, the method further comprises:
generating engineering files corresponding to the function modules according to the preset function modules;
and sending a writing instruction of the project file to the target motor.
3. The method of claim 2, wherein the functional modules include at least four of: the device comprises a control algorithm module, a basic function module, a logic module and a communication module.
4. The method according to claim 3, wherein when the target motor is a DC motor, the function modules include the control algorithm module, the basic function module, the logic module and the communication module corresponding to the DC motor;
when the target motor is an alternating current motor, the functional module comprises the control algorithm module, the basic functional module, the logic module and the communication module which correspond to the alternating current motor.
5. The method of claim 4, wherein the control algorithm module comprises: an open-loop control module and a closed-loop control module.
6. A method for generating control codes, the method comprising:
receiving a control instruction sent by an upper computer, wherein the control instruction is generated according to an input control instruction and is used for instructing a target motor to execute driving according to at least one functional module selected by the control instruction;
and generating a driving instruction to drive the load according to the control instruction.
7. The method according to claim 6, wherein before receiving the control instruction sent by the upper computer, the method further comprises:
receiving a write-in instruction sent by the upper computer, wherein the write-in instruction comprises: project files corresponding to the functional modules;
and writing the engineering file according to the writing instruction.
8. The method of claim 7, wherein generating a drive command to drive a load according to the control command comprises:
calling at least one target engineering file indicated by the control instruction according to the control instruction;
and generating the driving instruction driving load according to the target project file.
9. An apparatus for generating a control code, the apparatus comprising: a receiving module and a sending module;
the receiving module is used for receiving a control instruction input according to a preset function module, wherein the control instruction comprises at least one selected function module, and the preset function module comprises a plurality of function modules corresponding to different functions;
and the sending module is used for sending a control instruction to a target motor according to the control instruction, and the control instruction is used for instructing the target motor to execute driving according to the selected at least one functional module.
10. An apparatus for generating a control code, the apparatus comprising: a receiving module and a generating module;
the receiving module is used for receiving a control instruction sent by an upper computer, and the control instruction is generated according to an input control instruction and is used for instructing a target motor to execute driving according to at least one functional module selected by the control instruction;
and the generating module is used for generating a driving instruction to drive the load according to the control instruction.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010950243.7A CN112034765A (en) | 2020-09-10 | 2020-09-10 | Control code generation method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010950243.7A CN112034765A (en) | 2020-09-10 | 2020-09-10 | Control code generation method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN112034765A true CN112034765A (en) | 2020-12-04 |
Family
ID=73588517
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010950243.7A Pending CN112034765A (en) | 2020-09-10 | 2020-09-10 | Control code generation method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112034765A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112965697A (en) * | 2021-03-25 | 2021-06-15 | 北京奇艺世纪科技有限公司 | Code file generation method and device and electronic equipment |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101295179A (en) * | 2008-06-03 | 2008-10-29 | 北京大学 | Multi-motor control system of walking robot |
CN101598766A (en) * | 2009-07-07 | 2009-12-09 | 华中科技大学 | A kind of full-automatic testing device of open type portable motor driver |
JP2017111795A (en) * | 2015-12-15 | 2017-06-22 | シャープ株式会社 | Autonomous travel device |
CN108500967A (en) * | 2018-05-05 | 2018-09-07 | 深圳市越疆科技有限公司 | Control method, modular articulated robot and storage medium |
-
2020
- 2020-09-10 CN CN202010950243.7A patent/CN112034765A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101295179A (en) * | 2008-06-03 | 2008-10-29 | 北京大学 | Multi-motor control system of walking robot |
CN101598766A (en) * | 2009-07-07 | 2009-12-09 | 华中科技大学 | A kind of full-automatic testing device of open type portable motor driver |
JP2017111795A (en) * | 2015-12-15 | 2017-06-22 | シャープ株式会社 | Autonomous travel device |
CN108500967A (en) * | 2018-05-05 | 2018-09-07 | 深圳市越疆科技有限公司 | Control method, modular articulated robot and storage medium |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112965697A (en) * | 2021-03-25 | 2021-06-15 | 北京奇艺世纪科技有限公司 | Code file generation method and device and electronic equipment |
CN112965697B (en) * | 2021-03-25 | 2023-07-25 | 北京奇艺世纪科技有限公司 | Code file generation method and device and electronic equipment |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP5266412B2 (en) | Numerical controller system with multi-core processor | |
US8736217B2 (en) | Servo motor control device for controlling servo motor configured to drive feed axis of machine tool | |
CN110465422A (en) | A kind of flush coater kinetic control system and its motion control method based on FPGA | |
CN112034765A (en) | Control code generation method and device | |
CN103399568A (en) | Automobile instrument durability test testing system with CAN (controller area network) bus | |
CN112207829A (en) | Robot control method and device and readable storage medium | |
JP2014219911A (en) | Simulation device and simulation program | |
CN109108967B (en) | Motor compensation method, driver, mechanical arm joint module and mechanical arm | |
US7107119B2 (en) | Controller for a machine tool or production machine | |
CN116500977A (en) | Servo control system, control data conversion method and computing device | |
CN108829440B (en) | Method and system for converting logic configuration array into logic execution command | |
US9910995B2 (en) | System and method for secure file transmission | |
CN216544827U (en) | Control system and electronic device of bending machine | |
CN114665749B (en) | Motor high-precision subdivision control method, system, terminal equipment and storage medium | |
US6978186B2 (en) | Modular functional block for an electronic control system | |
US10114359B2 (en) | Numerical control device for realizing high-speed input and output of external signal in servo controller | |
CN112910332B (en) | Method and device for determining initial electrical angle of permanent magnet synchronous motor and storage medium | |
JPS61150686A (en) | Servo motor control system | |
CN105227041A (en) | The control method of motor driver and motor driven systems | |
CN110977180A (en) | Control method of marking device, marking device and storage medium | |
CN114365048A (en) | Numerical control device | |
CN117811463B (en) | Magnetic suspension motor control method and device, motor controller and storage medium | |
French et al. | Simulink real time controller implementation in a DSP based motor drive system | |
JP2008299763A (en) | Distributed object development tool | |
CN208723824U (en) | Motor micromanipulator |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20201204 |
|
RJ01 | Rejection of invention patent application after publication |