Wastewater treatment electric-control system based on the SOPC technology
Affiliated field:
The present invention relates to a kind of special-purpose electric-control system of wastewater treatment, particularly a kind of wastewater treatment electric-control system based on the SOPC technology.
Background technology:
The wastewater treatment electric-control system main problem that is in operation is: cesspool capacity such as regulating reservoir, hydrolysis acidification pool, intermediate pool, CAST reaction tank are big, and electric-control system can not cut off the power supply throughout the year, interrupt even produce festivals or holidays; Wastewater treatment can not be interrupted, and this poses a big pressure to electric-control system, especially central control unit; Be the CPU of programmable controller; Faults such as deadlock very easily take place in the continuous running in 5~6 years of general warp, cause plant of water disposal control malfunctioning; Cause sewage outflow, contaminated environment.
Summary of the invention:
The object of the invention just is to overcome the deficiency that exists in the above-mentioned prior art, and a kind of wastewater treatment electric-control system based on the SOPC technology is provided, and the functional reliability of this electric-control system, function expansibility and upgradability are strong.
Technical scheme of the present invention is: a kind of wastewater treatment electric-control system based on the SOPC technology is characterized in that: be made up of cpu motherboard module, several daughter boards IO expansion relays, several daughter boards IO expansion module and the two poles of the earth private bus; The cpu motherboard module is carried out two-way the connection with several daughter boards IO expansion relays through private bus, and each daughter board IO expansion relays is carried out two-way the connection through private bus with several daughter boards IO expansion module; Above-mentioned cpu motherboard module is integrated among the FPGA by several IP kernels; The IP kernel main body module is made up of two CPU main preparation system structures, Profibus controller, TCP/IP controller, RS232 serial communication controller and dedicated bus interface controller; Two CPU main preparation system structures are respectively with Profibus controller, TCP/IP controller, RS232 serial communication controller with the dedicated bus interface controller is two-way is connected; Wherein, two CPU main preparation system structures are made up of CPU1, CPU2, token moderator arbitrator, internal bus buffering switch mul, storage unit SRAM, FLASH and I/O interface; The active output signal of CPU1 is connected with the input port of token moderator arbitrator; The token output port of token moderator arbitrator is connected with the input port of CPU1; The active output signal of CPU2 is connected with the input port of token moderator arbitrator, and the token output port of token moderator arbitrator is connected with the input port of CPU2; CPU1 carries out two-way the connection through internal bus buffering switch mul with storage unit SRAM, FLASH and I/O interface respectively with CPU2.
Above-mentioned token moderator arbitrator is made up of timer, watchdog circuit, arbitration seeker, alarm and token follower; Watchdog circuit receives the output signal of timer, CPU1, CPU2, and is entered into the input end of arbitration seeker, and arbitration seeker output terminal is connected with the token follower with alarm respectively.
Above-mentioned CPU1, CPU2 adopt the soft nuclear flush bonding processor of the second generation NIOS II of altera corp.
Advantage of the present invention is:
1) good reliability.The present invention utilizes the embedded nuclear of NIOS II, and promptly two CPU of exploitation examine on a chip, and wherein No. 0 CPU is a host CPU, and No. 1 CPU is a stand-by heat.When a fault such as CPU generation deadlock, another seamless immediately startup overcomes general programmable controller, does not cut off the power supply all the year round like this, and (often reaching the several years) CPU control is malfunctioning, guarantees that the wastewater treatment electric-control system runs well.
2) owing to adopted the FPGA structure of hardware description, so function expansibility and upgradability are strong.
3) the controlled digital quantity I/O of controller mouth, analog quantity I/O mouth, it is individual to reach hundreds of thousands, can make the carefree expansion point of user.Overcome the low shortcoming of general programmable sequence controller I/O cost performance.
Description of drawings:
Fig. 1 is a main body theory diagram of the present invention.
Fig. 2 is two CPU main preparation system structural drawing.
Fig. 3 is the theory diagram of token moderator.
Embodiment:
Like Fig. 1, shown in 2: a kind of wastewater treatment electric-control system based on the SOPC technology is characterized in that: be made up of cpu motherboard module, several daughter boards IO expansion relays, several daughter boards IO expansion module and the two poles of the earth private bus; The cpu motherboard module is carried out two-way the connection with several daughter boards IO expansion relays through private bus, and each daughter board IO expansion relays is carried out two-way the connection through private bus with several daughter boards IO expansion module; Above-mentioned cpu motherboard module is integrated among the FPGA by several IP kernels; The IP kernel main body module is made up of two CPU main preparation system structures, Profibus controller, TCP/IP controller, RS232 serial communication controller and dedicated bus interface controller; Two CPU main preparation system structures are respectively with Profibus controller, TCP/IP controller, RS232 serial communication controller with the dedicated bus interface controller is two-way is connected; Wherein, two CPU main preparation system structures are made up of CPU1, CPU2, token moderator arbitrator, internal bus buffering switch mul, storage unit SRAM, FLASH and I/O interface; The active output signal of CPU1 is connected with the input port of token moderator arbitrator; The token output port of token moderator arbitrator is connected with the input port of CPU1; The active output signal of CPU2 is connected with the input port of token moderator arbitrator, and the token output port of token moderator arbitrator is connected with the input port of CPU2; CPU1 carries out two-way the connection through internal bus buffering switch mul with storage unit SRAM, FLASH and I/O interface respectively with CPU2.
Above-mentioned token moderator arbitrator is made up of timer, watchdog circuit, arbitration seeker, alarm and token follower; Watchdog circuit receives the output signal of timer, CPU1, CPU2, and is entered into the input end of arbitration seeker, and arbitration seeker output terminal is connected with the token follower with alarm respectively.Above-mentioned CPU1, CPU2 adopt the soft nuclear flush bonding processor of the second generation NIOS II of altera corp.
Principle of work of the present invention is: adopt the special-purpose SOPC embedded system of wastewater treatment of NIOSII nuclear, distributed input and output expansion structure.Integrated two processor cores that function is identical on a processor substrate are about to two physical processor core and are integrated in the kernel.Use the NiosII processor of altera corp and the double-core system that SOPC Builder developing instrument is designed and Implemented resource sharing, the embedded system of memory interface and I/O peripheral hardware.The double-core system overriding concern of resource sharing be the problem of resource sharing, resources shared can be visited by two processors.Which resource in the decision systems is shared, and how to use this resource between the different processor jointly be very crucial problem.Promptly two CPU of exploitation examine on a chip, and the dual-cpu structure schematic diagram is shown in 3.Wherein CPU_1 is a host CPU, and CPU_2 makes stand-by heat.Like this when faults such as CPU_1 generation deadlock; Arbitrate the regular pulse signal that nuclear abitrator does not receive CPU_1, arbitration nuclear just will encourage it through work_1, if still there is not back-signalling; Arbitration nuclear just will join token to CPU_2; And while switchable memory interface, all seamlessly switching to CPU_2 like stack (Stack), heap (Heap), variable storage district (R/W data), constant memory block (RO data), program entity district (Text) interface, other all switches to CPU_2 like IO mouth, interface controller etc.; CPU_2 has accepted work and has continued operation, to guarantee the normal operation of wastewater treatment electric-control system.Here researched and developed 3 technology, hardware link is switched nuclear, and storage resources is shared, and the double-core arbitration mechanism realizes active and standby seamless subsequent use.
(1) hardware link is switched nuclear
When faults such as CPU_1 generation deadlock; Arbitration nuclear abitrator does not receive the regular pulse signal of CPU_1; Arbitration nuclear just will encourage it through work_1; If still there is not back-signalling, arbitration nuclear just will join token to CPU_2, and switches internal bus interface simultaneously (comprising data bus data and address bus addr).
(2) storage resources is shared
Storage resources is realized mapping fully like stack (Stack), heap (Heap), variable storage district (R/W data), constant memory block (RO data), program entity district (Text).
(3) double-core arbitration mechanism
Arbitrate the regular pulse signal that nuclear abitrator does not receive CPU_1, arbitration nuclear just will pass through work_1 and encourage it, if still there is back-signalling, arbitration nuclear just will not join token to CPU_2, and while switchable memory interface.