CN102902207A - Method, device and system for integrated turntable control based on Matlab/VC - Google Patents

Method, device and system for integrated turntable control based on Matlab/VC Download PDF

Info

Publication number
CN102902207A
CN102902207A CN2012104538194A CN201210453819A CN102902207A CN 102902207 A CN102902207 A CN 102902207A CN 2012104538194 A CN2012104538194 A CN 2012104538194A CN 201210453819 A CN201210453819 A CN 201210453819A CN 102902207 A CN102902207 A CN 102902207A
Authority
CN
China
Prior art keywords
program
motor
driven
serial
parameter
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.)
Granted
Application number
CN2012104538194A
Other languages
Chinese (zh)
Other versions
CN102902207B (en
Inventor
郑伟
王鹏
高显忠
刘多能
朱炳杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
National University of Defense Technology
Original Assignee
National University of Defense Technology
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 National University of Defense Technology filed Critical National University of Defense Technology
Priority to CN201210453819.4A priority Critical patent/CN102902207B/en
Publication of CN102902207A publication Critical patent/CN102902207A/en
Application granted granted Critical
Publication of CN102902207B publication Critical patent/CN102902207B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention discloses a method, a device and a system for integrated turntable control based on Matlab/VC. The method for integrated turntable control based on Matlab/VC comprises the following steps of: obtaining a serial port data packet according to a real-time control parameter generated by a motor control program, wherein the motor control program is a program edited based on Matlab; and transmitting the serial port data packet via the first serial port of virtual serial ports so that a motor drive program controls the turntable according to the valve of a motor drive parameter, wherein the motor drive program is a drive program edited based on VC; and the value of the motor drive parameter is a drive parameter value obtained by decoding the serial port data packet. The problem of high price of the dSPACE real-time simulation system used in the prior art, and the problems of non-flexibility and inconvenience shortcomings of the system in control on the small-sized turntable are solved; and the effect of flexibly controlling the small-sized turntable is achieved.

Description

Turntable integrated control method, device and system based on Matlab/VC
Technical field
The present invention relates to computing machine semi-matter simulating system design field, in particular to a kind of turntable integrated control method, device and system based on Matlab/VC.
Background technology
In the process of carrying out the semi-matter simulating system design, important problem is to guarantee that emulator control program can the residing simulated environment of Real Time Drive controlled device, three-axle table such as virtual space attitude environment, the position of three-axle table be actually by in the space vertically arranged three motor-driven, so the problems referred to above are actually problem how to utilize emulator control program Real Time Drive motor.
Servomotor is all with servomotor controller, and manufacturer is distributed to the user with the motion control function of motor with the form of dynamic data chained library .dll file, calls for the user.Utilize this motion control function, can control motor by servomotor controller and move in any way.But these dynamic link libraries are all by the C language compilation, and only support and C language related platform calls.Large with C language compilation control simulated program workload, loaded down with trivial details and very easily make mistakes.Therefore directly with C language related platform such as VC(Microsoft Visual C++) directly to write Electric Machine Control driven by program motor movement be unpractical.
Matlab software is international control circle the recognized standard software for calculation, uses its Simulink tool box that carries can use easily graphical module to build the control simulated program.Utilize the storehouse of Matlab to be written into function and can call dynamic link library file, but need to use the mode of Matlab/VC hybrid programming to realize calling Dynamic Link Library Function.Because Matlab is interpreted language, before and after each command execution, all need statement carried out the work such as some explanations, storage allocation, can't satisfy the requirement that the motor-driven function sends gating pulse in real time, therefore can not directly use the Electric Machine Control program direct-driving motor motion of Matlab.
Solve one of above-mentioned contradiction preferably method be the real-time emulation system that uses dSPACE company to produce, it is based on the control system exploitation of Matlab/Simulink and the workbench of test, has realized the seamless link with Matlab/Simulink.But the dSPACE real-time emulation system is expensive, also has dumb, inconvenient shortcoming for the control of small turntable.
Expensive for the dSPACE real-time emulation system that uses in the prior art, and also have the problem of dumb, inconvenient shortcoming for the control of small turntable, effective solution is not yet proposed at present.
Summary of the invention
Fundamental purpose of the present invention is to provide a kind of turntable integrated control method, device and system based on Matlab/VC, expensive to solve the dSPACE real-time emulation system that uses in the prior art, and also have the problem of dumb, inconvenient shortcoming for the control of small turntable.
To achieve these goals, according to an aspect of the present invention, provide a kind of turntable integrated control method based on Matlab/VC.The method comprises: the real-time control parameter that generates according to the Electric Machine Control program obtains the serial data bag, and the Electric Machine Control program is for to write the program that obtains based on Matlab; And by the first serial of virtual serial port the serial data bag is sent, so that the motor-driven program is controlled turntable according to the value of motor-driven parameter, the motor-driven program is for to write the driver that obtains based on VC, wherein, the driving parameter value of the value of motor-driven parameter for the serial data bag is decoded and obtained.
Further, the real-time control parameter that the Electric Machine Control program is generated is packed and is comprised: adopt the RS232 coded format that the real-time control parameter that the Electric Machine Control program generates is packed.
Further, first serial by virtual serial port sends the serial data bag and comprises: the serial data bag is sent by serial ports transmission program, serial ports transmission program is that Matlab platform counterdie blocking programming realizes, the string slogan that serial ports sends program is first serial number.
Further, the motor-driven parameter comprises following a kind of at least: low velocity, high-speed, acceleration, displacement and kinematic axis.
To achieve these goals, according to a further aspect in the invention, also provide a kind of turntable integrated control method based on Matlab/VC.The method comprises: the second serial by virtual serial port receives the serial data bag, the serial data bag that the serial data bag obtains for the real-time control parameter that generates according to the Electric Machine Control program, and the Electric Machine Control program is for to write the program that obtains based on Matlab; The serial data bag is decoded, obtain decoded data; From decoded data, extract the value of motor-driven parameter; With the value assignment of motor-driven parameter in the motor-driven program so that the motor-driven program is controlled turntable according to the value of motor-driven parameter, the motor-driven program is for to write the driver that obtains based on VC.
Further, the second serial by virtual serial port receives the serial data bag and comprises: receive the serial data bag by the serial ports reception program, the serial ports reception program is that the programming of VC platform counterdie blocking realizes, the string slogan of serial ports reception program is second serial number.
Further, the motor-driven parameter comprises following a kind of at least: low velocity, high-speed, acceleration, displacement and kinematic axis.
To achieve these goals, according to a further aspect in the invention, also provide a kind of turntable integrated control unit based on Matlab/VC.This device comprises: the packet generation module, be used for obtaining the serial data bag according to the real-time control parameter that the Electric Machine Control program generates, and the Electric Machine Control program is for to write the program that obtains based on Matlab; And sending module, be used for by the first serial of virtual serial port the serial data bag being sent, so that the motor-driven program is controlled turntable according to the value of motor-driven parameter, the motor-driven program is for to write the driver that obtains based on VC, wherein, the driving parameter value of the value of motor-driven parameter for the serial data bag is decoded and obtained.
To achieve these goals, according to a further aspect in the invention, also provide a kind of turntable integrated control unit based on Matlab/VC.This device comprises: packet-receiving module, be used for receiving the serial data bag by the second serial of virtual serial port, the serial data bag that the serial data bag obtains for the real-time control parameter that generates according to the Electric Machine Control program, the Electric Machine Control program is for to write the program that obtains based on Matlab; Decoder module is used for the serial data bag is decoded, and obtains decoded data; Extraction module is used for from the value of decoded data extraction motor-driven parameter; The assignment module, be used for value assignment with the motor-driven parameter to the motor-driven program so that the motor-driven program is controlled turntable according to the value of motor-driven parameter, the motor-driven program is for to write the driver that obtains based on VC.
To achieve these goals, according to a further aspect in the invention, also provide a kind of turntable integral control system based on Matlab/VC.This system comprises: dispensing device, dispensing device are used for obtaining the serial data bag according to the real-time control parameter that the Electric Machine Control program generates, and the Electric Machine Control program is for to write the program that obtains based on Matlab; First serial by virtual serial port sends the serial data bag; And receiving trap, receiving trap is used for receiving the serial data bag by the second serial of virtual serial port; The serial data bag is decoded, obtain decoded data; From decoded data, extract the value of motor-driven parameter; With the value assignment of motor-driven parameter in the motor-driven program so that the motor-driven program is controlled turntable according to the value of motor-driven parameter, the motor-driven program is for to write the driver that obtains based on VC.
By the present invention, solved the dSPACE real-time emulation system that uses in the prior art expensive, and also had the problem of dumb, inconvenient shortcoming for the control of small turntable, and then reached the effect of flexible control small turntable.
Description of drawings
The accompanying drawing that consists of the application's a part is used to provide a further understanding of the present invention, and illustrative examples of the present invention and explanation thereof are used for explaining the present invention, do not consist of improper restriction of the present invention.In the accompanying drawings:
Fig. 1 is the structural drawing according to a kind of turntable integrated control unit based on Matlab/VC of the embodiment of the invention;
Fig. 2 is the schematic diagram according to the serial ports order format definition of the embodiment of the invention;
Fig. 3 is according to the another kind of the embodiment of the invention structural drawing based on the turntable integrated control unit of Matlab/VC;
Fig. 4 is the process flow diagram according to the driving turntable rotation of the embodiment of the invention;
Fig. 5 is the structural drawing according to a kind of turntable integral control system based on Matlab/VC of the embodiment of the invention;
Fig. 6 is the process flow diagram according to a kind of turntable integrated control method based on Matlab/VC of the embodiment of the invention; And
Fig. 7 is according to the another kind of the embodiment of the invention process flow diagram based on the turntable integrated control method of Matlab/VC.
Embodiment
Need to prove, in the situation that do not conflict, embodiment and the feature among the embodiment among the application can make up mutually.Describe below with reference to the accompanying drawings and in conjunction with the embodiments the present invention in detail.
Fig. 1 is that as shown in Figure 1, the turntable integrated control unit based on Matlab/VC of this embodiment comprises according to the structural drawing of a kind of turntable integrated control unit based on Matlab/VC of the embodiment of the invention:
Packet generation module 11 is used for obtaining the serial data bag according to the real-time control parameter that the Electric Machine Control program generates, and this Electric Machine Control program is for to write the program that obtains based on Matlab.
Can adopt the RS232 coded format that the real-time control parameter that the Electric Machine Control program generates is packed.For example, can utilize Simulink tool box constructing modular Electric Machine Control program at the Matlab platform.The effect of this Electric Machine Control program is by the real-time control parameter of kinetic model emulation generation to turntable, these control parameters are arranged according to sequencing occurring, self-defined packet header, bag tail, adopt the RS232 coded format to be packaged into a serial data bag, this serial ports order format definition can be as shown in Figure 2.
Sending module 12, be used for by the first serial of virtual serial port the serial data bag being sent, so that the motor-driven program is controlled turntable according to the value of motor-driven parameter, this motor-driven program is for to write the driver that obtains based on VC, wherein, the driving parameter value of the value of this motor-driven parameter for this serial data bag decoding is obtained.
The serial data bag can be sent by serial ports transmission program, serial ports transmission program is that the programming of Matlab platform counterdie blocking realizes, the string slogan that serial ports sends program is first serial number.For example, can VSPD virtual serial port program be installed at main control computer, a pair of virtual serial port is set on computers, the effect of this virtual serial port is to realize the communication between the different system software on the same computing machine, and communication mode adopts the RS232 coded format.This virtual serial port is the information bridge that connects Electric Machine Control program and motor-driven program.Virtual serial port can be realized by the mode that VSPD virtual serial port program is installed at main control computer.Then utilize PacketOutput module in the Real-Time windows Target tool box to set up serial data and send program, the string slogan is configured to first serial number in the above-mentioned virtual serial port.
The motor-driven parameter can comprise: low velocity, high-speed, acceleration, displacement, kinematic axis.
For example, the turntable integrated control unit based on Matlab/VC of the present embodiment can be realized in the following manner:
(1) a newly-built SerialPort.mdl file under the matlab platform, pull a Packet Output module into, double-click module and eject Block Parameters:Packet Output, click Install new board and select StardardDevices-SerialPort ejects that Serial Port selects virtual serial port in the dialog box.Regulation instruction according to order format has 11 characters, therefore Output packet size is set to 11.Each numerical value is to send with character style, all is expressed as the int8 type in matlab, therefore in Output Packet field data types, be set to:
{'1*int8','1*int8','1*int8','1*int8','1*int8','1*int8','1*int8','1*int8','1*int8','1*int8','1*int8'}。
(2) the metric numerical value that is of inputting among the Packet Output after finishing is set, input be the corresponding ASCII character of decimal system numerical value, be 65 such as what input, that receive with COM Debug Assistant is exactly A; What input is 48, and what receive is exactly 0.Electric Machine Control program in (1) is carried out the real time implementation configuration, generate the RTW program of real time execution by the compiler directive among the Matlab.Under operating path, preserve module, in matlab command, input: rtwinconfigset (' SerialPort') get back to the simulink interface, press ctrl+B, generate the RTW program.Click ConnectTo Target.Real-time program brings into operation.
(3) open the serial ports reception program of writing under the VC platform, the string slogan of serial ports reception program is set to the second serial number of virtual serial port, clicks Start Realtime Code in the Simulink interface, and turntable is just according to the instruction operation of appointment.
Aforesaid way can adopt the some position motor pattern of metric coded format and motor.In the three-axle table control of reality, 16 scale coding forms are adopted in transmission between the data usually, the motor pattern of motor is also varied, but principle and method of operating and above step are identical, just sets different coded formats and adopts different motor-driven codes.
Electric Machine Control program in the present embodiment and serial ports send program and can realize by modularization programming, and both only have the parameter transitive relation.
The turntable integrated control unit based on Matlab/VC that the present embodiment provides can be realized in following hardware environment:
Main control computer is winXP operating system, and the model of turntable motor servo driving case is HS11056, and the motor model of three-axle table is SRH1254-12.
Turntable integrated control unit based on Matlab/VC provided by the invention, connect the Electric Machine Control program of writing based on Matlab and the motor-driven program of writing based on VC by virtual serial port, the modularity control program that has realized being built by Matlab is to the real-time integrated driving process of controlling of turntable, so that the user can be in the situation that do not utilize other hardware conversion equipment, utilizing the upper Electric Machine Control program of working out of Matlab directly to drive turntable is synchronized with the movement, therefore effectively reduce the rotating platform control system manufacturing cost, made things convenient for the user that turntable is controlled and personal settings flexibly.
The turntable integrated control unit based on Matlab/VC that above-described embodiment provides is used for sending the serial data bag, and correspondingly, the embodiment of the invention also provides a kind of turntable integrated control unit based on Matlab/VC to be used for receiving the serial data bag.
Fig. 3 is that as shown in Figure 3, the turntable integrated control unit based on Matlab/VC of this embodiment comprises according to the structural drawing of a kind of turntable integrated control unit based on Matlab/VC of the embodiment of the invention:
Packet-receiving module 21, be used for receiving the serial data bag by the second serial of virtual serial port, the serial data bag that this serial data bag obtains for the real-time control parameter that generates according to the Electric Machine Control program, this Electric Machine Control program is for to write the program that obtains based on Matlab.
Can receive the serial data bag by the serial ports reception program, the serial ports reception program is that the programming of VC platform counterdie blocking realizes, the string slogan of serial ports reception program is second serial number.For example, can VSPD virtual serial port program be installed at main control computer, a pair of virtual serial port is set on computers, the effect of this virtual serial port is to realize the communication between the different system software on the same computing machine, and communication mode adopts the RS232 coded format.The motor-driven parameter can comprise: low velocity, high-speed, acceleration, displacement, kinematic axis.Write the serial ports reception program, the motor-driven parameter is arranged according to sequencing occurring, self-defined packet header, bag tail are packaged into a serial data bag.The string slogan is configured in a pair of virtual serial port one.The definition of serial ports order format can be as shown in Figure 2.
Decoder module 22 is used for this serial data bag is decoded, and obtains decoded data.
Extraction module 23 is used for from the value of this decoded data extraction motor-driven parameter.
Assignment module 24, be used for value assignment with this motor-driven parameter to the motor-driven program so that the motor-driven program is controlled turntable according to the value of motor-driven parameter, this motor-driven program is for to write the driver that obtains based on VC.
The effect of this motor-driven program is to receive by virtual serial port to send to the real-time control parameter that is generated in real time by the Electric Machine Control program on the VC platform.By the serial data bag that receives is decoded, extract the motor-driven parameter, the parameter assignment in the turntable driver, is driven the turntable running.The motor-driven parameter can comprise: low velocity, high-speed, acceleration, displacement, kinematic axis.
Participate in Fig. 4, the serial ports reception program detects whether receive character, if receive character, then that the character that receives is cumulative, judge then whether character is packet header, if not, judge then whether character is the bag tail, after judging that character is for the bag tail, extract the value of motor-driven parameter, then the actuating motor driver drives the turntable operation.
Turntable motor driver in the present embodiment and serial ports reception program can be realized by modularization programming, and both only have the parameter transitive relation.
The turntable integrated control unit based on Matlab/VC that the present embodiment provides can be realized in following hardware environment:
Main control computer is winXP operating system, and the model of turntable motor servo driving case is HS11056, and the motor model of three-axle table is SRH1254-12.
Turntable integrated control unit based on Matlab/VC provided by the invention, connect the Electric Machine Control program of writing based on Matlab and the motor-driven program of writing based on VC by virtual serial port, the modularity control program that has realized being built by Matlab is to the real-time integrated driving process of controlling of turntable, so that the user can be in the situation that do not utilize other hardware conversion equipment, utilizing the upper Electric Machine Control program of working out of Matlab directly to drive turntable is synchronized with the movement, therefore effectively reduce the rotating platform control system manufacturing cost, made things convenient for the user that turntable is controlled and personal settings flexibly.
The embodiment of the invention also provides a kind of turntable integral control system based on Matlab/VC, should comprise the turntable integrated control unit based on Matlab/VC that above-described embodiment provides based on the turntable integral control system of Matlab/VC.
Fig. 5 is that as shown in Figure 5, the turntable integral control system based on Matlab/VC of this embodiment comprises according to the structural drawing of a kind of turntable integral control system based on Matlab/VC of the embodiment of the invention:
Dispensing device 31, this dispensing device are used for obtaining the serial data bag according to the real-time control parameter that the Electric Machine Control program generates, and this Electric Machine Control program is for to write the program that obtains based on Matlab; First serial by virtual serial port sends the serial data bag.
Can VSPD virtual serial port journey be installed at main control computer.The effect of this virtual serial port is to realize the communication between the different system software on the same computing machine, and communication mode adopts the RS232 coded format.Virtual serial port is realized by the mode that VSPD virtual serial port program is installed at main control computer.
Can write serial ports and send program under the Matlab platform, the string slogan that this serial ports sends program is set to the first serial number of virtual serial port.
Receiving trap 32, this receiving trap are used for receiving the serial data bag by the second serial of virtual serial port; The serial data bag is decoded, obtain decoded data; From decoded data, extract the value of motor-driven parameter; With the value assignment of motor-driven parameter in the motor-driven program so that the motor-driven program is controlled turntable according to the value of motor-driven parameter, this motor-driven program is for to write the driver that obtains based on VC.
Can write the serial ports reception program under the VC platform, the string slogan of serial ports reception program is set to the second serial number of virtual serial port.
Turntable integral control system based on Matlab/VC provided by the invention, connect the Electric Machine Control program of writing based on Matlab and the motor-driven program of writing based on VC by virtual serial port, the modularity control program that has realized being built by Matlab is to the real-time integrated driving process of controlling of turntable, so that the user can be in the situation that do not utilize other hardware conversion equipment, utilizing the upper Electric Machine Control program of working out of Matlab directly to drive turntable is synchronized with the movement, therefore effectively reduce the rotating platform control system manufacturing cost, made things convenient for the user that turntable is controlled and personal settings flexibly.
Fig. 6 is that as shown in Figure 6, the turntable integrated control method based on Matlab/VC of this embodiment comprises according to the process flow diagram of a kind of turntable integrated control method based on Matlab/VC of the embodiment of the invention:
Step 401: the real-time control parameter that generates according to the Electric Machine Control program obtains the serial data bag, and this Electric Machine Control program is for to write the program that obtains based on Matlab.
Can adopt the RS232 coded format that the real-time control parameter that the Electric Machine Control program generates is packed.For example, can utilize Simulink tool box constructing modular Electric Machine Control program at the Matlab platform.The effect of this Electric Machine Control program is by the real-time control parameter of kinetic model emulation generation to turntable, these control parameters are arranged according to sequencing occurring, self-defined packet header, bag tail, adopt the RS232 coded format to be packaged into a serial data bag, this serial ports order format definition can be as shown in Figure 2.
Step 402: the first serial by virtual serial port sends the serial data bag, so that the motor-driven program is controlled turntable according to the value of motor-driven parameter, this motor-driven program is for to write the driver that obtains based on VC, wherein, the value of this motor-driven parameter is this driving parameter value that decoding obtains to the serial data bag.
The serial data bag can be sent by serial ports transmission program, serial ports transmission program is that the programming of Matlab platform counterdie blocking realizes, the string slogan that serial ports sends program is first serial number.For example, can VSPD virtual serial port program be installed at main control computer, a pair of virtual serial port is set on computers, the effect of this virtual serial port is to realize the communication between the different system software on the same computing machine, and communication mode adopts the RS232 coded format.This virtual serial port is the information bridge that connects Electric Machine Control program and motor-driven program.Virtual serial port can be realized by the mode that VSPD virtual serial port program is installed at main control computer.Then utilize PacketOutput module in the Real-Time windows Target tool box to set up serial data and send program, the string slogan is configured to first serial number in the above-mentioned virtual serial port.
The motor-driven parameter can comprise: low velocity, high-speed, acceleration, displacement, kinematic axis.
Turntable integrated control method based on Matlab/VC provided by the invention, connect the Electric Machine Control program of writing based on Matlab and the motor-driven program of writing based on VC by virtual serial port, the modularity control program that has realized being built by Matlab is to the real-time integrated driving process of controlling of turntable, so that the user can be in the situation that do not utilize other hardware conversion equipment, utilizing the upper Electric Machine Control program of working out of Matlab directly to drive turntable is synchronized with the movement, therefore effectively reduce the rotating platform control system manufacturing cost, made things convenient for the user that turntable is controlled and personal settings flexibly.
The turntable integrated control method based on Matlab/VC that above-described embodiment provides is used for sending the serial data bag, and correspondingly, the embodiment of the invention also provides a kind of turntable integrated control method based on Matlab/VC to be used for receiving the serial data bag.
Fig. 7 is that as shown in Figure 7, the turntable integrated control method based on Matlab/VC of this embodiment comprises according to the process flow diagram of a kind of turntable integrated control method based on Matlab/VC of the embodiment of the invention:
Step 501: the second serial by virtual serial port receives the serial data bag, the serial data bag that this serial data bag obtains for the real-time control parameter that generates according to the Electric Machine Control program, and this Electric Machine Control program is for to write the program that obtains based on Matlab.
Can receive the serial data bag by the serial ports reception program, the serial ports reception program is that the programming of VC platform counterdie blocking realizes, the string slogan of serial ports reception program is second serial number.For example, can VSPD virtual serial port program be installed at main control computer, a pair of virtual serial port is set on computers, the effect of this virtual serial port is to realize the communication between the different system software on the same computing machine, and communication mode adopts the RS232 coded format.The motor-driven parameter can comprise: low velocity, high-speed, acceleration, displacement, kinematic axis.Write the serial ports reception program, the motor-driven parameter is arranged according to sequencing occurring, self-defined packet header, bag tail are packaged into a serial data bag.The string slogan is configured in a pair of virtual serial port one.The definition of serial ports order format can be as shown in Figure 2.
Step 502: this serial data bag is decoded, obtain decoded data.
Step 503: the value of from this decoded data, extracting the motor-driven parameter.
Step 504: with the value assignment of this motor-driven parameter in the motor-driven program so that the motor-driven program is controlled turntable according to the value of motor-driven parameter, this motor-driven program is for to write the driver that obtains based on VC.
The effect of this motor-driven program is to receive by virtual serial port to send to the real-time control parameter that is generated in real time by the Electric Machine Control program on the VC platform.By the serial data bag that receives is decoded, extract the motor-driven parameter, the parameter assignment in the turntable driver, is driven the turntable running.The motor-driven parameter can comprise: low velocity, high-speed, acceleration, displacement, kinematic axis.
Participate in Fig. 4, the serial ports reception program detects whether receive character, if receive character, then that the character that receives is cumulative, judge then whether character is packet header, if not, judge then whether character is the bag tail, after judging that character is for the bag tail, extract the value of motor-driven parameter, then the actuating motor driver drives the turntable operation.
Turntable integrated control method based on Matlab/VC provided by the invention, connect the Electric Machine Control program of writing based on Matlab and the motor-driven program of writing based on VC by virtual serial port, the modularity control program that has realized being built by Matlab is to the real-time integrated driving process of controlling of turntable, so that the user can be in the situation that do not utilize other hardware conversion equipment, utilizing the upper Electric Machine Control program of working out of Matlab directly to drive turntable is synchronized with the movement, therefore effectively reduce the rotating platform control system manufacturing cost, made things convenient for the user that turntable is controlled and personal settings flexibly.
Need to prove, can in the computer system such as one group of computer executable instructions, carry out in the step shown in the process flow diagram of accompanying drawing, and, although there is shown logical order in flow process, but in some cases, can carry out step shown or that describe with the order that is different from herein.
Obviously, those skilled in the art should be understood that, above-mentioned each module of the present invention or each step can realize with general calculation element, they can concentrate on the single calculation element, perhaps be distributed on the network that a plurality of calculation elements form, alternatively, they can be realized with the executable program code of calculation element, thereby, they can be stored in the memory storage and be carried out by calculation element, perhaps they are made into respectively each integrated circuit modules, perhaps a plurality of modules in them or step are made into the single integrated circuit module and realize.Like this, the present invention is not restricted to any specific hardware and software combination.
The above is the preferred embodiments of the present invention only, is not limited to the present invention, and for a person skilled in the art, the present invention can have various modifications and variations.Within the spirit and principles in the present invention all, any modification of doing, be equal to replacement, improvement etc., all should be included within protection scope of the present invention.

Claims (10)

1. the turntable integrated control method based on Matlab/VC is characterized in that, comprising:
The real-time control parameter that generates according to the Electric Machine Control program obtains the serial data bag, and described Electric Machine Control program is for to write the program that obtains based on Matlab; And
First serial by virtual serial port sends described serial data bag, so that the motor-driven program is controlled turntable according to the value of motor-driven parameter, described motor-driven program is for to write the driver that obtains based on VC, wherein, the driving parameter value of the value of described motor-driven parameter for described serial data bag decoding is obtained.
2. method according to claim 1 is characterized in that, the described real-time control parameter that the Electric Machine Control program is generated is packed and comprised:
Adopt the RS232 coded format that the real-time control parameter that the Electric Machine Control program generates is packed.
3. method according to claim 1 is characterized in that, described first serial by virtual serial port sends described serial data bag and comprises:
Described serial data bag is sent by serial ports transmission program, and described serial ports transmission program is that the programming of Matlab platform counterdie blocking realizes, the string slogan that described serial ports sends program is described first serial number.
4. method according to claim 1 is characterized in that, described motor-driven parameter comprises following a kind of at least:
Low velocity, high-speed, acceleration, displacement and kinematic axis.
5. the turntable integrated control method based on Matlab/VC is characterized in that, comprising:
Second serial by virtual serial port receives the serial data bag, the serial data bag that described serial data bag obtains for the real-time control parameter that generates according to the Electric Machine Control program, and described Electric Machine Control program is for to write the program that obtains based on Matlab;
Described serial data bag is decoded, obtain decoded data;
From described decoded data, extract the value of motor-driven parameter;
With the value assignment of described motor-driven parameter in the motor-driven program so that described motor-driven program is controlled turntable according to the value of described motor-driven parameter, described motor-driven program is for to write the driver that obtains based on VC.
6. method according to claim 5 is characterized in that, described second serial by virtual serial port receives the serial data bag and comprises:
Receive the serial data bag by the serial ports reception program, described serial ports reception program is that the programming of VC platform counterdie blocking realizes, the string slogan of described serial ports reception program is described second serial number.
7. method according to claim 5 is characterized in that, described motor-driven parameter comprises following a kind of at least:
Low velocity, high-speed, acceleration, displacement and kinematic axis.
8. the turntable integrated control unit based on Matlab/VC is characterized in that, comprising:
The packet generation module is used for obtaining the serial data bag according to the real-time control parameter that the Electric Machine Control program generates, and described Electric Machine Control program is for to write the program that obtains based on Matlab; And
Sending module, be used for by the first serial of virtual serial port described serial data bag being sent, so that the motor-driven program is controlled turntable according to the value of motor-driven parameter, described motor-driven program is for to write the driver that obtains based on VC, wherein, the driving parameter value of the value of described motor-driven parameter for described serial data bag decoding is obtained.
9. the turntable integrated control unit based on Matlab/VC is characterized in that, comprising:
Packet-receiving module, be used for receiving the serial data bag by the second serial of virtual serial port, the serial data bag that described serial data bag obtains for the real-time control parameter that generates according to the Electric Machine Control program, described Electric Machine Control program is for to write the program that obtains based on Matlab;
Decoder module is used for described serial data bag is decoded, and obtains decoded data;
Extraction module is used for from the value of described decoded data extraction motor-driven parameter;
The assignment module, be used for value assignment with described motor-driven parameter to the motor-driven program so that described motor-driven program is controlled turntable according to the value of described motor-driven parameter, described motor-driven program is for to write the driver that obtains based on VC.
10. the turntable integral control system based on Matlab/VC is characterized in that, comprising:
Dispensing device, described dispensing device are used for obtaining the serial data bag according to the real-time control parameter that the Electric Machine Control program generates, and described Electric Machine Control program is for to write the program that obtains based on Matlab; First serial by virtual serial port sends described serial data bag; And
Receiving trap, described receiving trap are used for receiving described serial data bag by the second serial of described virtual serial port; Described serial data bag is decoded, obtain decoded data; From described decoded data, extract the value of motor-driven parameter; With the value assignment of described motor-driven parameter in the motor-driven program so that described motor-driven program is controlled turntable according to the value of described motor-driven parameter, described motor-driven program is for to write the driver that obtains based on VC.
CN201210453819.4A 2012-11-13 2012-11-13 Method, device and system for integrated turntable control based on Matlab/VC Active CN102902207B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210453819.4A CN102902207B (en) 2012-11-13 2012-11-13 Method, device and system for integrated turntable control based on Matlab/VC

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210453819.4A CN102902207B (en) 2012-11-13 2012-11-13 Method, device and system for integrated turntable control based on Matlab/VC

Publications (2)

Publication Number Publication Date
CN102902207A true CN102902207A (en) 2013-01-30
CN102902207B CN102902207B (en) 2015-06-17

Family

ID=47574509

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210453819.4A Active CN102902207B (en) 2012-11-13 2012-11-13 Method, device and system for integrated turntable control based on Matlab/VC

Country Status (1)

Country Link
CN (1) CN102902207B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104052632A (en) * 2014-05-29 2014-09-17 汉柏科技有限公司 Device automation testing method and device based on virtual serial port servers
CN108897322A (en) * 2018-07-18 2018-11-27 大连海事大学 Unmanned boat autonomous navigation Track In Track controller test emulation platform and working method
CN112859757A (en) * 2019-11-27 2021-05-28 宁波舜宇智能科技有限公司 Edge calculation control method, edge calculation control device, edge computer and readable storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101051226A (en) * 2007-02-27 2007-10-10 宁波杉工结构监测与控制工程中心有限公司 Remote online monitor method and device for stayed-cable force
CN101308365A (en) * 2008-07-07 2008-11-19 株洲南车时代电气股份有限公司 Quick control prototype system and realization method
CN101738642A (en) * 2008-11-10 2010-06-16 同济大学 Method for processing ground penetrating radar data
US7865349B2 (en) * 2001-01-19 2011-01-04 National Instruments Corporation Simulation, measurement and/or control system and method with coordinated timing
CN102033739A (en) * 2009-09-24 2011-04-27 宗鹏 Combined programming of MATLAB and OPNET for solving problem of automatic tracking of array antenna in OPNET pipeline
CN102298334A (en) * 2011-08-31 2011-12-28 北京空间飞行器总体设计部 Breakpoint simulation controller and control method for ground simulation system
CN102608922A (en) * 2012-03-27 2012-07-25 中国科学院光电技术研究所 Vega-and-RTW-based real-time visual simulation platform for photoelectric theodolite
CN102629110A (en) * 2012-04-12 2012-08-08 余大利 Pressurized water reactor hardware-in-the-loop simulation system based on physical model

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7865349B2 (en) * 2001-01-19 2011-01-04 National Instruments Corporation Simulation, measurement and/or control system and method with coordinated timing
CN101051226A (en) * 2007-02-27 2007-10-10 宁波杉工结构监测与控制工程中心有限公司 Remote online monitor method and device for stayed-cable force
CN101308365A (en) * 2008-07-07 2008-11-19 株洲南车时代电气股份有限公司 Quick control prototype system and realization method
CN101738642A (en) * 2008-11-10 2010-06-16 同济大学 Method for processing ground penetrating radar data
CN102033739A (en) * 2009-09-24 2011-04-27 宗鹏 Combined programming of MATLAB and OPNET for solving problem of automatic tracking of array antenna in OPNET pipeline
CN102298334A (en) * 2011-08-31 2011-12-28 北京空间飞行器总体设计部 Breakpoint simulation controller and control method for ground simulation system
CN102608922A (en) * 2012-03-27 2012-07-25 中国科学院光电技术研究所 Vega-and-RTW-based real-time visual simulation platform for photoelectric theodolite
CN102629110A (en) * 2012-04-12 2012-08-08 余大利 Pressurized water reactor hardware-in-the-loop simulation system based on physical model

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
张力等: "Labview 及Proteus 软件环境下单片机串口通讯的仿真方法", 《电子测量技术》 *
罗建国等: "上位机系统中VC、Matlab和LabVIEW程序间的串行通讯", 《化工自动化及仪表》 *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104052632A (en) * 2014-05-29 2014-09-17 汉柏科技有限公司 Device automation testing method and device based on virtual serial port servers
CN104052632B (en) * 2014-05-29 2018-01-02 汉柏科技有限公司 Equipment automatization method of testing and device based on virtual serial port server
CN108897322A (en) * 2018-07-18 2018-11-27 大连海事大学 Unmanned boat autonomous navigation Track In Track controller test emulation platform and working method
CN108897322B (en) * 2018-07-18 2021-02-12 大连海事大学 Unmanned ship autonomous navigation track tracking controller test simulation platform and working method
CN112859757A (en) * 2019-11-27 2021-05-28 宁波舜宇智能科技有限公司 Edge calculation control method, edge calculation control device, edge computer and readable storage medium

Also Published As

Publication number Publication date
CN102902207B (en) 2015-06-17

Similar Documents

Publication Publication Date Title
CN102681465A (en) Industrial robot demonstration planner with motion planning function and control method for industrial robot demonstration planner
CN103823467A (en) Control method of industrial robot demonstration planner with motion planning function
CN201689302U (en) Integrated intelligent servo driver
CN101114174A (en) Built-in type 4 axis sport controller
CN110967992A (en) Control system and method for robot
CN102955460A (en) Control system of numerical control system master station over input/output (IO) terminal slave station
CN101833892A (en) Embedded type teaching programming device and method for welding robot
CN110271009B (en) Method for realizing manipulator teaching function based on PLC robot-simulated instruction
CN104786221A (en) Opening type mechanical arm control method based on Ethernet
CN1936747A (en) Edition-translation type numerical-control system and edition-translation and operation control method of same
CN102122149A (en) Embedded control system for carton proofing machine and control method thereof
CN104698950A (en) Peripheral device control method, microcontroller, upper computer and system
CN105137800A (en) PLC cooperative control device based on SOPC technology
CN103226344A (en) Motion control on-chip system
CN103941650A (en) Logic and movement integrated controller
CN110488764A (en) A kind of engraving machine motion controller and its engraving equipment and method based on FPGA
CN102902207B (en) Method, device and system for integrated turntable control based on Matlab/VC
CN107783501A (en) A kind of numerical control interpolation system of PCIe controls
CN110355759A (en) A kind of industrial robot gluing control system of view-based access control model
CN112207829A (en) Robot control method and device and readable storage medium
CN102789206B (en) The centralized safety logic control system mixed with distributed AC servo system in numerical control of machine tools
CN102109835A (en) Motion control system based on PLC (programmable logic controller)
CN102567071A (en) Virtual serial port system and communication method for same
CN103552072B (en) A kind of robot control method based on embedded controller and device
CN201945835U (en) Embedded control system used for carton proofing machine

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant