Summary of the invention
The present invention is in order to solve existing motion controller when carrying out industrial networking and motion control, for conventional industrial field bus agreement and position sensor interface agreement, support less and fixing, cause motion controller cannot with the defect of external unit compatibility, simultaneously, too complicated control time length and the low problem of precision of causing of the control method of existing motion controller, has proposed a kind of universal industrial kinetic control system based on FPGA.
A universal industrial kinetic control system based on FPGA, is characterized in that, it comprises:
For realizing data interaction with external fieldbus, host computer, servo driver of motor and SD storage card, and according to the data message receiving, carry out the FPGA module of kinematic calculation simultaneously,
The bus interface module that carries out data interaction for realizing external fieldbus and FPGA module,
The usb interface module that carries out data interaction for realizing host computer and FPGA module,
The SD card interface module of carrying out data interaction for realizing SD storage card and FPGA module,
The driver interface module of carrying out data interaction for realizing servo driver of motor and FPGA module,
For by the system software that loads the pin of FPGA module and resource allocation information and execution FPGA module and store, and the configuration module that this configuration information is stored,
For the simulating signal of outside input is converted to digital signal, and this digital signal is delivered to the A/D modular converter of FPGA module.
The data receiver computing module that described FPGA inside modules has software to realize, described data receiver computing module comprises:
For receive the external fieldbus data reception module of external fieldbus data by bus interface module,
For send the external fieldbus data transmission blocks of data to external fieldbus by bus interface module,
For receive the host computer data reception module of host computer data by usb interface module,
For send the host computer data transmission blocks of data to host computer by usb interface module,
For receive the SD storing card data receiver module of SD storing card data by SD card interface module,
For send the SD storing card data sending module of data to SD storage card by SD card interface module,
For receive the servo driver of motor data reception module of servo driver of motor data by driver interface module,
For send the servo driver of motor data transmission blocks of data to servo driver of motor by driver interface module,
For outside fieldbus data, host computer data, servo driver of motor data and SD storing card data are resolved, and analysis result is sent to the fixed-point processor of floating point processor,
For carrying out logical operation according to analysis result, and logic operation result is sent to the floating point processor of motor control module,
For the motor control module of servo driver of motor being controlled according to logic operation result.
Described motor control module comprises:
For identifying the Electric Machine Control identification module that the current control method that servo driver of motor is controlled is open-loop control method or closed loop control method, when control method is open-loop control method, Electric Machine Control identification module sends out-of-work signal to closed loop control module, when control method is closed loop control method, Electric Machine Control identification module sends the signal of starting working to closed loop control module
Be used for the positional information of the servo driver of motor of receiving position sensor assembly transmission, and this positional information be sent to the positional information receiver module of closed loop control module,
For the positional information of servo driver of motor and the logic operation result of floating point processor transmission sending according to positional information receiver module, generate closed-loop control signal, and this closed-loop control signal be sent to the closed loop control module of closed loop pwm pulse generation module,
For when the control method of servo driver of motor is open-loop control method, according to logic operation result, generate the open loop pwm pulse generation module of open loop pwm pulse,
For when the control method of servo driver of motor is closed loop control method, according to the closed loop pwm pulse generation module of logic operation result and closed-loop control signal generation closed loop pwm pulse.
Control method based on the above-mentioned universal industrial kinetic control system based on FPGA, it comprises the following steps:
For by the system software that loads the pin of FPGA module and resource allocation information and execution FPGA module and store, and the configuration step that this configuration information is stored,
The duty detecting step in normal operating conditions whether for detection of the monitoring of system works voltage and house dog,
For FPGA module, receive the external fieldbus data receiver step of external fieldbus data,
For the fixed-point arithmetic step that outside fieldbus data, host computer data, servo driver of motor data and SD storing card data are carried out to instruction parsing,
For carry out motor motion control and single shaft-driven floating-point operation step according to instruction analysis result,
For identifying the Electric Machine Control identification step that the current control method that servo driver of motor is controlled is open-loop control method or closed loop control method, when control method is open-loop control method, Electric Machine Control identification module sends out-of-work signal to closed loop control module, when control method is closed loop control method, Electric Machine Control identification module sends the signal of starting working to closed loop control module
Be used for the positional information of the servo driver of motor of receiving position sensor assembly transmission, and this positional information be sent to the positional information receiving step of closed loop control module,
Be used for according to the closed-loop control step of the positional information of servo driver of motor and logic operation result generation closed-loop control signal,
For when the control method of servo driver of motor is open-loop control method, the open loop pwm pulse that generates open loop pwm pulse according to logic operation result generates step,
For when the control method of servo driver of motor is closed loop control method, according to the closed loop pwm pulse of logic operation result and closed-loop control signal generation closed loop pwm pulse, generate step.
Beneficial effect: the present invention is based on single FPGA chip, by system configuration, can support to comprise multiple industrial field bus and the position sensor interface agreement of ether, and possesses upgrading ability, therefore can conveniently carry out integrated with existing industrial network, do not need to purchase special motion controller and position transducer, there is very strong versatility;
The present invention can be according to the field bus protocol of practical application, by host computer, carry out logic configuration, reduced the overall cost of system, improved the versatility of motion controller, can rely on expansion interface to coordinate software to carry out the upgrading of bus protocol, further expanded the range of application of motion controller simultaneously;
The present invention is when carrying out position closed loop control, can support SSI, EnDat, BiSSel and tetra-kinds of the most frequently used position sensor interface agreements of HiperFace, but the upgrading that also can carry out interface protocol according to expansion interface adapts to the position transducer of more interface types.
The present invention is directed to day by day complicated industrial field bus communication and demand for control, by be embedded in the soft-core processor of two 32 at fpga chip, complete respectively and control monitoring and communication and movement locus and control, communication control and monitoring taking for hardware resource have been reduced, reduce system and controlled complicacy and cost, shorten the time of controlling motor, improved Electric Machine Control precision;
The present invention adopts USB interface and host computer to carry out communication, and the highest communication speed of system can reach 12Mbps, far above common serial communication speed, to better meet growing bus network communication need.
Embodiment
Embodiment one, in conjunction with Fig. 1, this embodiment is described, a kind of universal industrial kinetic control system based on FPGA described in this embodiment comprises:
For realizing data interaction with external fieldbus, host computer, servo driver of motor and SD storage card, and according to the data message receiving, carry out the FPGA module 1 of kinematic calculation simultaneously,
The bus interface module 2 that carries out data interaction for realizing external fieldbus and FPGA module 1,
The usb interface module 3 that carries out data interaction for realizing host computer and FPGA module 1,
The SD card interface module 4 of carrying out data interaction for realizing SD storage card and FPGA module 1,
The driver interface module 6 of carrying out data interaction for realizing servo driver of motor and FPGA module 1,
For loading the pin of FPGA module 1 and the system software of resource allocation information and 1 storage of execution FPGA module, and the configuration module 8 that this configuration information is stored,
For the simulating signal of outside input is converted to digital signal, and this digital signal is delivered to the A/D modular converter of FPGA module 1.
Bus interface module 2 described in present embodiment is comprised of 10/100/1000Mbps PHY Industrial Ethernet network chip, CAN interface chip, RS485 interface chip, M_LVDS interface chip and expansion interface, FPGA module 1 is connected with external fieldbus such as Industrial Ethernet, CAN, Modbus and Profibus, the command information of control terminal is provided to system, control servo driver of motor, status information is uploaded to control terminal by fieldbus simultaneously; Wherein, ethernet PHY chip has adopted 88E1111 chip, can select as required tri-kinds of different traffic rates of 10/100/1000Mbps, adopted parallel interface to be connected with FPGA module 1, CAN bus chip adopts SN65VHD230 chip, and ModBus and Profibus are based on RS485 agreement, adopts SP3485 chip, communication speed can reach 100Mbps, also has M_LVDS communication interface based on MAX3488 chip and the expansion bus interface on 8 tunnels.
In present embodiment, FPGA module 1 can be according to the needs of concrete application, adopt software can support flexibly SSI, EnDat, BiSSel and tetra-kinds of position sensor interface agreements of HiperFace, also can pass through at the inner expansion interfaces that increase of driver interface module 6 simultaneously, thereby by upgrading to support other position sensor interface agreement.
Usb interface module 3 described in present embodiment adopts CH375 chip to realize, and this chip can operate under usb host and slave condition, compatible USB2.0 agreement, and communication speed can reach 12Mbps; This chip can individually walk abreast or serial data transmission mode, in order to give full play to its speed advantage, employing parallel transmission mode realizes FPGA module 1 and host computer carries out the transmission of data, 4 of SD card interface module do not need proprietary chip to carry out level conversion, directly adopt FPGA to read and write by SPI serial protocol.
A/D modular converter described in present embodiment adopts AD7604 chip to realize, this chip have 16 precision, the 4 single-ended inputs in tunnel by 4 employing retainers can guarantee to sample simultaneously, the converter of 1 200KHz, interface can adopt parallel interface, power consumption is in 100mW left and right, this chip has the ESD ability of input saturation function and 7kV, is suitable for industrial occasions.
The difference of a kind of universal industrial kinetic control system based on FPGA described in embodiment two, this embodiment and embodiment one is, described FPGA module 1 employing EP3C40Q240 control chip realization.
In present embodiment, FPGA module 1 adopts EP3C40Q240 control chip to realize, 40K LE logical block contained in this control chip inside, have 126 available I/O resources, the RAM that contains 100kByte and 4 PLL, the integrated multiplier of 128 18 * 18, system adopts the crystal oscillator of 50M as system clock, by frequency multiplication, inner soft core operates under the frequency of 100MHz.System adopts independently soft-core processor to realize parallel control by hardware resource being taken to more communication algorithm, can greatly improve so the execution efficiency of system monitoring of system executive system communication control.System has extended out the FLASH chip AM29LV160 of a slice 16 * 1MB and the sram chip IS61LV25616 of 1 16 * 512KB, meets systematic control algorithm for the storage demand of program and data.
The difference of a kind of universal industrial kinetic control system based on FPGA described in embodiment three, this embodiment and embodiment one is, the data receiver computing module that described FPGA module 1 inside has software to realize, described data receiver computing module comprises:
For receive the external fieldbus data reception module of external fieldbus data by bus interface module 2,
For send the external fieldbus data transmission blocks of data to external fieldbus by bus interface module 2,
For receive the host computer data reception module of host computer data by usb interface module 3,
For send the host computer data transmission blocks of data to host computer by usb interface module 3,
For receive the SD storing card data receiver module of SD storing card data by SD card interface module 4,
For send the SD storing card data sending module of data to SD storage card by SD card interface module 4,
For receive the servo driver of motor data reception module of servo driver of motor data by driver interface module 6,
For send the servo driver of motor data transmission blocks of data to servo driver of motor by driver interface module 6,
For outside fieldbus data, host computer data, servo driver of motor data and SD storing card data are resolved, and analysis result is sent to the fixed-point processor of floating point processor,
For carrying out logical operation according to analysis result, and logic operation result is sent to the floating point processor of motor control module,
For the motor control module of servo driver of motor being controlled according to software operation result.
In present embodiment, at two NIOS II controllers of FPGA module 1 inner embedding, one of them is fixed-point processor, another is floating point processor, fixed-point processor is responsible for communication control and the status monitoring of system, this processor can pass through one or more in software configuration utility industrial ethernet protocol, CAN agreement, ModBus and Profibus agreement according to specific needs, this processor can also rely on USB interface to be connected with host computer simultaneously, by FIFO, carry out data buffering, improve reading efficiency; Floating point processor is responsible for carrying out kinematics computing, when fixed-point processor is transferred to instruction and parameter after floating point processor, happiness, with starting to carry out the kinematic calculation such as coordinate transform, straight line and circular interpolation, is controlled servo driver of motor thereby finally each axle controlled quentity controlled variable is sent to motor control module.
The difference of a kind of universal industrial kinetic control system based on FPGA described in embodiment four, this embodiment and embodiment three is, described motor control module comprises:
For identifying the Electric Machine Control identification module that the current control method that servo driver of motor is controlled is open-loop control method or closed loop control method, when control method is open-loop control method, Electric Machine Control identification module sends out-of-work signal to closed loop control module, when control method is closed loop control method, Electric Machine Control identification module sends the signal of starting working to closed loop control module
Be used for the positional information of the servo driver of motor of receiving position sensor assembly 12 transmissions, and this positional information be sent to the positional information receiver module of closed loop control module,
For the positional information of servo driver of motor and the logic operation result of floating point processor transmission sending according to positional information receiver module, generate closed-loop control signal, and this closed-loop control signal be sent to the closed loop control module of closed loop pwm pulse generation module,
For when the control method of servo driver of motor is open-loop control method, according to logic operation result, generate the open loop pwm pulse generation module of open loop pwm pulse,
For when the control method of servo driver of motor is closed loop control method, according to the closed loop pwm pulse generation module of logic operation result and closed-loop control signal generation closed loop pwm pulse.
The difference of a kind of universal industrial kinetic control system based on FPGA described in embodiment five, this embodiment and embodiment four is, described motor control module is 1-5.
The difference of a kind of universal industrial kinetic control system based on FPGA described in embodiment six, this embodiment and embodiment one is, described driver interface module 6 comprises:
For the level switch module 13 that the open loop control signal of FPGA module 1 output and closed-loop control signal are converted to differential signal,
For obtaining the positional information of servo driver of motor, and this positional information is delivered to the position transducer module 12 of FPGA module 1 by position sensor interface module.
In present embodiment, level switch module 13 adopts MAX3488 chip to realize, concrete communications protocol is resolved by the hardware module in FPGA module 1, by MAX3488 chip, pwm pulse is converted to differential signal simultaneously, and feedback differential signal is converted to common LVCMOS level.
The difference of a kind of universal industrial kinetic control system based on FPGA described in embodiment seven, this embodiment and embodiment one is, described configuration module 8 comprises:
For the FLASH module of storing FPGA module 1 system software,
For load FPGA module 1 configuration information, carry out the system software that FLASH module is stored, and overall control variable and motion control arithmetic are sent to the configuring chip module of RAM module,
For the RAM module of storing overall control variable and motion control arithmetic.
A kind of universal industrial kinetic control system based on FPGA described in embodiment eight, this embodiment and embodiment one, it is characterized in that, it also comprises the CPLD module 7 for the pin of FPGA module 1 and resource allocation information are encrypted.
CPLD module 7 described in present embodiment adopts EPM570T100IN chip to realize, and configurator and the application program of FPGA module 1 inside is encrypted, for system provides better security.
The control method of embodiment nine, a kind of universal industrial kinetic control system based on FPGA based on described in embodiment one to eight any one comprises the following steps:
For loading the pin of FPGA module 1 and the system software of resource allocation information and 1 storage of execution FPGA module, and the configuration step that this configuration information is stored,
The duty detecting step in normal operating conditions whether for detection of the monitoring of system works voltage and house dog,
For FPGA module 1, receive the external fieldbus data receiver step of external fieldbus data,
For the fixed-point arithmetic step that outside fieldbus data, host computer data, servo driver of motor data and SD storing card data are carried out to instruction parsing,
For carry out motor motion control and single shaft-driven floating-point operation step according to instruction analysis result,
For identifying the Electric Machine Control identification step that the current control method that servo driver of motor is controlled is open-loop control method or closed loop control method, when control method is open-loop control method, Electric Machine Control identification module sends out-of-work signal to closed loop control module, when control method is closed loop control method, Electric Machine Control identification module sends the signal of starting working to closed loop control module
Be used for the positional information of the servo driver of motor of receiving position sensor assembly 12 transmissions, and this positional information be sent to the positional information receiving step of closed loop control module,
Be used for according to the closed-loop control step of the positional information of servo driver of motor and logic operation result generation closed-loop control signal,
For when the control method of servo driver of motor is open-loop control method, the open loop pwm pulse that generates open loop pwm pulse according to logic operation result generates step,
For when the control method of servo driver of motor is closed loop control method, according to the closed loop pwm pulse of logic operation result and closed-loop control signal generation closed loop pwm pulse, generate step.