A kind of master-slave communication system based on AC power cord
(1) technical field:
The present invention relates to a kind of master-slave communication system based on AC power cord; The power supply of each data acquisition unit, actuator and controller is done the half-wave rectification acquisition by electrical network through the public rectification diode of system in the system; Hemiwave time is used between them through power line communication in addition; System is employed in the eigenwert counting that begins after public power switch is connected grid cyclic wave, and with the time reference of this count value as system synchronization.
(2) background technology:
In constituting a scm observe and control application system, often to adopt multi-computer system, this just relates to the message exchange between system.Adopt the master-slave mode multi-computer communication of RS485, RS232, I2C bus need use many buses, but under the not high situation of required communication rate, let us hope that the both sides that communicate take the least possible port line.The exchanges data of single line communication is only accomplished on 1 bus, but it must have strict sequential requirement to main frame and slave, is transmission and the reception that realizes data by " time slot " transmission.And high based on the carrier communication complex structure cost of line of electric force, the present invention adopts the exchanges data based on power lead, and it has characteristics easy and the saving hardware resource.
(3) summary of the invention:
Existing master-slave communication system all is to adopt that multibus is minimum to be the unibus structure form, and not only the system hardware cost is high, and also difficulty of wiring, if adopt power line carrier communication then cost is higher, and some application reliability is not enough.Simultaneously, because the independent separately timing of each principal and subordinate's machine in the system, its cumulative errors very greatly also must be corrected, and therefore for the little simple application system of many amount of communication data, adopts the method for introduction of the present invention to have excellent economy.
The present invention relates to a kind of master-slave communication system based on AC power cord; It is to be made up of a plurality of data acquisition units, a plurality of actuator and a controller; Their power supply is made half-wave rectification by electrical network through the public rectification diode of system and is obtained; Hemiwave time is used for the master-slave communication through power lead in addition, and this power lead is simultaneously as signal transmssion line.Each data acquisition unit, actuator and controller all begin an eigenwert counting to grid cyclic wave in the system after public power switch is connected; And with the count value of this grid cyclic wave eigenwert time reference as system synchronization; Here adopt the count value of the grid cyclic wave zero cross signal a kind of time reference as system, conventional timing time is as the meticulous time reference of system.The power module of said data acquisition unit, actuator and controller all is connected to isolates diode in order to the influence to signal transmssion line of the high direct voltage of insulating power supply module.The signal transmission that single-chip processor i/o mouth in each data acquisition unit is connected to power lead all has 2 the tunnel; Wherein one the tunnel is used to receive the address signal that controller sends, and it is that time point in controller control begins transmitting-receiving, and the shared time of the data transmit-receive of each address signal and collection is to confirm and be preset in each data acquisition unit, actuator and the controller with the count value of grid cyclic wave eigenwert; Take the CPU time to reduce incoherent data acquisition unit; Said data acquisition unit is in the hemiwave time that public rectification diode blocking-up cycle is used to communicate by letter, and through the method for inquiry I/O mouth, comes the receiver address signal; It can be dragged down a broad pulse by the noble potential Be Controlled device of signal transmission bus and represent that 1 burst pulse representes 0; The release of signal transmission bus can be by pull-up resistor signal transmission bus to be pulled to high level to realize, also can adopt interrupt method receiver address signal; Here the address of data acquisition unit and actuator is to give being solidificated in the program earlier or also can adopting toggle switch in the storer; Another road is used under controller control, the data that collect being sent to controller through power lead, and controller sends address signal to data acquisition unit earlier; After data acquisition unit receives address signal and comparison correctly; Promptly send the data of gathering, respectively be connected to an isolation diode on the passage of 2 road signals transmission of data acquisition unit, be used to isolate AC power to controller.All be connected to an electronic switch on the passage of its signal transmission of said controller and each actuator, this electronic switch turn-offs hemiwave time conducting in addition at the half-wave of electrical network to system's power supply.Actuator is the steering order of sending at the hemiwave time reception controller of electronic switch conducting.Above-mentioned signal transmitting and receiving all is in the hemiwave time of public rectification diode switching off AC power, to realize.
Native system is made up of following modules:
Public power switch unit and rectification diode, the half-wave rectification as power supply Push And Release and power supply can be connected in series an electronic switch and controlled by controller in power switch unit, make it to turn-off the safety with enhanced system in communication period.
Controller is made up of single-chip microcomputer, cycle detection, electronic switch, signal condition, storer, keyboard display and power supply, is used for sending address signal and receiving data that collect and the steering order of sending to actuator to data acquisition unit.
Data acquisition unit detects, isolates diode, signal condition, A/D conversion, sensor and power supply by single-chip microcomputer, cycle and constitutes the data that are used for the receiver address signal and gather to the controller transmission.
Actuator is made up of power supply, single-chip microcomputer, cycle detection, electronic switch, signal condition, driving circuit and actuator, is used for executivecontrol function under the control of controller.
(4) description of drawings:
Fig. 1 is a kind of circuit structure block scheme of the master-slave communication system based on AC power cord.
(5) embodiment:
A kind of circuit structure block scheme of the master-slave communication system based on AC power cord is as shown in Figure 1, and it is used for the indoor multipoint measurement and control of temperature, and controller controls corresponding actuator and opens or cut out according to indoor each point temperature measurement result.This system is made up of controller A, a plurality of data acquisition unit B and several actuators C; Wherein power switch unit 1 comprises a public power switch and a public electronic switch; Electronic switch is under the control of controller A; Make it in the conducting of half-wave rectification time, hemiwave time turn-offs in addition, and it is used for the security of enhanced system.Its controller A is made up of power supply 3, cycle detection 4, storer 5, single-chip microcomputer 6, electronic switch 7, signal condition 8, keyboard display 9; Wherein power supply 3 comprises an isolation diode and is used to block the passage refluence of direct supply high pressure to the signal transmission; Cycle detects 4 and is used for that the grid cyclic wave zero cross signal is triggered single-chip microcomputer 6 after shaping and produces interruptions and the grid cyclic wave zero cross signal is counted; Electronic switch 7 makes it to turn-off in the half-wave rectification time under single-chip microcomputer 6 controls, and the hemiwave time conducting is used for communication in addition.Data acquisition unit B is detected 14, isolates diode 12, signal condition 15, single-chip microcomputer 16, isolated diode 17, signal condition 18, A/D conversion 19, sensor 10 and constitute by power supply 13, cycle, and wherein power supply 13, cycle detect among 14 effect and the controller A identical.Signal condition 15 is connected to pull-up resistor to direct supply, drags down the completion address by controller A during communication and sends.The address of each data acquisition unit B is solidificated in separately in the program, and the data of collection are sent to controller A through isolating diode 17.Actuator C is made up of power supply 23, cycle detection 24, single-chip microcomputer 26, electronic switch 27, signal condition 28, driving circuit 29, actuator 20; Wherein power supply 23, cycle detect 24, identical among electronic switch 27 effects and the controller A, the address of each actuator C also is solidificated in separately in the program.