Disclosure of Invention
The invention aims to overcome the defects of the prior art and provide a system and a method for virtually and visually displaying the attitude of an excavator, so that the virtual visual display of the action attitude of the excavator can be realized without additionally developing a display interface and constructing a kinematic relationship among each component.
In order to achieve the purpose, the invention adopts the following technical scheme to realize the purpose:
a system for virtually and visually displaying the posture of an excavator comprises a lower computer control terminal, a communication module and an upper computer display terminal;
the lower computer control terminal comprises two-degree-of-freedom rockers and a controller; the output ends of the two-degree-of-freedom rockers are connected with the input end of the controller; the output end of the controller is connected with a display terminal of an upper computer through a communication module, and the controller is used for sending the action data of the two-degree-of-freedom rockers to the display terminal of the upper computer;
the upper computer display terminal adopts a computer, Solidworks three-dimensional modeling software containing an excavator model is stored in the computer, and the computer is used for defining different actions of the two-degree-of-freedom rocking bars corresponding to different action parts of the excavator model, extracting data representing the actions of the two-degree-of-freedom rocking bars in data sent by the communication module, and assigning the extracted data to parameters of the action parts corresponding to the data.
Preferably, the two-degree-of-freedom rocker adopts a potentiometer.
Preferably, the controller adopts an STM32 singlechip.
Preferably, the communication module adopts a WiFi module, a Bluetooth module, a 2.4G wireless serial port module, a wireless radio frequency module or a zigbee module.
Preferably, the wireless communication module adopts a JDY-402.4G wireless serial port module.
A method for carrying out virtual visual display on the posture of an excavator based on any one system comprises the following steps;
establishing an excavator model in Solidworks three-dimensional modeling software of a computer;
step two, performing assembly relation definition on four action parts in the excavator model, establishing two moving auxiliary surfaces vertical to the moving direction for two parts which move linearly on the excavator model, defining the assembly relation type of the two moving auxiliary surfaces as a distance, and defining a distance value parameter as a variable; establishing two rotation auxiliary surfaces parallel to an axis for two components which rotate on an excavator model, defining the type of an assembly relation of the two rotation auxiliary surfaces as an angle, and defining an angle value parameter as a variable;
setting 4 bits of each frame of data sent by the communication module to respectively represent two front and back actions and two left and right actions of the two-degree-of-freedom rockers; defining different actions of the two-degree-of-freedom rocker to correspond to different action parts of the excavator model;
step four, defining four variables ch1, ch2, ch3 and ch4 in the computer, sending the action data of the two-degree-of-freedom rockers to the computer by the communication module, and respectively extracting 4-bit data representing the action of the two-degree-of-freedom rockers in the data sent by the communication module by the four variables;
and fifthly, assigning the data extracted by each variable to a distance value parameter or an angle value parameter of an action part corresponding to the data, excavating each action part of the model, and acting according to the distance value parameter or the angle value parameter of the action part.
Preferably, the two front-back actions and the two left-right actions of the two-degree-of-freedom rockers represent the extension and contraction of a boom cylinder, the extension and contraction of an arm cylinder, the extension and contraction of a bucket cylinder and the rotation of a rotating platform in the excavator model respectively.
Compared with the prior art, the invention has the following beneficial effects:
according to the system, the upper computer of the excavator model is built in the Solidworks three-dimensional modeling software, the assembly relation among the parts of the working device is defined, the action instruction parameters of the two-degree-of-freedom rocker can be given to the parameters of the assembly relation set by the upper computer, the action of the two-degree-of-freedom rocker is transmitted to the upper computer, the upper computer can embody the corresponding excavator model action in the Solidworks three-dimensional modeling software, the correlation among all the parts is not required to be edited, and the virtual visual display of the action posture of the excavator can be realized. The system simulates the operating handle of the excavator by utilizing the two-degree-of-freedom rocker based on the potentiometer, and compared with the excavator operation under the real condition, the reduction degree is higher; the lower computer control terminal which is constructed by the system and takes the single chip microcomputer as a core controller belongs to an open source system, and compared with a common non-open source handle in the market, the lower computer control terminal can modify a program code of the lower computer according to the running condition of the system, so that the debugging is facilitated; the upper computer of the system does not need to install other professional software except for the Solidworks software which is the software commonly used by most engineering technicians and the necessary operating environment for operating the upper computer program, so that the operating environment is also possessed by most computers, and no additional burden is caused to users.
According to the method, an excavator model is established in Solidworks three-dimensional modeling software, the assembly relation among parts of a working device is defined, and a virtual attitude display interface does not need to be additionally established; by combining the characteristics of Solidworks software, when the assembly relationship between two parts of the excavator working device is determined, the association relationship of the movement is also determined, and a kinematic model between the parts does not need to be additionally constructed; according to the method, the movement posture of the connecting rod working device is controlled by controlling the stretching amount of each working device oil cylinder of the excavator model, and compared with excavator movement control under a real condition, the reduction degree is higher.
Detailed Description
The invention is described in further detail below with reference to the accompanying drawings:
the system and the method for virtually and visually displaying the posture of the excavator comprise a hardware system and a software system.
As shown in fig. 2, the hardware system includes a lower computer control terminal, a wireless communication module, and an upper computer display terminal.
The software system comprises a data conversion program of rocker parameters, a sending program of data of a lower computer control terminal, a receiving program of an upper computer display terminal and a program for carrying out secondary development on Solidworks software.
The lower computer control terminal mainly comprises a two-degree-of-freedom rocker and an STM32 single chip microcomputer, and the two are connected according to the mode shown in figure 4; two-degree-of-freedom rocker output ends are connected with the ADC module input end of the STM32 single chip microcomputer, and the STM32 single chip microcomputer is connected with an upper computer display terminal through a wireless communication module.
The two-degree-of-freedom rocker of the lower computer control terminal adopts a potentiometer.
And the STM32 singlechip is selected as the controller of the lower computer control terminal.
The wireless communication module can be a WiFi module, a Bluetooth module, a 2.4G wireless serial port module, a zigbee module and the like. In this embodiment, the JDY-402.4G wireless serial port module is preferably used as the wireless communication module.
The upper computer display terminal is a computer capable of running Solidworks three-dimensional modeling software.
As shown in fig. 5, the excavator is in an actual state.
Defining an assembly relationship: and defining an assembly relation related to the posture of the excavator in a solidworks assembly model of the excavator. Take the telescopic length of the bucket cylinder and the rotation angle of the rotary platform as examples. As shown in fig. 5, for the telescopic length of the bucket cylinder, two auxiliary surfaces are established at the end surface of the bucket cylinder bore and the end surface of the piston rod, respectively, and the type of the fitting relationship of the two auxiliary surfaces is defined as "distance". As shown in fig. 6, for the corner of the revolving platform, two auxiliary reference surfaces are respectively established on the side surface of the revolving platform and the side surface of the walking device, and the type of the assembling relationship of the two auxiliary surfaces is defined as an "included angle". The assembly relation corresponds to the action command of the two-freedom-degree rocker.
An upper computer program: writing a secondary development program of solidworks, defining constant values in the assembly relationship as variables so as to facilitate subsequent control, wherein programming languages supported by the secondary development of solidworks comprise C #, C + + and VB and the like, preferably selecting the C # programming language, and writing the secondary development program of solidworks in a Visual Studio 2010 environment; as shown in fig. 7, a selection menu of parameters such as "serial number", "baud rate", "parity bit", "data bit", and "stop bit" is provided in the communication parameter setting interface of the upper computer.
The lower computer control terminal: and the operator operates the two-degree-of-freedom rockers on the lower machine control terminal in the mode of fig. 8. As the position of the rocker is changed, the current and the voltage of the rocker are correspondingly changed. The rocker circuit is connected with an analog-to-digital conversion (ADC) module of the STM32 through P0-P3 interfaces of the STM32 singlechip. Sampling the voltage signal of the rocker into a digital value through an ADC module of the STM 32;
the lower computer controls the sending of the terminal data: the JDY-40 wireless serial port module is connected with a universal synchronous asynchronous receiver USART of an STM32 singlechip through PB10 and PB11 interfaces of the STM32 singlechip. The collected rocker digital value is sent through a USART module of an STM32 singlechip and according to a certain protocol by means of a JDY-40 wireless serial port module. The length of each frame of data sent by the lower computer control terminal is 15, wherein the 5 th bit represents data of the Y axis of the left rocker; bit 7 represents left rocker X-axis data; bit 9 represents the right rocker Y-axis data; bit 11 represents the right rocker X-axis data.
A lower computer program: the lower computer program is written according to the flow shown in fig. 9. And finally, the control signal of the potentiometer is transmitted to the upper computer display terminal through the JDY-402.4G wireless serial port module.
Receiving data of the upper computer display terminal: the JDY-402.4G wireless serial port module of the receiving end is inserted into an upper computer through a USB port. Before data reception, a serial port number and a baud rate corresponding to an STM32 single chip microcomputer are selected in advance in a corresponding pull-down frame in a communication parameter setting interface shown in FIG. 7; the parameters of parity check bit, data bit and stop bit select default values of None, 8 and 1, and then start to receive data.
As shown in fig. 1, the process of virtual visual display of the excavator posture includes:
firstly, establishing an excavator model in Solidworks three-dimensional modeling software of an upper computer display terminal;
and step two, defining the assembly relation of a movable arm oil cylinder, a bucket rod oil cylinder, a bucket oil cylinder and a rotary platform in the excavator model.
For linear moving components on the excavator model, namely a boom cylinder, an arm cylinder and a bucket cylinder, two moving auxiliary surfaces perpendicular to the moving direction are established, the type of the assembling relation of the two moving auxiliary surfaces is defined as a distance, and a distance value parameter is defined as a variable.
For a rotating component on the excavator model, namely a rotary platform, two rotating auxiliary surfaces parallel to an axis are established, the type of the assembling relation of the two rotating auxiliary surfaces is defined as an angle, and an angle value parameter is defined as a variable.
Setting the length of each frame of data sent by the communication module to be 15, wherein 4 bits in each frame of data respectively represent two front and back actions and two left and right actions of two-degree-of-freedom rockers; defining different actions of the two-degree-of-freedom rocker to correspond to different action parts of the excavator model;
step four, defining four variables ch1, ch2, ch3 and ch4 in a secondary development program in the upper computer display terminal, sending the action data of the two-degree-of-freedom rockers to the upper computer display terminal by the communication module, and respectively extracting 4-bit data representing the action of the two-degree-of-freedom rockers in the data sent by the communication module by the four variables;
and fifthly, assigning the data extracted by each variable to a distance value parameter or an angle value parameter of an action part corresponding to the data, excavating each action part of the model, and acting according to the distance value parameter or the angle value parameter of the action part.
As shown in fig. 8, each frame of data received by the wireless module has a length of 15, wherein the 5 th bit represents the data of the left joystick Y-axis; bit 7 represents left rocker X-axis data; bit 9 represents the right rocker Y-axis data; bit 11 represents the right rocker X-axis data. Four variables ch1, ch2, ch3 and ch4 are defined to store the 4 data, namely, ch1 represents the data of the left rocker Y axis; ch2 represents left rocker X-axis data; ch3 represents the right rocker Y-axis data; ch4 represents the right rocker X-axis data.
Defining different actions of the two-degree-of-freedom rocker to correspond to different action parts of the excavator model; the left rocker Y-axis controls the lifting of the excavator bucket rod; the left rocker X-axis controls the left and right rotation of the excavator rotary platform; the right rocker Y-axis controls the lifting of the movable arm of the excavator; the right rocker X-axis controls the extension and contraction of the excavator bucket. When the position of a rocker of the lower computer control terminal is changed, the four variables of ch 1-ch 4 are changed, so that the related assembly relation is changed, and the virtual posture of the excavator is displayed in real time.
Virtual representation of the posture of the excavator working device: and assigning the data received by the upper computer display terminal to variables influencing the assembly relation, so as to realize the virtual display of the posture of the excavator working device by controlling the excavator assembly body model.
The Solidworks second development API provides rich objects that can be used to edit features. Wherein the "imodel doc extension. selectbyid2 ()" method in the "ModelDoc 2" object is used to select two datum planes that make up the assembly relationship; the 'IAssemlyDoc.AddMate4 ()' method in the 'AssemblyDoc' object is used for editing the distance value of the assembly relationship, and the telescopic length in the oil cylinder of the working device can be changed by changing the parameters in the method; the iassembyddoc addmate3() method is used to edit the angle values of the assembly relationship, and the rotation angle of the rotary platform can be changed by changing the parameters in the method.
Specifically, the expansion and contraction of the oil cylinder of the working device and the rotation of the rotary platform are controlled by the following methods:
for the change of the telescopic amount of the boom cylinder: a parameter representing a distance value in the method "iassembydoc. addmate4 ()" is defined as a variable to which the data stored in ch3 is assigned.
For the change of the telescopic amount of the bucket rod oil cylinder: a parameter representing a distance value in the method "iassembydoc. addmate4 ()" is defined as a variable to which the data stored in ch1 is assigned.
For the change of the telescopic amount of the bucket cylinder: a parameter representing a distance value in the method "iassembydoc. addmate4 ()" is defined as a variable to which the data stored in ch4 is assigned.
For the slewing of the slewing platform: a parameter representing the angle value in the method "iassembydoc. addmate3 ()" is defined as a variable to which the data stored in ch2 is assigned.
The above-mentioned contents are only for illustrating the technical idea of the present invention, and the protection scope of the present invention is not limited thereby, and any modification made on the basis of the technical idea of the present invention falls within the protection scope of the claims of the present invention.