[0045] In order to make the above-mentioned features and advantages of the present invention clearer and easier to understand, the specific embodiments of the present invention will be explained in more detail below with reference to the accompanying drawings.
[0046] Such as figure 2 As shown, this figure is a structural implementation diagram for realizing rapid prototyping control of the present invention, including a host computer 1, a main control computer 2, an external expansion module 3, and a controlled object 4.
[0047] The host computer 1 is any x86 structure computer, and its structure can be a notebook computer, an industrial computer, a PC104 host, etc. according to different needs.
[0048] The host computer runs Windows operating system and related compiling software as well as simulation result observation and control software. The function of the compiler software is divided into 3 levels. The first level is to convert the graphics language into C language, the second level is to convert the converted C language into assembly language, and the third level is to convert assembly language into a machine. After the language is downloaded to the target drive, the simulation program is executed. The function of the simulation result observation and control software is to observe the position of each axis of the robot, the state of the force sensor, and the state of the drive unit in real time.
[0049] In order to realize the functions of the first level of the compiling software, the compiling software is preferably a Matlab/Simulink/RTW module. The work done in this level is divided into two parts: The first part is the writing of robot servo control algorithm modules. Since most of the sub-modules that make up these modules are integrated in the Simulink development environment, they can be based on existing modules in Simulink. Write the motion control function module of the robot servo system; the second part is the preparation of the basic input and output interface of the target machine and the hardware function module driver. The Simulink block diagram that needs to be compiled successfully can be automatically generated for the target system after being compiled by RTW. .
[0050] In order to realize the functions of the second and third levels of the compiler software, the compiler software prefers TI’s Code Composer Studio 3.3 to convert the C language code converted in the first stage into assembly code and target machine code. Features. At the same time, the user can also modify the converted C language code to increase the flexibility of the real-time simulation system.
[0051] The observation and control software of the simulation results is preferably LabVIEW. The graphical design of LabVIEW makes it possible to quickly generate a graphical interface for observation in the hardware-in-loop simulation (HILS) stage; in the rapid control prototyping (RCP) stage, LabVIEW can simulate The executable file generated in the stage is separated from the LabVIEW environment and executed in the Windows operating system.
[0052] The target machine 2 includes a download unit 21, a communication unit 22, a human-computer interaction unit 23, a control information processing unit 24, a test sensing unit 25, and a power driving unit 26.
[0053] The download unit 21 is used to download a compiled executable control program from a host computer, and the downloaded executable control program runs in the control and information processing unit 24 in the target computer 2.
[0054] The test sensing unit 25 collects the position, speed and current information of the controlled object, sends it to the control and information processing unit, calculates the result through the executable program downloaded therein, and sends the power drive signal to the control and information processing unit. In the power drive unit 26, a typical closed loop system is formed.
[0055] The communication unit 22 is used to expand the functions of the control system, and mainly includes three levels of objectives: the first level of objectives is the communication function with the external extended function module 3, and the main purpose is to expand the rapid control prototype system Test the sensing unit; the goal of the second level is to realize the mutual communication function between the target machine 2 to realize the coordinated control of the robot with multiple degrees of freedom; the third level is the high-speed communication between the target machine and the host machine Function to realize the real-time observation of data and the setting of control quantity.
[0056] The communication goal of the first level is preferably realized by CAN bus. The main reason is that CAN bus has good safety performance, high data transmission rate, strong anti-interference and fault tolerance, and good real-time performance, which is suitable for the sensor data collection of this system.
[0057] The communication goal of the second level is preferably realized by the FlexRay bus. As a new high-speed and reliable communication protocol, the FlexRay bus has the advantages of high transmission rate, good safety, and adaptability to harsh environments. The high transmission rate is reflected in its dual-channel maximum transmission bandwidth of up to 20Mb/s, which is 20 times that of the CAN bus; good security is reflected in the redundant communication backup method adopted, and the main control machines are connected by two buses Under normal circumstances, two channels can be used to exchange data between the masters at the same time. When one channel fails, the system can automatically switch data to another backup channel for data exchange, which greatly improves the robot control The reliability of the system; the FlexRay bus was originally designed for use in the automotive field. Since vehicle electronic equipment needs to work stably in an environment of vibration, high temperature, and strong electromagnetic interference, it can also be fully adapted to the robot field with a better working environment.
[0058] The control goal of the third level is preferably realized by Ethernet. Choose Ethernet as the communication interface between the host computer and the host computer. The main reason is that Ethernet is a standard configuration on the personal computer, so you don't need to add a new communication interface module to the host computer, which reduces the cost of the system; The communication rate of Ethernet can reach 100Mbps, which meets the bandwidth requirements for large amounts of data observation.
[0059] The human-computer interaction unit 23 is used to realize the display of the state of the controlled object and the control quantity, and the input function of the control quantity. Compared with uploading control information to the host computer for display via Ethernet, this display mode has the advantages of good real-time performance and convenient observation, and is especially suitable for some occasions that do not need to install a host computer after rapid prototyping.
[0060] The control and information processing unit 24 is the core of the target machine, which is responsible for the collection, calculation and output of control information. Compared with hand-written C language programs, the program generated by Matlab/RTW module has poor operation efficiency, and the effect of automatic optimization is difficult to achieve perfection in some cases, so the processing speed of the core processing device of the main control unit needs to be faster. And on this basis, meet the power consumption requirements. Based on the above requirements, the system selects TI’s TMS320F28335 as the core processor, and writes the core processing module hardware interface based on the block diagram of Simulink on this basis, and compiles it to generate the executable C language source code of the chip.
[0061] The communication between the host computer and the external expansion module is completed by CAN bus. The external expansion module can be divided into modules that collect bridge signals (such as force sensors), 0 to 10V analog voltage signals, and 0 to 20mA current signals for expansion Suitable for sensor types that require real-time feedback within a closed loop.
[0062] according to image 3 As shown, take the bridge sensor acquisition module as an example to explain the structure of the module. The bridge signal K101 is amplified by the instrument amplifier K201 and low-pass filtered by the anti-mixing filter K202 and sent to the analog-to-digital converter K203 for analog-to-digital conversion. The converted result is transmitted to the signal processor K300 through the SPI bus for information processing. The processor is preferably a 32-bit microcontroller of the STM32 series. Its main feature is low power consumption and a built-in CAN bus controller. The bridge information is connected to the CAN bus driver K401 after passing through the CAN2.0 bus controller, and exchanges information with the master computer via the RJ45 connector K402.
[0063] In the electromechanical control system, the interconnection of sensors is realized through the CAN bus, which reduces the number of cables and improves the adaptability of the main control machine to different sensors.
[0064] Based on the above-mentioned rapid prototype servo system, the present invention provides a realization method based on this rapid control prototype. The following describes the implementation process of the rapid prototyping method in conjunction with a typical robotic arm control system.
[0065] See Figure 4 , The implementation flow chart of a method for implementing rapid prototyping of a robot servo control system of the present invention includes the following steps:
[0066] Z401: Modeling, drawing control block diagrams and communication block diagrams. Construct a real-time control block diagram according to the characteristics of the controlled object and the control goal that the robot needs to achieve; construct a communication block diagram according to the control parameters and feedback results that the host needs to observe. Then program the control block diagram on the host computer. The host computer of the present invention is preferably a Windows operating system and a Matlab/Simulink/RTW environment. Drag and drop the control block diagram, communication block diagram and real-time control algorithm of the master computer in Simulink environment to construct a real-time simulation control system.
[0067] Z402: Compile, link, and download to the host computer. According to the block diagram that has been constructed in the previous step, the executable code for the master computer is generated through the RTW module, which includes the executable code converted into the control algorithm block diagram and the communication block diagram.
[0068] Z403: Collect the data of the controlled object and related sensors. The data of the controlled object and related sensors are input into the controller as the feedback quantity of the controller. The feedback data of the controlled object includes the collected encoder position, the speed and acceleration information obtained by the first and second differentiation of the position quantity, current information; and the force sensor information fed back by the external force sensor module, the force The sensor information needs to be processed by FIR low-pass digital filter.
[0069] Z404: The servo control module executes the program and inputs the collected results of the sensor into the compiled controller. Pass the signal obtained by feedback in step Z403 into the controller compiled and generated by the host computer. In this step, the controller has been compiled into the executable code of the host computer, and the code starts to execute under the instructions of the host computer.
[0070] Z405: Module servo control execution program, input the sensor's collection result into the compiled controller. The user-built controller converts the input control quantity into a pulse width modulation (PWM, Pulse Width Modulation) signal and outputs it to the power drive unit.
[0071] Z406: Upload the sensor collection results to the host computer via the Ethernet. The host computer's observation function of the control signal and feedback is an important function of the rapid prototyping system. In the host computer, the observation interface and control panel are quickly constructed through the graphical language of LabVIEW.
[0072] Z407: Data exchange with other modules through the FlexRay bus through the acquisition results of the sensor and the operating status of the controlled object. It should be noted that Z407 can exist in any position in the entire sequence. The maximum communication bandwidth of the FlexRay bus can reach 20Mb/s. When the system requires multiple motors to be used in coordination, a master control driver can be used as a computing machine to be responsible for the position calculation and command sending of the entire system; let the rest of the master As a servo, the control drive is mainly responsible for receiving the instructions sent back by the computer, and feedback the current position and other parameters to the computer. In all the processes of sending and receiving information, the FlexRay bus takes on the backbone task of data exchange. For the newly added degree of freedom in the mechanical system, it is only necessary to increase the number of the masters and connect them to the FlexRay bus. .
[0073] Z408: Display the simulation result. The display unit is used to realize the human-computer interaction function where it is not convenient to use the host computer.