Summary of the invention
The objective of the invention is to overcome the deficiencies in the prior art, a kind of digital address intelligent lighting system and method with long-range and local controlled function is provided.
Lighting Control Assembly with long-range and local controlled function comprises that PC, host node and 1~64 are from node, host node is connected by the DALI bus from node with 1~64, PC is connected by the RS232 serial ports with host node, and host node comprises single chip control module, DALI interface module, RS232 interface module, power module, environmental parameter transducer, host node panel-switch; Single chip control module respectively with the DALI interface module, the RS232 interface module, power module, the environmental parameter transducer, the host node panel-switch is connected, describedly be divided into the local control of single-point from node from node, the local control of scene is from node, standard is from three kinds of nodes, the local control of single-point comprises single chip control module from node, the DALI interface module, power module, electric ballast, the single-point switch panel, address dial and light fixture, single chip control module respectively with the DALI interface module, power module, electric ballast, the single-point switch panel, the address dial is connected, electric ballast is connected with light fixture, the local control of scene comprises single chip control module from node, the DALI interface module, power module, electric ballast, the scene switch panel, address dial and light fixture, single chip control module respectively with the DALI interface module, power module, electric ballast, the scene switch panel, the address dial is connected, and electric ballast is connected with light fixture.
The single-point switch panel of the local control of described single-point from node comprises 3 buttons and 1 led state lamp, and by 4 I/O mouths from the node single-chip microcomputer free time, 3 buttons are connected with single chip control module with 1 led state lamp.The scene switch panel of the local control of scene from node comprises 16 buttons, and by 8 I/O mouths from the node single-chip microcomputer free time, 16 buttons are connected with single chip control module.
The exchange of the DALI level of described DALI interface module realization two-wire pressure reduction 6.5~9.5V and the single-chip microcomputer level of single line 0~5V, the circuit of DALI interface module is: the 3rd port of rectifier bridge heap and the anode of voltage-stabiliser tube, the emitter of triode, the 4th resistance one end, the negative electrode of electric capacity is connected, the 4th port and first resistance, one end of rectifier bridge heap, the 5th resistance one end, the anode of diode is connected, the 5th resistance other end is connected with the collector electrode of triode, the 4th port of the negative electrode of diode and first optocoupler, the anode of electric capacity is connected, the 3rd port of first optocoupler is connected with the 3rd resistance one end, the 3rd resistance other end with and the 4th resistance other end, the base stage of triode is connected, the 1st port of the first resistance other end and second optocoupler is connected, the 2nd port of second optocoupler is connected with the negative electrode of voltage-stabiliser tube, DALI sends mouth and is connected with the 2nd port of first optocoupler by the 6th resistance, the 1st port of first optocoupler is connected with the 5V power supply, the 3rd port of the DALI receiving port and second optocoupler, second resistance, one end is connected, the second resistance other end is connected with power supply ground, and the 4th port of second optocoupler is connected with the 5V power supply.
Illumination control method with long-range and local controlled function is: the local control of the remote controlled single-point of host node is controlled from node from node and scene this locality under the DALI system primary and secondary structure, the local control of single-point also can control isolated operation through this locality from node, and the local control of scene also can be controlled through this locality from node system's scene is set.
The local control of described single-point can be by the switching between off-line state and the on line state from node, finish local control and Long-distance Control, a button is used for from the switching of node online in the single-point switch panel, and the LED lamp shows the online from node in real time; During off-line state, in addition length/the weak point of two keys by be used to close/dim or standard-sized sheet/lighten light fixture, this two key is invalid during on line state; During on line state, be connected with system, realize Long-distance Control from node; During off-line state, separate with the DALI system from node, isolated operation, therefore, single-point is local to be controlled from node and DALI standard agreement compatibility, and has the local controlled function of single-point.
Local all that whole system can be set from node of described scene control are from the node scene, and the scene switch panel has 16 buttons, and is corresponding one by one with 16 scenes of DALI systemic presupposition; In a single day the user presses certain button, and the inquiry of host node is waited in the local control of scene from node; When scene this locality is controlled from node response querying command, the scene order of this key correspondence is sent to the DALI bus, host node abandons this scene order, and all respond this scene order from node, therefore, scene is local to be controlled from node and DALI standard agreement compatibility, and has local scene controlled function.
DALI of the present invention is from node, makes lighting control networks have the local controlled function of single-point/scene, and with DALI standard agreement compatibility;
DALI interface module of the present invention makes the desirable DALI signal waveform of master/slave node output, has improved stability, the reliability of system, and the compatibility between the different manufacturers product.
Embodiment
Shown in Fig. 1,2,3,4, Lighting Control Assembly with long-range and local controlled function comprises that PC, host node and 1~64 are from node, host node is connected by the DALI bus from node with 1~64, PC is connected by the RS232 serial ports with host node, and host node comprises single chip control module, DALI interface module, RS232 interface module, power module, environmental parameter transducer, host node panel-switch; Single chip control module respectively with the DALI interface module, the RS232 interface module, power module, the environmental parameter transducer, the host node panel-switch is connected, describedly be divided into the local control of single-point from node from node, the local control of scene is from node, standard is from three kinds of nodes, the local control of single-point comprises single chip control module from node, the DALI interface module, power module, electric ballast, the single-point switch panel, address dial and light fixture, single chip control module respectively with the DALI interface module, power module, electric ballast, the single-point switch panel, the address dial is connected, electric ballast is connected with light fixture, the local control of scene comprises single chip control module from node, the DALI interface module, power module, electric ballast, the scene switch panel, address dial and light fixture, single chip control module respectively with the DALI interface module, power module, electric ballast, the scene switch panel, the address dial is connected, and electric ballast is connected with light fixture.
The major function of host node is response user's operation and transmits the environmental parameter that environmental sensor obtains, send the DALI commands for controlling and make corresponding action from node, monitoring DALI system is from the operating state of node, such as the adjusting of a certain small cup lamp being carried out brightness, and inquiry DALI system is from the operating state of node.User's operation can also can come the PC of self-operating DALI application software from panel-switch.The local control of single-point all is that hardware setting should be from the physical address of node from node and the local control of scene from address of node dial function.According to the function of DALI protocol requirement, the model that the CPU processor is selected for use among the present invention is the ATmega16 single-chip microcomputer that Atmel company produces.ATmega16 has abundant instruction set and 32 general purpose working registers, above-mentioned register all directly is connected with ALU (ALU), make an instruction to visit two independently registers simultaneously in a clock cycle, this structure has improved code efficiency greatly.The ATmega16 single-chip microcomputer has 32 programmable I/O mouths, and node has taken 24 in standard DALI system, and the remaining suitable idle I/O mouth that connects other functional modules of setting up has 8.
As shown in Figure 5, standard comprises single chip control module, DALI interface module, power module, address dial, electric ballast and light fixture from node.Compare with host node, standard is relatively simple from the function of node, and the function that it mainly needs to finish is the DALI instruction of response host node, produces brightness and the state of the simulation dimmer voltage of 1-10V by the electronic ballast control light fixture then.Wherein the model of CPU processor is still selected the ATmega16 single-chip microcomputer that Atmel company produces for use.The user can be provided with this physical address from node by address dial (encoder).
As shown in Figure 6, isolate by mitsutsugu device between DALI bus and the microprocessor.The pin of microprocessor linked to each other with the light end of mitsutsugu device (PVA1354NS) carry out data and send, realize by a two-way optocoupler (SFH6206) and receive data, adopt that the DALI bus to be become behind the two-way optocoupler nonpolarity, though two line reversal connections, can proper communication.
Can respond the signal waveform of main control unit from the oscilloscope intercepting from node, schematic diagram as shown in Figure 7.What the waveform above among the figure was represented is the signal that sends from microprocessor, and what following waveform was represented among the figure is the signal waveform of catching behind public version design DALI interface.Relatively the difference of both waveforms can find that following signal waveform rising edge and trailing edge all have tangible hysteresis effect, and trailing edge postpones very serious.A public version design DALI interface biggest advantage is simple, does not almost use other elements except two optical isolator spares, and this is fit to be integrated on the ballast very much because the direct benefit that circuit simply brings be take up room little.Yet adopting the measured result of public version design but is not to make us very satisfied.The hysteresis of DALI signal of communication and distortion come from the intrinsic time delay feature of PV1354NS device, and the waveform schematic diagram as shown in Figure 8.
As shown in Figure 9, in view of public version design interface can produce distortion to signal waveform, and the heating of the PVA1354 that works long hours also is a more scabrous problem, the present invention improves public version design, isolate by optocoupler U1 and bus from the DALI signal of node, under the normal condition, the DALI bus keeps high level, if send the level that mouth will drag down DALI, the electric current of 250mA just need be provided at least, but general photoelectrical coupler all can not bear this electric current, and general common solution adopts the higher particular device PVA1354 of cost, and the present invention carries out power amplification by transistor Q1 with the signal that U1 produces.Therefore bus must be maintained lowly in process of transmitting, needs voltage that capacitor C 1 keeps the Q1 base stage for high, in order to prevent the collector electrode discharge of electric capacity by resistance and Q1, has increased anti-backflow diode D3 simultaneously.
The exchange of the DALI level of DALI interface module realization two-wire pressure reduction 6.5~9.5V of the present invention and the single-chip microcomputer level of single line 0~5V, the circuit of DALI interface module is: the 3rd port of rectifier bridge heap D1 and the anode of voltage-stabiliser tube D3, the emitter of triode Q1, the 4th resistance R 4 one ends, the negative electrode of capacitor C 1 is connected, the 4th port and first resistance R, 1 one ends of rectifier bridge heap D1, the 5th resistance R 5 one ends, the anode of diode D2 is connected, the 5th resistance R 5 other ends are connected with the collector electrode of triode Q1, the 4th port of the negative electrode of diode D2 and the first optocoupler U1, the anode of capacitor C 1 is connected, the 3rd port of the first optocoupler U1 is connected with the 3rd resistance R 3 one ends, the 3rd resistance R 3 other ends with and the 4th resistance R 4 other ends, the base stage of triode Q1 is connected, the 1st port of first resistance R, 1 other end and the second optocoupler U2 is connected, the 2nd port of the second optocoupler U2 is connected with the negative electrode of voltage-stabiliser tube D3, DALI sends mouth and is connected by the 2nd port of the 6th resistance R 6 with the first optocoupler U1, the 1st port of the first optocoupler U1 is connected with the 5V power supply, the 3rd port of the DALI receiving port and the second optocoupler U2, second resistance R, 2 one ends are connected, second resistance R, 2 other ends are connected with power supply ground, and the 4th port of the second optocoupler U2 is connected with the 5V power supply.
As shown in figure 10, the signal waveform that intercepts from oscilloscope from control cell response main control unit.What the waveform above among the figure was represented is the signal that sends from microprocessor, and what following waveform was represented among the figure is the signal waveform signal of catching through behind the public version design of communications interface.Both difference relatively, discovery that can be clearly, relatively more public version design, the waveform above in the comparison diagram, the signal waveform rising edge below among the figure and the hysteresis effect of trailing edge are much smaller.
As shown in figure 11, the single-point switch panel of the local control of single-point from node comprises 3 buttons and 1 led state lamp, and by 4 I/O mouths from the node single-chip microcomputer free time, 3 buttons are connected with single chip control module with 1 led state lamp.Wherein a button K1 is used for from the switching of node online, and the LED lamp shows the online from node in real time; During off-line state, in addition length/weak point of two key K2 and K3 close by being respectively applied for/dim or standard-sized sheet/lighten, this two key is invalid during on line state.Button K1, K2, K3 link to each other with PA0 mouth, PA1 mouth, the PA2 mouth of ATmega16 single-chip microcomputer respectively; The LED lamp links to each other with the PA3 mouth of ATmega16 single-chip microcomputer.Solution of the present invention makes the local control of single-point from node and DALI standard agreement compatibility, and has the local controlled function of single-point.
As shown in figure 12, the scene switch panel of the local control of scene from node comprises 16 buttons, by 8 I/O mouths from the node single-chip microcomputer free time, and being connected of 16 buttons with single chip control module.K1 to K15 corresponds respectively to the default scene of DALI, links to each other with PA0 mouth to the PA7 mouth of ATmega16 single-chip microcomputer with the matrix keyboard form.
Illumination control method with long-range and local controlled function: the local control of the remote controlled single-point of host node is controlled from node from node and scene this locality under the DALI system primary and secondary structure, the local control of single-point also can control isolated operation through this locality from node, and the local control of scene also can be controlled through this locality from node system's scene is set.
The local control of described single-point can be by the switching between off-line state and the on line state from node, finish local control and Long-distance Control, a button is used for from the switching of node online in the single-point switch panel, and the LED lamp shows the online from node in real time; During off-line state, in addition length/the weak point of two keys by be used to close/dim or standard-sized sheet/lighten light fixture, this two key is invalid during on line state; During on line state, be connected with system, realize Long-distance Control from node; During off-line state, separate with the DALI system from node, isolated operation, therefore, single-point is local to be controlled from node and DALI standard agreement compatibility, and has the local controlled function of single-point.
Local all that whole system can be set from node of described scene control are from the node scene, and the scene switch panel has 16 buttons, and is corresponding one by one with 16 scenes of DALI systemic presupposition; In a single day the user presses certain button, and the inquiry of host node is waited in the local control of scene from node; Scene control is local during from node response querying command, and the scene order of this key correspondence is sent to the DALI bus, and host node abandons this scene order, and respond this scene order from node, therefore, scene is local to be controlled from node and DALI standard agreement compatibility, and has local scene controlled function.
Shown in Figure 13,14, the local control of scene is used for reference the establishment of μ cosII embedded OS time driving mechanism from node and the local control of single-point from node software among the present invention, the software principal function enters a major cycle after finishing initialization, and functional module realizes in interrupt service routine.If when a functional module is related with another functional module generation, one flag bit then is set, these flag bits are inquired about in major cycle, enter the correlation function module then, carry out corresponding program, event-driven mechanism makes between each functional module and has realized loose coupling, and each functional module is independently debugged, and helps function expansion and maintenance.
The local control of single-point relates generally to two indexed variable Flag_Off when node moves, Key_Value, and equal zero setting during power-up initializing, expression is on line state from node, and local brightness key does not have operation.In case the user presses K1 key among Fig. 9, then produce and interrupt, interrupt service routine reads the K1 key, and Flag_Off is carried out xor operation with numeral 1, realizes the switching of online, and drives off-line state LED lamp.In case press the K2 key with the head of a household/weak point, interrupt service routine reads the K2 key, and Key_Value puts 256/+1, and the K3 key is handled same K2, and Key_Value puts-256/-1.The local control of single-point is from the node major cycle, and when Flag_Off=0, operative norm DALI is from the node flow process, when Flag_Off=1, separate with the DALI system from node, according to the Key_Value value, 256/-256 execution standard-sized sheet/close lamp operation ,+1/-1 carries out and lightens/dim one grade of lamp brightness.
The local control of scene relates generally to an indexed variable Scene_Value when node moves, zero setting during power-up initializing, expression does not have operation from the local scene key of node, in case the user presses arbitrary key (K1-K16) among Figure 10, then produce and interrupt, interrupt service routine reads the key position, and Scene_Value puts the correspondent button position.The local control of scene is from the node major cycle; When Scene_Value=0, operative norm DALI is from the node flow process; When Scene_Value ≠ 0, carry out local scenes function; Wait for host node to this querying command, and behind querying command, send scene order, Scene_Value zero setting simultaneously from node.