WO2011114438A1 - 速度検出装置 - Google Patents

速度検出装置 Download PDF

Info

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
Application number
PCT/JP2010/054428
Other languages
English (en)
French (fr)
Inventor
広 吉川
Original Assignee
三菱電機株式会社
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 三菱電機株式会社 filed Critical 三菱電機株式会社
Priority to CN201080065451.3A priority Critical patent/CN102792167B/zh
Priority to JP2011532411A priority patent/JP4912511B2/ja
Priority to PCT/JP2010/054428 priority patent/WO2011114438A1/ja
Priority to US13/582,313 priority patent/US9151772B2/en
Publication of WO2011114438A1 publication Critical patent/WO2011114438A1/ja

Links

Images

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01PMEASURING LINEAR OR ANGULAR SPEED, ACCELERATION, DECELERATION, OR SHOCK; INDICATING PRESENCE, ABSENCE, OR DIRECTION, OF MOVEMENT
    • G01P3/00Measuring linear or angular speed; Measuring differences of linear or angular speeds
    • G01P3/42Devices characterised by the use of electric or magnetic means
    • G01P3/44Devices characterised by the use of electric or magnetic means for measuring angular speed
    • G01P3/48Devices characterised by the use of electric or magnetic means for measuring angular speed by measuring frequency of generated current or voltage
    • G01P3/481Devices 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/489Digital circuits therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F7/00Methods or arrangements for processing data by operating upon the order or content of the data handled
    • G06F7/38Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation
    • G06F7/48Methods 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/499Denomination or exception handling, e.g. rounding or overflow
    • G06F7/49905Exception handling
    • G06F7/4991Overflow or underflow
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01PMEASURING LINEAR OR ANGULAR SPEED, ACCELERATION, DECELERATION, OR SHOCK; INDICATING PRESENCE, ABSENCE, OR DIRECTION, OF MOVEMENT
    • G01P3/00Measuring linear or angular speed; Measuring differences of linear or angular speeds
    • G01P3/42Devices characterised by the use of electric or magnetic means
    • G01P3/44Devices characterised by the use of electric or magnetic means for measuring angular speed
    • G01P3/48Devices characterised by the use of electric or magnetic means for measuring angular speed by measuring frequency of generated current or voltage
    • G01P3/481Devices 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

 パルス計数部107と、パルス計時部109と、オーバーフローレジスタOVFに保持するオーバーフロー検出部108と、パルス計数部107の出力をパルス計数レジスタCNに保持しパルス計時部109の出力をパルス計時レジスタCTに保持するキャプチャー部110と、パルス計数レジスタCNとパルス計時レジスタCTとオーバーフローレジスタOVFとを読み取り周波数演算値Fを算出する演算部113(周波数算出部)と、を備え、演算部113は、パルス計時部109がオーバーフローした場合、前回割込時におけるパルス計時データ(YT)に、キャプチャークロックCK_CAPの周期/計時クロックCK_TIMの周期で得られる所定の定数(TCAP)を加算して、最後のパルスPEからの時間/計時クロックCK_TIMの周期で得られるパルス計時データ(XT)を求める。

Description

速度検出装置
 本発明は、運動物体の速度、回転速度、または回転数等に比例した周波数を有する交流信号を検出する速度検出装置に関する。
 従来から、パルス信号から運動物体(電気車両等)の速度を検出し、種々の制御(例えば、空転や滑走の防止)等に用いる装置がよく知られている。例えば、下記特許文献1~2に示される速度検出装置が挙げられる。
特開平8-233842号公報 特開平8-136563号公報
 しかし、上記特許文献1に示される速度検出装置は、パルス計数レジスタとパルス計時レジスタとのセットが得られる周期であるキャプチャー周期が一定していないため、後段でデジタルフィルタ処理を入れ難いという課題があった。そのためデジタルフィルタ処理を後段に入れる場合には、マイクロプロセッサ側の演算周期毎に、そのとき得られている最新のパルス計数レジスタとパルス計時レジスタとのセットを用いて周波数を求め、バッファリングしていくことになる。そのため、場合によっては一部のデータは使われずに捨てられる状況もあり、周波数の精度劣化の要因になっているという課題があった。
 また、上記特許文献2に示される速度検出装置では、パルスの時間を測定するためのカウンターの値をラッチするのに、パルスエッジでラッチし、さらにキャプチャークロックでさらにラッチさせるため、ハードウェアリソースが余分に必要であるという課題があった。
 また、上記特許文献2に示される速度検出装置では、所定の周期内にパルスエッジが1個も入力されなかった場合と、オーバーフローが発生している場合との処置内容が明示されていないという課題があった。
 本発明は、上記に鑑みてなされたものであって、周波数の精度劣化がなく、常にデータ更新され、回路規模も比較的小さく、ソフトウェアへのオーバーヘッドも少ない速度検出装置を得ることを目的とする。
 上述した課題を解決し、目的を達成するために、本発明は、外部からの入力信号のパルス数を計数するパルス計数部と、計時クロックによりカウントアップし、パルスによってクリアされることで、最後のパルスからの時間を計時するパルス計時部と、前記パルス計時部がオーバーフローしたことを検出しオーバーフローレジスタに保持するオーバーフロー検出部と、一定周期毎に測定結果を得るキャプチャークロックのタイミングで、前記パルス計数部からの出力をパルス計数レジスタに保持すると共に、前記パルス計時部からの出力をパルス計時レジスタに保持するキャプチャー部と、前記パルス計数レジスタの値と、前記パルス計時レジスタの値と、前記オーバーフローレジスタの値と、を読み取り、所定の演算により、周波数演算値を算出する周波数算出部と、を備え、前記周波数算出部は、前記パルス計時部がオーバーフローした場合、前回割込時におけるパルス計時データに、前記キャプチャークロックの周期/前記計時クロックの周期で得られる所定の定数を加算して、最後のパルスからの時間/前記計時クロックであるパルス計時データを求めることにより、前記周波数演算値を算出すること、を特徴とする。
 この発明によれば、キャプチャー周期を一定にしているため、周波数の精度劣化がなく、常にデータ更新され、回路規模も比較的小さく、ソフトウェアへのオーバーヘッドも少なくできるという効果を奏する。
図1は、本発明の実施の形態1にかかる速度検出装置の構成例を示す図である。 図2は、図1のオーバーフロー検出部と演算部との構成例を示す図である。 図3は、本発明の実施の形態2にかかる速度検出装置のオーバーフロー検出部と演算部との構成例を示す図である。 図4は、本発明の実施の形態3にかかる速度検出装置のオーバーフロー検出部と演算部との構成例を示す図である。 図5は、図1の速度検出装置の設計手順の一例を示す図である。 図6は、図1の演算部の処理手順の一例を示す図である。 図7は、図1の演算部の処理内容の説明図である。 図8は、図1の速度検出装置のハードウェア部分の一の動作を説明するための図である。 図9は、図1の速度検出装置のハードウェア部分の他の動作を説明するための図である。 図10は、本発明の実施の形態4にかかる演算部の構成例を示す図である。 図11は、本発明の実施の形態4にかかる速度検出装置の設計手順の一例を示す図である。 図12は、図10のバッファ処理部の処理手順の一例を示す図である。 図13は、図10の演算処理部の処理手順の一例を示す図である。 図14は、図10の演算部の処理内容の説明図である。 図15は、図10の演算部の他の処理内容の説明図である。 図16は、本発明の実施の形態5にかかる速度検出装置の構成例を示す図である。 図17は、本発明の実施の形態6にかかる速度検出装置の構成例を示す図である。 図18は、特許文献1に示される速度検出装置の精度劣化の一例を示す図である。 図19は、特許文献1に示される速度検出装置のシミュレーション結果の一例を示す図である。 図20は、本発明の実施の形態4にかかる速度検出装置のシミュレーション結果の一例を示す図である。
 以下に、本発明にかかる速度検出装置の実施の形態を図面に基づいて詳細に説明する。なお、この実施の形態によりこの発明が限定されるものではない。
実施の形態1.
 図1は、本発明の実施の形態1にかかる速度検出装置の構成例を示す図である。速度検出装置1の役割は、入力信号INの周波数を検出することである。関連図は、図1~図9である。
 実施の形態1の速度検出装置1は、主たる構成として、波形整形部101と、エッジ検出部106と、パルス計数部107と、計時クロック発生部103と、パルス計時部109と、キャプチャークロック発生部104と、オーバーフロー検出部108と、キャプチャー部110と、割込要求部111と、演算部(周波数算出部)113と、を有して構成されている。
 速度検出装置1は、図1では単体の装置のように記載しているが、ある装置の一部の機能であってもよい。名前も速度検出装置でなくてもよく、「**制御装置」や、「**制御システム」と呼ばれることもある。
 本明細書の中では、数式の中に右辺と左辺に同じ変数名が出てくることがある。その場合右辺の変数前回値を使うことを意味している。
 波形整形部101は、入力信号INを波形整形して矩形波(パルス信号P)に変換すると共に、フォトカプラなどを用いて入力信号INと装置内部の信号の絶縁を行う。
 エッジ検出部106は、パルス信号Pの立ち上がりまたは立下りのどちらか一方のエッジのみを検出し、パルスエッジ(パルス)PEとして出力する。このパルスエッジPEは、エッジが検出された瞬間だけ所定のパルス幅のHとなり、それ以外はLとなる。
 計時クロック発生部103は、パルス計時部109が時間を計測するための計時クロックCK_TIMを発生する。
 キャプチャークロック発生部104は、一定周期毎に測定結果を得るためのタイミングであるキャプチャークロックCK_CAPを発生する。
 パルス計数部107は、出力値の初期状態が0であり、エッジ検出部106からのパルスエッジPEによって、出力値をカウントアップするように構成されている。つまり、このカウンターにはリセット条件はなく、フリーランで動作する。
 パルス計時部109は、計時クロック発生部103からの計時クロックCK_TIMによりカウントアップし、エッジ検出部106からのパルスエッジPEによってクリアされることで、最後のパルスエッジPEからの時間を測定する。
 キャプチャー部110は、キャプチャークロック発生部104からのキャプチャークロックCK_CAPのタイミングで、パルス計数部107からのライブパルス計数値LNをパルス計数レジスタCNに保持する。また、キャプチャー部110は、キャプチャークロック発生部104からのキャプチャークロックCK_CAPのタイミングで、パルス計時部109からのライブパルス計時値LTをパルス計時レジスタCTに保持する。
 ここで、パルス計時部109とキャプチャー部110とオーバーフロー検出部108との関係を説明する。パルス計時部109は、最後に入力したパルスエッジPEからの時間を計測していて、キャプチャーが発生した際に、キャプチャー部110によって、その瞬間の値がキャプチャーされる。キャプチャー部110は、最後に入力したパルスエッジPEからキャプチャーが発生するまでの時間を保持していることになる。また、このタイマー(パルス計時部109)は、キャプチャー周期Tcapの間を十分に測定可能なビット幅を用意すればよく、それ以上に長い間パルスエッジPEが入力されない場合、オーバーフローして、オーバーフロー検出部108でオーバーフローが検出される。
 割込要求部111は、キャプチャークロック発生部104からのキャプチャークロックCK_CAPのタイミングで、割込要求IRQを出力する。また、割込要求部111は、演算部113からの割込要求クリア要求ICRQ(図示せず)によって、割込要求IRQを取りやめる。なお、割込要求クリア要求ICRQに関しては、後述する。
 図2は、図1のオーバーフロー検出部と演算部との構成例を示す図である。オーバーフロー検出部108は、パルス計時部109からのライブパルス計時値LTが所定の最大値を超えたことを検出してオーバーフローレジスタOVFをセット(OVF=1)し、演算部113からリセットされるまでオーバーフローレジスタOVFを保持する。
 演算部113は、オーバーフローレジスタOVFがセットされている場合であっても、前回割込時のパルス計数レジスタの値と、今回割込時のパルスレジスタの値と、の差があるとき、オーバーフローが発生していないと判断するとともに、オーバーフローレジスタOVFをリセットする。また、演算部113は、前回割込時のパルス計数レジスタの値と、今回割込時のパルス計数レジスタの値と、の差が無い場合には、オーバーフローレジスタOVFの値により、オーバーフローが発生しているか否かを判断する。オーバーフローしているか否かは、オーバーフローフラグOVFFに設定される。
 図8および図9に、実施の形態1にかかる速度検出装置1の動作の一例を示す。
 図8は、図1の速度検出装置のハードウェア部分の一の動作を説明するための図である。図8には、オーバーフローが発生していない場合における各信号のタイミングチャートが示されている。ライブパルス計数値LNは、パルスエッジPEに応じてカウントアップされ、キャプチャークロックCK_CAPのタイミングでパルス計数レジスタCNに保持される。ライブパルス計時値LTは、最後のパルスエッジPEが入力されてから次のパルスエッジPEによってクリアされるまで増加し、キャプチャークロックCK_CAPのタイミングでパルス計時レジスタCTに保持される。
 図9は、図1の速度検出装置のハードウェア部分の他の動作を説明するための図である。図9には、オーバーフローが発生している場合における各信号のタイミングチャートが示され、ライブパルス計数値LNは、パルス計数レジスタCNに保持され、ライブパルス計時値LTは、パルス計時レジスタCTに保持される。
 例えば、図9の場合、演算部113は、2つめのキャプチャークロックCK_CAPの後、前回割込時のパルス計数レジスタの値と、今回割込時のパルス計数レジスタの値と、の差があるため、オーバーフローが発生していないと判断し、オーバーフローレジスタOVFの値をクリアする。ここで、図9の2つめのキャプチャークロックCK_CAPから3つめのキャプチャークロックCK_CAPまでの間で、ライブパルス計時値LTが所定の最大値を超えたため、オーバーフロー検出部108は、オーバーフローレジスタOVFをセット(OVF=1)する。演算部113は、前回割込時のパルス計数レジスタの値と、今回割込時のパルス計数レジスタの値との差が無く、かつ、OVFの値が1であることで、オーバーフローが発生していると判断する。
 図5は、図1の速度検出装置の設計手順の一例を示す図である。以下、速度検出装置1の設計手順例を説明する。
・スペック設定ステップ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となる。
 図6は、図1の演算部の処理手順の一例を示す図である。演算部113は、割込要求IRQにより起動し、主たる構成として、データ読込ステップ201と、オーバーフロー処理ステップ202と、割込要求クリアステップ203と、分子演算ステップ204と、分母演算ステップ205と、周波数演算ステップ206と、前回値設定ステップ207と、を有して構成されている。なお、計時クロック周期は、1/計時クロック周波数Ftimである。
・読込ステップ201
 演算部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で初期化しなければならない。
 ここで、図7を用いて、演算部113の処理を解説する。図7は、図1の演算部の処理内容の説明図である。CASE1は、図7の1つめのキャプチャークロックCK_CAPが入力されてから、2つめのキャプチャークロックCK_CAPが入力されるまでの間に、パルスエッジPEが1個以上入ってきている例である。図では、パルスエッジPEの数NUMが12個であり、また(TCAP+YT-XT)/Ftimと記載した区間には、パルス周期が12周期ある。よって、周波数演算値Fを求める式の分子として、NUMの値で問題ないことが分かる。
 また、周波数演算値Fを求める式の分母、つまり12周期分の時間については、(TCAP+YT-XT)/Ftim、と図示したところをみれば、TCAP/Ftim、と図示した時間より、YT/Ftim分左側が長く、XT/Ftim分右側が短くなっていることから、(TCAP+YT-XT)/Ftimで正しいことは明白だろう。
 そのため、周波数演算値Fを求める式として「F=NUM*Ftim/(TCAP+YT-XT)」が正しいことが分かる。
 次にCASE2では、図7の1つめのキャプチャークロックCK_CAPが入力されてから、2つめのキャプチャークロックCK_CAPが入力されるまで間(所定の周期内)に、パルスエッジPEが1つも入ってきていない状態である。このとき、情報としては、パルスエッジPEが入ってきていないからといって何もないのではなく、現時点で、最後のパルスエッジPEからXT/Ftimだけ経過しているため、少なくとも、周波数としてFtim/XTよりは小さいことは明白である。従って、演算部113は、前回の周波数演算値FとFtim/XTとの小さい方を、新しい周波数演算値Fとして出力する。つまり「F=MIN(Ftim/XT,F)」という式を使っている。
 このように、演算部113は、所定の周期内に入力されたパルスエッジの数が0個であっても、直後に仮にパルスエッジPEが入力されると仮定した周波数演算値(即ち、計時クロック周波数/パルス計時データで得られる値)と、前回の周波数演算値(F)と、の低い方の値を選択することにより、周波数演算値Fを推定する。
 図18は、特許文献1に示される速度検出装置の精度劣化の一例を示す図である。図18には、パルス計数レジスタとパルス計時レジスタとのセットが得られる周期であるキャプチャー周期Tcap(キャプチャータイミング)と、マイクロプロセッサ側の演算周期Tcalとが示されている。図18に示すように、特許文献1に示される速度検出装置では、キャプチャー周期Tcapが一定でないため、デジタルフィルタ処理を後段に入れた場合には、マイクロプロセッサ側の演算周期毎に得られる最新のパルス計数レジスタとパルス計時レジスタとのセットを用いて周波数を求め、バッファリングしていくことになる。従って、図18に示すように、一部のデータが使われずに捨てられる場合があり、周波数の精度劣化の要因になっていた。一方、実施の形態1にかかる速度検出装置1では、このような問題が発生しない。
 以上説明したように、実施の形態1にかかる速度検出装置1は、パルス計数部107と、パルス計時部109と、計時クロック発生部103と、キャプチャークロック発生部104と、オーバーフロー検出部108と、キャプチャー部110と、演算部113とを有し、キャプチャー周期Tcapが一定になるようにしたので、特許文献1に示される速度検出装置のように、一部のデータが使われずに捨てられるというケースがなく、周波数の精度劣化が生じない。
 また、実施の形態1にかかる速度検出装置1は、パルスエッジPEが入ってくるかどうかに関わらず、キャプチャークロックCK_CAPによって定期的にデータ(周波数演算値F)の取得が行われ、データが更新されるので、下記特許文献1に示される速度検出装置であったような、パルスエッジPEが無いときにデータが更新されないといった問題は発生しない。即ち、特許文献1に示される速度検出装置では、パルスエッジPEが入力されない場合、パルス計数レジスタとパルス計時レジスタとのセット(キャプチャー周期Tcap)が得られないため、最新の周波数演算値Fが求めることができないという問題があった。さらに、その対処方法として、パルス信号が長期に渡って入力されていないことを検出するパルス欠落検出手段を設け、パルス欠落しているときには、周波数演算値を0と認識するという処理を行わなければならなかったが、本発明の実施の形態1にかかる速度検出装置1では、このようなパルス欠落検出手段は不要である。
 また、実施の形態1にかかる速度検出装置1では、キャプチャークロックCK_CAPによって定期的にデータ取得が行われるため、ハードウェアのタイマーに大きな値を格納する必要がなく、格段に小さなリソースによって低い周波数に対応できる。即ち、特許文献1に示される速度検出装置では、低い周波数まで認識可能とするためには、その周波数に相当する周期分の時間を測定可能な容量の時間計測回路を設けなければならない。例えば、計時用クロック=1MHz、16ビット幅のパルス計時部で計時する場合、1MHz/65536=15.3Hzが測定可能な下限周波数となる。このように、特許文献1に示される速度検出装置では、低い周波数に対応するために大きなハードウェアリソースが必要となるという問題があったのに対して、本発明の実施の形態1にかかる速度検出装置1では、このような大きなハードウェアリソースが不要である。
 また、実施の形態1にかかる速度検出装置1によれば、パルスの時間測定用カウンターを1つのラッチのみで構成すればよい(本実施の形態では、キャプチャー部110のパルス計時レジスタCT)。即ち、特許文献2に示される速度検出装置では、パルスの時間を測定するためのカウンターの値をラッチするためにパルスエッジでラッチし、さらにキャプチャークロックでさらにラッチさせるため、二重のラッチが必要であったが、本発明の実施の形態1にかかる速度検出装置1では、余分なハードウェアリソースが不要である。
 また、実施の形態1にかかる速度検出装置1は、パルス計時部109がオーバーフローした場合、前回割込時におけるパルス計時データ(YT)に、キャプチャークロック周期/計時クロック周期で得られる所定の定数値(TCAP)を加算することで、最後のパルスエッジPEからの時間/計時クロック周期であるパルス計時データ(XT)を求めるように構成されている。特許文献2に示される速度検出装置は、オーバーフローが発生している場合の処置内容が明示されていなかったが、本発明の実施の形態1にかかる速度検出装置1では、これらの処置内容も明確に示している。
 また、実施の形態1にかかる速度検出装置1によれば、所定の周期内に入力されたパルスエッジの数が0個の場合、直後に仮にパルスエッジPEが入力されると仮定した周波数演算値と、前回の周波数演算値と、の低い方の値を選択するようにしたので、パルスエッジPEが入ってくるかどうかに関わらず、計時クロックCK_TIMによって、定期的に周波数演算値Fを得ることが可能である。特許文献2に示される速度検出装置は、所定の周期内にパルスエッジPEが1つも入力されなかった場合の処置内容が明示されていなかったが、本発明の実施の形態1にかかる速度検出装置1では、これらの処置内容も明確に示している。
実施の形態2.
 次に、オーバーフローの検出方法が若干異なるものを紹介する。実施の形態1では、オーバーフローしているか否かをオーバーフロー検出部108のオーバーフローレジスタOVFで管理していた。実施の形態2では、オーバーフローしているか否かを、メモリーで管理する。それ以外は全く変わらないので、変更のある部分のみの説明を行う。
 図3は、本発明の実施の形態2にかかる速度検出装置のオーバーフロー検出部と演算部との構成例を示す図である。オーバーフロー検出部108は、実施の形態1と同様である。
 演算部113は、オーバーフローしているか否かを判断し、オーバーフローフラグOVFFをメモリーに保持するように構成され、オーバーフローレジスタOVFがセットされている場合、オーバーフローが発生していると判断してオーバーフローフラグOVFFをセットするとともに、オーバーフロー検出部108のオーバーフローレジスタOVFをクリアする。また、前回割込時のパルス計数レジスタの値と、今回割込時のパルス計数レジスタの値と、の差がある場合、演算部113は、オーバーフローが発生していないと判断してオーバーフローフラグOVFFをクリアする。
 図3のオーバーフロー検出部108および演算部113の動作を説明する。図3のオーバーフロー検出部108は、ライブパルス計時値LTが最大値を超えたとき、オーバーフローレジスタOVFをセットする。演算部113は、割込処理によって、オーバーフローフラグOVFFをセットし、オーバーフローフラグOVFFを保持するとともに、オーバーフロー検出部108のオーバーフローレジスタOVFをクリアする。即ち、オーバーフローレジスタOVFが0から1に変化したとき、オーバーフローフラグOVFFが保持されるとともに、オーバーフローレジスタOVFがクリアされる。
 以上説明したように、実施の形態2にかかる速度検出装置1は、オーバーフローしているか否かを判断し、オーバーフローフラグOVFFをメモリーに保持するように構成されているので、実施の形態1と同様の効果と共に、演算部113の構成を簡素化することが可能である。
実施の形態3.
 次に、さらにオーバーフローの検出方法が若干異なるものを紹介する。実施の形態1、2では、オーバーフローしているか否かをオーバーフロー検出部108および演算部113で協調して行うが、実施の形態3では、オーバーフローしているか否かを、オーバーフロー検出部108で自動的に判定し、演算部113では、このオーバーフローレジスタOVFを読み込んでオーバーフローフラグOVFFに設定する。
 図4は、本発明の実施の形態3にかかる速度検出装置のオーバーフロー検出部と演算部との構成例を示す図である。オーバーフロー検出部108は、ライブパルス計時値LTが最大値を超えたときオーバーフローレジスタOVFをセットするとともに、パルスエッジPEによりオーバーフローレジスタOVFをクリアする。即ち、実施の形態1および2は、演算部113の割込処理によって、オーバーフローレジスタOVFをクリアする態様であるが、実施の形態3は、パルスエッジPEによって、オーバーフローレジスタOVFをクリアするように構成されている。さらに、オーバーフロー検出部108は、オーバーフローレジスタOVFの値(1または0)を、キャプチャークロックCK_CAPのタイミングで保持するように構成されている。演算部113は、オーバーフロー検出部108で保持されたオーバーフローレジスタOVFを読み込んでオーバーフローフラグOVFFに設定する。
 以上説明したように、実施の形態3にかかる速度検出装置1は、オーバーフローしているか否かをオーバーフロー検出部108で判定するようにしたので、実施の形態1と同様の効果と共に、演算部113の構成を一層簡素化することが可能である。
実施の形態4.
 次に、ハードウェアの制約などにより、パルス計数部107のビット数や、パルス計時部109のビット数をあまり大きく出来ないが、精度を高める目的で、周波数を求める分母にあたるベース時間(=演算周期)を大きくしたいケースのために、実施の形態3に比べて、演算部113の構成を変更した実施の形態4を説明する。
 図10は、本発明の実施の形態4にかかる演算部の構成例を示す図である。関連図は、図10~図14である。実施の形態4にかかる速度検出装置1は、ソフトウェアに少しだけ負担をかけることで、ハードウェアの規模(パルス計数部107のビット数、パルス計時部109)を小さく保つように設計されている。
 図10に示される演算部113は、バッファ処理部901と、演算処理部902とを有して構成されている。
 バッファ処理部901は、周波数を求めるところは行わず、割込要求IRQによって、リングバッファへの書き込み処理を行う。周波数を演算する部分は、演算周期Tcal毎の演算処理部902に移す。より具体的には、バッファ処理部901は、パルス計数レジスタCNの値を時系列的に記憶するパルス計数リングバッファN[ ]と、パルス計時レジスタCTの値を時系列的に記憶するパルス計時リングバッファT[ ]と、リングバッファの現在の位置を保持するリングバッファポインタPNTとを有している。
 演算処理部902は、キャプチャークロックの周期の整数倍の演算周期Tcal(所定の演算周期)毎に起動し、バッファ処理部901でバッファされたデータに基づいて、周波数演算値Fを算出する。
 図11は、本発明の実施の形態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となる。
 図12は、図10のバッファ処理部の処理手順の一例を示す図である。バッファ処理部901は、割込要求IRQにより起動し、主たる構成として、データ読込ステップ401と、オーバーフロー処理ステップ402と、割込要求クリアステップ403と、計数値編集ステップ404と、計時値編集ステップ405と、バッファ更新ステップ406と、ポインタ更新ステップ407と、前回値設定ステップ408と、を有して構成されている。
・データ読込ステップ401
 バッファ処理部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
 ここでひとつ注意点がある。パルス計時リングバッファT[ ]はパルス計数最大値TMAXで初期化されていなければならない。
 図13は、図10の演算処理部の処理手順の一例を示す図である。演算処理部902は、演算周期Tcal毎に起動し、主たる構成として、ポインタ読込ステップ501と、分子演算ステップ502と、周波数演算値Fを求める周波数演算ステップ503と、を有して構成されている。
・ポインタ読込ステップ501
 演算処理部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])
 ここで、図14および図15を用いて、演算部113の処理を解説する。図14は、図10の演算部の処理内容の説明図であり、図15は、図10の演算部の他の処理内容の説明図である。
 図14において、CASE1は、パルスエッジPEが1個以上入ってきている例である。図では、NUMが12個であり、また(TCAL+T[C1]-T[C0])/Ftimと記載した区間には、パルス周期が12周期ある。よって、周波数を求める式の分子としてNUMの値で問題ないことが分かる。
 また、周波数演算値Fを求める式の分母、つまり12周期分の時間については、(TCAL+T[C1]-T[C0])/Ftimと図示したところをみれば、TCAL/Ftimと図示した時間より、T[C1]/Ftim分左側が長く、T[C0]/Ftim分右側が短くなっていることから、(TCAL+T[C1]-T[C0])/Ftimで正しいことは明白だろう。
 そのため、周波数演算値Fを求める式として、「F = NUM*Ftim/(TCAL+T[C1]-T[C0])」が正しいことが分かる。
 次にCASE2では、パルスエッジPEが1つも入ってきていない状態である。このとき、情報としては、パルスエッジPEが入ってきていないからといって何もないのではなく、現時点で、最後のパルスエッジPEからT[C0]/Ftimだけ経過しているため、少なくとも、周波数として、Ftim/T[C0]よりは小さいことは明白である。従って、演算部113は、前回の周波数演算値FとFtim/T[C0]との小さい方を、新しい周波数演算値Fとして出力する。つまり、「F=MIN(Ftim/T[C0],F)」という式を使っている。
 なお、図15のCALは、本演算部113が動作している部分を示すが、これはソフトウェアの負荷変動の都合上、ぴったり演算周期Tcalとはならず、毎回多少変動する。しかし、これは演算には全く影響しない。なぜなら、ポインタ読込ステップ501でリングバッファポインタPNTを一度だけ参照することで、直前のキャプチャデータの位置を憶え、それから所定の数だけポインタを遡ることできっちり演算周期Tcal間のデータを参照することができるからである。よって、非常に稀ではあるが、図15に示すようなタイミングで本演算部113が動作した場合には、CASE1では、図中G(ギャップ)と示されている区間のデータは用いられず、CASE2では、図中W(ラップ)と示されている区間のデータは2度使われる。
 ここで、図19および図20を用いて、シミュレーション結果の説明を行う。図19は、特許文献1に示される速度検出装置のシミュレーション結果の一例を示す図であり、図20は、本発明の実施の形態4にかかる速度検出装置のシミュレーション結果の一例を示す図である。
 図19において、従来の速度検出装置では、701の動作で、周波数演算値Fが、15.3Hzで飽和しているは、パルス信号Pが入力されない期間であるためである。また、従来の速度検出装置では、702の動作が示すように、入力周波数0の状態から1パルスだけ、入力信号INが入力された場合、最低認識周波数を認識してしまう。
 図20において、実施の形態4にかかる速度検出装置1では、パルスエッジPEが入ってくるかどうかに関わらず、計時クロックCK_TIMによって定期的にデータ取得が行われる。図20の801の動作を図19の701の動作と比較すると、図20の801の動作には図19の701に見られるような飽和は見られない。さらに、図19の702の動作に見られるような、最低周波数を認識してしまう現象も見られない。
 以上説明したように、実施の形態4にかかる速度検出装置1によれば、ソフトウェアに少し負担をかけるだけで、ハードウェアの規模(パルス計数部107のビット数、パルス計時部109)を更に小さく保つことができる。特許文献1に示される速度検出装置のように、データが使われることなく失われるケースは稀にあるものの、周波数の精度劣化とはいえない。
実施の形態5.
 次に、ノイズの影響を除去するために、フィルタ部105を追加した実施の形態5について説明する。図16は、本発明の実施の形態5にかかる速度検出装置の構成例を示す図である。以下、実施の形態1と同一部分には同一符号を付してその説明を省略し、ここでは異なる部分についてのみ述べる。
 図16の速度検出装置1は、主たる構成として、波形整形部101と、フィルタクロック発生部102と、フィルタ部105と、エッジ検出部106と、パルス計数部107と、計時クロック発生部103と、パルス計時部109と、キャプチャークロック発生部104と、オーバーフロー検出部108と、キャプチャー部110と、割込要求部111と、演算部113と、を有して構成されている。実施の形態5では、実施の形態1と異なる要素として、波形整形部101の後段に設置されたノイズ除去用のフィルタ部105と、フィルタ部105に必要なクロックを供給するフィルタクロック発生部102とを有している。
 フィルタ部105は、フィルタクロックCK_FILでパルス信号Pをサンプリングし、所定回数の連続一致を条件に、出力を変化させるように構成されている。
 ノイズの周波数は一般的に高く、回路に混入した場合、パルス信号Pが高速に変化する。そのため、フィルタクロックCK_FILと連続一致の回数を適切に設定すれば、ノイズ成分は完全にカットできる。また、入力信号INに重畳されるノイズではなくても、波形整形部101の出力波形が振動的になった場合には、ノイズと同様に高い周波数成分を含んでしまうが、この場合も同様に、本フィルタ回路で除去することができる。さらに、フィルタ部105はフィルタであるので、若干の応答遅れが発生するが、キャプチャー周期Tcapに比べて十分短いものであり、図示しない後段のシステムへは全く影響を与えない。
 ここで、フィルタを設定する上での注意点がある。波形整形部101ではフォトカプラを用いて絶縁することがある。この場合、フォトカプラのON時間とOFF時間との違いによって、高い周波数を入力信号INに入力したとき、入力信号INのデューティ比がたとえ50:50だとしても、パルス信号Pのデューティ比が大きく偏ってしまうことがある。フィルタクロックCK_FILと連続一致の回数によって得られる帯域については、このデューティ比の偏りを考慮して、実際に使用する帯域より十分高い帯域に設定しなければならない。例えば、スペック上の最大入力周波数で、パルス信号Pのデューティ比1:99となった場合でも認識可能な帯域としてもよいだろう。
 以上説明したように、実施の形態5にかかる速度検出装置1は、波形整形部101の後段に設置され、フィルタクロックCK_FILでパルス信号Pをサンプリングし、数回の連続一致を条件に出力を変化させるフィルタ部105を備えるようにしたので、実施の形態1~4の効果に加えて、波形整形部101の出力波形が振動的になった場合でも、高いノイズフィルタ効果を得ることが可能である。
実施の形態6.
 次に、多チャンネル化した実施の形態6について説明する。図17は、本発明の実施の形態6にかかる速度検出装置の構成例を示す図である。以下、実施の形態5と同一部分には同一符号を付してその説明を省略し、ここでは異なる部分についてのみ述べる。
 図17の速度検出装置1は、主たる構成として、波形整形部101と、フィルタクロック発生部102と、フィルタ部105と、エッジ検出部106と、パルス計数部107と、計時クロック発生部103と、パルス計時部109と、キャプチャークロック発生部104と、オーバーフロー検出部108と、キャプチャー部110と、割込要求部111と、演算部113と、を有して構成されている。実施の形態5では、実施の形態1と異なる要素として、波形整形部101の後段に設置されたノイズ除去用のフィルタ部105と、フィルタ部105に必要なクロックを供給するフィルタクロック発生部102とを有している。
 図17の速度検出装置1は、波形整形部101、フィルタ部105、エッジ検出部106、パルス計数部107、パルス計時部109、オーバーフロー検出部108、およびキャプチャー部110を複数有し、さらに、フィルタクロック発生部102、計時クロック発生部103、キャプチャークロック発生部104、および割込要求部111を有して構成されている。即ち、図17の速度検出装置1は、複数のチャンネルに対して、フィルタクロック発生部102、計時クロック発生部103、キャプチャークロック発生部104、および割込要求部111を共用する構成である。
 以上説明したように、実施の形態6にかかる速度検出装置1は、計時クロック発生部103と、キャプチャークロック発生部104と、フィルタクロック発生部102と、割込要求部111と共用するようにしたので、多チャンネル化した場合でも割込要求IRQ発生頻度は変わらないため、ソフトウェアへのオーバーヘッドを抑えることが可能である。特許文献1に示される速度検出装置では、多チャンネル化した際に、チャンネル毎に、ばらばらに割込要求IRQが発生するため、この割込要求IRQが割込頻度を上げ、ソフトウェアへのオーバーヘッドが発生する場合があるという問題があったが、実施の形態6の速度検出装置1では、多チャンネル化しても割込要求IRQ発生頻度は変わらず、ソフトウェアへのオーバーヘッドを抑えることが可能である。
 なお、本発明の実施の形態1~6にかかる速度検出装置は、波形整形部101と、エッジ検出部106と、計時クロック発生部103と、キャプチャークロック発生部104とを有して構成されているが、これに限定されるものではなく、波形整形部101と、エッジ検出部106と、計時クロック発生部103と、キャプチャークロック発生部104とを速度検出装置の外部に設置し、そこから得られたパルスエッジPE、キャプチャークロックCK_CAP、計時クロックCK_TIMを用いてもよい。
 また、本発明の実施の形態1~6にかかる速度検出装置は、鉄道車両の向けの速度検出装置を例に説明したが、他にも周波数信号を測定するあらゆる機器にも適用可能である。その他、本発明は、その趣旨を逸脱しない範囲で種々変形して実施可能である。
 以上のように、本発明にかかる速度検出装置は、鉄道車両向け速度検出装置を始め、他にも周波数信号を測定するあらゆる機器に適用可能であり、特に、周波数の精度劣化がなく、常にデータ更新され、回路規模も比較的小さく、ソフトウェアへのオーバーヘッドも少ない発明として有用である。
 1 速度検出装置
 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)

  1.  外部からの入力信号のパルス数を計数するパルス計数部と、
     計時クロックによりカウントアップし、パルスによってクリアされることで、最後のパルスからの時間を計時するパルス計時部と、
     前記パルス計時部がオーバーフローしたことを検出しオーバーフローレジスタに保持するオーバーフロー検出部と、
     一定周期毎に測定結果を得るキャプチャークロックのタイミングで、前記パルス計数部からの出力をパルス計数レジスタに保持すると共に、前記パルス計時部からの出力をパルス計時レジスタに保持するキャプチャー部と、
     前記パルス計数レジスタの値と、前記パルス計時レジスタの値と、前記オーバーフローレジスタの値と、を読み取り、所定の演算により、周波数演算値を算出する周波数算出部と、
     を備え、
     前記周波数算出部は、前記パルス計時部がオーバーフローした場合、前回割込時におけるパルス計時データに、前記キャプチャークロックの周期/前記計時クロックの周期で得られる所定の定数を加算して、最後のパルスからの時間/前記計時クロックであるパルス計時データを求めることにより、前記周波数演算値を算出すること、
     を特徴とする速度検出装置。
  2.  外部からの入力信号のパルス数を計数するパルス計数部と、
     計時クロックによりカウントアップし、パルスによってクリアされることで、最後のパルスからの時間を計時するパルス計時部と、
     前記パルス計時部がオーバーフローしたことを検出しオーバーフローレジスタに保持するオーバーフロー検出部と、
     一定周期毎に測定結果を得るキャプチャークロックのタイミングで、前記パルス計数部からの出力をパルス計数レジスタに保持すると共に、前記パルス計時部からの出力をパルス計時レジスタに保持するキャプチャー部と、
     前記パルス計数レジスタの値と、前記パルス計時レジスタの値と、前記オーバーフローレジスタの値と、を読み取り、所定の演算により、周波数演算値を算出する周波数算出部と、
     を備え、
     前記周波数算出部は、所定の周期内に入力されたパルスが0個の場合、直後にパルスが入力されると仮定した周波数演算値と、前回の周波数演算値と、の低い方の値を選択することにより、周波数演算値を推定すること、
     を特徴とする速度検出装置。
  3.  外部からの入力信号のパルス数を計数するパルス計数部と、
     計時クロックによりカウントアップし、パルスによってクリアされることで、最後のパルスからの時間を計時するパルス計時部と、
     前記パルス計時部がオーバーフローしたことを検出しオーバーフローレジスタに保持するオーバーフロー検出部と、
     一定周期毎に測定結果を得るキャプチャークロックのタイミングで、前記パルス計数部からの出力をパルス計数レジスタに保持すると共に、前記パルス計時部からの出力をパルス計時レジスタに保持するキャプチャー部と、
     前記パルス計数レジスタの値と、前記パルス計時レジスタの値と、前記オーバーフローレジスタの値と、を読み取り、所定の演算により、周波数演算値を算出する周波数算出部と、
     を備え、
     前記周波数算出部は、前記パルス計時部がオーバーフローした場合、前回割込時におけるパルス計時データに、前記キャプチャークロックの周期/前記計時クロックの周期で得られる所定の定数を加算して、最後のパルスからの時間/前記計時クロックであるパルス計時データを求めることにより、前記周波数演算値を算出し、
     所定の周期内に入力されたパルスが0個の場合、直後にパルスが入力されると仮定した周波数演算値と、前回の周波数演算値と、の低い方の値を選択することにより、周波数演算値を推定すること、
     を特徴とする速度検出装置。
  4.  前記オーバーフロー検出部は、
     前記オーバーフローレジスタを、前記パルス計時部が所定の最大値を超えたことを検出してセットし、前記周波数算出部からクリアされるまで保持するように構成され、
     前記周波数算出部は、
     前回割込時のパルス計数レジスタの値と、今回割込時のパルス計数レジスタの値と、の差がない場合、オーバーフローが発生していないと判断すると共に、前記オーバーフローレジスタをクリアし、
     前回割込時のパルス計数レジスタの値と、今回割込時のパルス計数レジスタの値と、の差がある場合、前記オーバーフローレジスタの値によりオーバーフローが発生しているか否かを判断すること、
     を特徴とする請求項1~3のいずれか1つに記載の速度検出装置。
  5.  前記オーバーフロー検出部は、
     前記オーバーフローレジスタを、パルス計時部が所定の最大値を超えたことを検出してセットし、前記周波数算出部からクリアされるまで保持するように構成され、
     前記周波数算出部は、
     前記オーバーフローレジスタがセットされている場合、所定のメモリーに、オーバーフローの発生を示すオーバーフローフラグをセットすると共に、前記オーバーフローレジスタをクリアし、
     前回割込時のパルス計数レジスタの値と、今回割込時のパルス計数レジスタの値と、の差がある場合、オーバーフローが発生していないと判断し、前記オーバーフローフラグをクリアすること、
     を特徴とする請求項1~3のいずれか1つに記載の速度検出装置。
  6.  前記オーバーフロー検出部は、
     オーバーフロービットを、パルス計時部が所定の最大値を超えたことを検出してセットし、パルスによりクリアし、
     前記キャプチャークロックにあわせて、前記オーバーフロービットを前記オーバーフローレジスタに保持すること、
     を特徴とする請求項1~3のいずれか1つに記載の速度検出装置。
  7.  前記周波数算出部は、
     パルス計時レジスタのビット数を拡張して保持する変数であるパルス計時データを備え、
     今回割込時におけるパルス計数レジスタの値から、前回割込時におけるパルス計数レジスタの値を減じた値に基づき、前回割込時から今回割込時の間に入力されたパルスの数を求め、
     前記パルス計時部でオーバーフローが発生していない場合、前記パルス計時レジスタの値により、パルス計時データを求め、
     前記パルス計時部でオーバーフローが発生している場合、前回のパルス計時データに、前記キャプチャークロックの周期/前記計時クロックの周期で得られる所定の定数を加算することで、最後のパルスからの時間/前記計時クロックであるパルス計時データを求め、
     下記演算式により周波数演算値を求めること、
     を特徴とする請求項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は、前回割込時における最後のパルスからの時間/計時クロックの周期である前回のパルス計時データ。
  8.  前記周波数算出部は、
     前記パルス計数レジスタの値と、前記パルス計時レジスタの値と、前記オーバーフローレジスタの値と、を読み取りバッファリングするバッファ処理部と、
     前記キャプチャークロックの周期の整数倍の演算周期毎に起動し、前記バッファ処理部でバッファしたデータに基づき、演算周波数を算出する演算処理部と、
     を有し、
     前記バッファ処理部は、
     前記パルス計数レジスタの値と前記パルス計時レジスタの値とを時系列的に記憶するリングバッファと、前記リングバッファの現在の位置を保持するリングバッファポインタとを備え、
     今回割込時におけるパルス計数レジスタの値から前回割込時におけるパルス計数レジスタの値を減じた値と、第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]は、所定の演算周期分過去のパルス計時データ。
  9.  前記波形整形部の後段に設置されたフィルタ部と、
     前記フィルタ部に必要なクロックを供給するフィルタクロック発生部と、
     を備え、
     前記フィルタ部は、フィルタクロックでパルス信号をサンプリングし、所定回数の連続一致を条件に、出力を変化させること、
     を特徴とする請求項1~3のいずれか1つに記載の速度検出装置。
  10.  前記エッジ検出部と、前記パルス計数部と、前記オーバーフロー検出部と、前記パルス計時部と、前記キャプチャー部と、前記フィルタ部とを複数備え、
     前記フィルタクロック発生部を共用すること、
     を特徴とする請求項9に記載の速度検出装置。
PCT/JP2010/054428 2010-03-16 2010-03-16 速度検出装置 WO2011114438A1 (ja)

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)

* Cited by examiner, † Cited by third party
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)

* Cited by examiner, † Cited by third party
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)

* Cited by examiner, † Cited by third party
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 サミー株式会社 基板ユニット

Patent Citations (3)

* Cited by examiner, † Cited by third party
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