WO2011114438A1 - 速度検出装置 - Google Patents
速度検出装置 Download PDFInfo
- Publication number
- WO2011114438A1 WO2011114438A1 PCT/JP2010/054428 JP2010054428W WO2011114438A1 WO 2011114438 A1 WO2011114438 A1 WO 2011114438A1 JP 2010054428 W JP2010054428 W JP 2010054428W WO 2011114438 A1 WO2011114438 A1 WO 2011114438A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- pulse
- value
- unit
- register
- overflow
- Prior art date
Links
Images
Classifications
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01P—MEASURING LINEAR OR ANGULAR SPEED, ACCELERATION, DECELERATION, OR SHOCK; INDICATING PRESENCE, ABSENCE, OR DIRECTION, OF MOVEMENT
- G01P3/00—Measuring linear or angular speed; Measuring differences of linear or angular speeds
- G01P3/42—Devices characterised by the use of electric or magnetic means
- G01P3/44—Devices characterised by the use of electric or magnetic means for measuring angular speed
- G01P3/48—Devices characterised by the use of electric or magnetic means for measuring angular speed by measuring frequency of generated current or voltage
- G01P3/481—Devices characterised by the use of electric or magnetic means for measuring angular speed by measuring frequency of generated current or voltage of pulse signals
- G01P3/489—Digital circuits therefor
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F7/00—Methods or arrangements for processing data by operating upon the order or content of the data handled
- G06F7/38—Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation
- G06F7/48—Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation using non-contact-making devices, e.g. tube, solid state device; using unspecified devices
- G06F7/499—Denomination or exception handling, e.g. rounding or overflow
- G06F7/49905—Exception handling
- G06F7/4991—Overflow or underflow
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01P—MEASURING LINEAR OR ANGULAR SPEED, ACCELERATION, DECELERATION, OR SHOCK; INDICATING PRESENCE, ABSENCE, OR DIRECTION, OF MOVEMENT
- G01P3/00—Measuring linear or angular speed; Measuring differences of linear or angular speeds
- G01P3/42—Devices characterised by the use of electric or magnetic means
- G01P3/44—Devices characterised by the use of electric or magnetic means for measuring angular speed
- G01P3/48—Devices characterised by the use of electric or magnetic means for measuring angular speed by measuring frequency of generated current or voltage
- G01P3/481—Devices characterised by the use of electric or magnetic means for measuring angular speed by measuring frequency of generated current or voltage of pulse signals
Definitions
- the present invention relates to a speed detection device that detects an AC signal having a frequency proportional to the speed, rotational speed, rotational speed, or the like of a moving object.
- the speed detection device disclosed in Patent Document 1 has a problem that it is difficult to perform digital filter processing at a later stage because the capture period, which is a period for obtaining a set of the pulse counting register and the pulse timing register, is not constant. there were. Therefore, when digital filter processing is put in the latter stage, the frequency is obtained and buffered using the latest set of pulse count register and pulse timing register obtained at each calculation cycle on the microprocessor side. Will go. For this reason, in some cases, some data may be discarded without being used, which causes a problem of frequency accuracy deterioration.
- the present invention has been made in view of the above, and an object of the present invention is to obtain a speed detection device that does not degrade frequency accuracy, is constantly updated, has a relatively small circuit scale, and has little overhead on software. .
- the present invention includes a pulse counting unit that counts the number of pulses of an input signal from the outside, and is counted up by a clock and cleared by the pulse.
- a pulse timing unit that counts the time from the pulse
- an overflow detection unit that detects that the pulse timing unit overflows and holds it in an overflow register
- a capture clock that obtains measurement results at regular intervals
- the output from the counting unit is held in the pulse counting register, and the capture unit that holds the output from the pulse timing unit in the pulse timing register, the value of the pulse counting register, the value of the pulse timing register, and the overflow Read the value of the register, and calculate the frequency by a predetermined calculation.
- a frequency calculating unit that calculates the pulse timing data when the pulse timing unit overflows, the pulse timing data at the previous interrupt is obtained by the period of the capture clock / the period of the timing clock
- the frequency calculation value is calculated by adding a predetermined constant and calculating pulse time data that is time from the last pulse / time clock.
- the capture cycle is made constant, there is no frequency deterioration, data is constantly updated, the circuit scale is relatively small, and the overhead to software can be reduced.
- FIG. 1 is a diagram illustrating a configuration example of a speed detection device according to the first exemplary embodiment of the present invention.
- FIG. 2 is a diagram illustrating a configuration example of the overflow detection unit and the calculation unit in FIG. 1.
- FIG. 3 is a diagram illustrating a configuration example of an overflow detection unit and a calculation unit of the speed detection device according to the second exemplary embodiment of the present invention.
- FIG. 4 is a diagram illustrating a configuration example of an overflow detection unit and a calculation unit of the speed detection device according to the third embodiment of the present invention.
- FIG. 5 is a diagram showing an example of a design procedure of the speed detection device of FIG.
- FIG. 6 is a diagram illustrating an example of a processing procedure of the calculation unit in FIG. 1.
- FIG. 7 is an explanatory diagram of processing contents of the calculation unit of FIG.
- FIG. 8 is a diagram for explaining an operation of a hardware part of the speed detection device of FIG.
- FIG. 9 is a diagram for explaining another operation of the hardware portion of the speed detection device of FIG.
- FIG. 10 is a diagram illustrating a configuration example of a calculation unit according to the fourth embodiment of the present invention.
- FIG. 11 is a diagram illustrating an example of a design procedure of the speed detection device according to the fourth embodiment of the present invention.
- FIG. 12 is a diagram illustrating an example of a processing procedure of the buffer processing unit in FIG.
- FIG. 13 is a diagram illustrating an example of a processing procedure of the arithmetic processing unit in FIG. 10.
- FIG. 10 is a diagram illustrating a configuration example of a calculation unit according to the fourth embodiment of the present invention.
- FIG. 11 is a diagram illustrating an example of a design procedure of the speed detection device according to the fourth embodiment of the present invention.
- FIG. 14 is an explanatory diagram of processing contents of the calculation unit of FIG.
- FIG. 15 is an explanatory diagram of other processing contents of the calculation unit of FIG.
- FIG. 16 is a diagram of a configuration example of the speed detection device according to the fifth embodiment of the present invention.
- FIG. 17 is a diagram of a configuration example of a speed detection device according to the sixth embodiment of the present invention.
- FIG. 18 is a diagram illustrating an example of accuracy degradation of the speed detection device disclosed in Patent Document 1.
- FIG. 19 is a diagram illustrating an example of a simulation result of the speed detection device disclosed in Patent Document 1.
- FIG. 20 is a diagram illustrating an example of a simulation result of the speed detection device according to the fourth embodiment of the present invention.
- FIG. 1 is a diagram illustrating a configuration example of a speed detection device according to the first exemplary embodiment of the present invention.
- the role of the speed detection device 1 is to detect the frequency of the input signal IN.
- the related diagrams are shown in FIGS.
- the speed detection device 1 mainly includes a waveform shaping unit 101, an edge detection unit 106, a pulse counting unit 107, a clocking clock generation unit 103, a pulse timing unit 109, and a capture clock generation unit. 104, an overflow detection unit 108, a capture unit 110, an interrupt request unit 111, and a calculation unit (frequency calculation unit) 113.
- the speed detection device 1 is described as a single device in FIG. 1, but may be a partial function of a certain device.
- the name does not have to be a speed detection device, and is sometimes called “** control device” or “** control system”.
- variable name may appear on the right and left sides of mathematical expressions. In that case, it means to use the previous value of the variable on the right side.
- the waveform shaping unit 101 shapes the input signal IN to convert it into a rectangular wave (pulse signal P), and insulates the input signal IN from the internal signal using a photocoupler or the like.
- the edge detection unit 106 detects only one of the rising edge and falling edge of the pulse signal P and outputs it as a pulse edge (pulse) PE.
- This pulse edge PE becomes H of a predetermined pulse width only at the moment when the edge is detected, and becomes L otherwise.
- the time clock generator 103 generates a time clock CK_TIM for the pulse timer 109 to measure time.
- the capture clock generation unit 104 generates a capture clock CK_CAP that is a timing for obtaining a measurement result at regular intervals.
- the pulse counting unit 107 is configured such that the initial state of the output value is 0, and the output value is counted up by the pulse edge PE from the edge detecting unit 106. In other words, this counter has no reset condition and operates in free run.
- the pulse timer 109 counts up with the clock CK_TIM from the clock generator 103 and is cleared by the pulse edge PE from the edge detector 106 to measure the time from the last pulse edge PE.
- the capture unit 110 holds the live pulse count value LN from the pulse count unit 107 in the pulse count register CN at the timing of the capture clock CK_CAP from the capture clock generation unit 104. In addition, the capture unit 110 holds the live pulse timing value LT from the pulse timing unit 109 in the pulse timing register CT at the timing of the capture clock CK_CAP from the capture clock generation unit 104.
- the pulse timing unit 109 measures the time from the last input pulse edge PE, and when capture occurs, the capture unit 110 captures the instantaneous value.
- the capture unit 110 holds the time from the last input pulse edge PE until capture occurs.
- the timer (pulse timing unit 109) only needs to prepare a bit width that can be sufficiently measured during the capture period Tcap. If the pulse edge PE is not input for a longer time, the timer overflows to detect overflow. An overflow is detected by the unit 108.
- the interrupt request unit 111 outputs an interrupt request IRQ at the timing of the capture clock CK_CAP from the capture clock generation unit 104. Further, the interrupt request unit 111 cancels the interrupt request IRQ by an interrupt request clear request ICRQ (not shown) from the arithmetic unit 113.
- the interrupt request clear request ICRQ will be described later.
- FIG. 2 is a diagram illustrating a configuration example of the overflow detection unit and the calculation unit in FIG.
- the arithmetic unit 113 detects that the overflow occurs when there is a difference between the value of the pulse count register at the previous interrupt and the value of the pulse register at the current interrupt. It is determined that the error has not occurred, and the overflow register OVF is reset. In addition, when there is no difference between the value of the pulse count register at the previous interrupt and the value of the pulse count register at the current interrupt, the arithmetic unit 113 causes an overflow due to the value of the overflow register OVF. Judge whether or not. Whether an overflow has occurred is set in an overflow flag OVFF.
- FIG. 8 is a diagram for explaining one operation of the hardware part of the speed detection device of FIG. FIG. 8 shows a timing chart of each signal when no overflow has occurred.
- the live pulse count value LN is counted up according to the pulse edge PE and is held in the pulse count register CN at the timing of the capture clock CK_CAP.
- the live pulse timing value LT increases from when the last pulse edge PE is input until it is cleared by the next pulse edge PE, and is held in the pulse timing register CT at the timing of the capture clock CK_CAP.
- FIG. 9 is a diagram for explaining another operation of the hardware part of the speed detection device of FIG. FIG. 9 shows a timing chart of each signal when an overflow occurs.
- the live pulse count value LN is held in the pulse count register CN, and the live pulse count value LT is held in the pulse count register CT. Is done.
- the arithmetic unit 113 has a difference between the value of the pulse count register at the previous interrupt and the value of the pulse count register at the current interrupt. Then, it is determined that no overflow has occurred, and the value of the overflow register OVF is cleared.
- the calculation unit 113 generates an overflow because there is no difference between the value of the pulse count register at the previous interrupt and the value of the pulse count register at the current interrupt and the value of OVF is 1.
- FIG. 5 is a diagram showing an example of a design procedure of the speed detection device of FIG.
- Specification setting step 301 A capture cycle Tcap, a maximum input frequency Fmax, a minimum input frequency Fmin, and a target accuracy ACCt are set.
- the above are 0x1f, 160, 0x1fff, 6250, and 2500000, respectively.
- FIG. 6 is a diagram illustrating an example of a processing procedure of the calculation unit in FIG.
- the calculation unit 113 is activated by an interrupt request IRQ, and includes, as main components, a data reading step 201, an overflow processing step 202, an interrupt request clearing step 203, a numerator calculation step 204, a denominator calculation step 205, a frequency It has a calculation step 206 and a previous value setting step 207.
- the clocking clock cycle is 1 / clocking clock frequency Ftim.
- Read step 201 The calculation unit 113 reads CN and CT from the capture unit 110 and copies them to the local variables XN and XT.
- Overflow processing step 202 The calculation unit 113 obtains the overflow flag OVFF by performing any one of FIG. 2, FIG. 3, and FIG.
- Interrupt request clear step 203 Operation unit 113 outputs an interrupt request clear request ICRQ.
- Molecular calculation step 204 The calculation unit 113 calculates the local variable NUM using the following equation.
- NUM MIN ((XN-YN) & NMASK0, NMAX) That is, based on the value obtained by subtracting the value of the pulse count register (YN) at the previous interrupt from the value of the pulse count register (XN) at the current interrupt (from the previous interrupt to the current interrupt) The number NUM of pulse edges input during the period Tcap) is obtained.
- the calculation unit 113 adds a predetermined constant value (TCAP) obtained by the capture clock cycle / timed clock cycle to the previous pulse timing data (YT), Pulse timing data (XT) that is the time / time clock period from the last pulse edge PE is obtained.
- TCAP predetermined constant value
- XT Pulse timing data
- Frequency calculation step 206 The calculation unit 113 calculates the frequency calculation value F using the following equation using the pulse timing data (XT) obtained in step 205.
- FIG. 7 is an explanatory diagram of processing contents of the calculation unit of FIG. CASE 1 is an example in which one or more pulse edges PE are input between the time when the first capture clock CK_CAP in FIG. 7 is input and the time when the second capture clock CK_CAP is input.
- the number NUM of pulse edges PE is 12, and there are 12 pulse periods in the section described as (TCAP + YT ⁇ XT) / Ftim. Therefore, it can be seen that there is no problem with the value of NUM as the numerator of the formula for calculating the frequency calculation value F.
- the calculation unit 113 calculates the frequency calculation value (that is, the time clock) assuming that the pulse edge PE is input immediately after the number of pulse edges input within a predetermined period is zero.
- the frequency calculation value F is estimated by selecting the lower value of the frequency / pulse timing data) and the previous frequency calculation value (F).
- FIG. 18 is a diagram illustrating an example of accuracy degradation of the speed detection device disclosed in Patent Document 1.
- FIG. 18 shows a capture cycle Tcap (capture timing) that is a cycle in which a set of the pulse count register and the pulse timing register is obtained, and a calculation cycle Tcal on the microprocessor side.
- Tcap capture timing
- the frequency is obtained and buffered by using a set of the pulse count register and the pulse timing register. Therefore, as shown in FIG. 18, some data may be discarded without being used, which has been a cause of frequency accuracy deterioration. On the other hand, such a problem does not occur in the speed detection device 1 according to the first embodiment.
- the speed detection device 1 includes the pulse counting unit 107, the pulse timing unit 109, the timing clock generation unit 103, the capture clock generation unit 104, the overflow detection unit 108, Since the capture unit 110 and the calculation unit 113 are included and the capture cycle Tcap is constant, a part of the data is discarded without being used as in the speed detection device disclosed in Patent Document 1. There is no deterioration in frequency accuracy.
- the speed detection apparatus 1 periodically acquires data (frequency calculation value F) by the capture clock CK_CAP regardless of whether the pulse edge PE enters, and updates the data. Therefore, the problem that the data is not updated when there is no pulse edge PE as in the speed detection device disclosed in Patent Document 1 below does not occur. That is, in the speed detection device disclosed in Patent Document 1, when the pulse edge PE is not input, the set (capture period Tcap) of the pulse count register and the pulse timing register cannot be obtained, so the latest frequency calculation value F is obtained. There was a problem that I could not.
- pulse missing detection means for detecting that the pulse signal has not been input for a long period of time is provided, and when the pulse is missing, a process of recognizing the frequency calculation value as 0 must be performed.
- a missing pulse detection unit is unnecessary.
- the pulse time measurement counter may be configured by only one latch (in this embodiment, the pulse timing register CT of the capture unit 110).
- the speed detection device disclosed in Patent Document 2 requires a double latch to latch at the pulse edge to latch the counter value for measuring the pulse time, and further to latch at the capture clock.
- the speed detection device 1 according to the first exemplary embodiment of the present invention does not require extra hardware resources.
- the pulse timing data (YT) at the previous interruption is a predetermined constant value obtained by the capture clock cycle / timed clock cycle.
- TCAP pulse time data
- XT pulse time data that is the time / time clock period from the last pulse edge PE is obtained.
- the speed detection device 1 when the number of pulse edges input within a predetermined period is zero, the frequency calculation value assumed that the pulse edge PE is input immediately after that. Since the lower value of the previous frequency calculation value is selected, the frequency calculation value F is periodically obtained by the clock CK_TIM regardless of whether or not the pulse edge PE enters. Is possible.
- the speed detection device disclosed in Patent Document 2 the treatment content when no pulse edge PE is input within a predetermined period is not clearly described. However, the speed detection device according to the first embodiment of the present invention is not disclosed. In 1, these treatment contents are also clearly shown.
- Embodiment 2 we introduce a slightly different method for detecting overflow.
- whether or not an overflow has occurred is managed by the overflow register OVF of the overflow detection unit 108.
- whether or not an overflow has occurred is managed by a memory. Other than that, there is no change at all, so only the changed part will be explained.
- FIG. 3 is a diagram illustrating a configuration example of an overflow detection unit and a calculation unit of the speed detection device according to the second exemplary embodiment of the present invention.
- the overflow detection unit 108 is the same as that in the first embodiment.
- the calculation unit 113 is configured to determine whether or not an overflow has occurred, and is configured to hold the overflow flag OVFF in the memory.
- the overflow register OVF When the overflow register OVF is set, it is determined that an overflow has occurred and the overflow flag is determined. OVFF is set and the overflow register OVF of the overflow detection unit 108 is cleared. If there is a difference between the value of the pulse count register at the previous interrupt and the value of the pulse count register at the current interrupt, the arithmetic unit 113 determines that no overflow has occurred and determines that the overflow flag OVFF To clear.
- the overflow detection unit 108 in FIG. 3 sets the overflow register OVF when the live pulse timing value LT exceeds the maximum value.
- the arithmetic unit 113 sets the overflow flag OVFF by interrupt processing, holds the overflow flag OVFF, and clears the overflow register OVF of the overflow detection unit 108. That is, when the overflow register OVF changes from 0 to 1, the overflow flag OVFF is held and the overflow register OVF is cleared.
- the speed detection device 1 is configured to determine whether or not an overflow has occurred and hold the overflow flag OVFF in the memory.
- the configuration of the calculation unit 113 can be simplified.
- Embodiment 3 FIG. Next, we will introduce a slightly different method for detecting overflow.
- whether or not an overflow has occurred is coordinated by the overflow detection unit 108 and the calculation unit 113.
- whether or not an overflow has occurred is automatically detected by the overflow detection unit 108.
- the arithmetic unit 113 reads the overflow register OVF and sets it to the overflow flag OVFF.
- FIG. 4 is a diagram illustrating a configuration example of an overflow detection unit and a calculation unit of the speed detection device according to the third embodiment of the present invention.
- the overflow detection unit 108 sets the overflow register OVF when the live pulse timing value LT exceeds the maximum value, and clears the overflow register OVF by the pulse edge PE. That is, the first and second embodiments are modes in which the overflow register OVF is cleared by the interrupt processing of the arithmetic unit 113, but the third embodiment is configured to clear the overflow register OVF by the pulse edge PE. Has been. Furthermore, the overflow detection unit 108 is configured to hold the value (1 or 0) of the overflow register OVF at the timing of the capture clock CK_CAP. The calculation unit 113 reads the overflow register OVF held by the overflow detection unit 108 and sets it to the overflow flag OVFF.
- the overflow detection unit 108 determines whether or not an overflow has occurred. Therefore, the calculation unit 113 has the same effect as the first embodiment. It is possible to further simplify the configuration.
- FIG. 10 is a diagram illustrating a configuration example of a calculation unit according to the fourth embodiment of the present invention. The related diagrams are shown in FIGS.
- the speed detection device 1 according to the fourth embodiment is designed to keep the hardware scale (the number of bits of the pulse counting unit 107, the pulse timing unit 109) small by placing a little burden on the software.
- 10 includes a buffer processing unit 901 and an arithmetic processing unit 902.
- the buffer processing unit 901 does not calculate the frequency, but performs the writing process to the ring buffer by the interrupt request IRQ.
- the portion for calculating the frequency is moved to the calculation processing unit 902 for each calculation cycle Tcal.
- the buffer processing unit 901 includes a pulse counting ring buffer N [] that stores the value of the pulse counting register CN in time series, and a pulse timing ring that stores the value of the pulse timing register CT in time series. It has a buffer T [] and a ring buffer pointer PNT that holds the current position of the ring buffer.
- the calculation processing unit 902 is activated every calculation cycle Tcal (predetermined calculation cycle) that is an integral multiple of the capture clock cycle, and calculates the frequency calculation value F based on the data buffered by the buffer processing unit 901.
- FIG. 11 is a diagram illustrating an example of a design procedure of the speed detection device according to the fourth embodiment of the present invention.
- Specification setting step 601 The calculation cycle Tcal, the maximum input frequency Fmax, the minimum input frequency Fmin, and the target accuracy ACCt are set.
- Calculation cycle Tcal 20ms
- Maximum input frequency Fmax 8000Hz
- Minimum input frequency Fmin 1Hz
- -Clock clock frequency setting step 602 Ftim ⁇ 1 / ACCt ⁇ 1 / Tcal For example, ⁇ 1.999995 MHz, and here, 2.5 MHz is set.
- Various calculation constant calculation step 604 Find various constants. This value is used by the calculation unit 113 described later.
- FIG. 12 is a diagram illustrating an example of a processing procedure of the buffer processing unit in FIG.
- the buffer processing unit 901 is activated by an interrupt request IRQ.
- the buffer processing unit 901 has a data reading step 401, an overflow processing step 402, an interrupt request clearing step 403, a count value editing step 404, and a time value editing step 405.
- the buffer processing unit 901 reads CN and CT from the capture unit 110 and copies them to the local variables XN and XT.
- Overflow processing 402 The buffer processing unit 901 obtains the overflow flag OVFF by performing any of FIG. 2, FIG. 3, and FIG.
- Interrupt request clear step 403 The buffer processing unit 901 outputs an interrupt request clear request ICRQ.
- Count value editing step 404 The buffer processing unit 901 obtains a value XN that is bit-extended from the capture cycle Tcap to the calculation cycle Tcal using the following equation.
- XN (YN + (XN-YN) & NMASK0) & NMASK1 That is, the buffer processing unit 901 obtains the logical product of the value obtained by subtracting the value of the pulse count register YN at the previous interrupt from the value of the pulse count register XN at the current interrupt and NMASK0 from the previous interrupt time. Find the number of pulse edges input during the current interrupt. Further, the buffer processing unit 901 performs a logical product of the value obtained by adding the number of pulse edges input between the previous interrupt and the current interrupt to the previous pulse count data (YN), and NMASK1. Pulse count data (XN) is obtained.
- Time value editing step 405 The buffer processing unit 901 obtains a time XT from the last input of the pulse edge PE to the capture clock CK_CAP using the following formula.
- OVFF 0, ie no overflow
- TCAP predetermined constant value
- the pulse timing data (XT) which is the time / time clock cycle from the last pulse edge PE is obtained.
- the pulse timing ring buffer T [] must be initialized with the maximum pulse count value TMAX.
- FIG. 13 is a diagram illustrating an example of a processing procedure of the arithmetic processing unit in FIG.
- the arithmetic processing unit 902 is activated every arithmetic cycle Tcal, and includes a pointer reading step 501, a molecular arithmetic step 502, and a frequency arithmetic step 503 for obtaining a frequency arithmetic value F as main components. .
- Pointer reading step 501 The arithmetic processing unit 902 refers to the ring buffer pointer PNT only once, sets the current pointer position in the local variable C0, and sets the pointer position retroactive from T0 by TCAL / TCAP in the local variable C1.
- FIG. 14 is an explanatory diagram of processing contents of the arithmetic unit of FIG. 10
- FIG. 15 is an explanatory diagram of other processing contents of the arithmetic unit of FIG.
- CASE 1 is an example in which one or more pulse edges PE are included.
- NUMs there are 12 NUMs, and there are 12 pulse periods in the section described as (TCAL + T [C1] ⁇ T [C0]) / Ftim. Therefore, it can be seen that there is no problem with the value of NUM as the numerator of the equation for obtaining the frequency.
- FIG. 19 is a diagram illustrating an example of a simulation result of the speed detection device disclosed in Patent Document 1
- FIG. 20 is a diagram illustrating an example of a simulation result of the speed detection device according to the fourth embodiment of the present invention. .
- the frequency calculation value F is saturated at 15.3 Hz in the operation of 701, because the pulse signal P is not input. Also, in the conventional speed detection device, as indicated by the operation 702, when the input signal IN is input for only one pulse from the state of the input frequency 0, the lowest recognition frequency is recognized.
- the hardware scale (the number of bits of the pulse counting unit 107 and the pulse timing unit 109) can be further reduced with a slight burden on the software. Can keep. Although there are rare cases where data is lost without being used as in the speed detection device disclosed in Patent Document 1, it cannot be said that the accuracy of the frequency is deteriorated.
- FIG. 16 is a diagram of a configuration example of the speed detection device according to the fifth embodiment of the present invention.
- the same reference numerals are given to the same parts as those in the first embodiment, and the description thereof is omitted, and only different parts will be described here.
- the speed detection device 1 of FIG. 16 has, as main components, a waveform shaping unit 101, a filter clock generation unit 102, a filter unit 105, an edge detection unit 106, a pulse counting unit 107, a time clock generation unit 103, The pulse timing unit 109, the capture clock generation unit 104, the overflow detection unit 108, the capture unit 110, the interrupt request unit 111, and the calculation unit 113 are configured.
- a noise removing filter unit 105 installed at a subsequent stage of the waveform shaping unit 101, and a filter clock generation unit 102 for supplying a clock necessary for the filter unit 105, have.
- the filter unit 105 is configured to sample the pulse signal P with the filter clock CK_FIL and change the output on the condition of a predetermined number of continuous matches.
- the noise frequency is generally high, and when mixed in the circuit, the pulse signal P changes at high speed. Therefore, the noise component can be completely cut if the number of continuous matches with the filter clock CK_FIL is appropriately set. Further, even if it is not the noise superimposed on the input signal IN, if the output waveform of the waveform shaping unit 101 becomes oscillating, it contains a high frequency component like the noise. It can be removed by this filter circuit. Furthermore, since the filter unit 105 is a filter, a slight response delay occurs, but it is sufficiently shorter than the capture cycle Tcap, and does not affect the subsequent system (not shown).
- the waveform shaping unit 101 may be insulated using a photocoupler.
- the duty ratio of the pulse signal P is large even if the duty ratio of the input signal IN is 50:50. It may be biased.
- the band obtained by the number of consecutive matches with the filter clock CK_FIL must be set to a band sufficiently higher than the band actually used in consideration of the deviation of the duty ratio. For example, it may be a recognizable band even when the duty ratio of the pulse signal P is 1:99 at the maximum input frequency on the specification.
- the speed detection device 1 is installed at the subsequent stage of the waveform shaping unit 101, samples the pulse signal P with the filter clock CK_FIL, and changes the output on the condition of several consecutive matches.
- a high noise filter effect can be obtained even when the output waveform of the waveform shaping unit 101 becomes oscillating. .
- FIG. 17 is a diagram of a configuration example of a speed detection device according to the sixth embodiment of the present invention.
- the same reference numerals are given to the same parts as those of the fifth embodiment, and the description thereof is omitted, and only different parts will be described here.
- the speed detection device 1 of FIG. 17 has, as main components, a waveform shaping unit 101, a filter clock generation unit 102, a filter unit 105, an edge detection unit 106, a pulse counting unit 107, a timing clock generation unit 103, The pulse timing unit 109, the capture clock generation unit 104, the overflow detection unit 108, the capture unit 110, the interrupt request unit 111, and the calculation unit 113 are configured.
- a filter unit 105 for noise removal installed at a subsequent stage of the waveform shaping unit 101, and a filter clock generation unit 102 for supplying a clock necessary for the filter unit 105 have.
- the 17 includes a plurality of waveform shaping units 101, filter units 105, edge detection units 106, pulse counting units 107, pulse timing units 109, overflow detection units 108, and capture units 110, and further includes a filter.
- the clock generator 102, the time clock generator 103, the capture clock generator 104, and the interrupt request unit 111 are configured. That is, the speed detection device 1 in FIG. 17 has a configuration in which the filter clock generation unit 102, the clock generation unit 103, the capture clock generation unit 104, and the interrupt request unit 111 are shared for a plurality of channels.
- the speed detection device 1 is shared by the clocking clock generation unit 103, the capture clock generation unit 104, the filter clock generation unit 102, and the interrupt request unit 111. Therefore, even when the number of channels is increased, the interrupt request IRQ occurrence frequency does not change, so that overhead to software can be suppressed.
- the speed detection device disclosed in Patent Document 1 when the number of channels is increased, interrupt requests IRQ are generated separately for each channel. Therefore, the interrupt request IRQ increases the interrupt frequency, and overhead to software is increased.
- the speed detection device 1 of the sixth embodiment even if the number of channels is increased, the frequency of interrupt request IRQ occurrence does not change, and overhead to software can be suppressed.
- the speed detection apparatus includes a waveform shaping unit 101, an edge detection unit 106, a clocking clock generation unit 103, and a capture clock generation unit 104.
- the present invention is not limited to this, and the waveform shaping unit 101, the edge detection unit 106, the timing clock generation unit 103, and the capture clock generation unit 104 are installed outside the speed detection device and obtained from the speed detection device.
- the pulse edge PE, the capture clock CK_CAP, and the clock CK_TIM may be used.
- speed detection device has been described by taking the speed detection device for railway vehicles as an example, it can also be applied to any device that measures frequency signals.
- present invention can be variously modified and implemented without departing from the spirit of the present invention.
- the speed detection device can be applied to any device that measures a frequency signal, including a speed detection device for a railway vehicle, and in particular, there is no deterioration in the accuracy of frequency, and data is always obtained.
- the invention is useful as an invention that is updated, has a relatively small circuit scale, and has little overhead on software.
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computational Mathematics (AREA)
- Computing Systems (AREA)
- Mathematical Analysis (AREA)
- Mathematical Optimization (AREA)
- Pure & Applied Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Measuring Frequencies, Analyzing Spectra (AREA)
Abstract
Description
図1は、本発明の実施の形態1にかかる速度検出装置の構成例を示す図である。速度検出装置1の役割は、入力信号INの周波数を検出することである。関連図は、図1~図9である。
・スペック設定ステップ301
キャプチャー周期Tcap、最大入力周波数Fmax、最小入力周波数Fmin、目標精度ACCtを設定する。例えば、
キャプチャー周期 Tcap=2.5ms
最大入力周波数 Fmax=8000Hz
最小入力周波数 Fmin=1Hz
目標精度 ACCt=200ppm*2.5ms=0.5ppm・s
とする。
・計時クロック周波数設定ステップ302
計時クロック周波数 Ftim≧1/ACCt-1/Tcap(例えば、≧1.9996MHzで、ここでは2.5MHzに設定する。)
・ハードウェア設定ステップ303
パルス計数必要ビット数 Nwidth=Roundup(log(Fmax*Tcap)/log(2),0)
パルス計時必要ビット数 Twidth=Roundup(log(Ftim*Tcap)/log(2),0)
例えば、両者は、それぞれ、5、13となるため、パルス計数部107のビット数を5、パルス計時部109のビット数を13に設定する。
・各種演算定数算出ステップ304
各種定数を求める。この値は、後述する演算部113で用いられる。
パルス計数マスク値0 NMASK0=2^Nwidth-1
パルス計数最大値 NMAX=Fmax*Tcap
パルス計時マスク値0 TMASK0=2^Twidth-1
キャプチャー周期指数 TCAP=Tcap*Ftim
パルス計時最大値 TMAX=Ftim/Fmin
例えば、上記はそれぞれ、0x1f、160、0x1fff、6250、2500000となる。
演算部113は、キャプチャー部110よりCN、CTを読み取りローカル変数XN、XTにコピーする。
・オーバーフロー処理ステップ202
演算部113は、図2、図3、図4の何れかを実施してオーバーフローフラグOVFFを得る。
・割込要求クリアステップ203
演算部113は、割込要求クリア要求ICRQを出力する。
・分子演算ステップ204
演算部113は、下記の式にて、ローカル変数NUMを求める。
NUM=MIN((XN-YN)&NMASK0,NMAX)
即ち、今回割込時におけるパルス計数レジスタの値(XN)から、前回割込時におけるパルス計数レジスタの値(YN)を減じた値に基づき、前回割込時から今回割込時の間(直前のキャプチャー周期Tcapの間)に入力されたパルスエッジの数NUMを求める。
・分母演算ステップ205
演算部113は、下記の式にて、XTを求める。
OVFF=0即ちオーバーフローなしの時、
XT=XT&TMASK0
即ち、演算部113は、パルス計時部109でオーバーフローが発生していない場合、パルス計時レジスタCTの値により、パルス計時データXTを求める。
それ以外、即ちオーバーフローありの時、
XT=MIN(YT+TCAP,TMAX)
このオーバーフローありの時の設定については、パルス計時レジスタCTがオーバーフローで無効であるため、前回値YTから計算しているのである。ただし、上限TMAXを設けている。なお、ソフトウェアで値を足しこんでいるので、周波数の精度劣化が発生するのかというと、そうではない。仮にパルス計時部109のビット幅が十分あったとしたら、キャプチャー周期Tcapの時間にキャプチャー周期指数TCAP分増加する。従って、これによる周波数の精度劣化はない。ハードウェア(パルス計時部109)は短い時間に関して分担し、ソフトウェアは長い時間に関して分担しているのである。即ち、演算部113は、パルス計時部109がオーバーフローしている場合、前回のパルス計時データ(YT)に、キャプチャークロック周期/計時クロック周期で得られる所定の定数値(TCAP)を加算して、最後のパルスエッジPEからの時間/計時クロック周期であるパルス計時データ(XT)を求める。
・周波数演算ステップ206
演算部113は、ステップ205で得られたパルス計時データ(XT)を用いて、下記演算式にて周波数演算値Fを算出する。
NUMが0のとき、
F=MIN(Ftim/XT,F)
即ち、演算部113は、所定の周期内に入力されたパルスエッジPEが0個の場合、直後にパルスエッジPEが入力されると仮定した周波数演算値(Ftim/XT)と、前回の周波数演算値Fと、の低い方の値を選択することにより、周波数演算値Fを推定する。
それ以外のとき、
F=NUM*Ftim/(TCAP+YT-XT)
・前回値設定ステップ207
演算部113は、次回の演算のために、XTと、XNを、前回値YTとYNとへ保存する。ここでひとつ注意点がある。※前回値YTはパルス計数最大値TMAXで初期化しなければならない。
次に、オーバーフローの検出方法が若干異なるものを紹介する。実施の形態1では、オーバーフローしているか否かをオーバーフロー検出部108のオーバーフローレジスタOVFで管理していた。実施の形態2では、オーバーフローしているか否かを、メモリーで管理する。それ以外は全く変わらないので、変更のある部分のみの説明を行う。
次に、さらにオーバーフローの検出方法が若干異なるものを紹介する。実施の形態1、2では、オーバーフローしているか否かをオーバーフロー検出部108および演算部113で協調して行うが、実施の形態3では、オーバーフローしているか否かを、オーバーフロー検出部108で自動的に判定し、演算部113では、このオーバーフローレジスタOVFを読み込んでオーバーフローフラグOVFFに設定する。
次に、ハードウェアの制約などにより、パルス計数部107のビット数や、パルス計時部109のビット数をあまり大きく出来ないが、精度を高める目的で、周波数を求める分母にあたるベース時間(=演算周期)を大きくしたいケースのために、実施の形態3に比べて、演算部113の構成を変更した実施の形態4を説明する。
・スペック設定ステップ601
演算周期Tcal、最大入力周波数Fmax、最小入力周波数Fmin、目標精度ACCtを設定する。例えば、
演算周期 Tcal=20ms
最大入力周波数 Fmax=8000Hz
最小入力周波数 Fmin=1Hz
目標精度 ACCt=25ppm*20ms=0.5ppm・s
とする。
・計時クロック周波数設定ステップ602
Ftim≧1/ACCt-1/Tcal 例えば、≧1.99995MHzで、ここでは2.5MHzに設定する。
・キャプチャー周期設定ステップ603
ハードウェア制約、ソフトウェア制約を考慮し、以下の条件を満たす様にキャプチャー周期Tcapを設定する。
パルス計数必要ビット数 Nwidth=Roundup(log(Fmax*Tcap)/log(2),0)
パルス計時必要ビット数 Twidth=Roundup(log(Ftim*Tcap)/log(2),0)
上記必要ビット数が大きくなると、ハードウェア制約となり、Tcapが小さくなると、割込頻度が増え、ソフトウェア制約となる。バランスを考慮して決定する。例えば、Tcap=2.5ms、Nwidth=5、Twidth=13に設定する。
・各種演算定数算出ステップ604
各種定数を求める。この値は後述する演算部113で用いられる。
パルス計数マスク値0(第1のマスク値) NMASK0 = 2^Nwidth-1
パルス計数最大値 NMAX = Fmax * Tcal
パルス計数マスク値1(第2のマスク値) NMASK1 = 2^(Roundup(log(NMAX)/log(2),0))-1
パルス計時マスク値0 TMASK0 = 2^Twidth-1
キャプチャー周期指数 TCAP = Tcap * Ftim
パルス計時最大値 TMAX = Ftim / Fmin
演算周期指数 TCAL = Tcal * Ftim
例えば、上記はそれぞれ、0x1f、160、0xff、0x1fff、6250、2500000、50000となる。
バッファ処理部901は、キャプチャー部110よりCN、CTを読み取り、ローカル変数XN、XTにコピーする。
・オーバーフロー処理402
バッファ処理部901は、図2、図3、図4の何れかを実施してオーバーフローフラグOVFFを得る。
・割込要求クリアステップ403
バッファ処理部901は、割込要求クリア要求ICRQを出力する。
・計数値編集ステップ404
バッファ処理部901は、下記の式にて、キャプチャー周期Tcap用から演算周期Tcal用にビット拡張した値XNを求める。
XN=(YN+(XN-YN)&NMASK0)&NMASK1
即ち、バッファ処理部901は、今回割込時におけるパルス計数レジスタXNの値から前回割込時におけるパルス計数レジスタYNの値を減じた値と、NMASK0と、の論理積から、前回割込時から今回割込時の間に入力されたパルスエッジの数を求める。さらに、バッファ処理部901は、前回のパルス計数データ(YN)に、前回割込時から今回割込時の間に入力されたパルスエッジの数を加算した値と、NMASK1と、の論理積により今回のパルス計数データ(XN)を求める。
・計時値編集ステップ405
バッファ処理部901は、下記の式にて、最後にパルスエッジPEが入力されてから、キャプチャークロックCK_CAPまでの時間XTを求める。
OVFF=0即ちオーバーフローなしの時、
XT=XT&TMASK0
即ち、バッファ処理部901は、パルス計時部109でオーバーフローが発生していない場合、パルス計時レジスタCTの値によって、パルス計時データXTを求める。
それ以外のとき、
XT=MIN(YT+TCAP,TMAX)
即ち、バッファ処理部901は、パルス計時部109でオーバーフローが発生している場合、前回のパルス計時データ(YT)に、キャプチャークロック周期/計時クロック周期で得られる所定の定数値(TCAP)を加算することで、最後のパルスエッジPEからの時間/計時クロック周期であるパルス計時データ(XT)を求める。
・バッファ更新ステップ406
バッファ処理部901は、次のリングバッファポインタの位置PNT2を求める。
下記の式にて、リングバッファを更新する。
N[PNT2]=XN
T[PNT2]=XT
・ポインタ更新ステップ407
バッファ処理部901は、リングバッファポインタPNTを更新する。
・前回値設定ステップ408
バッファ処理部901は、下記の式にて、前回値を設定する。
YN=XN
YT=XT
演算処理部902は、リングバッファポインタPNTを一度だけ参照し、ローカル変数C0には今回のポインタ位置を設定し、ローカル変数C1にはC0からTCAL/TCAP個分遡ったポインタ位置を設定する。
・分子演算ステップ502
演算処理部902は、下記の式にて、NUMを求める。
NUM = MIN((N[C0]-N[C1])&MASK1,NMAX)
即ち、演算処理部902は、リングバッファを参照して、今回のパルス計数データ(N[C0])から、所定の演算周期(TCAL/TCAP)分遡った位置のパルス計数データ(N[C1])を減じた値と、MASK1との論理積から、所定の演算周期の間に入力されたパルスエッジの数NUMを求める。
・周波数演算ステップ503
演算処理部902は、下記の式にて、Fを求める。
NUMが0のとき、
F=MIN(Ftim/T[C0],F)
それ以外のとき、
F=NUM*Ftim/(TCAL+T[C1]-T[C0])
次に、ノイズの影響を除去するために、フィルタ部105を追加した実施の形態5について説明する。図16は、本発明の実施の形態5にかかる速度検出装置の構成例を示す図である。以下、実施の形態1と同一部分には同一符号を付してその説明を省略し、ここでは異なる部分についてのみ述べる。
次に、多チャンネル化した実施の形態6について説明する。図17は、本発明の実施の形態6にかかる速度検出装置の構成例を示す図である。以下、実施の形態5と同一部分には同一符号を付してその説明を省略し、ここでは異なる部分についてのみ述べる。
101 波形整形部
102 フィルタクロック発生部
103 計時クロック発生部
104 キャプチャークロック発生部
105 フィルタ部
106 エッジ検出部
107 パルス計数部
108 オーバーフロー検出部
109 パルス計時部
110 キャプチャー部
111 割込要求部
113 演算部(周波数算出部)
701,702,801周波数演算値の波形
901 バッファ処理部
902 演算処理部
ACCt 目標精度
CK_CAP キャプチャークロック
CK_FIL フィルタクロック
CK_TIM 計時クロック
CN パルス計数レジスタ
CT パルス計時レジスタ
F 周波数演算値
Fmax 最大入力周波数
Fmin 最小入力周波数
Ftim 計時クロック周波数
ICRQ 割込要求クリア要求
IN 入力信号
IRQ 割込要求
LN ライブパルス計数値
LT ライブパルス計時値
N[ ] パルス計数リングバッファ
NMASK0 パルス計数マスク値0(第1のマスク値)
NMASK1 パルス計数マスク値1(第2のマスク値)
NMAX パルス計数最大値
NUM パルスエッジの数
Nwidth パルス計数必要ビット数
OVF オーバーフローレジスタ
OVFF オーバーフローフラグ
P パルス信号
PE パルスエッジ(パルス)
PNT リングバッファポインタ
T[ ] パルス計時リングバッファ
TCAL 演算周期指数
TCAP キャプチャー周期指数(所定の定数)
Tcap キャプチャー周期
Tcal 演算周期
TMASK0 パルス計時マスク値0
TMAX パルス計時最大値
Twidth パルス計時必要ビット数
Claims (10)
- 外部からの入力信号のパルス数を計数するパルス計数部と、
計時クロックによりカウントアップし、パルスによってクリアされることで、最後のパルスからの時間を計時するパルス計時部と、
前記パルス計時部がオーバーフローしたことを検出しオーバーフローレジスタに保持するオーバーフロー検出部と、
一定周期毎に測定結果を得るキャプチャークロックのタイミングで、前記パルス計数部からの出力をパルス計数レジスタに保持すると共に、前記パルス計時部からの出力をパルス計時レジスタに保持するキャプチャー部と、
前記パルス計数レジスタの値と、前記パルス計時レジスタの値と、前記オーバーフローレジスタの値と、を読み取り、所定の演算により、周波数演算値を算出する周波数算出部と、
を備え、
前記周波数算出部は、前記パルス計時部がオーバーフローした場合、前回割込時におけるパルス計時データに、前記キャプチャークロックの周期/前記計時クロックの周期で得られる所定の定数を加算して、最後のパルスからの時間/前記計時クロックであるパルス計時データを求めることにより、前記周波数演算値を算出すること、
を特徴とする速度検出装置。 - 外部からの入力信号のパルス数を計数するパルス計数部と、
計時クロックによりカウントアップし、パルスによってクリアされることで、最後のパルスからの時間を計時するパルス計時部と、
前記パルス計時部がオーバーフローしたことを検出しオーバーフローレジスタに保持するオーバーフロー検出部と、
一定周期毎に測定結果を得るキャプチャークロックのタイミングで、前記パルス計数部からの出力をパルス計数レジスタに保持すると共に、前記パルス計時部からの出力をパルス計時レジスタに保持するキャプチャー部と、
前記パルス計数レジスタの値と、前記パルス計時レジスタの値と、前記オーバーフローレジスタの値と、を読み取り、所定の演算により、周波数演算値を算出する周波数算出部と、
を備え、
前記周波数算出部は、所定の周期内に入力されたパルスが0個の場合、直後にパルスが入力されると仮定した周波数演算値と、前回の周波数演算値と、の低い方の値を選択することにより、周波数演算値を推定すること、
を特徴とする速度検出装置。 - 外部からの入力信号のパルス数を計数するパルス計数部と、
計時クロックによりカウントアップし、パルスによってクリアされることで、最後のパルスからの時間を計時するパルス計時部と、
前記パルス計時部がオーバーフローしたことを検出しオーバーフローレジスタに保持するオーバーフロー検出部と、
一定周期毎に測定結果を得るキャプチャークロックのタイミングで、前記パルス計数部からの出力をパルス計数レジスタに保持すると共に、前記パルス計時部からの出力をパルス計時レジスタに保持するキャプチャー部と、
前記パルス計数レジスタの値と、前記パルス計時レジスタの値と、前記オーバーフローレジスタの値と、を読み取り、所定の演算により、周波数演算値を算出する周波数算出部と、
を備え、
前記周波数算出部は、前記パルス計時部がオーバーフローした場合、前回割込時におけるパルス計時データに、前記キャプチャークロックの周期/前記計時クロックの周期で得られる所定の定数を加算して、最後のパルスからの時間/前記計時クロックであるパルス計時データを求めることにより、前記周波数演算値を算出し、
所定の周期内に入力されたパルスが0個の場合、直後にパルスが入力されると仮定した周波数演算値と、前回の周波数演算値と、の低い方の値を選択することにより、周波数演算値を推定すること、
を特徴とする速度検出装置。 - 前記オーバーフロー検出部は、
前記オーバーフローレジスタを、前記パルス計時部が所定の最大値を超えたことを検出してセットし、前記周波数算出部からクリアされるまで保持するように構成され、
前記周波数算出部は、
前回割込時のパルス計数レジスタの値と、今回割込時のパルス計数レジスタの値と、の差がない場合、オーバーフローが発生していないと判断すると共に、前記オーバーフローレジスタをクリアし、
前回割込時のパルス計数レジスタの値と、今回割込時のパルス計数レジスタの値と、の差がある場合、前記オーバーフローレジスタの値によりオーバーフローが発生しているか否かを判断すること、
を特徴とする請求項1~3のいずれか1つに記載の速度検出装置。 - 前記オーバーフロー検出部は、
前記オーバーフローレジスタを、パルス計時部が所定の最大値を超えたことを検出してセットし、前記周波数算出部からクリアされるまで保持するように構成され、
前記周波数算出部は、
前記オーバーフローレジスタがセットされている場合、所定のメモリーに、オーバーフローの発生を示すオーバーフローフラグをセットすると共に、前記オーバーフローレジスタをクリアし、
前回割込時のパルス計数レジスタの値と、今回割込時のパルス計数レジスタの値と、の差がある場合、オーバーフローが発生していないと判断し、前記オーバーフローフラグをクリアすること、
を特徴とする請求項1~3のいずれか1つに記載の速度検出装置。 - 前記オーバーフロー検出部は、
オーバーフロービットを、パルス計時部が所定の最大値を超えたことを検出してセットし、パルスによりクリアし、
前記キャプチャークロックにあわせて、前記オーバーフロービットを前記オーバーフローレジスタに保持すること、
を特徴とする請求項1~3のいずれか1つに記載の速度検出装置。 - 前記周波数算出部は、
パルス計時レジスタのビット数を拡張して保持する変数であるパルス計時データを備え、
今回割込時におけるパルス計数レジスタの値から、前回割込時におけるパルス計数レジスタの値を減じた値に基づき、前回割込時から今回割込時の間に入力されたパルスの数を求め、
前記パルス計時部でオーバーフローが発生していない場合、前記パルス計時レジスタの値により、パルス計時データを求め、
前記パルス計時部でオーバーフローが発生している場合、前回のパルス計時データに、前記キャプチャークロックの周期/前記計時クロックの周期で得られる所定の定数を加算することで、最後のパルスからの時間/前記計時クロックであるパルス計時データを求め、
下記演算式により周波数演算値を求めること、
を特徴とする請求項1~3のいずれか1つに記載の速度検出装置。
NUMが0以外の場合、
F=NUM*Ftim÷(TCAP+YT-XT)
NUMが0の場合、
F=MIN(Ftim÷XT,F)
ここで、
右辺に現れるFは、前回の周波数演算値。
左辺に現れるFは、今回の周波数演算値。
NUMは、前回割込時から今回割込時の間に入力されたパルスの数。
Ftimは、計時クロック周波数。
TCAPは、前記キャプチャークロックの周期を、計時クロックの周期で割った所定の定数。
XTは、今回割込時における最後のパルスからの時間/計時クロックの周期であるパルス計時データ。
YTは、前回割込時における最後のパルスからの時間/計時クロックの周期である前回のパルス計時データ。 - 前記周波数算出部は、
前記パルス計数レジスタの値と、前記パルス計時レジスタの値と、前記オーバーフローレジスタの値と、を読み取りバッファリングするバッファ処理部と、
前記キャプチャークロックの周期の整数倍の演算周期毎に起動し、前記バッファ処理部でバッファしたデータに基づき、演算周波数を算出する演算処理部と、
を有し、
前記バッファ処理部は、
前記パルス計数レジスタの値と前記パルス計時レジスタの値とを時系列的に記憶するリングバッファと、前記リングバッファの現在の位置を保持するリングバッファポインタとを備え、
今回割込時におけるパルス計数レジスタの値から前回割込時におけるパルス計数レジスタの値を減じた値と、第1のマスク値と、の論理積から前回割込時から今回割込時の間に入力されたパルスの数を求め、
前回のパルス計数データに、前回割込時から今回割込時の間に入力されたパルスの数を加算した値と、第2のマスク値と、の論理積により今回のパルス計数データを求め、
ここで、マスク値は2のべき乗-1の形式で表され、第2のマスク値は第1のマスク値より大きい値であり、
前記パルス計時部でオーバーフローが発生していない場合、前記パルス計時レジスタの値により、パルス計時データを求め、
前記パルス計時部でオーバーフローが発生している場合、前回のパルス計時データに、前記キャプチャークロックの周期/前記計時クロックの周期で得られる所定の定数を加算することで、最後のパルスからの時間/前記計時クロックであるパルス計時データを求め、
リングバッファの現在の位置の次の位置に、パルス計数データおよびパルス計時データを保存してからポインタを更新する処理を含み、
前記演算処理部は、
ポインタの値を参照し、今回のポインタ位置と、今回のポインタ位置から所定の演算周期分過去に遡ったポインタ位置と、を求め、
リングバッファを参照して、今回のパルス計数データから、所定の演算周期分過去のパルス計数データを減じた値と、第2のマスク値と、の論理積から、所定の演算周期の間に入力されたパルスの数を求め、
下記演算式により周波数演算値を求めること、
を特徴とする請求項1~3のいずれか1つに記載の速度検出装置。
NUMが0以外の場合、
F=NUM*Ftim÷(TCAL+T[C1]-T[C0])
NUMが0の場合、
F=MIN(Ftim÷T[C0],F)
ここで、
右辺に現れるFは、前回の周波数演算値。
左辺に現れるFは、今回の周波数演算値。
NUMは、所定の演算周期の間に入力されたパルスの数。
Ftimは、計時クロック周波数。
TCALは、所定の演算周期を、計時クロック周期で割った所定の定数。
T[C0]は、今回のパルス計時データ。
T[C1]は、所定の演算周期分過去のパルス計時データ。 - 前記波形整形部の後段に設置されたフィルタ部と、
前記フィルタ部に必要なクロックを供給するフィルタクロック発生部と、
を備え、
前記フィルタ部は、フィルタクロックでパルス信号をサンプリングし、所定回数の連続一致を条件に、出力を変化させること、
を特徴とする請求項1~3のいずれか1つに記載の速度検出装置。 - 前記エッジ検出部と、前記パルス計数部と、前記オーバーフロー検出部と、前記パルス計時部と、前記キャプチャー部と、前記フィルタ部とを複数備え、
前記フィルタクロック発生部を共用すること、
を特徴とする請求項9に記載の速度検出装置。
Priority Applications (4)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201080065451.3A CN102792167B (zh) | 2010-03-16 | 2010-03-16 | 速度检测装置 |
JP2011532411A JP4912511B2 (ja) | 2010-03-16 | 2010-03-16 | 速度検出装置 |
PCT/JP2010/054428 WO2011114438A1 (ja) | 2010-03-16 | 2010-03-16 | 速度検出装置 |
US13/582,313 US9151772B2 (en) | 2010-03-16 | 2010-03-16 | Speed detection device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/JP2010/054428 WO2011114438A1 (ja) | 2010-03-16 | 2010-03-16 | 速度検出装置 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2011114438A1 true WO2011114438A1 (ja) | 2011-09-22 |
Family
ID=44648570
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/JP2010/054428 WO2011114438A1 (ja) | 2010-03-16 | 2010-03-16 | 速度検出装置 |
Country Status (4)
Country | Link |
---|---|
US (1) | US9151772B2 (ja) |
JP (1) | JP4912511B2 (ja) |
CN (1) | CN102792167B (ja) |
WO (1) | WO2011114438A1 (ja) |
Families Citing this family (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9686062B2 (en) * | 2011-03-04 | 2017-06-20 | Alcatel Lucent | Virtual aggregation of fragmented wireless spectrum |
FR3037392B1 (fr) * | 2015-06-12 | 2018-11-09 | Renault S.A.S. | Procede de calcul d'une vitesse de roue et dispositif de mesure correspondant |
US10788853B2 (en) * | 2017-01-31 | 2020-09-29 | Texas Instruments Incorporated | Interrupt handling method and apparatus for slow peripherals |
CN109375128B (zh) * | 2018-10-15 | 2020-09-15 | 合肥本源量子计算科技有限责任公司 | 一种载频脉冲信号频率校准方法 |
CN111141926B (zh) * | 2019-12-27 | 2022-06-03 | 宁波三星智能电气有限公司 | 一种充电桩内的风机转速检测方法 |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPS59214920A (ja) * | 1983-05-20 | 1984-12-04 | Yaskawa Electric Mfg Co Ltd | パルス周波数演算方式 |
JPH0618538A (ja) * | 1992-02-05 | 1994-01-25 | Shinko Electric Co Ltd | 速度検出装置 |
JP2007045395A (ja) * | 2005-07-15 | 2007-02-22 | Denso Corp | 代替入力制御方法および代替入力制御装置 |
Family Cites Families (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH061279B2 (ja) * | 1982-12-01 | 1994-01-05 | 株式会社日立製作所 | デイジタル式速度検出装置 |
JPH04121085A (ja) * | 1990-09-10 | 1992-04-22 | Hitachi Ltd | ディジタルパルス処理装置 |
JPH04350564A (ja) * | 1991-05-28 | 1992-12-04 | Zexel Corp | パルスの発生周期演算方法 |
JP2742371B2 (ja) | 1993-08-17 | 1998-04-22 | ローム株式会社 | Vtrのマイコンサーボ系におけるモータ起動回路 |
JP2945284B2 (ja) | 1994-11-08 | 1999-09-06 | 神鋼電機株式会社 | 速度検出装置 |
JPH08233842A (ja) | 1995-02-28 | 1996-09-13 | Mitsubishi Electric Corp | 速度検出装置およびその異常検出方法 |
US6219624B1 (en) * | 1998-08-03 | 2001-04-17 | Visteon Global Technologies, Inc. | Synchronous timer vehicle speed measurement |
JP2000074962A (ja) | 1998-08-28 | 2000-03-14 | Nec Ic Microcomput Syst Ltd | 周期計測装置および周期計測方法、並びに記録媒体 |
DE102006032788A1 (de) | 2005-07-15 | 2007-03-29 | Denso Corp., Kariya | Alternatives Eingabesteuerverfahren und -vorrichtung |
JP4761525B2 (ja) | 2005-09-15 | 2011-08-31 | サミー株式会社 | 基板ユニット |
-
2010
- 2010-03-16 CN CN201080065451.3A patent/CN102792167B/zh not_active Expired - Fee Related
- 2010-03-16 JP JP2011532411A patent/JP4912511B2/ja not_active Expired - Fee Related
- 2010-03-16 US US13/582,313 patent/US9151772B2/en not_active Expired - Fee Related
- 2010-03-16 WO PCT/JP2010/054428 patent/WO2011114438A1/ja active Application Filing
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPS59214920A (ja) * | 1983-05-20 | 1984-12-04 | Yaskawa Electric Mfg Co Ltd | パルス周波数演算方式 |
JPH0618538A (ja) * | 1992-02-05 | 1994-01-25 | Shinko Electric Co Ltd | 速度検出装置 |
JP2007045395A (ja) * | 2005-07-15 | 2007-02-22 | Denso Corp | 代替入力制御方法および代替入力制御装置 |
Also Published As
Publication number | Publication date |
---|---|
US9151772B2 (en) | 2015-10-06 |
JP4912511B2 (ja) | 2012-04-11 |
US20120323523A1 (en) | 2012-12-20 |
JPWO2011114438A1 (ja) | 2013-06-27 |
CN102792167A (zh) | 2012-11-21 |
CN102792167B (zh) | 2014-09-03 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP4912511B2 (ja) | 速度検出装置 | |
US9647606B2 (en) | Counter based circuit for measuring movement of an object | |
EP3598179A1 (en) | Seismic sensor and earthquake determination method | |
KR101240798B1 (ko) | 리얼타임클럭 주파수 오프셋 검출장치 및 그 방법 | |
JP3750924B2 (ja) | 放射線モニタ | |
JPH04344466A (ja) | エレベータの速度検出装置 | |
JP6000652B2 (ja) | パルスモータ制御装置およびパルス信号生成方法 | |
CN112484844A (zh) | 一种变压器噪声抗环境干扰检测方法及系统 | |
JP5678868B2 (ja) | 信号処理装置 | |
JPH0340847B2 (ja) | ||
KR850002115A (ko) | 전자식 점화 제어장치 | |
KR19990043005A (ko) | 증분형 엔코더를 이용한 전동기 속도 검출 장치 | |
US20060171494A1 (en) | Method and system for indicating zero-crossings of a signal in the presence of noise | |
EP3321764A1 (en) | Clock frequency detection method and apparatus | |
JPH04157374A (ja) | パルスくり返し間隔測定回路 | |
KR19980054686A (ko) | 전동기에 있어서 속도검출방법 및 장치 | |
JP3049671B2 (ja) | 直流電動機の速度制御装置 | |
JP2533707Y2 (ja) | 可変周期パルスのカウント装置 | |
JPH02295217A (ja) | パルス計測回路 | |
JP6374350B2 (ja) | タイマ同期システム | |
JP3842880B2 (ja) | クロックの周波数異常検出回路および方法 | |
KR19990001541A (ko) | 속도검출방법 및 장치 | |
JP2015106748A (ja) | ノイズ除去装置及びノイズ除去方法 | |
JP3256356B2 (ja) | 時間差測定方法 | |
JPH03100473A (ja) | パルス列入力処理装置 |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
WWE | Wipo information: entry into national phase |
Ref document number: 201080065451.3 Country of ref document: CN |
|
WWE | Wipo information: entry into national phase |
Ref document number: 2011532411 Country of ref document: JP |
|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 10847854 Country of ref document: EP Kind code of ref document: A1 |
|
WWE | Wipo information: entry into national phase |
Ref document number: 13582313 Country of ref document: US |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 10847854 Country of ref document: EP Kind code of ref document: A1 |