A kind of sewage treatment plant TCP/IP local area network automatic control systems and method
Technical field
The invention belongs to technical field of sewage, are related to a kind of sewage treatment plant TCP/IP local area network automatic control systems
And method, specifically, being related to a kind of sewage treatment plant's TCP/IP local area network automatic control systems based on PIC single chip microcomputer and side
Method.
Background technology
The automatic control technology starting of external sewage treatment plant is more early, from large-scale wastewater treatment plant to small-sized oxidation pond, entirely
Portion is using modernization instruments such as computer controlled automatic, remote control and closed-circuit televisions.Wastewater treatment in China factory is after the nineties
Just start to introduce automatic control system, but is mostly direct Introduced From Abroad complete self-control equipment, the application of domestic automatic control system
It is also fewer.Successively setting PID adjustings, ratio, feedforward, rear feed, FCS (field bus control system), DCS (are concentrated distributed
Control system) and initial ethernet technology, change great several times is experienced, automatization level is enhanced.Mesh
Preceding wastewater treatment in China factory automatic control system the most advanced is that Industrial Ethernet is used to coordinate FCS as grid,
It is state-of-the-art automated system in the world, which is equipped with high-performance, highly reliable PLC control stations, and with server
The control system of latest generation.
Programmable controller (PIC) is the universal industrial automation equipment using computer technology as core.Its maximum spy
Point is to proceed from the reality, and payes attention to the performance and price ratio of product, meets the application requirement of different levels by development Multiple Type.
And PIC single chip microcomputer can be such that its execution efficiency greatly improves with reduced instruction, and pin has anti-transient state ability, passes through current limliting electricity
Resistance can be connected to 220V AC powers, can directly be connected with control relay circuit, without photoelectric coupler isolation, to using band
Greatly facilitate, while reducing production cost.
TCP/IP (Transmission Control Protocol/Internet Protocol) model is also referred to as
DoD models (Department ofDefense Model).Two agreements are represented on TCP/IP is literal:TCP (passes transport control protocol
View) and IP (Internet protocol).On January 1 nineteen eighty-three, in predecessor's (Advanced Research Projects Agency Network) of internet, ICP/IP protocol is instead of old
Network Control Protocol (NCP, Network Control Protocol), to the foundation stone of the internet as today.
The sewage disposal system of PLC control system, the sewage disposal system is used to use SBR circular treatments in the prior art
Technique, i.e. batch-type batch activated sludge method, and combine PLC technology.To realize sewage disposal process it is real-time detection and
Control ensures the continuity of production process, reduces labor intensity.This technique is made of 4 ponds, and each SBR process cycles include
Processes, the sewage such as water inlet, biochemical reaction (aeration), precipitation, discharge intermittently enter each reaction process in SBR by sequence.
Aeration makes aerobic, anoxic and anaerobic state alternately, is finally reached the purpose of decarburization, deamination and denitrogenation.
Master control system uses PLC and microcomputer forming control system.PLC selects Mitsubishi Corporation of Japan FX series of programmable sequence controls
Device processed.Software becomes using FXGPW1N realizations, and configuration is realized using MCGS 6.2, control centres of the PLC as whole system,
The start and stop of the action of completion water pump, each regulating valve in systematic procedure, spotter and diving mixer etc., level sensing signal
Input and output.Sewage disposal remote computer based system is controlled and is managed using MCGS configuration softwares.This is to apply mechanically
Construct and generate the configuration software of computer supervisory control system, by being shown to the acquisition of field data, alert process, flow control
A variety of intuitive manners such as system and report output, provide a user the scheme of solving practical problems.To reduce the personnel to operate, improve
The automaticity of sewage disposal system and safety.The technology has the following defects:
1, the master control system volume is larger, can encapsulation it is poor.
2, PLC's (programmable logic controller (PLC)) is expensive, and cost is especially high, is not suitable for the batch production of device.
3, in Industry Control, the speed that MCGS reads variable is very slow, causes system that can not in real time handle sewage.
4, the sewage disposal system is delay system, influences the timeliness of sewage disposal.
Invention content
It is an object of the invention to overcome defect existing for above-mentioned technology, provide it is a kind of it is at low cost, service life is long, reliable
Property high, sewage treatment plant's TCP/IP local area network automatic control systems for maintaining easily and method.
Its specific technical solution is:
A kind of sewage treatment plant TCP/IP local area network automatic control systems, PIC16F877A controllers are assisted by SPI communication
View realizes communication chip W5500 real-time exchange data, master control of the PIC16F877A controllers as SPI communication, when controller exists
When independently realizing the data acquisition and control instruction output of this terminal control, PIC16F877A controllers are in real time by related register
Data communication chip W5500 transmit and read LAN and upload the data sent, communication chip W5500 is by data with TCP/IP
Agreement is transported on LAN, and the controller for meeting data address requirement receives the data and makes corresponding action response, real
The control and acquisition of the number and analog quantity of existing terminating machine, realize system automation.
A kind of sewage treatment plant TCP/IP LAN autocontrol methods, include the following steps:
(1);System energization, host, slave, terminal control unit start.
(2);Host is connected with slave by defining serial ports, and the operation of host internal processes passes through SPI communication protocol realization master
Machine and slave exchange real time data.
(3) slave is connected by cable with terminal control unit, and slave sends command instruction to terminal control unit, terminal control
Device processed executes order, is operated to process object, to realize system automation.
Compared with prior art, beneficial effects of the present invention are:
1, the present invention reduces production and maintenance cost using inexpensive device PIC single chip microcomputer.
2, the hard protocol instead of the soft agreement in conventional network system is improved the reliability of system operation by the present invention.
3, system core control panel is made plug-in card by the present invention, convenient to overhaul, to reduce cost of equipment maintenance.
4, the present invention uses TCP/IP local area network automatic control systems, to realize the arbitrary extension of control terminal.
5, the present invention improves the performance of master control system, extends the no-failure life of system.
Description of the drawings
Fig. 1 is the structure principle chart of sewage treatment plant's TCP/IP local area network automatic control systems;
Fig. 2 is the structure chart of PIC16F877A controllers;
Fig. 3 is the structure chart of communication chip W5500;
Fig. 4 is the mechanical flow diagram of sewage treatment plant TCP/IP LAN autocontrol methods.
Specific implementation mode
Technical scheme of the present invention is described in more detail in the following with reference to the drawings and specific embodiments.
Referring to Fig.1, PIC16F877A controllers pass through SPI communication protocol realization and communication chip W5500 real-time exchange numbers
According to master control of the PIC16F877A controllers as SPI communication in the present system, when controller is independently realizing this terminal control
When data acquisition and control instruction output, PIC16F877A controllers are in real time by the data of related register to communication chip
W5500, which is transmitted and read LAN, uploads the data sent, and data are transported to local by communication chip W5500 with ICP/IP protocol
On the net, the controller for meeting data address requirement receives the data and makes corresponding action response, to realize terminating machine
System automation is realized in the control and acquisition of number and analog quantity.
As shown in Fig. 2, the acp chip of control system uses the PIC16F877A microcontrollers of Wei Xin companies of the U.S..
The main feature of PIC16F877A is shown:Instruction is one-cycle instruction;High filling/sourcing current is up to 25mA;14
10 bit resolution A/D converter of a channel;16 bit timing devices/counter with pre-divider;10 PWM outputs turn to
Steering is controlled, maximum frequency 20kHz;Support RS-485, RS-232, main synchronous serial interface (Master
Synchronous Serial Port, MSSP) module supports 3 line SPI (4 kinds of patterns in total), and carries I2C address mask work(
The master/slave pattern communications of I2C of energy.
The features such as microcontroller has communication speed fast, and external harmoniousness function is more, and driving capability is strong.It can not only accomplish system
Driving capability it is strong, and the design of peripheral circuit can be reduced, improve the reliability of system;The analog of sewage disposal can be met
The control of the acquisition and multiple digital amount of amount.
As shown in figure 3, the communication chip of Control card system is using W5500.
W5500 is a devices at full hardware TCP/IP embedded Ethernet controllers, is provided for embedded system eased
Internet connection scheme.W5500 is integrated with ICP/IP protocol stack, 10/100M ethernet data link layers (MAC) and physical layer
(PHY) so that user can expand network connection using single-chip in the application of control system, form local area control net
Network.Since chip is by ICP/IP protocol hardware integration, the communication speed of system is not only increased.Hard ICP/IP protocol can be done
Simple to mcu programming, code is few, and stable and reliable operation is real-time.
W5500 provides SPI (peripheral hardware serial line interface) so as to be more prone to integrate with peripheral hardware MCU.The use of W5500
New efficient SPI protocol supports 80MHz rates, so as to preferably realize that express network communicates.In order to reduce system energy
Consumption, W5500 provide Wake on LAN pattern (WOL) and power-down mode and select to use for client.
System of the present invention has been substantially carried out the research of following three aspects:
(1) Control card is for executing the control loaded
By the driver of the Control card of every motor and motor (including:Soft strater, frequency converter etc.) it is mounted on one
In small control cabinet, and switch board is installed nearby with motor, accomplishes to drive power cable shorter in this way, be less prone to power transmission
The failure of circuit.
Using band TCP/IP network communication transceiver PIC16F877A as core controller, this microcontroller has high system
Filling/sourcing current, multi-functional multiplexed port, built-in crystal oscillating circuit, a variety of integrated function modules.LAN is communicated to use
W5500 realizes TCP/IP network communications, and W5500 is a devices at full hardware TCP/IP embedded Ethernet controllers, is embedded system
System provides eased internet connection scheme, and reliable communication can be provided under electrical noise environment.PIC16F877A
Have 40 it is I/O mouthfuls workable, the I/O quantity as controller is abundant, and 8 road analog ports can meet the more of sewage disposal
The control of the acquisition and multiple digital amount of analog quantity.
Acp chip key wiring diagram inside terminal board is as shown in Figure 1.Left side uses for system host module
PIC16F877A microcontrollers, middle section are system slave module ICP/IP protocol chips W 5500, and right side is system communication interface
Module uses RJ45 cable interfaces.When running work, SPI communication agreement exchange real time data is used between host and slave.It is logical
The port definition for crossing microcontroller realizes number and the control and acquisition of analog quantity of terminating machine, realizes system automation.
(2) realization of TCP/IP network communications
Information is exchanged by TCP/IP communication between the Control card of each machine set control cabinet, and is realized and PC host computers
Data communication, really realize real-time decentralised control.Each node in control is independent in the control function for executing the unit
It completes, the core of control content is also mainly responsible for the operation control of the unit (start, stop, acceleration and deceleration), and passes through biography
The operating condition that sensor acquires the unit uploads to PC machine.
With reference to Fig. 4, this system uses TCP/IP local area network structures, the extension of multiple terminals to be realized using cable router, such as
The port number of fruit router is inadequate, is hung using routing is continuous, to realize the more terminal controls of the LAN of bigger.Terminal and
Using cable connection, it can be achieved that the data transmission of remote teminal between router.Hard ICP/IP protocol can accomplish microcontroller
Programming is simple, and code is few, stable and reliable operation, real-time.
The C language programming that the core controller PIC16F877A of this system is used, the editor of program and readability are strong, programming
Simply, system maintenance upgrading is convenient;Five kinds of standardizing programming language of PLC:Sequential function chart (SFC), ladder diagram (LD), function
Three kinds of graphical languages of module map (FBD) and two kinds of statement list (IL), structure text (ST) text language programmings program flexible
Property readability compared with C language want difference it is more;
What PLC was generally mostly used is the centralized control of controller, installs concentratedly, control signal output input it is negative from terminal
The distance of load farther out, easily causes the introducing of decaying and the interference of signal in this way.This system is using by the control of every motor
Board and motor driver (including:Soft strater, frequency converter etc.) it is mounted in small control cabinet, and by switch board and electricity
Machine is installed nearby, accomplishes to drive power cable shorter in this way, is less prone to the failure of power transmission circuit, the number of control and acquisition
It is believed that number even more segment distance transmission, to realize the fidelity transmission of data.
From the point of view of the requirement of the reliability of control, since the control environment of sewage treatment plant is relatively good, free from dust, no spoke
It penetrates, no strong electromagnetic, so this control system can meet stable requirement completely in such a case.
In terms of the cost of maintenance, PLC is due to needing the higher engineers and technicians of degree of specialization to carry out the soft of maintenance system
Hardware;And the core controller of this system is inexpensive plate card type, when system breaks down, layman need to only pull out
Board changes substitute.
From PLC control system in terms of the cost of installation in addition to the installation of core controller, it is also necessary at a distance bury power line,
Control signal wire and acquisition signal wire, installation it is of high cost, labour is big.It is negative that the switch board of this control system is mounted in terminal
The side of load, power and signal wire are shorter.Each terminal room, which need to only set up a cable, can realize the transmission of data.
The foregoing is only a preferred embodiment of the present invention, protection scope of the present invention is without being limited thereto, it is any ripe
Those skilled in the art are known in the technical scope of present disclosure, the letter for the technical solution that can be become apparent to
Altered or equivalence replacement are each fallen in protection scope of the present invention.