Addressing slave devices using iterative power activation
Through an iterative process of measuring current consumption using public default addresses and power lines in the slave device chain, the complexity and high cost of slave device address allocation and fault detection in the existing technology are solved, and efficient and accurate slave devices are achieved. Activation and fault detection.
Patent Information
- Application Number
- CN202010799889.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2019-08-14
- Filing Date
- 2020-08-11
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2040-08-11
AI Technical Summary
Existing technology relies on communication line switching when assigning addresses to slave devices, resulting in complex and expensive signal integrity issues and making it difficult to detect faults in the slave device chain.
With the master assigning a common default address to the slaves in an unaddressed state and activating and addressing them one by one through an iterative process, current consumption is measured on the power line between the slaves to detect faults, addressing only when a new device is detected. address steps, improving efficiency and accuracy.
It achieves effective and economical detection and activation of slave devices in the slave device chain, reduces fault detection costs, and improves addressing efficiency and accuracy.
Smart Images

Figure CN112398961B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a network system comprising serial bus slave devices controlled by a master device. In particular, it relates to assigning addresses to slave devices during a configuration phase, such as during startup of the network system. Background Art
[0002] In a wired communication network, it is indeed necessary to assign addresses to slave devices (or nodes) present / added in the network.
[0003] This can be performed manually, but this solution is time consuming, prone to input errors, and requires the expertise of an operator who manually addresses the slave devices.
[0004] To overcome this, some prior art methods, such as those described in patent applications US2010 / 0274945, EP3139574A1 and WO03 / 085899, use a self-addressing mechanism to assign addresses to slave devices.
[0005] refer to Figure 1 , shows slave devices 101.1, 101.2 and 101.3 of a network system according to the prior art.
[0006] The slave devices 101 are connected via a communication bus comprising two communication lines 102 and 103. Each slave device 101 also comprises respective switches 104 and 105 to disconnect the next slave device from each of the communication lines 102 and 103.
[0007] According to these solutions, the bus switching mechanism is implemented on the communication bus itself.
[0008] The prior art solutions have the following disadvantages:
[0009] - they rely on switching between communication lines 102 and 103, which is technically complex as switches 104 / 105 on the signal lines inherently increase signal integrity issues. This means that the technology is expensive to implement;
[0010] - Switching between the communication lines 102 and 103 makes it difficult to detect a faulty slave in the slave chain.
[0011] The proposed solution overcomes at least some of the above disadvantages. Summary of the invention
[0012] It is an object of the present invention to alleviate at least some of the above disadvantages.
[0013] A first aspect of the present invention relates to a method for addressing a slave device in a network system including a master device and a plurality of slave devices. The slave device has a common default address in an unaddressed state, and the master device and the plurality of slave devices are connected in a chain via a power line and a communication line.
[0014] Each slave device is indexed by an index greater than or equal to 1, the slave device with index 1 is connected to the master device, and in order to address the slave device with index k, k being equal to or greater than 2, the method comprises the following operations performed by the master device:
[0015] - instructing the slave device with index k-1 via the communication line to activate the power supply of the slave device with index k via the power line;
[0016] - Sending a command to change the public default address of the slave device with index k to the unique address with index k to the public default address on the communication line.
[0017] This iterative process allows one unaddressed slave to be addressed at a time, which allows efficient detection and activation of slaves. In fact, at each iteration, there is only one unaddressed slave in the network. This also makes it easy to detect faulty slaves.
[0018] According to some embodiments, after activating the slave device with index k, the method may include measuring a current consumption value on the power line, and determining whether the slave device with index k is correctly activated based on a comparison between the measured value and a previous value.
[0019] Therefore, the detection of faults is performed efficiently at a lower cost since it only requires measuring the current drawn on the power line at each iteration.
[0020] As a complement, if the difference between the measured value and the previous value is substantially different from zero, a command for changing the common default address of the slave device with index k may be sent.
[0021] This ensures that the addressing step is only performed when a new slave device is detected, thereby increasing the efficiency of the method.
[0022] Alternatively, or in addition, if the difference between the measured value and the previous value is within a predetermined range, a command for changing the common default address of the slave device with index k may be sent, otherwise the master device issues an error message.
[0023] This allows easy and efficient detection of errors in a chain of slave devices, and possibly easy and efficient detection of errors in a slave device indexed k.
[0024] According to some embodiments, for a slave device with an index of 1, the method may include the following operations:
[0025] - measuring the current consumption on the power line and storing said current consumption as a previous value;
[0026] - Activate the slave device with index 1 via the power line;
[0027] - After the slave device with index 1 is activated, the current consumption on the power line is measured.
[0028] This allows defining a reference current consumption value on the power line and thus improves the accuracy of fault detection.
[0029] According to some embodiments, a command for changing the public default address of the slave device indexed k may be sent if an acknowledgment has been received from the slave device indexed k-1 following the instruction sent on the communication line.
[0030] This enables sending a command only when the slave with index k-1 has confirmed that the activation of the slave with index k is valid, thereby improving the efficiency of the method.
[0031] According to some embodiments, the method may further include sending a presence query to a unique address indexed k, and upon receiving an acknowledgement of the presence query from the slave device indexed k, repeating the operations of the method for the slave device indexed k+1.
[0032] This enables the method to be iterated only when the slave with index k has been correctly registered.
[0033] According to some embodiments, the unique address with index k may be a code determined based on the index k.
[0034] A second aspect of the invention relates to a non-transitory computer-readable storage medium having stored thereon a computer program comprising instructions for, when executed by a processor, performing the steps of the method according to the first aspect of the invention.
[0035] A third aspect of the present invention is a master device for addressing a slave device in a network system including a master device and a plurality of slave devices, wherein the slave device has a public default address in an unaddressed state, the master device comprising:
[0036] A first interface, used to access a power line for supplying power to the slave device;
[0037] a second interface for communicating with a slave device via a communication line;
[0038] Each slave device is indexed by an index greater than or equal to 1, and the master device is connected to the slave device with index 1.
[0039] The master device includes a processor that implements the following operations to address a slave device with an index k, where k is equal to or greater than 2:
[0040] - instructing the slave device with index k-1 via the communication line to activate the power supply of the slave device with index k via the power line;
[0041] - Sending a command to change the public default address of the slave device with index k to the unique address with index k to the public default address on the communication line.
[0042] A fourth aspect of the present invention relates to a system comprising a master device according to the third aspect and a plurality of slave devices connected to the master device in a chain.
[0043] Other objects, aspects, effects and details of the present invention will be described in the following detailed description of various exemplary embodiments with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] By way of example only, embodiments of the present disclosure will be described with reference to the accompanying drawings, in which:
[0045] Figure 1 shows a chain of slave devices according to the prior art;
[0046] Figure 2 represents a network system according to some embodiments of the present invention;
[0047] Figure 3 is a flow chart illustrating steps of a method according to some embodiments of the present invention;
[0048] Figure 4 shows the structure of a master device according to some embodiments of the present invention;
[0049] Figure 5 shows the structure of a connection / disconnection circuit according to some embodiments of the present invention;
[0050] Figure 6 The structure of the sensing circuit according to some embodiments of the present invention is shown. DETAILED DESCRIPTION
[0051] refer to Figure 2 , showing a network system according to some embodiments of the present invention.
[0052] The network system includes a master device 200 and a plurality of N slave devices 201.1, 201.k-1, 201.k, ... 201.N, where N is an integer greater than or equal to 2, and k is an index varying between 1 and N. The slave devices 201 thus form a "daisy chain".
[0053] The master device 200 is connected to a chain of slave devices 201 via a communication line 202 and a power line 203 .
[0054] The communication line 202 may include, for example, Figure 2 Several unidirectional lines are shown, or alternatively only one bidirectional line is included.
[0055] The master device may include activation circuit 206 and sensing circuit 207 .
[0056] The activation circuit 206 is configured to activate / deactivate the power line 203. To this end, the activation circuit 206 may be placed in the power supply ( Figure 1 ) and a switch between slave device 201.
[0057] Each slave device 201.k with index k also includes circuitry 205 for connecting / disconnecting the slave device with index k+1 (the next one in the daisy chain).
[0058] Figure 3 is a diagram illustrating steps of a method according to some embodiments of the invention.
[0059] By default, initially, all slave devices have a common default address, such as 0*FE.
[0060] In an initial step 300, the master device 200 activates the power line 203 using the activation circuit 206. For example, the circuit 206 may include a switch between the power source and the slave device 201.
[0061] The following steps are repeated for an increasing index k with an initial value of 1. In the following, N represents the number of slave devices 201 in the network system. N is not known in advance by the master device 200 and is only determined when the method according to the invention is terminated.
[0062] In step 301, the master device 200 optionally measures the power consumed on the power line 203. For example, the master device 200 measures the current drawn on the power line 203. The current drawn on the power line 203 can then be stored in a memory of the master device 200. According to an optional embodiment, this measurement can then be used to detect a fault in a slave device. For k=1, the master device 200 measures the power on the power line 203 when no slave device is activated.
[0063] In step 302, the master device 200 sends an instruction to enable the power line 203 of the slave device indexed k via the communication line 202 to the slave device indexed k-1 via the communication line 202. For k=1, the master device 200 activates its activation circuit 206 to activate the slave device 201.1 without sending any instructions.
[0064] According to some embodiments, the master device 300 optionally checks whether a response is received from the slave device indexed as k-1 (for k=1, the master device 200 does not expect any response because the instruction has not been sent yet). To this end, in step 303, the master device 200 checks whether a response is received from the slave device 201.k-1, for example by setting a timer. If a response is received before the timer expires, the method proceeds to step 304. Otherwise, the method terminates in step 305 and concludes that there are no more slave devices in the network and N is equal to k-1.
[0065] In step 304, the master device 200 optionally waits until the measurements performed by the sensing unit are stable. In practice, once the slave device k-1 is connected to the power line 203, it increases the current drawn on the power line 203, and this current may stabilize after a certain amount of time.
[0066] At step 306 , the master device 200 measures the power drawn on the power line 203 , such as the current drawn on the power line 203 .
[0067] At step 307 , the master device 200 compares the measurements performed at step 306 with the measurements performed at step 301 , or alternatively with the measurements performed at step 306 for the previous iteration k−1.
[0068] Based on this comparison, it can be detected whether the slave device with index k is correctly activated.
[0069] For example, the master device 200 checks whether the measured values of iterations k and k-1 are substantially the same (their difference is substantially equal to 0). If so, the method can terminate at step 305: it is concluded that there is no slave device with index k and N is equal to k-1. Otherwise, the method proceeds to step 308.
[0070] In step 308, the master device 200 checks whether the difference between the compared measured values is below a predetermined threshold. The threshold represents the current that the slave device can normally draw. If not (if the difference is above the predetermined threshold), the method ends in step 305: it is concluded that the slave device 201.k is faulty. An error message / alarm may be issued in step 305.
[0071] In step 309, the master device 200 sends a command for changing the public default address of the slave device indexed as k to the unique address of k via the communication line 202. The command is for the public default address, because the slave device indexed as k is the only active and has a public default address (such as 0*FE) from the device (other slave devices have previously been addressed with unique addresses). The public default address can be placed in the recipient field of the command (depending on the communication protocol used on the communication line 202). The unique address can have the same format as the public default address (such as a digit and two letters), and the index k of the slave device 201.k can be encoded. For example, the address of the first slave device indexed as 1 can be, for example, 0*AA or 0*01. The unique address indexed as k can be included in the payload of the command.
[0072] In step 310, the master device optionally checks whether a response to the command has been received from the slave device 201.k. If not, the method terminates in step 305: it is concluded that the unique address with index k has not been correctly allocated.
[0073] Otherwise, the method is repeated for the next index k+1 and returns to step 301 .
[0074] In optional step 311, and before the method is iterated, a query may be sent to the unique address indexed k to check whether the slave device 201.k is properly configured.
[0075] If a response is received at step 312 , the method is repeated for the next index k+1 and returns to step 301 .
[0076] If no response is received at step 312, the method terminates at step 305: it is concluded that the slave device 201.k is not registered.
[0077] Therefore, according to the present invention, at any time, only one unaddressed slave device (with a common default address) is connected to the network. This is because, at startup, all slave devices are deactivated by the master device, and activation is performed iteratively.
[0078] This method provides the advantage of easily measuring the current consumption of devices in the daisy chain, allowing the master device 200 to determine whether the slave device 201 is functioning under its operating conditions. It can also distinguish whether a slave device is absent, malfunctioning, or functioning normally.
[0079] Figure 4 The structure of the main device 200 according to some embodiments of the present invention is shown.
[0080] The host device 200 includes a memory 401, such as a read-only memory ROM, a random access memory RAM, a flash memory or any other type of memory, and is configured to execute Figure 3 Alternatively, the processor 400 may be a processor such as a processor configured to perform Figure 3 The steps shown are replaced by a microcontroller electronic circuit.
[0081] The master device 200 may also include a communication interface 402 for communicating via the communication line 202 and a power interface 403 between the activation circuit 206 and the slave device 201 .
[0082] As described above, the master device 200 also includes a sensing circuit 207 configured to measure the power drawn on the power line 203 .
[0083] refer to Figure 5 , shows the structure of the circuit 205 of the slave device 201. This structure is given only for the purpose of explanation.
[0084] The structure of the circuit 205 includes:
[0085] - Ferrites L1 and L2 for filtering noise and reducing surge current;
[0086] - P-channel MOSFET Q6 operating as a normally closed electronic switch;
[0087] - Capacitors C3, C13 and C14 used as noise and EMC filtering components;
[0088] - Resistor R20 for smoothing the switching of MOSFET Q6; and
[0089] - Power output PW_OUT for the next slave device before current sensing.
[0090] The slave device 200 receives the signal UC_OK to enable / disable the next slave device.
[0091] refer to Figure 6 , shows the structure of the sensing circuit 207 according to some embodiments of the present invention. This structure is given only for the purpose of illustration.
[0092] The circuit of the sensing circuit 207 includes:
[0093] - Current sensing resistor R21;
[0094] - Differential amplifier AMP_1 for regulating current measurement;
[0095] - Bias current balancing resistors R22 and R23 for amplifier AMP_1;
[0096] a power output PW_O towards the first slave device 201 , such as the power interface 403 ; and
[0097] - Power output PW_OUT from activation circuit 206 .
[0098] The sensed current signal I_SENSE is transmitted to the processor 400 of the master device 200 .
[0099] Although the present invention has been described above with reference to specific embodiments, the present invention is not limited to the specific forms set forth herein. On the contrary, the present invention is limited only by the appended claims, and within the scope of these appended claims, other embodiments besides the specific embodiments described above are equally possible.
[0100] In addition, although exemplary embodiments have been described above in some exemplary combinations of components and / or functions, it should be understood that alternative embodiments may be provided by different combinations of components and / or functions without departing from the scope of the present disclosure. In addition, it is specifically contemplated that specific features described separately or as part of an embodiment may be combined with other separately described features or parts of other embodiments.
Claims
1. A method for addressing a slave device in a network system comprising a master device (200) and a plurality of slave devices (201.1-201.k), wherein the slave devices have a common default address in an unaddressed state, and wherein the master device and the plurality of slave devices are connected in a chain via a power line (203) and a communication line (202), in, Each slave device is indexed by an index greater than or equal to 1. The slave device with index 1 is connected to the master device. Wherein, in order to address a slave device with an index of k, k being equal to or greater than 2, the method comprises the following operations performed by the master device: - instructing (302) the slave device with index k-1 via the communication line to activate the power supply of the slave device with index k via the power line; - measuring (306) a current consumption value on the power line (203); - determining (307) the difference between the measured value and the previous value; and - If the difference between the measured value and the previous value is within a predetermined range, sending (309) a command for changing the common default address of the slave device indexed k to the unique address indexed k to the common default address on the communication line.
2. The method according to claim 1, wherein: After activating the slave device with index k (201.k), the method includes determining whether the slave device with index k is correctly activated based on a comparison between the measured value and the previous value.
3. The method according to claim 2, wherein: If the difference between the measured value and the previous value is substantially different from zero, said command for changing the common default address of the slave device (201.k) with index k is sent.
4. The method according to claim 1, wherein: If the difference between the measured value and the previous value is not within a predetermined range, the master device (200) issues an error message.
5. The method according to any one of claims 1 to 4, wherein: For a slave device with index 1 (201.1), the method includes the following operations: - measuring (301) the current consumption on the power line and storing said current consumption as a previous value; - activating (302) the slave device indexed 1 via the power line; - After the slave device with index 1 is activated, the current consumption on the power line is measured (306).
6. The method according to any one of claims 1 to 4, wherein: If an acknowledgement has been received from the slave device (201.k-1) with index k-1 after sending the instruction on the communication line (202), the command for changing the public default address of the slave device (201.k) with index k is sent.
7. The method according to any one of claims 1-4 also includes sending (311) an existence query to a unique address indexed as k, and when a confirmation of the existence query is received (312) from the slave device indexed as k, repeating the operation of the method for the slave device indexed as k+1.
8. The method according to any one of claims 1 to 4, wherein: The unique address with index k is a code determined based on the index k.
9. A non-transitory computer-readable storage medium having stored thereon a computer program, the computer program comprising instructions for, when executed by a processor, performing the steps of the method according to one of claims 1 to 8.
10. A master device for addressing slave devices in a network system comprising a master device (200) and a plurality of slave devices (201.1-201.k), wherein the slave devices have a common default address in an unaddressed state, the master device comprising: A first interface (403) for accessing a power line for supplying power to a slave device; a second interface (402) for communicating with a slave device via a communication line; Each slave device is indexed by an index greater than or equal to 1, and the master device is connected to the slave device with index 1. The master device includes a processor, and the processor implements the following operations to address a slave device with an index of k, where k is equal to or greater than 2: - instructing (302) the slave device with index k-1 via the communication line to activate the power supply of the slave device with index k via the power line; - measuring (306) a current consumption value on the power line (203); - determining (307) the difference between the measured value and the previous value; - If the difference between the measured value and the previous value is within a predetermined range, sending (309) a command for changing the common default address of the slave device indexed k to the unique address indexed k to the common default address on the communication line.
11. A system comprising the master device (200) according to claim 10 and a plurality of slave devices (201.1-201.k) connected to the master device in a chain.
