The M-BUS bus controller
Technical field
The invention belongs to the Field Bus Control Technology field; Be specifically related to a kind of controller of the M-BUS of being used for bus data transmission, can be used for water, electricity and gas hotlist, industry spot instrument, fire protection warning and the fields such as interlock control, Smart Home, building and sub-district of M-BUS bus.
Background technology
(Meter-BUS EN1434-3) is consumer instrument current international practice standard to M-BUS.It is a kind of economical and practical fieldbus; Have good opening, its topological structure is bus structure, adopts common two core cable to connect; Accomplish the function of power supply power supply and data communication simultaneously; When connecting, need not distinguish polarity, can be according to randomly topologically structured cable wiring manufacture, its construction cost and difficulty descend greatly.
M-BUS bus electric interfaces should meet the following requirements:
When slave station was supplied power by main website, each slave station obtained to be not more than the electric current of 2mA, and the main website driving force should be not less than 64 slave stations.
The information transmission of main website to slave station is to realize through the mode that level changes.During mark (logic level is " 1 "): the big 10V of bus voltage when bus voltage should be than spacing, and bus voltage is smaller or equal to 42V; During spacing (logic level is " 0 "): bus voltage should be greater than 12V.
Slave station to master information transmission is that the variation through the slave station size of current realizes.During mark (logic level " 1 "): marking current is 0mA~1.5mA; During spacing (logic level " 0 "): spacing current is on the basis of marking current value, to increase about 11mA~20mA; When bus was idle, master and slave station should keep mark condition.
M-BUS bus controller (being main website) mainly has two functions; The one, for the slave station that connects on the M-BUS bus provides enough power supplies; Has failure protection function simultaneously (when being bus short circuit or overload current anomaly; Cut off the supply power of M-BUS bus), the 2nd, with slave station communication.
Not enough below current M-BUS bus controller or main website exist:
The data transmit circuit more complicated generally will be passed through circuit such as shaping filter, comparison, amplification and could be realized the modulation of M-BUS bus voltage, has shortcomings such as circuit is loaded down with trivial details, debugging complicacy, maintenance difficult, job insecurity.
The sampling resistor of series connection larger capacity on the M-BUS bus causes M-BUS bus output voltage to reduce, and influences communication distance, reduces slave station quantity.
Receiving circuit sensitivity is not high, poor anti jamming capability, and the communication success ratio is low.
No bus failure defencive function or failure protection function poor (response time is slow, sensitivity is lower, be prone to misoperation etc.) influence system works or decrease the ring apparatus components and parts.
Summary of the invention
For remedying the deficiency of prior art, the present invention provides a kind of M-BUS bus controller, and it is characterized in that: transtation mission circuit is simple and reliable; Receiving circuit is highly sensitive, and antijamming capability is strong, minimum current sampling resistor; Basic absence of voltage, communication distance is far away, fast, highly sensitive, the no misoperation of bus failure defencive function response time; Adopt matrix switch expansion bus passage, increase the quantity of controller band slave station, reduce cost and energy consumption.
The following technical scheme of the concrete employing of the present invention:
A kind of M-BUS bus controller mainly comprises stabilized voltage supply, data transmission unit, current sampling resistor, Data Receiving unit, bus protection unit, first electronic switch, matrix switch unit and control module, it is characterized in that:
Said stabilized voltage supply first utmost point and second utmost point are connected to the input end of said data transmission unit, and said stabilized voltage supply the 3rd utmost point is connected to the said first electronic switch input end.Stabilized voltage supply is output as three utmost points, according to the difference of 0V with reference to the utmost point, is divided into three kinds of situation, so the plus or minus of a certain utmost point is unfixed, sees embodiment for details.
The control end of said data transmission unit is connected to said control module.
Said current sampling resistor is connected on the M-BUS bus; One end of current sampling resistor is connected with said data transmission unit output terminal; The other end is as the output of M-BUS bus; Be connected to the input end of said matrix switch unit, said current sampling resistor two ends also are connected to said Data Receiving unit, gather the current signal of M-BUS bus through said Data Receiving unit.
Said Data Receiving unit also is connected to said bus protection unit and control module respectively; Said Data Receiving unit carries out the Differential Detection processing and amplifying to current sampling resistor voltage signal; Realize the demodulate reception of bus data; The confession control module is handled, and the part signal of said Data Receiving unit also outputs to said bus protection unit.
Said bus protection unit also is connected to the said control module and first electronic switch controling end respectively; Judgement is handled to said Data Receiving element output signal in said bus protection unit; Control first electronic switch conducting or the shutoff; The protection of realization bus failure, control module is through first electronic switch conducting or the shutoff of bus protection unit controls.
The said first electronic switch output terminal is the output of M-BUS bus, is connected to the input end of said matrix switch unit, and control end is connected to said bus protection unit.
Said matrix switch unit input end is connected to the M-BUS bus, and output terminal is each passage M-BUS bus output, and control end is connected to said control module.
According to the requirement of M-BUS bus standard, the information transmission of main website to slave station is to realize through the mode that level changes.During mark (logic level is " 1 "): the big 10V of bus voltage when bus voltage should be than spacing, and bus voltage is smaller or equal to 42V; During spacing (logic level is " 0 "): bus voltage should be greater than 12V.
The voltage of said stabilized voltage supply output: first utmost point and the 3rd voltage across poles are smaller or equal to 42V, and first utmost point and second voltage across poles are greater than 10V, and second utmost point and the 3rd voltage across poles are greater than 12V.
Described data transmission unit comprises one second electronic switch and a diode, and stabilized voltage supply first utmost point is connected to output terminal through second electronic switch, and stabilized voltage supply second utmost point is connected to output terminal through diode; When sending logical zero, control module is controlled second electronic switch and is turn-offed, and stabilized voltage supply second utmost point is connected to output terminal through diode; Output LOW voltage; When sending logical one, control module is controlled the second electronic switch conducting, and the cathode voltage of diode is higher than anode voltage (the first pole tension ﹥, second pole tension); Diode ends; Stabilized voltage supply first utmost point is connected to output terminal, output HIGH voltage, thereby the modulation that realization M-BUS bus is sent voltage.
Described current sampling resistor is connected on the M-BUS bus, and bus current produces the voltage drop signal on this resistance, offer the Data Receiving cell processing, and current sampling resistor is less than 1 Ω, and the voltage drop of its generation can be ignored.
Described Data Receiving unit comprises current detecting amplifying circuit, signaling conversion circuit, signal comparator circuit, the clamped circuit of signal.The current detecting amplifying circuit is a Differential Detection amplifying circuit, the signal of input is carried out difference amplify, and realizes effectively to the inhibiting effect of common mode input (interference) signal with to the amplification of difference-mode input (effectively) signal; Signaling conversion circuit is a subtraction circuit of being made up of operational amplifier, and the signal after this handles is supplied with signal comparator circuit on the one hand, supplies with the bus protection unit on the other hand; Signal comparator circuit is a high-speed comparator circuit, and the signal of input obtains comprising the signal of effective reception data after through this; The clamped circuit limitations of signal is input to the signal amplitude of control module, makes it in the safe range that allows.
Described bus protection unit is a failure detector circuit, and the signal of monitoring data receiving element output is controlled first electronic switch conducting or the shutoff simultaneously; When the electric current of M-BUS bus is in normal range; First electronic switch is in conducting state, in case unusual (short circuit or electric current overload) appears in the M-BUS bus load, the signal after current sampling resistor and Data Receiving cell processing also exceeds allowed band; After failure detector circuit monitors this abnormal signal; Automatically control first electronic switch immediately and turn-off, cut off the M-BUS supply power, effectively protected total system.
M-BUS bus one is realized to multichannel expansion in described matrix switch unit, and a M-BUS bus controller can be connected a plurality of passages in turn, has enlarged the quantity of band slave station.
Beneficial effect of the present invention: data transmit circuit is simple, and debugging maintenance is simple and convenient; The current sampling resistor of series connection is little, basic absence of voltage, and communication distance is far away; Receiving circuit adopts the difference current detection technique, and highly sensitive, antijamming capability is strong; Have the bus failure defencive function, fast, highly sensitive, no misoperation of response time has protected system not fragile effectively; Adopt matrix switch to expand bus run, increased the quantity of controller band slave station widely, reduced cost and energy consumption.
Description of drawings
Fig. 1 is a general principles synoptic diagram of the present invention;
Fig. 2 A is one of data transmission unit second electronic switching circuit embodiment principle schematic among the present invention;
Fig. 2 B is two principle schematic of the data transmission unit second electronic switching circuit embodiment among the present invention;
Fig. 3 is the circuit theory synoptic diagram of Data Receiving unit among the present invention;
Fig. 4 is the circuit theory synoptic diagram of bus protection unit among the present invention;
Fig. 5 is a matrix switch unit principle schematic among the present invention;
Fig. 6 A is one of matrix switch unit the 1st channel switching circuit embodiment principle schematic among the present invention;
Fig. 6 B is two principle schematic of matrix switch unit the 1st channel switching circuit embodiment among the present invention;
Embodiment
Below in conjunction with instantiation and accompanying drawing the present invention is further described
Shown in accompanying drawing 1, the M-BUS bus controller mainly comprises stabilized voltage supply, data transmission unit 1, current sampling resistor 2, Data Receiving unit, bus protection unit, first electronic switch 3, matrix switch unit and control module.
Said stabilized voltage supply first utmost point and second utmost point are connected to the input end of said data transmission unit 1, and said stabilized voltage supply the 3rd utmost point is connected to said first electronic switch, 3 input ends.
The control end of said data transmission unit 1 is connected to said control module.
Said current sampling resistor 2 is connected on the M-BUS bus; One end of current sampling resistor 2 is connected with said data transmission unit 1 output terminal; The other end is as the output of M-BUS bus; Be connected to the input end of said matrix switch unit, said current sampling resistor 2 two ends also are connected to said Data Receiving unit, gather the current signal of M-BUS bus through said Data Receiving unit.
Said Data Receiving unit 1 also is connected to said bus protection unit and control module respectively; Said Data Receiving unit carries out the Differential Detection processing and amplifying to current sampling resistor 2 voltage signals; Realize the demodulate reception of bus data; The confession control module is handled, and the part signal of said Data Receiving unit also outputs to said bus protection unit.
Said bus protection unit also is connected to said control module and first electronic switch, 3 control ends respectively; Judgement is handled to said Data Receiving element output signal in said bus protection unit; Control 3 conductings of first electronic switch or shutoff; The protection of realization bus failure, control module is through first electronic switch, 3 conductings of bus protection unit controls or shutoff.
Said first electronic switch, 3 output terminals are the output of M-BUS bus, are connected to the input end of said matrix switch unit, and control end is connected to said bus protection unit.
Said matrix switch unit input end connects the M-BUS bus, and output terminal is each passage M-BUS bus output, and control end is connected to said control module.Its principle of work is: when sending data; Control module control data transmitting element is modulated into the transmission voltage signal, and this voltage signal is connected to the matrix switch unit through current sampling resistor, when receiving data; The current signal of M-BUS bus produces the voltage drop signal at the current sampling resistor two ends; Be transferred to control module behind this voltage drop signal of Data Receiving cell processing, this voltage drop signal offers the bus protection unit simultaneously, in case unusual (short circuit or electric current overload) appears in bus load; The bus protection unit is automatically controlled first electronic switch immediately and is turn-offed, and cuts off the electricity supply and being connected of M-BUS bus negative pole.Control module gating matrix switch element is selected corresponding M-BUS bus run, realizes that M-BUS bus one is to multichannel expansion.
According to the requirement of M-BUS bus standard, the information transmission of main website to slave station is to realize through the mode that level changes.During mark (logic level is " 1 "): the big 10V of bus voltage when bus voltage should be than spacing, and bus voltage is smaller or equal to 42V; During spacing (logic level is " 0 "): bus voltage should be greater than 12V.
The voltage of stabilized voltage supply output: first utmost point and the 3rd voltage across poles are smaller or equal to 42V, and first utmost point and second voltage across poles are greater than 10V, and second utmost point and the 3rd voltage across poles are greater than 12V.According to difference, be divided into following 3 kinds of situation with reference to the utmost point (0V voltage):
1, first very with reference to the utmost point (0V), then the second pole tension scope be-10V is to-30V, the 3rd pole tension scope be-22V extremely-42V.
2, second very with reference to the utmost point (0V), then first voltage range be+10V is to+30V, the 3rd pole tension scope be-12V extremely-32V;
3, the 3rd very with reference to the utmost point (0V), then first voltage range be+22V is to+42V, the second pole tension scope be+10V extremely+30V;
Shown in accompanying drawing 1, data transmission unit 1 comprises one second electronic switch 4 and a diode 5, and stabilized voltage supply first utmost point is connected to output terminal through second electronic switch 4; Stabilized voltage supply second utmost point is connected to output terminal through diode 5, and when sending logical zero, control module is controlled second electronic switch 4 and turn-offed; Stabilized voltage supply second utmost point is connected to output terminal through diode 5, and output 0V voltage is when sending logical one; Control module is controlled 4 conductings of second electronic switch; The cathode voltage of diode 5 is higher than anode voltage, and diode 5 ends, and stabilized voltage supply first utmost point is connected to output terminal; Output positive voltage, thereby the modulation that realization M-BUS bus is sent voltage.
Shown in accompanying drawing 2A; Second electronic switch 4 of accompanying drawing 1 is made up of triode Q1, MOSFET pipe Q2 and resistance R 2, R3, R4, R5, and the base stage of triode Q1 connects an end of resistance R 2, and resistance R 3 is connected between the base stage and emitter of triode Q1; Resistance R 5 is connected between the grid and source electrode of MOSFET pipe Q2; Resistance R 4 is connected between the collector of grid and triode Q1 of MOSFET pipe Q2, and the source electrode of MOSFET pipe Q2 is connected to stabilized voltage supply first utmost point, and the drain electrode of MOSFET pipe Q2 is connected to the negative electrode of diode 5; The anode of diode 5 is connected to stabilized voltage supply second utmost point, and the negative electrode of diode 5 is the output terminal of data transmission unit.
Shown in accompanying drawing 2B; Second electronic switch, 4 electronic switches in the accompanying drawing 1 are made up of triode Q3, relay K 1, diode D1 and resistance R 6, R7; One end of resistance R 6 connects the base stage of triode Q3; Resistance R 7 is connected between triode Q3 base stage and the emitter, and fly-wheel diode and relay coil are connected in the collector of triode Q3 and an end that is connected to stabilized voltage supply first utmost point of relay K 1 in parallel.One end of relay K 1 is connected to stabilized voltage supply first utmost point, and the other end is connected to the negative electrode of diode 5, and diode D1 is the fly-wheel diode of relay, and the anode of diode 5 connects stabilized voltage supply second utmost point, and the negative electrode of diode 5 is the output terminal of data transmission unit.Shown in accompanying drawing 3, the Data Receiving unit comprises current detecting amplifying circuit, signaling conversion circuit, signal comparator circuit, the clamped circuit of signal.Current detection circuit is made up of current detecting chip U1 and resistance R 9, R10; Signaling conversion circuit is made up of operational amplifier U2A and resistance R 11, R12, R13, R14; Signal comparator circuit is made up of comparer U3A, diode D2, capacitor C 1 and resistance R 15, R16, R17, and the clamped circuit of signal is made up of diode D3 and resistance R 18, R19.The current detecting amplifying circuit is a Differential Detection amplifying circuit, the signal of input is carried out difference amplify, and has realized effectively to the inhibiting effect of common mode input (interference) signal with to the amplification of difference-mode input (effectively) signal; Signaling conversion circuit is a subtraction circuit of being made up of operational amplifier, and the signal after this handles is supplied with signal comparator circuit on the one hand, supplies with the bus protection unit on the other hand; Signal comparator circuit is a high-speed comparator circuit, and the signal of input obtains comprising the signal of valid data information after relatively; The clamped circuit limitations of signal is input to the signal amplitude of control module, makes it in the safe range that allows.
Shown in accompanying drawing 4, the bus protection unit comprises signal comparator circuit, the clamped circuit of signal and signal latch circuit.Signal comparator circuit is made up of U3B and resistance R 20, R21, R22, R23; The clamped circuit of signal is made up of diode D4, capacitor C 2 and resistance R 24, R25, R26; Signal latch circuit is made up of latch U4A, resistance R 27, R28, through the emergency protection current value of resistance R 20 with R21 setting bus.
Shown in accompanying drawing 5; Be the switch matrix circuit principle schematic, comprise 16 identical channel switchs (number of channels can increase and decrease as required), the input end of each channel switch is connected with the M-BUS bus; Output terminal is connected to lead-out terminal, and control end is connected with control module.Through channel switch, control signal can be controlled the conducting or the shutoff of M-BUS bus positive pole, negative pole and lead-out terminal simultaneously.Channel switch is a double-break switch.
In the present embodiment, the 1st channel switch with switch matrix circuit is its circuit structure principle of example explanation.
Shown in accompanying drawing 6A, be one of the 1st channel switching circuit embodiment of switch matrix circuit principle schematic.Channel switch S1 among Fig. 5 is made up of 4 electronic switches: the 1st electronic switch of being made up of resistance R A1, RA4 and triode QA2; Manage the 2nd electronic switch that QA1 forms by resistance R A2, RA3 and MOSFET; By the 3rd electronic switch that diode DA1, resistance R A5 and triode QA3 form, manage the 4th electronic switch that QA4 forms by resistance R A6, RA7 and MOSFET; Wherein the end of resistance R A4 is connected to the base stage of triode QA2, and the other end is connected to control module; The source electrode of MOSFET pipe QA1 is connected to the negative pole of M-BUS bus, drains to the negative pole output of this passage, is connected to lead-out terminal; The source electrode of MOSFET pipe QA4 is connected to the positive pole of M-BUS bus, drains to the positive pole output of this passage, is connected to lead-out terminal;
Principle of work is: control module is controlled the 1st electronic switch conducting or shutoff; The 1st electronic switch is controlled the 2nd electronic switch and the 3rd electronic switch conducting or shutoff; The 3rd electronic switch is controlled the 4th electronic switch conducting or shutoff, and promptly input control signal is controlled the conducting or the shutoff of M-BUS bus positive pole, negative pole and lead-out terminal simultaneously.
Shown in accompanying drawing 6B, be two principle schematic of the 1st channel switching circuit embodiment of switch matrix circuit.Channel switch S1 among Fig. 5 is made up of the 5th electronic switch and relay K A1, diode DA2; Wherein the 5th electronic switch is made up of resistance R A8, RA9 and triode QA5; DA2 plays the afterflow effect with relay K A1 diode connected in parallel; The positive pole of M-BUS bus and negative pole are connected respectively to the common port of relay K A1, and the Chang Kaiduan of relay K A1 is connected respectively to the lead-out terminal of this passage.Control module drives the conducting or the shutoff of output head anode, negative pole and the lead-out terminal of relay control M-BUS bus through electronic switch.
Applicant of the present invention combines Figure of description that embodiments of the invention have been done detailed explanation and description; But those skilled in the art should understand that; Above embodiment is merely the preferred embodiments of the invention, and detailed explanation is just in order to help the reader to understand spirit of the present invention better, and is not the restriction to protection domain of the present invention; On the contrary, any any improvement or modification of being done based on invention spirit of the present invention all should drop within protection scope of the present invention.