Summary of the invention
The object of the present invention is to provide a kind of micro radio centralized and decentralized system and control method thereof, it has overcome the shortcoming that wired or wireless Distributed Control System in the prior art can't satisfy part intricately condition, provide a kind of satisfy at cable laying, optical cable have difficulties, work station distributes and to disperse, and the application scenario that the work station position often will be moved is realized between main website and each slave station, between each slave station and the transducer and carry out the radio centralized and decentralized system and the control method thereof of the needs that data wireless transmits between main website and each transducer.
The technical solution used in the present invention comprises: a kind of micro radio centralized and decentralized system, it comprises a main station controller, at least one is from station control, with each from the corresponding transducer of station control, wherein, described main station controller, from station control, transducer all add the band modulator-demodulator (MODEM) wireless data transmission module.
Wherein, described wireless data transmission module is the wireless data transmission module that works in 230MHZ.
Wherein, described main station controller and all can be PLC or single-chip microcomputer or industrial computer from station control.
Wherein, described main station controller, link to each other with wireless data transmission module by the RS232 interface from station control, transducer.
Wherein, described wireless data transmission module can install high-power antenna enhancing data transmission distance additional.
Wherein, described transducer, wireless data transmission module and cell package are in the enclosed box body of a firm waterproof.
A kind of control method of micro radio centralized and decentralized system comprises following flow process:
1, the wireless data transmission module setting address code of not setting condition code and not giving the connection main station controller for main station controller, guarantee that main station controller can receive all signals, set a general address sign indicating number for the wireless data transmission module that connects from station control, give a unique condition code to each from station control again, give a unique address code for the wireless data transmission module that connects each transducer, set the information code of a cover representative transmission data implication again;
2, order from station control regularly to corresponding transducer transmitting control commands, wherein N is " information code of N sensor address sign indicating number+a certain implication of representative " from the form of the control command of station control transmission, the wireless data transmission module that the N transducer links to each other is received the control command that meets own receiver address, information code is delivered to transducer, transducer is obtained order, after carrying out corresponding order, sensing data is sent by wireless data transmission module, wait for that N receives sensing data from station control, the form that transducer sends sensing data is " it is the information code+sensing data of sensing data that general address sign indicating number+representative this time sends ";
3, because the wireless data transmission module that links to each other with main station controller is not established address code, therefore no matter be the signal that sends of transducer or can both receive from the signal main station controller that station control sends, it is transducer or the signal sent from station control that main station controller is distinguished according to the difference of the difference of the address code of received signal and the information code of following later, and further district office sends the content of signal, like this, main station controller is preserved and is handled with regard to will disaggregatedly signal being left in corresponding data storage area;
4, main station controller is " a general address sign indicating number+from the information code of station control condition code+a certain implication of representative " to the form from the station control transmitting control commands, only the follow-up data that meets own condition code is handled from station control, is that " our station condition code+represent follow-up data implication information code+follow-up data " starts from station control to the form that main station controller sends data, and then main station controller is received after the data and can be distinguished and handle according to condition code.
Wherein, cause confusion and disturb for preventing to give an order simultaneously from station control for 2, in second step in said method, every from station control transmission " information code of implication is forbidden in general address sign indicating number+representative " earlier, send the control command of respective sensor again, wait for then and receiving, after receiving the sensing data that respective sensor beams back, send again " information code of implication is lifted a ban in general address sign indicating number+representative ", concerning other from the station control, as long as receive " information code that implication is forbidden in representative ", just suspend the various information that send at once, to after the sensing data that receives do not deal with yet, up to receiving last the proper communication function of just recovering oneself after " information code of implication is lifted a ban in representative " that station control sent.
Wherein, main station controller also can adopt similar mode from station control initiatively to send to the transducer timesharing and trigger the sensing data that control command is waited for the loopback of reception respective sensor then, main station controller should send " information code of implication is forbidden in general address sign indicating number+representative " earlier, send the control command of respective sensor again, wait for then and receiving, after receiving the sensing data that respective sensor beams back, send again " information code of implication is lifted a ban in general address sign indicating number+representative ", concerning other from the station control, as long as receive " information code that implication is forbidden in representative ", just suspend the various information that send at once, to after the sensing data that receives do not deal with yet, after receiving " information code of implication is lifted a ban in representative " that main station controller sends, just recover the proper communication function of oneself.
The Mini-scale Distributed Control Systems that the present invention proposes is a micro radio centralized and decentralized system of selecting for use existing digital transmission module and transducer to form fast, its delicate structure, configuration is convenient, reliable, flexible design, highly versatile, selected digital transmission module works in 230MHz, transmitting power 500mW belongs to micropower and exempts to apply for civilian amateur band, need not additionally to authorize expense or network third party to support.For wired connection have any problem, working range is disperseed, unfixed application scenario, service position is especially suitable, the present invention can adapt to the multiple needs in a plurality of fields of industrial production, help to improve production automation level and managerial skills, improve the quality of products, industrial development be can effectively promote, bigger economic benefit and social benefit createed.
Embodiment
Now according to accompanying drawing, the present invention will be further described in conjunction with the embodiments.
Embodiment 1
Present embodiment is the steel column perpendicularity control system that the inventor develops, this system is used for monitoring and the regulation and control of building foundation construction to cast-in-place concrete pile steel column perpendicularity, guarantee in the filling pile construction process, the perpendicularity of steel column is controlled within the designing requirement.Native system 10 is made up of 12,13, two transducers of 11, two slave stations of a main website 14,15.Main website 11, slave station 12,13 all is connected a wireless data transmission module 19 by serial ports with transducer 14,15.Main website 11 realizes the monitoring of slave station 12,13 operating states and the tabulate statistics and the storage of measurement data, and each slave station corresponding sensor realizes the measurement of steel column 18,18 ' perpendicularity and realizes regulation and control to perpendicularity.Two slave stations 12,13 are worked simultaneously, can monitor stake position 1, stake position 2 simultaneously.Main website 11 and slave station 12,13 are owing to be operated in outdoor architecture building site environment, the temperature difference is big, requirements such as shockproof, waterproof and dustproof, anti-electromagnetic interference is arranged, the special requirement reliable operation, and price can not be too high, therefore selects for use the FX2n of Mitsubishi type Programmable Logic Controller (PLC) as controller.The DR202B type digital transmission module that the digital double-shaft tilt angle sensor of NS-15/P2 type that transducer 14,15 selects for use German HL-Planar company to produce, wireless data transmission module 19 select for use Jiaxing Lan Bo Electronics Co., Ltd. to produce.When system's 10 work, transducer 14,15 be fixed on respectively steel column 18,18 ' on, the degree of perception steel column inclination at any time after transducer 14,15 is receiving slave station 12,13 detection trigger commands, can be exported the squareness measurement data from serial digital interface.After measurement data is transferred to slave station 12,13, by controller these data and perpendicularity reference data (being called the value of making zero) are compared, arrive actuator according to comparative result output control command---hydraulic jack 17,17 ' to steel column 18,18 ' enforcement correction.Main website 11 in native system, slave station 12,13, and the transfer of data between each parts such as transducer 14,15 all relies on wireless data transmission module 19 to realize wireless transmission.
In order between each data sources such as main website, slave station, transducer, to realize the wireless transmission of data, used the terminal equipment of wireless data transmission module, with the carrier composition data transmission channel of radio wave as the signal transmission as each data source.The employed digital transmission module 19 of native system is DR202B type digital transmission modules, is furnished with MD4800 type intelligence MODEM, transmitting power is 500mW, accessible communication distance can reach hundreds of rice when being equipped with the rubber antenna, communication distance can reach more than the 1000m when being equipped with car antenna, can both penetrate general body of wall or construction machinery signal, can be in various building sites, field or do not use in the environment in the factory building separated of conductively-closed body etc.The digital transmission module of also replaceable big transmitting power model during as the bigger communication distance of needs.Being connected as shown in Figure 2 between transducer 14,15 and the digital transmission module 19, being connected as shown in Figure 3 between main website 11, slave station 12,13 and the digital transmission module 19.
In the accompanying drawing 2, NS-15/P2 type obliquity sensor 14,15 has the interface socket of one 7 pin, comprised in 7 pins power supply (DC+5V~+ 24V) and RS232 serial data I/O terminal.And in the RS232 of DR202B digital transmission module 19 serial line interface, to receive data wire RxD and send data wire TxD and change the demodulated data signal output line of MODEM respectively into and receive the data-signal incoming line, therefore when digital transmission module is connected with transducer, no longer need to resemble common serial ports when interconnected with RxD, the TxD interconnection of RxD, TxD and the MODEM of digital terminal, and as long as the two RxD is directly linked to each other with TxD with RxD, TxD.In the native system, transducer 14 connects back maintenance-free battery with 1 12V with digital transmission module 19 usefulness stub cables and is encapsulated in (antenna is contained on the steel box shell) in 1 waterproof steel box, is fixed on steel column 18 upper ends of job site.
PLC need install 1 RS232 serial communication expansion templates FX-232-BD in the accompanying drawing 3, interface on the FX-232-BD plate is the public type socket of DB-9, it with digital transmission module 19 on DB-9 parent form RS232 interface socket between use commercially available 1 end public affairs, 1 end mother's 9 core serial communication cables to be connected (the connection heart yearn between 2 plugs at cable two ends does not intersect).Digital transmission module 19 used power supplys are provided by the Switching Power Supply that is output as DC12V, owing to be limited to+12V on the supply voltage of digital transmission module 19, for the purpose of reliable, should earlier voltage be turned down 11.5V when using Switching Power Supply.
Use 2 transducers, 3 PLC controllers in the native system 10, adopted said method to be connected with digital transmission module 19 separately respectively.And 5 digital transmission modules all are set to identical working channel (centre frequency 227.225MHz), data format (1 position of rest, 8 data bit, parity check None) and air transfer rate (2400bps).
Control method is as described below in the native system 10:
1, address code determines
For each data source is distinguished, should set up different address codes to each data source respectively.For PLC controller 12,13, can receiver address be set by the digital transmission module 19 that is attached thereto, and send target to specify by PLC controller extra address sign indicating number in the data sequence that will send.But concerning transducer 14,15, because employed transducer 14,15 itself does not have the ability of geocoding in the native system, MODEM in the digital transmission module 19 also only has the ability that receiver address is set, and be transparent to the data that sent, can not be on data extra address information, therefore can be distinguished by the receiver address that before order, adds the digital transmission module 19 that links to each other with transducer for the order that controller is issued transducer 14,15.
Learn after the measurement data form that transducer sent analyzed, the data of transducer are to export with the form of ASCII character, data format is " X=± ##.### (carriage return; line feed) Y=± ##.### (carriage return; line feed) ", and each measurement data that sends is always with the beginning as data sequence of the ASCII character " 58 3D " of character " X=".Therefore, in the native system 10 just with the address of byte " 58H " as 1# controller and 2# controller, and with " 3DH " as the information code of controller identification measurement data so that distinguished with out of Memory.For but the measurement data controlled device 12,13 that transducer 14,15 is sent receives respectively, the measure that system taked is to make 1 # controller 12 and 13 timesharing of 2# controller send the control command that has respective sensor receiver address sign indicating number, the transducer that conforms to address code receives the measurement data beamed back after the control command and is only received by the controller of transmitting control commands just now, the controller of transmitting control commands is not then shielded this measurement data, disregards.Because the address code of controller 12,13 all is set to " 58H ", which controller in order to allow main website 11 distinguish is, 1 # controller 12 and 2# controller 13 are set to " 58H " except receiver address in the digital transmission module 19 that is attached thereto, and have also used condition code in signal procedure separately: the condition code of 1# controller 12 is " B1H "; The condition code of 2# controller 13 is " B2H ".Consider the measurement data that main website 11 should receiving sensor sends, receive the various information that 1 # controller 12 and 2# controller 13 are sent again, and also to intercept the control command that 1 # controller 12 and 2# controller 13 are issued transducer for distinguishing sensor 14,15, therefore determine main website 11 for not establishing address code, the signal that promptly all data sources are sent out can both be received by main website 11.In sum, the address code of each data source and condition code are as shown in table 1.
The address code of each data source of table 1 and condition code
Data source |
Address code |
Condition code |
Main website |
11 1# controllers, 12 2# controllers, 13 1# transducers, 14 2# transducers 15 |
No 58H 58H AAH CCH |
No B1H B2H nothing |
The address code of transducer 14,15 can be provided with arbitrarily in the table 1, as long as other address code, condition code and information code of discord clashes.
2, the method for transfer of data
(1) from the communicate by letter agreement of station control with transducer
1# controller 12 and 2# controller 13 all regularly send control command to respective sensor, 12 control words of 1# controller " AA6DH "; 13 control words of 2# controller " CC6DH ".Wherein " AAH " reaches the receiver address that " CCH " is respectively 2 transducers 14,15, and " 6DH " then is the measurement triggering control command of transducer defined.19 pairs of orders that meet own receiver address of the digital transmission module that links to each other with transducer are received, and after automatic fitration falls address code, by the serial ports that joins with transducer " 6DH " are delivered to transducer.After transducer receives trigger command,, be about to the measurement of dip angle data and send, received by the controller that sent control command just now by digital transmission module 19 through the time-delay (about about 1s) of certain hour.In order to prevent that controller 12,13 from sending control command simultaneously and causing confusion, disturb for preventing to produce simultaneously, before the control command of every controller transmission to transducer, send the transmission decretum inhibitorium word " 58COH " (its last byte " 58H " is the address code of another controller) of an agreement earlier, send control command again, wait for then receiving transducer.After receiving the measurement data that transducer beams back, send one again and remove decretum inhibitorium word " 58CAH ".Concerning another controller, as long as receive decretum inhibitorium " COH " (preceding 1 byte 58H is fallen by automatic fitration), just suspend the various information that send at once, to after the sensor measurement data that receive do not deal with yet, after receiving last the releasing decretum inhibitorium " CAH " that controller sent, just recover the proper communication function of oneself.Therefore 2 controllers can the phase mutual interference to the control command of transducer, and the measurement data of each transducer is only received by corresponding controller, can not get wrong.
(2) main website is to the reception of sensor measurement data
Because the digital transmission module 19 that links to each other with main website 11 is not establish address code, so no matter is the signal that sends of transducer or can both receives from the signal main website that station control sends.Receiver address sign indicating number " AAH " and " CCH " of transducer therefrom recognizes by to the intercepting of slave station signal in main website, sends thereby which transducer is the measurement data that distinguishing sensor is beamed back be.As listened to " AA6DH " signal, and just can determine to be 1# controller 12 in the measurement triggering control command that sends 1# transducer 14, be exactly the measurement data that 1# transducer 14 is beamed back following received signal then with " 583DH " beginning; Then be the measurement data that 2# transducer 15 is beamed back in like manner listening to the received measurement data in " CC6DH " back.Like this, just received measurement data can be stored in respectively in the corresponding data storage area and preserve and handle.
In addition, main website 11 also can adopt the mode of similar slave station initiatively to send to transducer 14,15 timesharing and trigger the measurement data that control command is waited for the loopback of reception respective sensor then.Certainly, main website 11 is carrying out also should sending decretum inhibitorium " 58COH " in the process of timesharing transmission with transducer 14,15 and is removing decretum inhibitorium " 58CAH " to suspend and the transmit operation of recovery slave station 12,13.
(3) agreement of communicating by letter between main website and the slave station
2 address codes from station control all are " 58H ", and wherein the condition code of 1# controller 12 is " B1H ", and the condition code of 2# controller 13 is " B2H ".Therefore all start with " 58B1H " to the data that slave station 12 sends in main website 11, the data that send to slave station 13 all start with " 58B2H ".13 pairs of data that receive of slave station 12 or slave station are analyzed, and the follow-up data that meets own condition code is handled, and the follow-up data that does not meet own condition code is then disregarded.From standing in when main website 11 sends data, then always with condition code " B1H " or " B2H " beginning of our station.Whether main website 11 is that condition code " B1H " or " B2H " distinguish 2 slave stations with first received byte content after the information of receiving.
Because institute's data packets for transmission contains various command, request, state, statistics or the like between main website 11 and the slave station, its implication of various data sequences and data length are all inequality.Therefore in native system 10, be that the 1st byte is condition code " B1H " or " B2H " with the format design of the data sequence transmitted between main website 11 and the slave station; The 2nd byte is for representing the information code of follow-up data implication; Be the data field then.(the 1st byte is address code " 58H " in the data that main website sends, but address code can be fallen by automatic fitration when slave station receives).The data length of per 1 data sequence is arranged in advance according to various information codes, has only as the data sequence of expression request function that 2 bytes---condition code and information code do not have follow-up data; The data sequence length of data then is 256 bytes in the expression transmission log district---condition code, information code add 254 byte records data again.Main website or slave station carry out respective handling according to received information code to follow-up data or directly respond.The implication of various information codes is as shown in table 2.
The information code of transmission data between table 2 main website and slave station
Information code |
Implication |
Information code |
Implication |
00H |
Transmitting data in the recording areas |
99H |
The order slave station is uploaded the value of making zero and parameter |
22H |
Transmitting the value of making zero and parameter |
A5H |
Slave station is uploaded the electromagnetically operated valve status word |
33H |
Control is transferred to slave station by main website |
B1H |
Notice main website slave station 1 has been started shooting |
44H |
Slave station is transferred control to the main website request |
B2H |
Notice main website slave station 2 has been started shooting |
66H |
The full request of slave station recording areas is uploaded |
3DH |
Follow-up data is the sensor measurement data |
77H |
Slave station stops to monitor, shuts down |
|
|
(4) serial communication instruction
Main website and slave station all use the FX2n type PLC of Mitsubishi as controller in the native system, and be connected with wireless data transmission module 19 by adjunction RS232 serial line interface template on the elementary cell of PLC, all data communication are all carried out with serial communication instruction RS by serial ports.
RS command format as shown in Figure 4, the instruction in the accompanying drawing 4 represents that the data that are ready for sending are placed on from the transmission buffer area that D600 begins, the byte number (10 bytes) that sends data is specified in m; The data working area that receives is from D700, and the maximum length (25 bytes) that receives is specified in n.
When using the RS instruction to communicate, the parameter of relevant communication pattern will be set in special function register D8120, as baud rate, data bits, position of rest, parity check, bebinning character etc., should notice that set parameter value is consistent with the parameter of digital transmission module 19.After the data that are ready for sending are delivered to and sent buffer area, can begin to send with trigger data, send end back serial ports and can transfer the reception armed state automatically immediately to by specific function auxiliary relay M8122 being carried out pulse set; And after receiving data, receiving sign M8123 can automatic set, at this moment just can arrive the reception working area and reach out the reception data and handle.M8123 in time should be resetted after data are taken out makes serial ports keep the reception armed state.
When parameter will change in every page data length, buffer area address or the communication pattern that will send, can in program, use the RS instruction of different operating number or D8120 is reset.But PLC can only use 1 RS instruction at synchronization, and when switching between different RS instructions, should guarantee to instruct OFF interval greater than equaling 1 scan period, switches by time-delay 0.1s in native system.In addition, when the data in the buffer area were sent or receive, the figure place of data can be 8, also can be 16, and the practical communication pattern of serial ports is always undertaken by 8, and this just requires the figure place that specific data is handled in program.Can specify the communication of carrying out 16 bit data or the communication of carrying out 8 bit data by the state of specific function auxiliary relay M8161, be 16 bit walks during M8161=OFF, is 8 bit walks during M8161=ON.The data that send in the buffer area when carrying out 8 bit walks have only least-significant byte effective; And PLC can divide 2 transmission with the data that send in the buffer area by least-significant byte and most-significant byte automatically when 16 bit walks.Certainly when changing, the M8161 state equally also needs to make the RS instruction that the enough OFF time be arranged between this two states by time-delay 0.1s.Because when transmit leg sends with 16 bit data processing modes, the recipient does not also know that the data of bringing are 16, and the recipient always receives by 8 data processing method.But when data are handled in to the reception working area, thereby can be by the information code analysis of every page of beginning being learnt whether corresponding data be 16 and make corresponding processing.For example, information code represents to transmit the value of making zero and relevant parameter during for 22H, these data are 16, when recognizing information code in the data that receive and be 22H, just know that follow-up data is 16, again 2 bytes are combined into 1 word and constitute 16 bit data after when handling, just the data in the working area respectively being taken out least-significant byte.
The identification that receives information code in the data is to realize by the information code that receives the 2nd byte in the working area and agreement is compared, and be that " B1H " or " B2H " distinguish by the 1st byte (condition code) is slave station 1 or slave station 2 (as a kind of situation of exception, information code " 3DH " is the 1st byte in the working area in the sensor measurement data that slave station receives).When condition code, information code are all coincide, follow-up data is handled accordingly, then the reception data are regarded as when misfitting and disturb and disregard, thereby realized filtration useful data.