DE-102024132904-A1 - Method for operating a sensor system and sensor system
Abstract
The invention relates to a method (100) for operating a sensor system (200) with at least one control unit (201) and a sensor unit (203), wherein the method (100) comprises; Receiving a trigger message (211) transmitted by the control unit (201) via the two-wire physics (205) by the sensor unit (203) in a receive step (101); processing the trigger message (211) by the second microcontroller unit (209) of the sensor unit (203) in a processing step (107); Sending the reply message (213) from the sensor unit (203) to the control unit (201) at a sending time (T_send) by the sensor unit (203) in a sending step (111). The invention further relates to a sensor system (200).
Inventors
- Patrick Jebramcik
- Christopher Pohl
Assignees
- BECKHOFF AUTOMATION GMBH
Dates
- Publication Date
- 20260513
- Application Date
- 20241111
Claims (20)
- Method (100) for operating a sensor system (200) with at least one control unit (201) and one sensor unit (203), wherein the control unit (201) and the sensor unit (203) are interconnected via a two-wire physical communication (205), wherein data communication between the control unit (201) and the sensor unit (203) is implemented via the two-wire physical communication (205), wherein the control unit (201) comprises a first microcontroller unit (207) and the sensor unit (203) comprises a second microcontroller unit (209) for performing the data communication, wherein the method (100) comprises: receiving a trigger message (211) transmitted by the control unit (201) via the two-wire physical communication (205) by the sensor unit (203) in a receive step (101); Determining a receive time (T_rec) of the receipt of the trigger message (211) by the second microcontroller unit (209) of the sensor unit (203) in a receive time determination step (103); Determining a send time (T_send) for sending a response message (213) from the sensor unit (203) to the control unit (201) based on the receive time (T_rec) by the second microcontroller unit (209) of the sensor unit (203) in a send time determination step (105), wherein the send time (T_send) is later than the receive time (T_rec) by a first predefined delay period (DT1); Processing the trigger message (211) by the second microcontroller unit (209) of the sensor unit (203) in a processing step (107); Generation of the response message (213) by the second microcontroller unit (209) of the sensor unit (203) in a message generation step (109); Sending of the response message (213) from the sensor unit (203) to the control unit (201) at a transmission time (T_send) by the sensor unit (203) in a transmission step (111).
- Procedure (100) according to Claim 1 , wherein the receive time determination step (103) comprises: determining a first temporal positioning (P1) of the trigger message (211) in an input buffer (215) of a serial communication interface unit (217) of the first microcontroller unit (207) by the second microcontroller unit (209) in a first positioning determination step (113), wherein the first temporal positioning (P1) of the trigger message (211) in the input buffer (215) corresponds to the receive time (T_rec) of the trigger message (211), and wherein the transmit time determination step (105) comprises: determining a second temporal positioning (P2) of the response message (213) in an output buffer (221) of a serial communication interface unit (217) of the second microcontroller unit (209) by the second microcontroller unit (209) in a second positioning determination step (115), wherein the second temporal positioning (P2) corresponds to the first The temporal positioning (P1) is time-spaced by a second predefined delay period (DT2), and the sending time (T_send) is determined based on the second positioning (P2) of the reply message (213) in the output buffer (221) of the serial communication interface unit (217).
- Procedure (100) according to Claim 2 , wherein the receive step (101) comprises: writing the received trigger message (211) into the input buffer (215) of the serial communication interface unit (217) of the second microcontroller unit (209) in a first write step (117); and wherein the message generation step (109) comprises: writing the response message (213) into the output buffer (221) of the serial communication interface unit (217) to the second position determination step (115) by the second microcontroller unit (209) in a second write step (119).
- Procedure (100) according to Claim 3 , wherein the first write step (117), the second write step (119) and the processing step (107) are executed in execution cycles (223), and wherein the second predefined delay period (DT2) comprises a predefined number of execution cycles (223).
- Method (100) according to one of the preceding claims, further comprising: Activating a timer unit (225) of the sensor unit (203) at an activation time (T_act) to trigger the sending of the response message (213) at the send time (T_send) by the second microcontroller unit (209) of the sensor unit (203) in an activation step (121), wherein the activation time (T_act) is time-separated from the send time (T_send) by a third predefined delay time interval (DT3).
- Procedure (100) according to Claim 5 , wherein the timer unit (225) is further activated in the activation step (121) at the activation time (T_act) to trigger a sensor element (227) of the sensor unit (203) to measure sensor data at a measurement time (T_dat), and wherein the activation time (T_act) is time-separated from the measurement time (T_dat) by a fourth predefined delay period (DT4).
- Procedure (100) according to Claim 5 or 6 , wherein a data output channel (229) of the serial communication interface unit (217) is connected to an input terminal of the timer unit (225), and wherein the timer unit (225) is activated by the response message (213) placed by the output buffer (221) on the data output channel (229) of the serial communication interface unit (217).
- Procedure (100) according to one of the preceding Claims 5 until 7 , where the activation time (T_act) is time-spaced by a fifth predefined delay period (DT5) from the second temporal positioning (P2) of the response message (213) in an output buffer (221).
- Procedure (100) according to one of the preceding Claims 6 until 8 , where the measurement time (T_dat) is separated from the reception time (T_rec) by a sixth predefined delay period (DT6).
- Procedure (100) according to Claim 9 or 10 , wherein the first predefined delay time (DT1) between the receive time (T_rec) and the send time (T_send) is defined as the sum of the second predefined delay time (DT2) between the first positioning (P1) of the first feature (241) in the input buffer (215) and the second positioning (P2) of the second feature (243) in the output buffer (221), the fifth predefined delay time (DT5) between the second positioning (P2) of the second feature (243) in the output buffer (221) and the activation time (T_act), and the third predefined delay time (DT3) between the activation time (T_act) and the send time (T_send), and/or wherein the first predefined delay time (DT1) and/or the second predefined delay time (DT2) and/or the third predefined delay time (DT3) and/or the fourth predefined delay period (DT4) and/or the fifth predefined period The delay period (DT5) and/or the sixth predefined delay period (DT6) are pre-stored in the second microcontroller unit (209) of the sensor unit (203).
- Procedure (100) according to Claim 9 or 10 , where the sixth predefined delay time interval (DT6) between the receive time (T_rec) and the measurement time (T_dat) is defined as a sum of the second predefined delay time interval (DT2) between the first positioning (P1) of the first feature (241) in the input buffer (215) and the second positioning (P2) of the second feature (243) in the output buffer (221) and the fifth predefined delay time interval (DT5) between the second positioning (P2) of the second feature (243) in the output buffer (221) and the activation time (T_act) and the fourth predefined delay time interval (DT4) between the activation time (T_act) and the measurement time (T_dat).
- Procedure (100) according to one of the preceding Claims 4 until 8 , further comprising: triggering a transmitter module (235) of the sensor unit (203) to send the reply message (213) at the sending time (T_send) by the activated timer unit (225) in a triggering step (123), wherein the transmitter module (235) is connected to the two-wire physics (205) and is configured to send the reply message (213) via the two-wire physics (205); and/or triggering a recording of sensor data of the sensor element (227) of the sensor unit (203) by the activated timer unit (225) at the measurement time (T_dat) in a further triggering step (125).
- Procedure (100) according to Claim 12 , wherein the processing step (107) comprises: determining sensor information based on the sensor data of the sensor element (227) by the second microcontroller unit (209) of the sensor unit (203) in a sensor information determination step (127); and wherein the second write step (119) comprises: writing the sensor information into the data section (233) of the response message (213) in the output buffer (221) of the serial communication interface unit (217) by the second microcontroller unit (209) of the sensor unit (203) in an information write step (129).
- Procedure (100) according to Claim 13 , wherein the data section (233) is arranged in an end section (237) of the reply message (213).
- Method (100) according to one of the preceding claims, wherein the first write step (117), the second write step (119) and the processing step (107) are executed in execution cycles (223), wherein in the execution cycles (223) the first write step (117), the second write step (119) and the processing step (107) are executed simultaneously, and wherein, in the simultaneous execution in the first write step (117), second write step (119) and processing step (107), different parts of the trigger message (211) and/or response message (213) are taken into account.
- Method (100) according to one of the preceding claims, wherein in the execution cycles (223) in the first write step (117) groups of data bits of the trigger message (211) are written into the input buffer (215), wherein in the processing step (107) the data bits of a group of the trigger message (211) written into the input buffer (215) are processed together, and wherein in the second write step (119) in the execution cycles (223) groups of processing results are written into the output buffer (221).
- Method (100) according to one of the preceding claims, wherein the trigger message (211) and the reply message (213) are each configured as a telegram with at least one start section (231) and at least one data section (233), and wherein the start section (231) comprises a plurality of level changes and defines a start of the respective telegram.
- Procedure (100) according to one of the preceding Claims 2 until 17 , wherein the first temporal positioning (P1) of the trigger message (211) in the input buffer (215) is determined based on a temporal positioning of a first feature (241) of the trigger message (211) in the input buffer (215), and wherein the second temporal positioning (P2) of the response message (213) in the output buffer (221) is determined based on a temporal positioning of a second feature (243) of the response message (213) corresponding to the first feature (241) of the trigger message (211) in the output buffer (221).
- Procedure (100) according to one of the preceding Claims 18 , wherein the first feature (241) and/or the second feature (243) is each defined as a predefined sequence of high levels (245) and/or low levels (247).
- Procedure (100) according to Claim 18 or 19 , where the first feature (241) in the trigger message (211) and the second feature (243) in the response message (213) each define a start-of-frame section.
Description
The invention relates to a method for operating a sensor system. The invention further relates to a sensor system. Sensor systems with control units and sensor units are known from the prior art. For accurate and precise control of the sensor unit by the control unit, reliable data communication between the control unit and the sensor unit is necessary. Furthermore, it must be ensured that the acquisition of sensor values by the sensor unit is controllable by the control unit. It is therefore an object of the invention to provide an improved method for operating a sensor system and an improved sensor system. This problem is solved by the method and the sensor system of the independent claims. Advantageous embodiments are specified in the dependent claims. According to one aspect, a method for operating a sensor system with at least one control unit and one sensor unit is provided, wherein the control unit and the sensor unit are connected to each other via a two-wire physical connection, wherein data communication between the control unit and the sensor unit is realized via the two-wire physical connection, wherein the control unit comprises a first microcontroller unit and the sensor unit a second microcontroller unit for executing the data communication, wherein the method comprises: receiving a trigger message transmitted by the control unit via the two-wire physical connection by the sensor unit in a receiving step; Determining the time of receipt of the trigger message by the second microcontroller unit of the sensor unit in a time of receipt determination step; determining a time of transmission for sending a response message from the sensor unit to the control unit based on the time of receipt by the second microcontroller unit of the sensor unit in a time of transmission determination step, wherein the time of transmission is later than the time of receipt by a first predefined delay period; Processing the trigger message by the second microcontroller unit of the sensor unit in one processing step; Generating the response message by the second microcontroller unit of the sensor unit in one message generation step; Sending the response message from the sensor unit to the control unit at a specific transmission time by the sensor unit in one transmission step. This allows for the technical advantage of providing an improved method for operating a sensor system. In particular, the method according to the invention enables data communication between a control unit and a sensor unit of the sensor system. Data communication is carried out entirely on a two-wire system with two current-carrying transmission lines. For data communication, the control unit comprises a first microcontroller unit and the sensor unit a second microcontroller unit. According to the invention, data communication is carried out exclusively by the first and second microcontroller units. The use of technically complex and therefore expensive computing components, such as FPGAs, which are used in the state of the art for data communication carried out on a two-wire physics, can be avoided. The use of two-wire technology for data communication allows for the saving of additional transmission wires. The use of microcontrollers to generate and/or read the trigger and response messages exchanged between the control unit and the sensor unit represents a technically simple and therefore cost-effective implementation of data communication via two-wire physics. According to the invention, for data communication, the sensor unit receives a trigger message sent by the control unit at a specific reception time. Based on the reception time, the second microcontroller unit of the sensor unit determines a transmission time at which a response message to the trigger message of the control unit is to be sent from the sensor unit to the control unit via the two-wire physical connection. The transmission time is determined by the second microcontroller unit of the sensor unit. Based on the time of reception, it is determined that the transmission time is later than the time of reception by a first predefined delay period. The response message is therefore not sent from the sensor unit to the control unit at an arbitrary time. Instead, the response message is sent after the first predefined delay period following the receipt of the trigger message. The first predefined delay period is applied by the second microcontroller unit of the sensor unit to each received trigger message from the control unit. Each response message from the sensor unit can therefore be sent with the same initial predefined delay period after receiving the respective trigger message. This enables deterministic data communication between the control unit and the sensor unit, in which each response message from the sensor unit is sent out after the same first predefined delay time after the receipt of the respective trigger message from the control unit. Furthermore, for data commu