Method for time-synchronized input and / or output of signals at a selectable sampling rate

By using clock pulses and counters in electronic circuits, the synchronization problem in multi-channel I/O circuits is solved, enabling switching of sampling periods and offsets while maintaining synchronization. This simplifies model processing and supports faster rate changes and adaptive applications.

CN115606099BActive Publication Date: 2026-11-17D SPACE GMBH
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202180034232.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2020-03-27
Filing Date
2021-03-26
Publication Date
2026-11-17
Estimated Expiration
2041-03-26

AI Technical Summary

Technical Problem

Existing technologies make it difficult to switch sampling periods and offsets in multi-channel I/O circuits while maintaining synchronization, especially when the sampling rate changes between different channels, resulting in data not having a constant time relationship.

Method used

By using a clock pulse generator and counter in the electronic circuit, the following steps are taken: a) configuring a standard sampling period, b) synchronously starting all channels, c) detecting a change in the sampling period of the first channel, d) detecting the current counter value, e) calculating the waiting time, and f) starting the channel after the waiting time, the synchronous switching of sampling rate and offset is achieved.

Benefits of technology

It enables the changing of sampling rate and offset in multi-channel I/O circuits while maintaining synchronization, simplifies model processing, avoids errors and resource waste in gating methods, and supports faster rate changes and adaptive applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115606099B_ABST
    Figure CN115606099B_ABST
Patent Text Reader

Abstract

This invention relates to a method for time-synchronously inputting and / or outputting signals at a selectable sampling rate on a set of input and / or output channels of an electronic circuit, the electronic circuit including at least two input channels and / or at least two output channels, a clock pulse generator, and a counter, wherein the channels process the signals with a sampling period determined by the number of clock pulses from the clock pulse generator, and the processing of the signals by the channels is delayed by an offset determined by the number of clock pulses from the clock pulse generator. According to the invention, the method includes the following steps: configuring each channel in the set with a standard sampling period; synchronously starting all channels in the set with the standard sampling period; detecting a predetermined value of a changed sampling period for a first channel in the set; detecting a current counter value; configuring the first channel with the changed sampling period; determining a waiting time based on the changed sampling period and a remainder determined by division using the current counter value and the changed sampling period; and starting the first channel after the waiting time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a method for synchronously inputting and / or outputting signals at a selectable sampling rate, preferably a method for synchronously detecting multiple signals on multiple input channels of an electronic circuit. Background Technology

[0002] "Signal" here can be understood as a continuous or discrete variable physical quantity that represents information, such as voltage or digital values, in particular; for example, in TTL technology, voltage values ​​greater than 2V or 4V can represent logical "true" values ​​as digital information.

[0003] Electronic circuits with input and / or output channels are well known in the art and are commonly referred to as I / O circuits. I / O circuits are used to output electrical signals on the pins of the output channel and / or detect electrical signals present on the pins of the input channel, for example, to transmit the detected signals for further processing via analog-to-digital conversion, whether on the electronic circuit itself or on other electronic devices connected to the circuit.

[0004] A "channel" can generally be understood as an arrangement of electronic conversion circuits between the input and output sides, which perform the functions assigned to the channel, such as analog-to-digital conversion and / or analog amplification or filtering as described above. At least one side of the input and output sides can be implemented by a pin, on which an (analog or digital) electrical signal is physically applied. The other side can also be implemented by a pin, for example in an analog amplifier, depending on the channel function, or it can be implemented by a memory or register, such as in a converter that provides a digital value on the output side or requires a digital value on the input side.

[0005] A typical and preferred application area is HIL simulation, also known as hardware-in-the-loop simulation, but the present invention is not limited to this application area. To verify the correct functioning of a control unit, such as a motor vehicle control unit, the control unit to be tested is connected to a circuit of the type described at the beginning, so that signals are applied to the control unit and / or detected by the control unit through this circuit.

[0006] To this end, a software model of the test environment is run in a simulated environment, such as simulating driving in the case of a motor vehicle. Simulated events are represented by electrical signals applied to the output channels of the circuit, such as pins or registers of the output channels, so that they are transmitted to the control unit, and / or the control unit applies signals to the input channels of the circuit, such as pins or registers of the input channels, so that they can be detected and processed in the simulated environment. Thus, the control unit can operate in a simulated environment as if it were actually operating in a real environment.

[0007] The simulation environment, or simulator for short, is formed, for example, by a real-time computer system having at least one processor that processes the software model. This model can be provided, for example, by software with real-time capabilities or multiple working software tools, preferably having a graphical user interface and particularly preferably programmed using software objects. The software may include MATLAB, Simulink, or the applicant's RTI (Real-Time Interface), which, for example, forms a connection link with Simulink. Software objects are, in the above cases, programmed graphically as blocks, particularly hierarchically. However, the simulation environment is not limited to using the software exemplified in these examples. The software model can be run directly after programming or run in the simulation environment after code generation and compilation.

[0008] In addition to the processor circuitry including the at least one processor, the analog environment typically includes at least one I / O circuitry connected to the processor circuitry, having the aforementioned input / output channels. It may also be specified that at least one such I / O circuitry including input and / or output channels is connected to a circuitry including programmable logic components, particularly a field-programmable gate array (FPGA), to obtain signals from or provide signals to that circuitry. The FPGA circuitry may be connected to the processor circuitry on its side, allowing the analog model to be implemented partly on the FPGA circuitry and partly on the processor circuitry. The input / output channels may have switchable sampling rates, allowing, for example, rapidly changing signals to be measured more frequently than slowly changing signals. The sampling rate f may also be expressed in the form of a sampling period T corresponding to T = 1 / f.

[0009] The key difference between real-time computer systems and commercially available computer systems lies in the fact that, for example, there is no predetermined delay between the input of changing sensor signals and the resulting response, such as the output of changing control signals. Depending on the system being simulated, this may require a maximum delay of, for example, 1 millisecond or less. The simulation of electric vehicle drive systems (E-Drive) or power electronics, in particular, places high demands on the high speed of the control loop, especially the maximum permissible delay in the microsecond range. Therefore, real-time simulation is often no longer covered by a pure processor model and processor-controlled I / O channels, but rather the time-critical model portions are implemented on freely programmable FPGA circuits. It is preferable to design the FPGA circuit in such a way that different I / O circuits can be modularly connected to the FPGA circuit.

[0010] Connections can be provided via direct connection or via interfaces, particularly standard interfaces, buses, or network connections. In the aforementioned preferred applications, but generally in other possible applications, the following requirement may arise: multiple electrical signals must be output simultaneously through multiple channels of the I / O circuit, and / or these multiple signals must be further processed simultaneously after being detected through multiple channels. The problem here is that different delays or signal run times may occur even in channels of the same type and function, because even functionally identical electrical conversion circuits, for example, do not have the same delay due to manufacturing variations. Various measures are known in principle to simultaneously provide multiple signals on the pins (physical connection locations of the channels) or registers / memory of multiple output channels after channel functions such as digital-to-analog conversion, such that signals synchronously appearing on the pins / registers of multiple input channels are also synchronously provided after channel functions such as analog-to-digital conversion, resulting in signals for further processing. As described in EP3224325A1, the determined delays of each channel can be measured during manufacturing and stored for compensation.

[0011] However, if an application requires switching between different sampling rates for the input or output channels, then according to existing technology, the synchronization between different channels will be lost, and the data received by different channels will not have a constant time relationship. Therefore, an unresolved problem is: how to maintain the synchronization of all channels with the same sampling period and offset, while ensuring that the sampling period and offset are variable not only during simulator initialization but also during runtime. Summary of the Invention

[0012] In this context, the objective of this invention is to provide a method and apparatus that improve upon existing techniques and preferably enables the switching of sampling periods to maintain synchronization during simulator operation.

[0013] The task is accomplished by a method and apparatus having the features of the present invention for synchronously inputting and / or outputting signals at a selectable sampling rate.

[0014] Therefore, a computer-implemented method is proposed for time-synchronously inputting and / or outputting signals at a selectable sampling rate on a set of input and / or output channels of an electronic circuit, the electronic circuit including at least two input channels and / or at least two output channels, a clock pulse generator, and a counter, wherein the channels process signals at a predetermined sampling period, the predetermined sampling period preferably determined by the number of clock pulses from the clock pulse generator. According to the invention, the method comprises the following sequential steps: a) Configure each channel in the group with a standard sampling period. b) Start all channels of the group synchronously with the standard sampling period, and also start the counter. c) The sampling period for detecting changes in the first channel of the group. The predetermined value, d) Detect the current counter value , e) Configure the first channel with a modified sampling period. f) According to Sure The waiting time for the clock pulse, where, Indicates the current counter value and the changed sampling period The remainder formed by division, and g) During the waiting time Then the first channel is started, and once the waiting time is over, the startup is performed without delay.

[0015] This invention offers the advantage that, in multi-channel I / O circuits, the sampling rate of a channel can be changed while maintaining synchronization, without having to adjust other channels identically. All channels with a predetermined sampling period or a multiple thereof as their sampling rate remain synchronized without any problems. The synchronization method according to this invention can, in principle, be implemented using any I / O board, especially when the I / O board's circuitry is implemented in an FPGA.

[0016] This also eliminates the need for the method known by the term "strobing," in which the value of the sampling period previously transmitted in the register is synchronously adopted by a strobing signal for multiple channels. Therefore, the method according to the invention has several advantages: i) Synchronization of different channels, even if these channels are set to the same sampling rate and offset at different times.

[0017] ii) Different channels whose sampling periods are in integer ratios are also automatically synchronized with each other.

[0018] iii) The processing in the model is simplified: unlike gating, it is not necessary to reset the rate of the unchanged channel.

[0019] iv) When the same or multiple rates are set, there will be no incorrect intermediate cycles as with gating.

[0020] iv) Faster rate changes are possible: simply set the rate, optionally setting an additional offset, without requiring additional strobing costs.

[0021] Preferably, the signal processing by the channel can delay an offset determined by the number of clock pulses from the clock pulse generator, and the step of detecting a predetermined value of the changed sampling period additionally includes detecting the changed offset. The predetermined value, and based on the waiting time when determining the waiting time. To consider the changed offset, if no changed offset is detected, then set... .

[0022] Offset, in particular, represents a constant movement of the measurement or sampling time point. In a preferred form, the invention also enables synchronized offset changes during operation with non-equidistant offsets. Furthermore, new applications are possible: applications with adaptive sampling rates and applications with adaptive sampling offsets (adaptive interleaving) can be implemented while maintaining synchronization. If, for example, the spectrum is to be calculated from analog values ​​via Fourier transform (FFT), sampling must not only be precisely equidistant but also at the desired sampling rate. If a signal whose rate of change is too high for the minimum possible conversion duration needs to be detected, multiple channels with different offsets can be recorded in parallel and subsequently processed in combination using the invention.

[0023] In a preferred embodiment of the invention, at least two input channels receive the same signal, the at least two input channels operating with the same sampling period, particularly the shortest possible sampling period, and with a first constant offset between adjacent channels. A new constant offset, particularly half of the first constant offset, is set if a trigger condition is met. In particular, the trigger condition is met if the difference between two successive measurements of at least one input channel exceeds a predetermined threshold.

[0024] In another preferred embodiment of the invention, the input channel operates at a first sampling period and is configured to a second sampling period, particularly a shorter sampling period, if a trigger condition is met. Preferably, the trigger condition is met if the difference between two successive measurements of at least one input channel exceeds a predetermined threshold.

[0025] The at least two input channels and / or at least two output channels, or the converter assembly mounted on the channels, require a conversion duration of more than one clock pulse to process the signal. If at the start time of a changed sampling period The start time of the last processing of the signal according to Less than the conversion duration The waiting time is based on Extend the sampling period by one. Depending on the conversion duration, the waiting time can also be extended by multiple new sampling periods.

[0026] Particularly preferred is the required conversion duration of the channel. The required conversion duration for a channel is read out when the sampling period for that channel changes, and the latency is extended based on the read-out conversion duration, particularly according to... Extend the duration by multiple (n>1) cycles. The values ​​stored in memory can be determined based on the type of converter component, for example, from a data table or by measuring individual channels.

[0027] Therefore, starting from the counter value at the beginning of the calculation, it can be achieved through... Determine the time point at which the new cycle will first activate. Preferably, when sampling or detecting input values, store the current counter value at the sampling time point. This allows for a simple check, after calculating the wait time, whether the last conversion before switching sampling rates has completed. Otherwise, the start of detection with a new sampling period is delayed by one or more full new sampling periods, thus ensuring the synchronization of values ​​for all channels with the same sampling period. Other delays, such as the long duration of calculating the new wait time, can also be considered by delaying by one or more new sampling periods accordingly.

[0028] If the electronic circuit comprises at least two sub-circuits, each having at least one input channel and / or at least one output channel, a clock pulse line leading to another sub-circuit, or its own clock pulse generator and counter, the step of synchronously starting all channels of the group at the standard sampling period preferably includes prior synchronization of the clock pulse generator and counter of each sub-circuit, such that all channels of the group are synchronized regardless of their arrangement on the sub-circuit. Methods for synchronizing counters are known in themselves; for example, each of the multiple connected sub-circuits can have its own clock pulse line, through which the clock pulse generator of one sub-circuit acts as the master to pre-determine the clock of all sub-circuits. Thus, all sub-circuits have the same pulse clock with precisely identical frequency and remain synchronized with each other for any length of time. If each sub-circuit has a clock pulse generator, such as, in particular, a quartz crystal, different methods known in themselves for synchronizing clock pulse generators can be used to correct for possible frequency drift.

[0029] The present invention also relates to a real-time computing system, comprising an interface circuit having a set of input channels and / or output channels, the interface circuit including at least two input channels and / or at least two output channels, a clock pulse generator, and a counter, wherein the channels process signals at a sampling period determined by the number of clock pulses from the clock pulse generator, and the processing of signals by the channels is delayed by an offset determined by the number of clock pulses from the clock pulse generator. The real-time computing system further includes a processor and a programmable logic component, the processor being connected to the programmable logic component, the programmable logic component being connected to the interface circuit, and instructions and / or bit streams for performing the method according to the present invention being stored in the non-volatile memory of the real-time computing system.

[0030] The present invention also relates to an interface circuit comprising a set of input channels and / or output channels consisting of at least two input channels and / or at least two output channels. The interface circuit further includes a clock pulse generator, a counter, a programmable logic component, and a non-volatile memory connected thereto. The channels process signals at a sampling period determined by the number of clock pulses from the clock pulse generator, and the processing of signals by the channels is delayed by an offset determined by the number of clock pulses from the clock pulse generator. A bitstream for the programmable logic component is stored in the non-volatile memory, the bitstream enabling the programmable logic component to perform the method according to the present invention.

[0031] Preferably, the bitstream of the programmable logic component includes a partial configuration for performing division remainder calculations, and at least two of the at least two input and / or output channels use a common partial configuration to calculate the division remainder. This allows for switching sampling periods on the FPGA with reduced resource requirements.

[0032] Alternatively, the bitstream of the programmable logic component preferably includes a configuration for performing division remainder calculations, predefines different possible sampling periods, and selects the width of the counter based on the possible sampling periods when creating the bitstream. By selecting the maximum value of the counter as the least common multiple of the possible sampling periods, counter overflow is not a problem, thus allowing the use of a counter with a smaller width.

[0033] The invention will now be described in detail with reference to the accompanying drawings. Components of the same type are given the same reference numerals. The illustrated embodiments are highly schematic, i.e., the distances and lateral and vertical dimensions are not to scale and do not have a deducible geometric relationship with each other, unless otherwise stated. Attached Figure Description

[0034] The attached image is as follows: Figure 1 A schematic diagram of an exemplary hardware-in-the-loop test environment is shown; Figure 2 A schematic diagram of a simulator including synchronized I / O modules or sub-circuits and synchronized input and output channels is shown. Figure 3 A schematic flowchart of the method according to the present invention is shown; Figure 4 This shows a timeline diagram during the switching of sampling periods; Figure 5 A schematic diagram of an exemplary simulation model is shown; Figure 6a A schematic diagram illustrating a first embodiment of the user interface, which allows for changing the sampling period and optional offset within the simulation model; Figure 6b A schematic diagram of a second embodiment of the user interface is shown, which additionally uses signals to indicate the timing of new sampling rates or offset activation. Detailed Implementation

[0035] exist Figure 1 The diagram schematically illustrates a hardware-in-the-loop test environment according to the present invention, comprising an operating computer (PC), an emulator (ES), and a control unit (DUT) under test (DUT). The operating computer (PC) can be configured as a commercially available personal computer with a display screen, input devices, and one or more network interfaces.

[0036] The simulator ES with real-time capabilities includes a computing node CN, which is connected to an operating computer PC via a network interface NET. The computing node CN has at least one processor CPU, particularly a multi-core processor, working memory RAM, and non-volatile memory NVM, on which the operating system and / or bootloader are preferably stored. A logic board with a programmable logic component FPGA, two I / O circuits ADC and DAC, and a fault simulation circuit FIU is connected to the computing node via a high-speed bus SBC or a corresponding controller. The programmable logic component FPGA is preferably freely programmable and configurable according to the invention. Alternatively, the simulator ES may have multiple logic boards or multiple programmable logic components FPGA on a single logic board. The logic board preferably has one or more slots for I / O modules. An I / O module IOM is shown, which is connected to the control unit DUT under test and, for example, can exchange digital input and output signals with the control unit DUT. The I / O circuit ADC has one or more analog-to-digital converters that receive analog signals from the control unit DUT under test. The simulator ES can output analog signals to the control unit DUT under test via the I / O circuit DAC, which has one or more digital-to-analog converters. The Fault Simulation Circuit (FIU) can apply defined electrical faults to connected devices, such as a short circuit between two channels.

[0037] Programmable logic components (FPGAs) are particularly useful in applications such as drive systems for electric vehicles and power electronics, where particularly fast regulation loops are required. Ideally, logic boards with such FPGAs have multiple slots for I / O modules; for example, dSPACE offers the DS6601 FPGA board with five slots, which can accommodate different I / O modules. Existing test environments can be expanded, for example, by installing a new I / O module to provide a high-resolution analog-to-digital converter. I / O modules can also have different types of channels, such as the DS6651 multi-I / O module, which includes six analog input and output channels with 16-bit resolution and sixteen digital input and output channels. If five DS6651 modules are running on the logic board, then up to 30 analog input channels and 30 analog output channels must operate synchronously. "Synchronous operation" should preferably be understood as all channels precisely sampling (or triggering conversions) the input and / or output channels on the same clock edge of a common clock, thus providing, for example, a time resolution of 8 ns.

[0038] By using the method according to the invention to synchronously adjust the sampling rate, it is not necessary to operate at a single fixed sampling rate. Instead, the sampling rate can be adjusted arbitrarily multiple times, and the offset is also adjusted additionally. Nevertheless, all channels used by the I / O modules on the FPGA board will once again operate precisely synchronized on the clock pulse, as long as the same sampling rate and the same offset are set again for these used channels later.

[0039] Simultaneously, sampling rate changes and offset changes occur more rapidly and are therefore highly variable, enabling sampling rate adaptive applications and applications with adaptive sampling offset (adaptive interleaving) while maintaining synchronization. "Interleaving" refers to a measurement method in which multiple channels receive the same signal with different offsets, allowing for higher time resolution measurements of the signal in the case of short, equidistant offsets. A typical 16-bit ADC has, for example, a minimum sampling period or conversion duration of 200 ns, while the offset can be shifted by several, especially 8 ns, clock pulse cycles. A DS6601 FPGA substrate with five DS6651 modules allows for a sampling sequence of 30 measurements within a grid down to 8 ns, thereby enabling continuous sampling up to 8 ns / 125 MHz within a minimum sampling period of 200 ns when using 25 ADCs. The offset can be adaptively shifted as needed using the method according to the invention. This allows, for example, adjustment of the time resolution by setting the offset in multiples of 8 ns. The method according to the invention eliminates the need to restart the measurement after each sampling rate change. Furthermore, non-equidistant offsets are also possible, thus allowing, for example, selected signal regions to be sampled at a higher resolution than the rest of the signal regions.

[0040] Figure 2 A schematic diagram of a simulator including synchronous I / O modules or sub-circuits and synchronous input / output channels is shown. A real-time application (RTA) is executed on the compute node CN, which includes, for example, time-insensitive sub-models. A logic board with a programmable logic component FPGA #1, which can be at least partially freely programmable, is connected via a high-speed bus SBC. Other freely programmable logic components can be connected via the logic board's internal bus FB; a second programmable logic component FPGA #n is exemplarily shown here. At least one first partition of the logic component FPGA #1 is configured with a CNF configuration, which in particular includes time-critical sub-models. The CNF configuration can be created, in particular, based on a graphical model and loaded at the start of the simulation. An I / O bus controller (CTL) can be implemented on the second partition, through which different I / O modules are connected.

[0041] Exemplary examples show a first I / O module IOM #1 and a second I / O module IOM #n, which are connected to a freely programmable logic component FPGA #1 via an I / O bus. Each I / O module includes a programmable logic component IOF, two analog-to-digital converters (ADCs) #1 and #n, and two digital-to-analog converters (DACs) #1 and #n. Therefore, as shown, the I / O modules provide two analog inputs and two analog output channels. In principle, the number of available channels can be increased using additional components; however, only two are shown here for better overview.

[0042] In this diagram, synchronized I / O channels are represented by the same connecting lines, with the analog input channel ADC (dotted line connecting lines) and the analog output channel (dashed line connecting lines) separated into two separate synchronization domains. The connection between the synchronized I / O module and the central logic component FPGA is shown as a dotted-dashed line connecting lines. In principle, the input and output channels can also be combined into a common synchronization domain. Once the synchronization steps described below (especially the fourth step) are performed, the analog-to-digital converter (ADC) samples the analog input value within the same clock pulse as the transmission of the value to be output to the digital-to-analog converter (DAC). This can be called converter synchronization because the signals appear synchronously on the converter. However, there is no synchronization at the pin, through which the control unit under test is connected. This is because the value to be output from the DAC is only output as an analog signal at the pin after, for example, a conversion duration of 96 ns. Pin synchronization can be easily achieved using the method according to the invention by setting the conversion duration, given by the converter type and therefore known, as an offset of the corresponding channel. This allows for a free choice between converter synchronization and pin synchronization.

[0043] Figure 3 A flowchart illustrating a method according to a preferred embodiment of the present invention is shown, wherein the synchronization of sampling time points of all analog channels is performed in multiple steps.

[0044] In step S1 (Configuring Channels on the I / O Module) – this step is suitably performed by the logic component IOF located on the I / O module – all analog input channels and / or analog output channels located on the module are configured with a predetermined initial value for the sampling rate, or standard sampling period, and a predetermined initial value for the configured offset. The initial value of the offset can, in particular, be 0 or a value constant for all converters of a certain type. For example, if the I / O module's analog-to-digital converter (ADC) requires a longer conversion duration than the I / O module's digital-to-analog converter (DAC), the difference in conversion duration can be predetermined as a standard offset for the DAC to achieve pin synchronization. If multiple I / O modules are connected to a central logic component FPGA, it is preferable to pre-configure the channels of all I / O modules such that the sampling rate and offset are initially set on all ADCs and DACs of the analog channels. In particular, it can be specified that after simulator reset or startup, the logic component IOM of the I / O module calls and uses stored default settings, such as the fastest possible sampling rate by means of the corresponding converter and a 0 offset for all input and / or output channels located on the I / O module.

[0045] In step S2 (Synchronizing I / O Modules), all I / O modules connected to the central programmable logic component via the I / O bus are synchronized. It can be specified here that I / O modules of different types or with different channel configurations are also synchronized. Preferably, each I / O module is synchronized to the central logic component FPGA. For example, the I / O bus can be implemented as a low-voltage differential signaling (LVDS) interface with multiple channels. Synchronization of multiple I / O modules connected via LVDS can be performed such that, after training the LVDS path, the offsets of each channel are shifted relative to each other until all channels of all I / O modules are synchronized. In principle, other methods known per se that can achieve synchronization between multiple programmable logic components can also be used.

[0046] In step S3 (Start Channels and Counters), all analog channels are started synchronously with the configured sampling rate and offset. In addition to the synchronous start of all analog channels of all I / O modules with the configured sampling rate and offset, a counter instantiated on the IOF of each I / O module is also started separately. Since this counter limits the resolution of the synchronization, it is preferably loaded with a full clock and therefore counts clock pulses accurately. To prevent the counter from overflowing before the predetermined guaranteed runtime of the real-time simulator ends, the counter is preferably 56 bits wide, which corresponds to 18.3 years at an 8ns clock cycle; larger or smaller widths can also be used in principle.

[0047] In step S4 (receiving a change in channel #i), a predetermined value for the change in the sampling period and / or offset is received. This predetermined value can, for example, be input by the simulator user through the operating interface described further below. Alternatively, the real-time application or simulation model may contain a fixed-stored predetermined value for changing the sampling period; in particular, sampling can be performed at a higher time resolution when trigger conditions are met.

[0048] Now, the start time point for applying the new sampling period and / or the new offset must be determined to ensure synchronous sampling of all channels using the same sampling rate and offset; this is best done on the logic component IOF of the I / O module.

[0049] In step S5 (calculating the waiting time), for the new sampling rate to be set, the remainder of the division is determined by the counter value (the number of clock pulses) and the new sampling period (a multiple of the clock pulses). The difference between the sampling period and the division remainder generates a clock pulse time. Sampling must be started after waiting for this clock pulse time, ensuring that the sample is positioned on the sampling grid as if it had already started at time point 0 with that sampling grid. Therefore, if only the offset is changed... However, if the sampling period remains unchanged, the remainder is 0. The sum of this difference and the offset given as a multiple of the clock pulse produces the clock pulse time; that is, when an offset greater than 0 is additionally set, the wait time for this clock pulse time is until sampling should begin at the new rate. Therefore, the wait time in clock pulses until the start of a new sampling rate can be calculated using the following formula. :

[0050] In step S6 (Is the waiting time sufficient?), check if the waiting time is sufficient so that the converter for channel #i has completed the conversion of the last sampled value. If not, the time since the last sampled at the old rate and the calculated waiting time are considered. If the sum of the values ​​is less than the minimum conversion duration, the waiting time must be extended. For this purpose, in step S8 (extending the waiting time), according to... Add the period of the new sampling rate. This can be done iteratively until the condition is met. Alternatively, the waiting time can be extended by multiple clock pulses to match the corresponding converter.

[0051] If the waiting time is sufficient or has been extended accordingly, then in step S7 (start measurement on channel #i), measurement begins in conjunction with the end of the waiting time. All channels with the same sampling period are measured synchronously or at fixed predetermined time intervals between each other. The method can continue for the same channel or for any other channel that receives a changed sampling period and / or a changed offset.

[0052] Figure 4 This diagram illustrates the timeline during sampling period switching, schematically showing the sampling grid measured at the previous rate and the sampling grid measured at the new rate or a newly set sampling period and desired offset. Vertical lines represent the corresponding sampling time points. This indicates the time point at which the signal was last sampled at the previous rate. At time point... The system detects a changed sampling period, for example, because the user has set a new measurement rate. The waiting time is calculated according to the formula above. Represented as a shaded rectangle. As... This illustrates a point in time from which measurements can be taken with a new raster. However, in the example shown, an offset is additionally set. This offset results in a correspondingly longer waiting time. Here, as elsewhere, it is assumed that the calculation of the waiting time is instantaneous; however, depending on the duration of the transformation, a longer calculation time can also be considered within the waiting time.

[0053] Figure 5 A schematic diagram of an exemplary simulation model is shown, particularly a schematic diagram of a sub-model to be executed on a freely programmable logic component (FPGA). An input port P11, an output port P12, four computation blocks B11, B12, B13, and B14, and a configuration block K are shown. These blocks are connected by signal lines through which data, such as the values ​​of detected input signals, are exchanged. The illustrated simulation model can be displayed and processed, for example, on an operating computer (PC). For real-time simulation, code is generated from the simulation model, for example in the form of a hardware description language, and from this code, a configuration for the logic component FPGA is generated. It is also possible to specify that the model is further displayed during real-time simulation to serve as a user interface for displaying and changing values. Alternatively, a dedicated program can be used to display and set values ​​during simulation.

[0054] Simulator users have several options for setting new sampling rates or offsets for channels: The sampling rate can be set during real-time initialization by adjusting the corresponding parameters of the simulation model and then generating code for FPGA configuration. Preferably, the new value of the sampling period is transmitted to the logic component IOM of the I / O module after I / O module synchronization (step S2).

[0055] Alternatively, a modified sampling period can be specified on a representative of the FPGA configuration in the modeling tools for processor-based real-time applications. During the initialization of the real-time application, the new value is transferred from the processor through the logic board to the logic component (IOM) of the I / O module.

[0056] During runtime in the real-time phase, new values ​​for the sampling period and / or offset can be set via a port, for example, on a model block representing the analog channel. Preferably, the new value for the sampling period is received from the processor model by the freely programmable logic component FPGA through a register interface. In this case, the value can be adjusted not only by the FPGA model but also by the processor model and therefore also at runtime via control tools or control programs or automation interfaces such as the Universal Simulator Interface (XIL API) (Application Programming Interface).

[0057] Figure 6a A schematic diagram of a first embodiment of the user interface is shown, which allows changing the sampling period and optional offset in the simulation model. Thus, an identifier such as Analog In1[Modul:1] can be given to identify an input or output channel in which the changed sampling period and / or offset is set. The block shown includes inputs for receiving the new period and new offset. Furthermore, start signals for setting the new sampling period or new offset can be received via inputs Setze Periode and Setze Versatz, respectively. The value of the input signal measured by the analog-to-digital converter can be transmitted to other parts of the model via output Dayn. Once the new configuration is set, two additional outputs, NeuePeriode aktiv or Neue Versatz aktiv, output signals and thus sample with the new sampling period and / or new offset.

[0058] Figure 6bA schematic diagram of a second embodiment of the user interface is shown, corresponding to the described block, but additionally signaling when a new sampling rate or offset will be activated. By implementing a corresponding mechanism for each channel within the VHDL framework of the freely programmable logic component FPGA, these channels offer the user different possibilities: thus, a port on a block representing the corresponding channel in the FPGA model can precisely signal when a newly set sampling rate has been adopted in the I / O module. This allows for direct response in either the FPGA model or the analog model. Furthermore, another port can signal how many clock cycles the new sampling rate will be adopted. Preferably, the block may also include a checkbox, which the user can use to select whether converter synchronization or pin synchronization is applied between the analog input and analog output channels.

[0059] Determining the remainder after division requires either division or multiplication with the reciprocal, which can require a large area and several clock cycles of computation in programmable logic components. For example, it might be necessary to divide a 56-bit wide counter value by a 32-bit sampling period or determine the remainder, thus allowing for sampling periods ranging from 200ns (25 clock cycles) to 30s. Depending on the preferred implementation, performing all divisions can be omitted or the workload reduced. In the first implementation, it can be specified that only powers of 2 are allowed as sampling periods. This eliminates the need for division and only requires shifting, requiring only one clock cycle even for the maximum 32-bit sampling period and almost no resources.

[0060] In other implementations, arbitrary sampling periods are allowed, which necessitates division, and the divider can be optimized in different ways: In the second implementation, the division is instantiated n times in parallel. Even with pipelined multichannel operation, the divider is at least one clock cycle slower per channel than parallel execution. As a trade-off between speed and resource consumption on programmable logic components, the divider can be instantiated 1 to n times, allowing multiple channels to share a single divider.

[0061] In the third implementation, the divider is optimized to achieve lower operating latency: since the required logic and the resulting latency decrease as the number of bits to be processed decreases, the maximum operating time of the counter and therefore the high-order bits are more strongly limited here. By ensuring that counter overflow does not break synchronization, the number of bits in the counter can be greatly reduced.

[0062] Here, on the one hand, there is the possibility of limiting the maximum counter value to the smallest common multiple of all configurable sampling rates. This makes sense if there are only a small number of possible sampling periods. Therefore, counter overflow is meaningless because no shift will occur when the maximum counter value is divisible by all possible sampling periods without remainder.

[0063] On the other hand, one can be stored for each channel. (Irrelevant to offset).

[0064] At time point 0, .

[0065] To calculate the waiting time for the new sampling rate, this must be... Added to the counter in advance

[0066] For the new sampling rate, store the division remainder:

[0067] Each time the counter overflows, for each channel Will increase And then it decreases so that it does not overflow:

[0068] This invention enables the retrospective adjustment of the sampling rate and offset of analog-to-digital converters (ADCs) and digital-to-analog converters (DACs) in real-time systems, while maintaining the synchronization of sampling time points for all channels with the same sampling rate and offset settings.

Claims

1. Method for time-synchronously inputting and / or outputting signals on a set of input channels and / or output channels of an electronic circuit with a selectable sampling rate, the electronic circuit comprising at least two input channels and / or at least two output channels, a clock generator and a counter, wherein, The channel processes the signal at a predetermined sampling period, and the method includes the following successive steps: Configure each channel in the group with a standard sampling period. All channels of the group are started synchronously with the standard sampling period, and the counter is also started here. detecting a changed sampling period of a first channel of the group a predetermined value, detecting a current counter value , Configure the first channel with a modified sampling period. According to Determining the latency of a clock pulse wherein, denotes the division remainder formed from the current counter value and the changed sampling period and During the waiting time Then the first channel is activated.

2. The method according to claim 1, characterized in that, The processing of the channel pair signal delays an offset determined by the number of clock pulses of the clock pulse generator, the step of detecting a predetermined value of the changed sampling period additionally comprises detecting a changed offset The predetermined value of the changed offset is determined by the number of clock pulses of the clock pulse generator, and the changed offset is taken into account when determining the waiting time according to If no changed offset is detected, a value of is set.

3. The method according to claim 1 or 2, characterized in that, The at least two input channels and / or at least two output channels require more than one clock pulse conversion duration for processing the signal if at the start point in time with the changed sampling period to the start point in time of the last processing of the signal According to the conversion duration is to be extended by then the waiting time is according to by one changed sampling period.

4. The method according to claim 1 or 2, characterized in that, The predetermined sampling period is determined by the number of clock pulses generated by the clock pulse generator.

5. The method according to claim 3, characterized in that, Required conversion duration for the channel The required conversion duration for a channel is read out when the sampling period for the channel changes, and the waiting time is extended based on the read conversion duration.

6. The method according to claim 5, characterized in that, Waiting time according to Extend multiple cycles.

7. The method according to claim 1 or 2, characterized in that, At least two input channels receive the same signal, the at least two input channels operate with the same sampling period and a first constant offset between adjacent channels, and a new constant offset is set when a trigger condition is met.

8. The method according to claim 7, characterized in that, The at least two input channels operate with the shortest sampling period and with a first constant offset between adjacent channels.

9. The method according to claim 7, characterized in that, The new constant offset is half of the first constant offset.

10. The method according to claim 1 or 2, characterized in that, The input channel operates at the first sampling period and is configured to the second sampling period if the trigger condition is met.

11. The method according to claim 10, characterized in that, The second sampling period is shorter than the first sampling period.

12. The method according to claim 1 or 2, characterized in that, The electronic circuit includes at least two sub-circuits, each having at least one input channel and / or at least one output channel, a clock pulse line leading to another sub-circuit, or its own clock pulse generator and counter. The step of synchronously starting all channels of the group with the standard sampling period includes prior synchronization of the clock pulse generator and counter of each sub-circuit, such that all channels of the group are synchronized regardless of their arrangement on the sub-circuit.

13. The method according to claim 12, characterized in that, Each sub-circuit is set on a separate FPGA component.

14. The method according to claim 13, characterized in that, The central circuit is connected to two or more sub-circuits.

15. The method according to claim 13, characterized in that, The clock pulses for each sub-circuit are distributed to each sub-circuit by the clock pulse generator of the central circuit.

16. The method according to claim 1 or 2, characterized in that, The electronic circuit has a freely programmable FPGA component whose configuration is newly written during simulation initialization. The configuration settings of the freely programmable FPGA component are used to perform at least one step of the method for at least one channel.

17. The method according to claim 16, characterized in that, The configuration settings of the freely programmable FPGA component are used to perform at least one step of the method for all channels in use.

18. The method according to claim 16, characterized in that, The electronic circuit is connected to an operating computer, which executes a graphical user interface with a graphical representation of the model to be simulated, and displays a channel object in the graphical user interface for at least one channel.

19. The method according to claim 18, characterized in that, The channel object is a block.

20. The method according to claim 18, characterized in that, The configuration of freely programmable FPGA components is generated based on the graphical representation of the model to be simulated.

21. The method according to claim 18, characterized in that, The channel object is configured to receive signals from the simulation model via a port and / or output signals to the simulation model.

22. The method according to claim 21, characterized in that, The channel object is configured to receive signals from the analog model and / or output signals to the analog model via a port whose clock pulse precisely indicates when the matched channel starts with a new sampling period, and / or output to a port indicating how many clock pulses the newly set sampling rate is valid, and / or output to a port through which predetermined values ​​for offsetting the channel by multiple clock pulses are received.

23. A real-time computing system, comprising an interface circuit having a set of input channels and / or output channels, said interface circuit including at least two input channels and / or at least two output channels, a clock pulse generator, and a counter, wherein, The channel processes the signal with a sampling period determined by the number of clock pulses from the clock pulse generator, and the processing of the signal by the channel can be delayed by an offset determined by the number of clock pulses from the clock pulse generator. The real-time computing system further includes a processor and a programmable logic component, the processor being connected to the programmable logic component and the programmable logic component being connected to an interface circuit. The system is characterized in that instructions and / or bit streams for performing the method according to any one of claims 1 to 22 are stored in the non-volatile memory of the real-time computing system.

24. An interface circuit, comprising a set of input channels and / or output channels consisting of at least two input channels and / or at least two output channels, the interface circuit further comprising a clock pulse generator, a counter, a programmable logic component, and a non-volatile memory connected to the programmable logic component, wherein, The channel processes the signal with a sampling period determined by the number of clock pulses from a clock pulse generator, and the processing of the signal by the channel can be delayed by an offset determined by the number of clock pulses from a clock pulse generator. The channel is characterized by storing a bitstream for a programmable logic component in a non-volatile memory, the bitstream enabling the programmable logic component to perform the method according to any one of claims 1 to 22.

25. The interface circuit according to claim 24, characterized in that, The bitstream of the programmable logic component includes a partial configuration for performing division remainder calculations, and at least two of the at least two input channels and / or output channels use a common partial configuration to calculate the division remainder.

26. The interface circuit according to claim 24, characterized in that, The bitstream of the programmable logic component includes a configuration for performing division remainder calculations, predefines different achievable sampling periods, and selects the width of the counter based on the achievable sampling periods when creating the bitstream.

Citation Information

Patent Citations

  • Lubricant coating

    EP3224325A1

  • Equivalent sampling device

    CN101144835A

  • Synchronization aid device and device for reconstructing undersampled clock signals

    CN101262329A