KR101273750B1 - Measuring rotation speed of fan usinging counter - Google Patents

Measuring rotation speed of fan usinging counter Download PDF

Info

Publication number
KR101273750B1
KR101273750B1 KR1020100131443A KR20100131443A KR101273750B1 KR 101273750 B1 KR101273750 B1 KR 101273750B1 KR 1020100131443 A KR1020100131443 A KR 1020100131443A KR 20100131443 A KR20100131443 A KR 20100131443A KR 101273750 B1 KR101273750 B1 KR 101273750B1
Authority
KR
South Korea
Prior art keywords
counter
fan
flag
value
ovint
Prior art date
Application number
KR1020100131443A
Other languages
Korean (ko)
Other versions
KR20120070049A (en
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 KR1020100131443A priority Critical patent/KR101273750B1/en
Publication of KR20120070049A publication Critical patent/KR20120070049A/en
Application granted granted Critical
Publication of KR101273750B1 publication Critical patent/KR101273750B1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/34Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
    • G06F11/3466Performance evaluation by tracing or monitoring
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/04Generating or distributing clock signals or signals derived directly therefrom
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/26Power supply means, e.g. regulation thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F5/00Methods or arrangements for data conversion without changing the order or content of the data handled
    • G06F5/06Methods or arrangements for data conversion without changing the order or content of the data handled for changing the speed of data flow, i.e. speed regularising or timing, e.g. delay lines, FIFO buffers; over- or underrun control therefor
    • G06F5/10Methods or arrangements for data conversion without changing the order or content of the data handled for changing the speed of data flow, i.e. speed regularising or timing, e.g. delay lines, FIFO buffers; over- or underrun control therefor having a sequence of storage locations each being individually accessible for both enqueue and dequeue operations, e.g. using random access memory
    • G06F5/12Means for monitoring the fill level; Means for resolving contention, i.e. conflicts between simultaneous enqueue and dequeue operations
    • G06F5/14Means for monitoring the fill level; Means for resolving contention, i.e. conflicts between simultaneous enqueue and dequeue operations for overflow or underflow handling, e.g. full or empty flags

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Control Of Electric Motors In General (AREA)

Abstract

본 발명은 카운터를 이용한 팬의 회전속도 측정 방법에 관한 것으로, 1회전시 일정 개수의 구형파 신호를 발생하는 팬(Fan)의 회전속도를 카운터를 이용하여 측정하는 방법에 있어서, (a)구형파의 에지(Edge) 시점에서 발생하는 인터럽트(Interrupt, 이하 EINT)에 따라 상기 카운터 내의 CCF프래그(FLAG)와, 상기 카운터의 오버플로우(Overflow) 시점에서 발생하는 인터럽트(이하, OVINT)에 따라 상기 카운터 내의 CF프래그가 동시에 'HIGH'로 세팅되었는지 판단하는 단계; (b)상기 CCF프래그와 CF프래그가 동시에 'HIGH'로 세팅된 경우, 상기 EINT가 팬의 1회전시 발생된 구형파 신호에서 첫번째 에지 시점에서 발생하는 인터럽트(이하, EINT1)인지 판단하는 단계; (c)EINT1인 경우, EINT1 다음에 OVINT가 발생하였는지 판단하는 단계; (d)EINT1 다음에 OVINT가 발생한 경우, 상기 카운터의 오버플로우 발생 수를 나타내는 변수값(M)을 1로 세팅하고, 상기 CF 및 CCF프래그를 'LOW'로 세팅하며, 첫번째 에지 시점에서의 카운터값(N1)을 읽어들이는 단계; (e)EINT1만 인가되는 경우 카운터값(N1)을 읽어들이고 변수값(M)을 0으로 세팅하는 제1 알고리즘, 팬의 1회전시 발생된 구형파 신호에서 마지막 에지 시점에서 발생하는 인터럽트(이하, EINT2)만 인가되는 경우 마지막 에지 시점에서의 카운터값(N2)을 읽어들이고 변수값(M)을 확정하는 제2 알고리즘, OVINT만 인가되는 경우 변수값(M)을 하나 증가시키는 제3 알고리즘을 수행하는 단계; 및 (f)상기 카운터값(N1), 카운터값(N2), 변수값(M)을 이용하여 상기 팬의 회전속도를 구하는 단계;를 포함하는, 카운터를 이용한 팬의 회전속도 측정 방법을 제시한다.The present invention relates to a method for measuring the rotational speed of a fan using a counter, the method for measuring the rotational speed of a fan (Fan) that generates a certain number of square wave signals in one revolution by using a counter, (a) The counter according to the CCF flag FLAG in the counter according to the interrupt (EINT) occurring at the edge point and the interrupt (hereinafter referred to as OVINT) occurring at the overflow point of the counter. Determining whether the CF flag within is set to 'HIGH' at the same time; (b) if the CCF flag and the CF flag are set to 'HIGH' at the same time, determining whether the EINT is an interrupt (EINT1) generated at the first edge of the square wave signal generated during one revolution of the fan. ; (c) in the case of EINT1, determining whether OVINT occurs after EINT1; (d) When OVINT occurs after EINT1, the variable value M representing the number of overflow occurrences of the counter is set to 1, and the CF and CCF flags are set to 'LOW', and at the first edge time point. Reading a counter value N1; (e) The first algorithm for reading the counter value (N1) and setting the variable value (M) to 0 when only EINT1 is applied, the interrupt that occurs at the last edge point in the square wave signal generated during one revolution of the fan (hereinafter, If only EINT2) is applied, the second algorithm reads the counter value N2 at the last edge point and determines the variable value M. If only OVINT is applied, the third algorithm increases one variable value M. Doing; And (f) obtaining a rotation speed of the fan using the counter value (N1), the counter value (N2), and the variable value (M). .

Description

카운터를 이용한 팬의 회전속도 측정 방법{MEASURING ROTATION SPEED OF FAN USINGING COUNTER} How to measure fan speed using counter {MEASURING ROTATION SPEED OF FAN USINGING COUNTER}

본 발명은 카운팅 방법에 관한 것으로서, 더욱 상세하게는 카운터를 이용하여 팬의 회전속도를 측정하는 방법에 관한 것이다.
The present invention relates to a counting method, and more particularly to a method for measuring the rotational speed of the fan using a counter.

서버 시스템에 장착된 파워 서플라이(Power Supply)는 서버 시스템에 전원을 공급하는 장치로써, 서버 시스템은 통신 채널을 통하여 파워 서플라이로부터 정보를 얻어 파워 서플라이의 상태를 파악하고, 파워 서플라이를 제어하는 신호를 출력한다.
여기서, 서버 시스템에 전달되는 파워 서플라이의 정보로는 파워 서플라이의 내부 온도, 팬 회전 속도, 주 전원의 전압, 전류 등이 있는데, 파워 서플라이 내부온도를 제어하기 위하여, 파워 서플라이에 내장된 팬의 회전속도를 측정하게 된다.
파워 서플라이 내부의 마이크로컨트롤러 유닛(Microcontroller Unit:MCU)은 팬의 회전 속도를 제어하는 펄스폭변조(PULSE WIDTH MODULATION:PWM)신호를 팬에 인가하며, 팬으로부터 출력되는 구형파 신호를 통하여 팬의 회전 속도를 측정할 수 있다.
도 1은 팬이 한번 회전하는 동안 출력하는 구형파 신호를 나타낸 도면으로, 도 1에서 보는 바와 같이, 팬이 한번 회전하는 동안 일정 개수의 구형파 신호(예를 들어, 2개의 구형파 신호)가 출력된다. 따라서, 상기 2개의 구형파가 출력되는 동안 걸리는 시간을 계산하면 팬이 한번 회전하는데 걸리는 시간(T, 여기서 단위는 초)을 구할 수 있고, 팬의 회전속도는 60/T[RPM]이 된다.
이때, 팬이 한번 회전하는데 걸리는 시간(T)를 구하기 위해 마이크로컨트롤러 유닛(MCU)에 포함된 카운터(Counter)를 이용할 수 있다.
상기 MCU는 상기 구형파가 로우(Low)에서 하이(High)로 변할 때, 즉, 라이징 에지(Rising edge) 시점 및 하이(HIGH)에서 로우(LOW)로 변할 때, 즉, 폴링 에지(Falling edge) 시점에서 에지 인터럽트(Edge Interrupt:EINT)가 발생하도록 카운터의 기능을 설정한다.
이에 따라, 도 1과 같이, 팬이 한번 회전하는 동안 2개의 구형파를 발생시키는 경우, 총 5번의 EINT가 발생하고, 여기서, 첫번째 에지 시점에서 발생하는 인터럽트를 EINT1, 그리고 마지막 에지 시점에서 발생하는 인터럽트를 EINT2라 칭하기로 한다.
그리고, 카운터값(예를 들어, 카운터의 비트(bit) 수(W)가 3인 경우, 카운터값은 0,1,2,3,4,5,6,7)은 일정시간(t) 마다 카운팅되므로, 첫번째 에지 시점에서의 카운터값(N1)과 마지막 에지 시점에서의 카운터값(N2)을 구하면, 팬이 한번 회전하는데 걸리는 시간(T)은 하기 수학식 1에 의해 결정된다.

Figure 112012098159346-pat00020

한편, 가장 큰 카운터값(예를 들어, 카운터의 비트 수(W)가 3인 경우 7, 이진수로 111) 다음에 다시 0(이진수로 000)으로 카운팅되는데, 이를 오버플로우(Overflow)라 하고, 이때, 오버플로우 시점에서 발생하는 인터럽트를 이하에서 OVINT라 칭한다.
상기 MCU는 OVINT가 발생한 때마다 이를 인식하여 오버플로우 발생 수를 나타내는 변수값(M)를 구할 수 있고, 이에 따라, 오버플로우 발생시 팬이 한번 회전하는데 걸리는 시간(T)은 하기 수학식 2에 의해 결정된다.
Figure 112012098159346-pat00021

여기서, t는 카운터에서 카운팅되는 시간(즉, t마다 카운팅값이 증가)이고, W는 카운터의 비트(Bit) 수이다. 카운터의 비트 수는 카운터마다 차이가 있으나 대체로 16비트가 사용될 수 있다.
예로서, 도 1에서 카운터값(N1)은 4, 카운터값(N2)는 6, 그리고 EINT1과 EINT2 사이에 OVINT가 한번 발생하였으므로 변수값(M)은 1이고, 카운터의 비트 수(W)가 3, 카운팅 시간(t)를 0.5초라 가정하면, 상기 수학식 2에 따라 팬이 한번 회전하는데 걸리는 시간(T)은 (1*23+6-4)*0.5가 되어 5초가 된다.

이제, 도 2를 참조하여 팬이 한번 회전하는데 걸리는 시간(T)를 구하는 과정을 살펴보기로 한다.
도 2는 팬이 한번 회전하는데 걸리는 시간(T)를 구하는 단계를 나타낸 흐름도로써, 먼저, 오버플로우(Overflow)가 발생하였는지 판단한다(S201 단계).
상기 MCU는 OVINT에 따라 CF프래그(FLAG, 여기서 프래그란 프로그래밍에서 상태를 기록하고 처리의 흐름을 제어하기 위한 변수를 의미한다.)를 'HIGH'로 세팅함으로써 오버플로우가 발생하였는지를 판단할 수 있다. 즉, 상기 CF프래그가 'HIGH'인 경우, MCU는 오버플로우가 발생한 것으로 판단할 수 있다.
상기 CF프래그를 통해 상기 S201단계에서 오버플로우가 발생된 것으로 판단되면, 변수값(M)을 하나 증가시키는 제3 알고리즘을 수행한다(S202 단계). 반대로, 오버플로우가 발생하지 않은 것으로 판단하면 다음 S203 단계로 분기한다.
S203 단계에서는 EINT1가 발생하였는지 판단한다. 상기 MCU는 EINT에 따라 CCF프래그를 'HIGH'로 세팅시키고, 에지 수를 나타내는 변수값(S)를 확인함으로써 EINT1가 발생하였는지 판단할 수 있다.
즉, 변수값(S)를 하나 지정하여 0으로 세팅한 다음, EINT가 발생할 때마다 변수값(S)을 하나씩 증가시키는 경우, 예를 들어, 상기 팬이 한번 회전하는 동안 2개의 구형파를 발생한다고 가정하면, EINT1에서 상기 변수값(S)은 1이 되고, EINT2에서 상기 변수값(S)은 5가 된다. 따라서, CCF프래그가 'HIGH'이고, 상기 변수값(S)가 1인 경우, EINT1가 발생한 것으로 판단할 수 있다. 참고로, EINT2 이후 다음 에지 인터럽트(INT)에서 상기 변수값(S)은 다시 0으로 리셋된다.
이와 같은 과정을 통해 EINT1가 발생한 것으로 판단되면, 변수값(M)를 0으로 세팅시키고, 첫번째 에지 시점에서의 카운터값(N1)을 읽어 들이는 제1 알고리즘을 수행한다(S204 단계). 반대로, EINT1가 발생하지 않은 것으로 판단하면 다음 S205 단계로 분기한다.
S205 단계에서는 EINT2가 발생하였는지 판단한다. 예를 들어, 상기 팬이 한번 회전하는 동안 2개의 구형파를 발생한다고 가정하면, CCF프래그가 'HIGH'이고 상기 변수값(S)이 5인 경우, EINT2가 발생한 것으로 판단할 수 있다.
이와 같은 과정을 통해 EINT2가 발생한 것으로 판단되면, 변수값(M)을 확정시키고, 마지막 에지 시점에서의 카운터값(N1)을 읽어 들이는 제2 알고리즘을 수행한다(S206 단계). 반대로, EINT2가 발생하지 않은 것으로 판단하면 다음 S207 단계로 분기한다.
S207 단계에서는 CF 또는 CCF프래그를 'LOW'로 세팅시키고, 마지막으로, S208 단계에서는, 상기 S201 내지 S206단계를 통해 상기 카운터값(N1) 및 카운터값(N2)이 모두 구해지고, 변수값(M)이 확정되면, 이를 상기 수학식 2에 적용하여 팬이 한번 회전하는데 걸리는 시간(T) 및 팬의 회전속도를 측정한다.

상기 S201 내지 S208 단계를 통해 팬이 한번 회전하는데 걸리는 시간(T) 및 팬의 회전속도를 구하는 실시예를 살펴보면 다음과 같다.
먼저, EINT1가 발생하였다고 가정하면, 상기 S204 단계로 진입하여 상기 제1 알고리즘에 따라 카운터값(N1)을 구하고, 변수값(M)을 0으로 세팅한다. 그 다음, 상기 S207 단계로 분기되어 CCF프래그를 'LOW'로 세팅시킨다.
그 다음, OVINT가 발생하였다고 가정하면, 상기 S202 단계로 진입하여 상기 제1 알고리즘에 따라 상기 변수값(M)을 1로 증가시킨다. 그 다음, 상기 S207 단계로 분기되어 CF프래그를 'LOW'로 세팅시킨다.
마지막으로, EINT2가 발생하였다고 가정하면, 상기 S206 단계로 진입하여 상기 제2 알고리즘에 따라 카운터값(N2)을 구하고, 상기 변수값(M)을 확정시킨다. 그 다음, 상기 S207 단계로 분기되어 CF프래그를 'LOW'로 세팅시킨다. 이에 따라, 상기 카운터값(N1) 및 카운터값(N2)이 모두 구해지고, 변수값(M)이 확정되므로, 상기 S208 단계에 따라 팬이 한번 회전하는데 걸리는 시간(T) 및 팬의 회전속도를 측정할 수 있다.

그러나, 이와 같은 과정 중 EINT와 OVINT가 근접하게 발생하여 상기 CCF프래그와 CF프래그가 동시에 'HIGH'로 세팅된 경우 오류가 발생할 수 있다.
구체적으로, EINT1 다음에 OVINT가 순차적으로 근접 발생한 경우, 올바르게 동작한다면 첫번째 에지 다음에 오버플로우가 발생한 경우로서 추후 상기 208단계에서 변수값(M)을 1로 두고 계산되어야 한다. 그러나, EINT1와 OVINT의 근접 발생으로 상기 CCF프래그와 CF프래그가 동시에 'HIGH'로 세팅됨으로써, 상기 제3 알고리즘만이 수행되어야 할 과정에서 상기 제1 알고리즘이 함께 수행되어 변수값(M)이 0으로 세팅되고, 결국, 추가되어야 변수값(M)이 누락되는 오류가 발생하게 된다.
그리고, EINT2 다음에 OVINT가 순차적으로 근접 발생한 경우, 올바르게 동작한다면 마지막 에지 다음에 오버플로우가 발생한 경우로서, 추후 상기 208단계에서마지막 에지 이전까지의 확정된 변수값(M)을 가지고 계산하여야 한다. 그러나, EINT2와 OVINT의 근접 발생으로 상기 CCF프래그와 CF프래그가 동시에 'HIGH'로 세팅됨으로써, 상기 제2 알고리즘만이 수행되어야 할 과정에서 상기 제3 알고리즘이 함께 수행되어 변수값(M)이 하나 더 증가하게 되고, 결국, 추가되지 않아야 할 변수값(M)이 하나 더 추가되는 오류가 발생하게 된다.
The power supply installed in the server system is a device for supplying power to the server system. The server system obtains information from the power supply through a communication channel to determine the status of the power supply and provides signals for controlling the power supply. Output
Here, the information of the power supply delivered to the server system includes the internal temperature of the power supply, the fan rotation speed, the voltage of the main power supply, the current, and the like. The speed is measured.
The microcontroller unit (MCU) inside the power supply applies a pulse width modulation (PWM) signal that controls the fan's rotational speed to the fan, and the fan's rotational speed through a square wave signal output from the fan. Can be measured.
FIG. 1 is a diagram illustrating a square wave signal output while the fan rotates once. As shown in FIG. 1, a number of square wave signals (for example, two square wave signals) are output during the fan rotation. Therefore, by calculating the time taken while the two square waves are outputted, it is possible to find the time taken for the fan to rotate once (in seconds, where the unit is seconds), and the rotation speed of the fan is 60 / T [RPM].
In this case, a counter included in the microcontroller unit MCU may be used to obtain a time T for the fan to rotate once.
The MCU has a square wave when it changes from low to high, that is, when it rises from a rising edge time point and from high to low, that is, a falling edge. Set the counter's function so that an edge interrupt (EINT) occurs at that point.
Accordingly, as shown in FIG. 1, when two square waves are generated while the fan rotates once, a total of five EINTs are generated, where interrupts generated at the first edge point are generated at EINT1 and the last edge point. Will be referred to as EINT2.
And, if the counter value (for example, the number of bits (W) of the counter is 3, the counter value is 0, 1, 2, 3, 4, 5, 6, 7) every fixed time (t) Since counting, when the counter value N1 at the first edge time point and the counter value N2 at the last edge time point are obtained, the time T for the fan to rotate once is determined by Equation 1 below.
Figure 112012098159346-pat00020

On the other hand, the largest counter value (for example, when the number of bits (W) of the counter is 3, 7, 111 in binary) is counted again to 0 (000 in binary), which is called overflow. At this time, an interrupt occurring at the overflow time point is referred to as OVINT hereinafter.
The MCU recognizes this every time an OVINT occurs and obtains a variable value M representing the number of overflow occurrences. Accordingly, the time T for the fan to rotate once when an overflow occurs is expressed by Equation 2 below. Is determined.
Figure 112012098159346-pat00021

Here, t is the time counted in the counter (that is, the counting value increases every t), and W is the number of bits of the counter. The number of bits in the counter varies from counter to counter, but usually 16 bits can be used.
For example, in FIG. 1, since the counter value N1 is 4, the counter value N2 is 6, and OVINT occurs once between EINT1 and EINT2, the variable value M is 1 and the number of bits W of the counter is 3, assuming that the counting time (t) is 0.5 seconds, the time (T) it takes for the fan to rotate once according to the equation (2) is (1 * 2 3 + 6-4) * 0.5 becomes 5 seconds.

Now, a process of obtaining a time T for the fan to rotate once will be described with reference to FIG. 2.
2 is a flowchart illustrating a step of obtaining a time T for the fan to rotate once. First, it is determined whether an overflow occurs (step S201).
The MCU can determine whether an overflow has occurred by setting the CF flag (FLAG, a variable for recording a state in programming and controlling the flow of processing) according to OVINT to 'HIGH'. have. That is, when the CF flag is 'HIGH', the MCU may determine that an overflow has occurred.
If it is determined that the overflow occurs in step S201 through the CF flag, a third algorithm of increasing the variable value M by one is performed (step S202). On the contrary, if it is determined that no overflow has occurred, the flow branches to the next step S203.
In step S203, it is determined whether EINT1 has occurred. The MCU may determine whether EINT1 has occurred by setting the CCF flag to 'HIGH' according to EINT and checking the variable value S indicating the number of edges.
That is, when one variable value S is set to 0 and the variable value S is increased by one each time EINT occurs, for example, two square waves are generated while the fan rotates once. If it is assumed, the variable value S is 1 in EINT1 and the variable value S is 5 in EINT2. Therefore, when the CCF flag is 'HIGH' and the variable value S is 1, it may be determined that EINT1 has occurred. For reference, the variable value S is reset to 0 again at the next edge interrupt INT after EINT2.
If it is determined that EINT1 is generated through the above process, the variable M is set to 0, and a first algorithm of reading the counter value N1 at the first edge point is performed (step S204). On the contrary, if it is determined that EINT1 has not occurred, the process branches to the next step S205.
In step S205, it is determined whether EINT2 has occurred. For example, assuming that two square waves are generated while the fan rotates once, when the CCF flag is 'HIGH' and the variable value S is 5, it may be determined that EINT2 has occurred.
If it is determined that EINT2 is generated through the above process, the second algorithm for determining the variable value M and reading the counter value N1 at the last edge point is performed (step S206). On the contrary, if it is determined that EINT2 does not occur, the process branches to the next step S207.
In step S207, the CF or CCF flag is set to 'LOW'. Finally, in step S208, the counter value N1 and the counter value N2 are obtained through the steps S201 to S206, and the variable value ( When M) is determined, it is applied to Equation 2 to measure the time (T) for the fan to rotate once and the rotational speed of the fan.

Looking at the embodiment to obtain the time (T) and the rotational speed of the fan to rotate once through the steps S201 to S208 as follows.
First, assuming that EINT1 has occurred, the process proceeds to step S204 to obtain a counter value N1 according to the first algorithm, and sets the variable value M to zero. Thereafter, the process branches to step S207 to set the CCF flag to 'LOW'.
Next, assuming that OVINT has occurred, the process proceeds to step S202 and increases the variable value M to 1 according to the first algorithm. Then, the process branches to step S207 to set the CF flag to 'LOW'.
Finally, assuming that EINT2 has occurred, the process proceeds to step S206 to obtain a counter value N2 according to the second algorithm, and to determine the variable value M. Then, the process branches to step S207 to set the CF flag to 'LOW'. Accordingly, since both the counter value N1 and the counter value N2 are obtained, and the variable value M is determined, the time T for the fan to rotate once and the rotation speed of the fan are determined according to the step S208. It can be measured.

However, when EINT and OVINT occur close to each other during this process, an error may occur when the CCF flag and the CF flag are set to 'HIGH' at the same time.
Specifically, if OVINT occurs sequentially after EINT1, if it operates correctly, overflow occurs after the first edge, and it should be calculated later with the variable value M as 1 in step 208. However, since the CCF flag and the CF flag are set to 'HIGH' at the same time due to the close occurrence of EINT1 and OVINT, the first algorithm is performed together with the first algorithm in the process in which only the third algorithm is to be executed. Is set to 0, and eventually, an error occurs that the variable value M is missing to be added.
In the case where OVINT occurs sequentially after EINT2, if it operates correctly, overflow occurs after the last edge, and it should be calculated later with the determined variable value M up to the last edge in step 208. However, since the CCF flag and the CF flag are set to 'HIGH' at the same time due to the close occurrence of EINT2 and OVINT, the third algorithm is performed together in the process in which only the second algorithm is to be executed, and thus the variable value (M). This one increases, and eventually, an error occurs that adds one more variable value M that should not be added.

본 발명은 상술한 종래 기술의 문제점을 해결하기 위하여 제안된 것으로, 상기 CCF프래그와 CF프래그가 동시에 'HIGH'로 세팅되어 있는지를 먼저 확인하여 팬의 회전속도 측정 방법을 제공함에 그 목적이 있다.
The present invention has been proposed to solve the above-mentioned problems of the prior art, and the object of the present invention is to provide a method for measuring the rotational speed of a fan by first checking whether the CCF flag and the CF flag are simultaneously set to 'HIGH'. have.

상기 목적을 달성하기 위하여, 본 발명의 일 실시예를 따르면, 1회전시 일정 개수의 구형파 신호를 발생하는 팬(Fan)의 회전속도를 카운터를 이용하여 측정하는 방법에 있어서, (a)구형파의 에지(Edge) 시점에서 발생하는 인터럽트(Interrupt, 이하 EINT)에 따라 상기 카운터 내의 CCF프래그(FLAG)와, 상기 카운터의 오버플로우(Overflow) 시점에서 발생하는 인터럽트(이하, OVINT)에 따라 상기 카운터 내의 CF프래그가 동시에 'HIGH'로 세팅되었는지 판단하는 단계; (b)상기 CCF프래그와 CF프래그가 동시에 'HIGH'로 세팅된 경우, 상기 EINT가 팬의 1회전시 발생된 구형파 신호에서 첫번째 에지 시점에서 발생하는 인터럽트(이하, EINT1)인지 판단하는 단계; (c)EINT1인 경우, EINT1 다음에 OVINT가 발생하였는지 판단하는 단계; (d)EINT1 다음에 OVINT가 발생한 경우, 상기 카운터의 오버플로우 발생 수를 나타내는 변수값(M)을 1로 세팅하고, 상기 CF 및 CCF프래그를 'LOW'로 세팅하며, 첫번째 에지 시점에서의 카운터값(N1)을 읽어들이는 단계; (e)EINT1만 인가되는 경우 카운터값(N1)을 읽어들이고 변수값(M)을 0으로 세팅하는 제1 알고리즘, 팬의 1회전시 발생된 구형파 신호에서 마지막 에지 시점에서 발생하는 인터럽트(이하, EINT2)만 인가되는 경우 마지막 에지 시점에서의 카운터값(N2)을 읽어들이고 변수값(M)을 확정하는 제2 알고리즘, OVINT만 인가되는 경우 변수값(M)을 하나 증가시키는 제3 알고리즘을 수행하는 단계; (f)상기 CF 및 CCF프래그를 'LOW'로 세팅하는 단계; 및 (g)상기 카운터값(N1), 카운터값(N2), 변수값(M)을 이용하여 상기 팬의 회전속도를 구하는 단계;를 포함하는, 카운터를 이용한 팬의 회전속도 측정 방법을 제공한다.
또한, 상기 (c)단계는 첫번째 에지 시점에서의 카운터값(N1)과 2(W-1)값(여기서, W는 상기 카운터의 비트(bit) 수)을 비교하여 상기 카운터값(N1)이 2(W-1)값보다 크면 EINT1 다음에 OVINT가 발생한 것으로 판단하는, 카운터를 이용한 팬의 회전속도 측정 방법을 제공한다.
또한, 상기 (a)단계에서 상기 CCF프래그와 CF프래그가 동시에 'HIGH'로 세팅되지 않은 것으로 판단된 경우, 상기 (e)단계로 분기하는, 카운터를 이용한 팬의 회전속도 측정 방법을 제공한다.
또한, 상기 (b)단계에서 EINT1이 아닌 것으로 판단된 경우, 또는 상기 (c)단계에서 EINT1 다음에 OVINT가 발생한 것이 아닌 것으로 판단된 경우, 상기 (e)단계로 분기하는, 카운터를 이용한 팬의 회전속도 측정 방법을 제공한다.

한편, 본 발명의 다른 실시예에 따르면, 1회전시 일정 개수의 구형파 신호를 발생하는 팬(Fan)의 회전속도를 카운터를 이용하여 측정하는 방법에 있어서, (a)EINT에 따라 상기 카운터 내의 CCF프래그(FLAG)와, OVINT에 따라 상기 카운터 내의 CF프래그가 동시에 'HIGH'로 세팅되었는지 판단하는 단계; (b)상기 CCF프래그와 CF프래그가 동시에 'HIGH'로 세팅된 경우, 상기 EINT가 EINT2인지 판단하는 단계; (c)EINT2인 경우, EINT2 다음에 OVINT가 발생하였는지 판단하는 단계; (d)EINT2 다음에 OVINT가 발생한 경우, 상기 카운터의 오버플로우 발생 수를 나타내는 변수값(M)을 확정하고, 상기 CF 및 CCF프래그를 'LOW'로 세팅하며, 카운터값(N5)을 읽어들이는 단계; (e)EINT1만 인가되는 경우 카운터값(N1)을 읽어들이고 변수값(M)을 0으로 세팅하는 제1 알고리즘, 팬의 1회전시 발생된 구형파 신호에서 마지막 에지 시점에서 발생하는 인터럽트(이하, EINT2)만 인가되는 경우 마지막 에지 시점에서의 카운터값(N2)을 읽어들이고 변수값(M)을 확정하는 제2 알고리즘, OVINT만 인가되는 경우 변수값(M)을 하나 증가시키는 제3 알고리즘을 수행하는 단계; (f)상기 CF 및 CCF프래그를 'LOW'로 세팅하는 단계; 및 (g)상기 카운터값(N1), 카운터값(N2), 변수값(M)을 이용하여 상기 팬의 회전속도를 구하는 단계;를 포함하는, 카운터를 이용한 팬의 회전속도 측정 방법을 제공한다.
또한, 상기 (c)단계는 마지막 에지 시점에서의 카운터값(N2)과 2(W-1)값(여기서, W는 상기 카운터의 비트(bit) 수)을 비교하여 상기 카운터값(N2)이 2(W-1)값보다 크면 EINT2 다음에 OVINT가 발생한 것으로 판단하는, 카운터를 이용한 팬의 회전속도 측정 방법을 제공한다.
또한, 상기 (b)단계에서 EINT2이 아닌 것으로 판단된 경우, 또는 상기 (c)단계에서 EINT2 다음에 OVINT가 발생한 것이 아닌 것으로 판단된 경우, 상기 (e)단계로 분기하는, 카운터를 이용한 팬의 회전속도 측정 방법을 제공한다.
또한, 상기 (a)단계에서 상기 CCF프래그와 CF프래그가 동시에 'HIGH'로 세팅되지 않은 것으로 판단된 경우, 상기 (e)단계로 분기하는, 카운터를 이용한 팬의 회전속도 측정 방법을 제공한다.
In order to achieve the above object, according to an embodiment of the present invention, in the method for measuring the rotational speed of a fan (Fan) that generates a certain number of square wave signals in one revolution using a counter, (a) The counter according to the CCF flag FLAG in the counter according to the interrupt (EINT) occurring at the edge point and the interrupt (hereinafter referred to as OVINT) occurring at the overflow point of the counter. Determining whether the CF flag within is set to 'HIGH' at the same time; (b) if the CCF flag and the CF flag are set to 'HIGH' at the same time, determining whether the EINT is an interrupt (EINT1) generated at the first edge of the square wave signal generated during one revolution of the fan. ; (c) in the case of EINT1, determining whether OVINT occurs after EINT1; (d) When OVINT occurs after EINT1, the variable value M representing the number of overflow occurrences of the counter is set to 1, and the CF and CCF flags are set to 'LOW', and at the first edge time point. Reading a counter value N1; (e) The first algorithm for reading the counter value (N1) and setting the variable value (M) to 0 when only EINT1 is applied, the interrupt that occurs at the last edge point in the square wave signal generated during one revolution of the fan (hereinafter, If only EINT2) is applied, the second algorithm reads the counter value N2 at the last edge point and determines the variable value M. If only OVINT is applied, the third algorithm increases one variable value M. Making; (f) setting the CF and CCF flags to 'LOW'; And (g) obtaining a rotation speed of the fan by using the counter value (N1), the counter value (N2), and a variable value (M). .
In the step (c), the counter value N1 at the first edge time point is compared with the value of 2 (W-1) , where W is the number of bits of the counter. If it is greater than 2 (W-1) , it provides a method of measuring the rotation speed of the fan using a counter that determines that OVINT occurs after EINT1.
In addition, if it is determined in step (a) that the CCF flag and the CF flag is not set to 'HIGH' at the same time, branching to the step (e) provides a method of measuring the rotational speed of the fan using a counter. do.
Further, if it is determined in step (b) that it is not EINT1, or in step (c) it is determined that OVINT does not occur after EINT1 in step (c), the fan branching to the step (e) is performed. Provides a method of measuring rotation speed.

On the other hand, according to another embodiment of the present invention, in the method for measuring the rotational speed of the fan (Fan), which generates a certain number of square wave signals in one revolution using a counter, (a) CCF in the counter according to EINT Determining whether the CF flag in the counter is simultaneously set to 'HIGH' according to the flag FLAG and OVINT; (b) determining whether the EINT is EINT2 when the CCF flag and the CF flag are simultaneously set to 'HIGH'; (c) in the case of EINT2, determining whether OVINT occurs after EINT2; (d) When OVINT occurs after EINT2, the variable value (M) indicating the overflow occurrence number of the counter is determined, the CF and CCF flags are set to 'LOW', and the counter value (N5) is read. Entering step; (e) The first algorithm for reading the counter value (N1) and setting the variable value (M) to 0 when only EINT1 is applied, the interrupt that occurs at the last edge point in the square wave signal generated during one revolution of the fan (hereinafter, If only EINT2) is applied, the second algorithm reads the counter value N2 at the last edge point and determines the variable value M. If only OVINT is applied, the third algorithm increases one variable value M. Making; (f) setting the CF and CCF flags to 'LOW'; And (g) obtaining a rotation speed of the fan by using the counter value (N1), the counter value (N2), and a variable value (M). .
In the step (c), the counter value N2 at the last edge point is compared with the value of 2 (W-1) , where W is the number of bits of the counter. If it is greater than 2 (W-1) , it provides a method of measuring the rotational speed of the fan using a counter that determines that OVINT occurs after EINT2.
Further, if it is determined in step (b) that it is not EINT2, or in step (c) it is determined that OVINT does not occur after EINT2 in step (c), branching to step (e) of the fan using the counter. Provides a method of measuring rotation speed.
In addition, if it is determined in step (a) that the CCF flag and the CF flag is not set to 'HIGH' at the same time, branching to the step (e) provides a method of measuring the rotational speed of the fan using a counter. do.

본 발명에 따르면, 오버플로우 인터럽트와 에지 인터럽트가 근접하게 발생하여 CCF프래그 및 CF프래그가 동시에 세팅되더라도, 이에 따른 오류를 수정할 수 있다.
오류 없이 팬이 한번 회전하는 데 걸리는 시간 및 팬의 회전속도를 구할 수 있어 파워 서플라이의 정확한 정보를 서버 시스템에 전달하고, 이에 따라, 서버 시스템의 신뢰성을 향상시킬 수 있다.
According to the present invention, even when the overflow interrupt and the edge interrupt occur in close proximity and the CCF flag and the CF flag are set at the same time, an error according to this can be corrected.
The time it takes for the fan to rotate once and the fan's rotational speed without error can be obtained so that accurate information of the power supply can be transmitted to the server system, thereby improving the reliability of the server system.

도 1은 팬이 한번 회전하는데 출력하는 구형파 신호를 나타낸 도면.
도 2는 팬이 한번 회전하는데 걸리는 시간을 구하는 단계를 나타낸 흐름도.
도 3은 본 발명에 따른 카운터를 이용한 팬의 회전속도 측정 방법의 흐름도.
도 4는 첫번째 에지 인터럽트 다음에 오버플로우 인터럽트가 발생하였는지 판단하는 방법을 설명하기 위한 예시도.
도 5는 마지막 에지 인터럽트 다음에 오버플로우 인터럽트가 발생하였는지 판단하는 방법을 설명하기 위한 예시도.
1 is a diagram illustrating a square wave signal outputted when a fan rotates once.
Figure 2 is a flow chart showing the step of finding the time it takes for the fan to rotate once.
3 is a flowchart of a method of measuring a rotation speed of a fan using a counter according to the present invention.
4 is an exemplary diagram for describing a method of determining whether an overflow interrupt occurs after a first edge interrupt.
5 is an exemplary diagram for describing a method of determining whether an overflow interrupt occurs after a last edge interrupt.

이하, 첨부된 도면을 참조하면서 본 발명에 따른 바람직한 실시예를 상세히 설명하기로 한다. 이에 앞서, 본 명세서 및 청구범위에 사용되는 용어나 단어는 통상적이거나 사전적인 의미로 한정해서 해석되어서는 아니 되며, 발명자는 그 자신의 발명을 가장 최선의 방법으로 설명하기 위해 용어의 개념을 적절하게 정의할 수 있다는 원칙에 입각하여, 본 발명의 기술적 사상에 부합하는 의미와 개념으로 해석되어야만 한다.

도 3은 본 발명에 따른 카운터를 이용한 팬의 회전속도 측정 방법의 흐름도이다. 여기서, 도 3a와 도 3c는 팬의 회전속도 측정시 발생할 수 있는 오류를 수정하는 과정을 단계적으로 나타낸 흐름도이고, 도 3b는 앞서 배경기술에서 기술한 팬의 회전속도를 측정하는 과정을 나타낸 흐름도와 동일한 것으로, 본 발명에 따른 카운터를 이용한 팬의 회전속도 측정 방법은 먼저 도 3a 또는 도3c의 과정을 거치고, 도 3b의 과정으로 넘어간다.

먼저, 도 3a를 참조하여 팬의 회전속도 측정시 발생할 수 있는 오류를 수정하는 과정에 대해 살펴보기로 한다.
1회전시 일정 개수의 구형파 신호를 발생하는 팬(Fan)의 회전속도를 카운터를 이용하여 측정하는 방법에 있어서, 구형파의 에지(Edge) 시점에서 발생하는 인터럽트(Interrupt, 이하 EINT)에 따라 상기 카운터 내의 CCF프래그(FLAG)와, 상기 카운터의 오버플로우(Overflow) 시점에서 발생하는 인터럽트(이하, OVINT)에 따라 상기 카운터 내의 CF프래그가 동시에 'HIGH'로 세팅되었는지 판단하는 단계를 수행한다(S301).
전술한 대로, EINT가 발생하는 경우 상기 CCF프래그가 'HIGH'로 세팅되고, OVINT가 발생하는 경우 상기 CF프래그가 'HIGH'로 세팅되므로, 상기 EINT와 OVINT가 근접하게 발생하는 경우, 상기 CCF프래그 및 CF프래그가 동시에 'HIGH'로 세팅될 수 있다.
상기 CCF프래그와 CF프래그가 동시에 'HIGH'로 세팅된 경우, 상기 EINT가 팬의 1회전시 발생된 구형파 신호에서 첫번째 에지 시점에서 발생하는 인터럽트(이하, EINT1)인지 판단하는 단계를 수행한다(S302).
이는, 에지 수를 나타내는 변수값(S)를 확인함으로써 EINT1가 발생하였는지 판단할 수 있다. 즉, 전술한 대로, 변수값(S)를 하나 지정하여 0으로 세팅한 다음, EINT가 발생할 때마다 변수값(S)을 하나씩 증가시키는 경우, 예를 들어, 상기 팬이 한번 회전하는 동안 2개의 구형파를 발생한다고 가정하면, EINT1에서 상기 변수값(S)은 1이 되므로, CCF프래그가 'HIGH'이고 상기 변수값(S)은 1인 경우, EINT1가 발생한 것으로 판단할 수 있다.
그 다음, EINT1인 경우, EINT1 다음에 OVINT가 발생하였는지 판단하는 단계를 수행한다(S303).
전술한 대로, 오류가 발생할 수 있는 경우 중 하나는, EINT1 다음에 OVINT가 순차적으로 근접 발생한 경우이므로, 상기 S303 단계를 통해 EINT1 다음에 OVINT 가 발생하였는지 판단하는 것이다.
이는, 첫번째 에지 시점에서의 카운터값(N1)과 2(W-1)를 비교함으로써 판단할 수 있고, 도 4를 참조하여 이에 자세히 설명하기로 한다. 여기서, W는 카운터의 비트(bit) 수이고, 이해를 돕기 위하여, 상기 카운터의 비트 수를 3라 가정하고 이하 설명하기로 한다.
2를 밑으로 하고 카운터의 비트 수(W)를 지수로 거듭제곱한 2(W-1)값은 카운터가 가질 수 있는 최대 카운터값의 반(즉, 2(3-1)=4)이 되므로, 도 4a에서 카운터값(N1), 즉 7이 2(W-1)값, 즉 4보다 보다 크면, EINT1 다음에 OVINT 가 발생한 것으로 판단할 수 있다.
반대로, 도 4b에 나타난 바와 같이, 카운터값(N1), 즉 1이 2(W-1)값, 즉 4보다 작은 경우에는 OVINT 다음에 EINT1이 발생한 것이 된다.
EINT1 다음에 OVINT가 발생한 경우, 상기 카운터의 오버플로우 발생 수를 나타내는 변수값(M)을 1로 세팅하고, 상기 CF 및 CCF프래그를 'LOW'로 세팅하며, 카운터값(N1)을 읽어들이는 단계를 수행한다(S305).
전술한 대로, EINT1 다음에 OVINT가 순차적으로 근접 발생하여 상기 CCF프래그와 CF프래그가 동시에 'HIGH'로 세팅되는 경우, 배경기술에서 기술한 상기 제3 알고리즘(도 3b의 202단계)만이 수행되어야 할 과정에서 상기 제1 알고리즘(도 3b의 204단계)이 함께 수행되어 변수값(M)이 0으로 세팅되고, 결국, 추가되어야 변수값(M)이 누락되는 오류가 발생하게 된다. 하지만, 상기 S305단계에서 변수값(M)을 1로 세팅함으로써 변수값(M)이 누락되는 오류를 수정할 수 있다. 그리고, 상기 CF 및 CCF프래그를 'LOW'로 세팅하여 도 3b의 S202, S204, S206단계를 모두 통과하고, 상기 S305단계에서 읽어들인 카운터값(N1)을 가지고 S208단계에서 팬의 회전속도를 측정하게 된다.
한편, 상기 S301 단계에서 상기 CCF프래그와 CF프래그가 동시에 'HIGH'로 세팅되지 않은 것으로 판단된 경우나, 상기 S302단계에서 EINT1이 아닌 것으로 판단된 경우, 또는 상기 S303단계에서 EINT1 다음에 OVINT가 발생한 것이 아닌 것으로 판단된 경우, 모두 오류가 발생하지 않는 상황이므로, 별도의 수정없이 바로 도 3b 과정으로 넘어간다.

이제, 도 3c를 참조하여 팬의 회전속도를 측정시 발생할 수 있는 또 다른 오류를 수정하는 과정에 대해 살펴보기로 한다.
1회전시 일정 개수의 구형파 신호를 발생하는 팬(Fan)의 회전속도를 카운터를 이용하여 측정하는 방법에 있어서, 구형파의 에지(Edge) 시점에서 발생하는 인터럽트(Interrupt, 이하 EINT)에 따라 상기 카운터 내의 CCF프래그(FLAG)와, 상기 카운터의 오버플로우(Overflow) 시점에서 발생하는 인터럽트(이하, OVINT)에 따라 상기 카운터 내의 CF프래그가 동시에 'HIGH'로 세팅되었는지 판단하는 단계를 수행한다(S301).
그 다음, 상기 CCF프래그와 CF프래그가 동시에 'HIGH'로 세팅된 경우, 상기 EINT가 팬의 1회전시 발생된 구형파 신호에서 마지막 에지 시점에서 발생하는 인터럽트(이하, EINT2)인지 판단하는 단계를 수행한다(S302'). 이는, 에지 수를 나타내는 변수값(S)를 확인함으로써 EINT2가 발생하였는지 판단할 수 있다.
즉, 전술한 대로, 변수값(S)를 하나 지정하여 0으로 세팅한 다음, EINT가 발생할 때마다 변수값(S)을 하나씩 증가시키는 경우, 예를 들어, 상기 팬이 한번 회전하는 동안 2개의 구형파를 발생한다고 가정하면, EINT2에서 상기 변수값(S)은 5가 되므로, CCF프래그가 'HIGH'이고 상기 변수값(S)은 5인 경우, EINT2가 발생한 것으로 판단할 수 있다. 참고로, EINT2 이후 다음 에지 인터럽트(INT)에서 상기 변수값(S)은 다시 0으로 리셋된다.
그 다음, EINT2인 경우, EINT2 다음에 OVINT가 발생하였는지 판단하는 단계를 수행한다(S304).
전술한 대로, 오류가 발생할 수 있는 경우 중 하나는 EINT2 다음에 OVINT가 순차적으로 근접 발생한 경우이므로, 상기 S304 단계를 통해 EINT2 다음에 OVINT 가 발생하였는지 판단하는 것이다.
이는, 마지막 에지 시점에서의 카운터값(N2)과 2(W-1)를 비교함으로써 판단할 수 있고, 도 5를 참조하여 이에 자세히 설명하기로 한다. 여기서, W는 카운터의 비트(bit) 수이고, 이해를 돕기 위하여, 상기 카운터의 비트 수를 3라 가정하고 이하 설명하기로 한다.
2를 밑으로 하고 카운터의 비트 수(W)를 지수로 거듭제곱한 2(W-1)값은 카운터가 가질 수 있는 최대 카운터값의 반(즉, 2(3-1)=4)이 되므로, 도 5a에서 카운터값(N2), 즉 7이 2(W-1)값, 즉 4보다 보다 크면, EINT2 다음에 OVINT 가 발생한 것으로 판단할 수 있다.
반대로, 도 5b에 나타난 바와 같이, 카운터값(N2), 즉 1이 2(W-1)값, 즉 4보다 작은 경우에는 OVINT 다음에 EINT2가 발생한 것이 된다.
EINT2 다음에 OVINT가 발생한 경우, 상기 카운터의 오버플로우 발생 수를 나타내는 변수값(M)을 확정하고, 상기 CF 및 CCF프래그를 'LOW'로 세팅하며, 카운터값(N5)을 읽어들이는 단계를 수행한다(S305').
전술한 대로, EINT2 다음에 OVINT가 순차적으로 근접 발생하여 상기 CCF프래그와 CF프래그가 동시에 'HIGH'로 세팅되는 경우, 원래대로라면 상기 제2 알고리즘만(도 3b의 S206단계)이 수행되어야 할 과정에서 상기 제3 알고리즘(도 3b의 S202단계)이 함께 수행되어 변수값(M)이 하나 더 증가하게 되고, 결국, 추가되지 않아야 할 변수값(M)이 하나 더 추가되는 오류가 발생하게 된다. 하지만, 상기 S305'단계에서 변수값(M)을 확정함으로써 변수값(M)이 더 추가되는 오류를 수정할 수 있다. 그리고, 상기 CF 및 CCF프래그를 'LOW'로 세팅하여 도 3b의 S202, S204, S206단계를 모두 통과하고, 상기 S305'단계에서 읽어들인 카운터값(N2)을 가지고 S208단계에서 팬의 회전속도를 측정하게 된다.
한편, 상기 S301 단계에서 상기 CCF프래그와 CF프래그가 동시에 'HIGH'로 세팅되지 않은 것으로 판단된 경우나, 상기 S302'단계에서 EINT2이 아닌 것으로 판단된 경우, 또는 상기 S304단계에서 EINT2 다음에 OVINT가 발생한 것이 아닌 것으로 판단된 경우, 모두 오류가 발생하지 않는 상황이므로, 별도의 수정없이 바로 도 3b 과정으로 넘어간다.

본 명세서에 기재되는 실시예와 도면에 도시되는 구성은 본 발명의 가장 바람직한 일 실시예에 불과할 뿐이고 본 발명의 기술적 사상을 모두 대변하는 것은 아니므로, 본 출원시점에 있어서 이들을 대체할 수 있는 다양한 균등물과 변형예들이 있을 수 있음을 이해하여야 한다.
Hereinafter, exemplary embodiments of the present invention will be described in detail with reference to the accompanying drawings. Prior to this, terms or words used in the present specification and claims should not be construed as being limited to the common or dictionary meanings, and the inventors should properly explain the concept of terms in order to best explain their own invention. Based on the principle that it can be defined, it should be interpreted as meaning and concept corresponding to the technical idea of the present invention.

3 is a flowchart illustrating a method of measuring a rotation speed of a fan using a counter according to the present invention. 3A and 3C are flowcharts illustrating a step of correcting an error that may occur when measuring the rotational speed of the fan, and FIG. 3B is a flowchart illustrating the process of measuring the rotational speed of the fan described in the background. In the same way, the method for measuring the rotational speed of the fan using the counter according to the present invention first goes through the process of FIG. 3A or 3C and then proceeds to the process of FIG. 3B.

First, a process of correcting an error that may occur when the rotation speed of the fan is measured will be described with reference to FIG. 3A.
In the method for measuring the rotation speed of the fan (Fan), which generates a certain number of square wave signals in one revolution using a counter, the counter according to the interrupt (EINT) generated at the edge of the square wave Determining whether the CF flag in the counter is set to 'HIGH' at the same time according to the CCF flag FLAG in the block and an interrupt (hereinafter referred to as OVINT) generated at the overflow of the counter (hereinafter, referred to as OVINT). S301).
As described above, when the EINT occurs, the CCF flag is set to 'HIGH', and when the OVINT occurs, the CF flag is set to 'HIGH'. The CCF flag and the CF flag can be set to 'HIGH' at the same time.
If the CCF flag and the CF flag are set to 'HIGH' at the same time, determining whether the EINT is an interrupt (hereinafter referred to as EINT1) occurring at the first edge of the square wave signal generated when the fan rotates one time. (S302).
This can determine whether EINT1 has occurred by checking the variable value S representing the number of edges. That is, as described above, if one variable value S is designated and set to 0, and then the variable value S is increased by one each time EINT occurs, for example, two fans are rotated once. Assuming that a square wave is generated, since the variable value S becomes 1 in EINT1, when the CCF flag is 'HIGH' and the variable value S is 1, it may be determined that EINT1 has occurred.
Then, in the case of EINT1, it is determined whether OVINT occurs after EINT1 (S303).
As described above, one of the cases where an error may occur is that OVINT occurs sequentially after EINT1, and thus, it is determined whether OVINT occurs after EINT1 through step S303.
This can be determined by comparing the counter value N1 and 2 (W-1) at the first edge time point, which will be described in detail with reference to FIG. 4. Here, W is the number of bits of the counter, and for convenience of explanation, it will be described below assuming that the number of bits of the counter is three.
The value of 2 (W-1) with 2 below and the number of bits of the counter (W) raised to the exponent is half the maximum counter value that the counter can have (that is, 2 (3-1) = 4). In FIG. 4A, when the counter value N1, that is, 7 is greater than the 2 (W-1) value, that is, 4, it may be determined that OVINT occurs after EINT1.
On the contrary, as shown in Fig. 4B, when the counter value N1, i.e., 1 is smaller than the value of 2 (W-1) , i.e., 4, EINT1 occurs after OVINT.
When OVINT occurs after EINT1, the variable value M indicating the overflow occurrence number of the counter is set to 1, the CF and CCF flags are set to 'LOW', and the counter value N1 is read. Performs the step (S305).
As described above, when OVINT sequentially occurs after EINT1 and the CCF flag and the CF flag are simultaneously set to 'HIGH', only the third algorithm described in the background art (step 202 of FIG. 3B) is performed. In the process to be performed, the first algorithm (step 204 of FIG. 3B) is performed together to set the variable value M to 0, and eventually, an error that the variable value M is missing must be added. However, by setting the variable value M to 1 in step S305, an error in which the variable value M is missing may be corrected. Then, the CF and CCF flags are set to 'LOW' to pass all the steps S202, S204, and S206 of FIG. 3B, and the rotation speed of the fan is determined in step S208 with the counter value N1 read in step S305. Will be measured.
On the other hand, when it is determined in step S301 that the CCF flag and the CF flag are not set to 'HIGH' at the same time, or when it is determined that it is not EINT1 in step S302, or OVINT after EINT1 in step S303. If it is determined that does not occur, since the error does not occur in both cases, go directly to Figure 3b process without any additional modification.

Now, a process of correcting another error that may occur when measuring the rotation speed of the fan will be described with reference to FIG. 3C.
In the method for measuring the rotation speed of the fan (Fan), which generates a certain number of square wave signals in one revolution using a counter, the counter according to the interrupt (EINT) generated at the edge of the square wave Determining whether the CF flag in the counter is set to 'HIGH' at the same time according to the CCF flag FLAG in the block and an interrupt (hereinafter referred to as OVINT) generated at the overflow of the counter (hereinafter, referred to as OVINT). S301).
Next, when the CCF flag and the CF flag are set to 'HIGH' at the same time, determining whether the EINT is an interrupt (EINT2) occurring at the last edge point in the square wave signal generated at one rotation of the fan. To perform (S302 '). This can determine whether EINT2 has occurred by checking the variable value S representing the number of edges.
That is, as described above, if one variable value S is designated and set to 0, and then the variable value S is increased by one each time EINT occurs, for example, two fans are rotated once. Assuming that a square wave is generated, since the variable value S becomes 5 in EINT2, when the CCF flag is 'HIGH' and the variable value S is 5, it may be determined that EINT2 occurs. For reference, the variable value S is reset to 0 again at the next edge interrupt INT after EINT2.
Next, in the case of EINT2, it is determined whether OVINT occurs after EINT2 (S304).
As described above, one of the cases where an error may occur is that OVINT occurs sequentially after EINT2, and thus, it is determined whether OVINT occurs after EINT2 through step S304.
This can be determined by comparing the counter value N2 at the last edge time and 2 (W-1) , which will be described in detail with reference to FIG. Here, W is the number of bits of the counter, and for convenience of explanation, it will be described below assuming that the number of bits of the counter is three.
The value of 2 (W-1) with 2 below and the number of bits of the counter (W) raised to the exponent is half the maximum counter value that the counter can have (that is, 2 (3-1) = 4). In FIG. 5A, when the counter value N2, that is, 7 is greater than the value of 2 (W-1) , that is, 4, it may be determined that OVINT occurs after EINT2.
Conversely, as shown in Fig. 5B, when the counter value N2, i.e., 1 is smaller than the value of 2 (W-1) , i.e., 4, then EOV2 occurs after OVINT.
When OVINT occurs after EINT2, determining a variable value M indicating the overflow occurrence number of the counter, setting the CF and CCF flags to 'LOW', and reading the counter value N5. (S305 ').
As described above, when OVINT occurs sequentially after EINT2 and the CCF flag and the CF flag are set to 'HIGH' at the same time, the second algorithm alone (step S206 of FIG. 3B) should be performed. In this process, the third algorithm (step S202 of FIG. 3B) is performed together to increase the variable value M by one more, resulting in an error of adding one more variable value M that should not be added. do. However, by determining the variable value M in step S305 ', the error of adding the variable value M may be corrected. Then, the CF and CCF flags are set to 'LOW' to pass all the steps S202, S204 and S206 of FIG. 3B, and the rotation speed of the fan in step S208 with the counter value N2 read in step S305 '. Will be measured.
On the other hand, when it is determined in step S301 that the CCF flag and the CF flag are not set to 'HIGH' at the same time, or when it is determined that it is not EINT2 in step S302, or after EINT2 in step S304. If it is determined that the OVINT does not occur, since all errors do not occur, go directly to Figure 3b process without any additional modification.

The embodiments described in the present specification and the configuration shown in the drawings are only the most preferred embodiments of the present invention, and do not represent all of the technical idea of the present invention, and various equivalents may be substituted for them at the time of the present application. It should be understood that there may be water and variations.

삭제delete

Claims (14)

1회전시 일정 개수의 구형파 신호를 발생하는 팬(Fan)의 회전속도를 카운터를 이용하여 측정하는 방법에 있어서,
(a)구형파의 에지(Edge) 시점에서 발생하는 인터럽트(Interrupt, 이하 EINT)에 따라 상기 카운터 내의 CCF프래그(FLAG)와, 상기 카운터의 오버플로우(Overflow) 시점에서 발생하는 인터럽트(이하, OVINT)에 따라 상기 카운터 내의 CF프래그가 동시에 'HIGH'로 세팅되었는지 판단하는 단계;
(b)상기 CCF프래그와 CF프래그가 동시에 'HIGH'로 세팅된 경우, 상기 EINT가 팬의 1회전시 발생된 구형파 신호에서 첫번째 에지 시점에서 발생하는 인터럽트(이하, EINT1)인지 판단하는 단계;
(c)EINT1인 경우, EINT1 다음에 OVINT가 발생하였는지 판단하는 단계;
(d)EINT1 다음에 OVINT가 발생한 경우, 상기 카운터의 오버플로우 발생 수를 나타내는 변수값(M)을 1로 세팅하고, 상기 CF 및 CCF프래그를 'LOW'로 세팅하며, 첫번째 에지 시점에서의 카운터값(N1)을 읽어들이는 단계;
(e)EINT1만 인가되는 경우 카운터값(N1)을 읽어들이고 변수값(M)을 0으로 세팅하는 제1 알고리즘, 팬의 1회전시 발생된 구형파 신호에서 마지막 에지 시점에서 발생하는 인터럽트(이하, EINT2)만 인가되는 경우 마지막 에지 시점에서의 카운터값(N2)을 읽어들이고 변수값(M)을 확정하는 제2 알고리즘, OVINT만 인가되는 경우 변수값(M)을 하나 증가시키는 제3 알고리즘을 수행하는 단계;
(f)상기 CF 및 CCF프래그를 'LOW'로 세팅하는 단계; 및
(g)상기 카운터값(N1), 카운터값(N2), 변수값(M)을 이용하여 상기 팬의 회전속도를 구하는 단계;를 포함하는, 카운터를 이용한 팬의 회전속도 측정 방법.
In the method of measuring the rotational speed of the fan (Fan) that generates a certain number of square wave signals in one rotation using a counter,
(a) The CCF flag FLAG in the counter and the interrupt generated at the overflow point of the counter (hereinafter referred to as OVINT) according to the interrupt (EINT) occurring at the edge point of the square wave. Determining whether the CF flag in the counter is set to 'HIGH' at the same time;
(b) if the CCF flag and the CF flag are set to 'HIGH' at the same time, determining whether the EINT is an interrupt (EINT1) generated at the first edge of the square wave signal generated during one revolution of the fan. ;
(c) in the case of EINT1, determining whether OVINT occurs after EINT1;
(d) When OVINT occurs after EINT1, the variable value M representing the number of overflow occurrences of the counter is set to 1, and the CF and CCF flags are set to 'LOW', and at the first edge time point. Reading a counter value N1;
(e) The first algorithm for reading the counter value (N1) and setting the variable value (M) to 0 when only EINT1 is applied, the interrupt that occurs at the last edge point in the square wave signal generated during one revolution of the fan (hereinafter, If only EINT2) is applied, the second algorithm reads the counter value N2 at the last edge point and determines the variable value M. If only OVINT is applied, the third algorithm increases one variable value M. Making;
(f) setting the CF and CCF flags to 'LOW'; And
(g) calculating the rotational speed of the fan using the counter value (N1), the counter value (N2), and the variable value (M).
삭제delete 삭제delete 제 1 항에 있어서,
상기 (c)단계는 첫번째 에지 시점에서의 카운터값(N1)과 2(W-1)값(여기서, W는 상기 카운터의 비트(bit) 수)을 비교하여 상기 카운터값(N1)이 2(W-1)값보다 크면 EINT1 다음에 OVINT가 발생한 것으로 판단하는, 카운터를 이용한 팬의 회전속도 측정 방법.
The method of claim 1,
The step (c) is a counter value (N1) and second (W-1) value (where, W is a bit (bit) number of the counter), the counter value (N1) as compared to at the time when the first edge 2 ( W-1) If it is greater than the value, it is determined that OVINT occurs after EINT1.
삭제delete 삭제delete 제 1 항에 있어서,
상기 (a)단계에서 상기 CCF프래그와 CF프래그가 동시에 'HIGH'로 세팅되지 않은 것으로 판단된 경우, 상기 (e)단계로 분기하는, 카운터를 이용한 팬의 회전속도 측정 방법.
The method of claim 1,
If it is determined in step (a) that the CCF flag and CF flag is not set to 'HIGH' at the same time, branching to the step (e), the rotational speed measuring method of the fan using a counter.
제 1 항에 있어서,
상기 (b)단계에서 EINT1이 아닌 것으로 판단된 경우, 또는 상기 (c)단계에서 EINT1 다음에 OVINT가 발생한 것이 아닌 것으로 판단된 경우, 상기 (e)단계로 분기하는, 카운터를 이용한 팬의 회전속도 측정 방법.
The method of claim 1,
If it is determined in step (b) that it is not EINT1, or in step (c) it is determined that OVINT does not occur after EINT1 in step (c), the rotation speed of the fan using the counter branching to step (e). How to measure.
1회전시 일정 개수의 구형파 신호를 발생하는 팬(Fan)의 회전속도를 카운터를 이용하여 측정하는 방법에 있어서,
(a)EINT에 따라 상기 카운터 내의 CCF프래그(FLAG)와, OVINT에 따라 상기 카운터 내의 CF프래그가 동시에 'HIGH'로 세팅되었는지 판단하는 단계;
(b)상기 CCF프래그와 CF프래그가 동시에 'HIGH'로 세팅된 경우, 상기 EINT가 EINT2인지 판단하는 단계;
(c)EINT2인 경우, EINT2 다음에 OVINT가 발생하였는지 판단하는 단계;
(d)EINT2 다음에 OVINT가 발생한 경우, 상기 카운터의 오버플로우 발생 수를 나타내는 변수값(M)을 확정하고, 상기 CF 및 CCF프래그를 'LOW'로 세팅하며, 카운터값(N5)을 읽어들이는 단계;
(e)EINT1만 인가되는 경우 카운터값(N1)을 읽어들이고 변수값(M)을 0으로 세팅하는 제1 알고리즘, 팬의 1회전시 발생된 구형파 신호에서 마지막 에지 시점에서 발생하는 인터럽트(이하, EINT2)만 인가되는 경우 마지막 에지 시점에서의 카운터값(N2)을 읽어들이고 변수값(M)을 확정하는 제2 알고리즘, OVINT만 인가되는 경우 변수값(M)을 하나 증가시키는 제3 알고리즘을 수행하는 단계;
(f)상기 CF 및 CCF프래그를 'LOW'로 세팅하는 단계; 및
(g)상기 카운터값(N1), 카운터값(N2), 변수값(M)을 이용하여 상기 팬의 회전속도를 구하는 단계;를 포함하는, 카운터를 이용한 팬의 회전속도 측정 방법.
In the method of measuring the rotational speed of the fan (Fan) that generates a certain number of square wave signals in one rotation using a counter,
(a) determining whether the CCF flag (FLAG) in the counter is set to 'HIGH' at the same time according to EINT and the CF flag in the counter according to OVINT;
(b) determining whether the EINT is EINT2 when the CCF flag and the CF flag are simultaneously set to 'HIGH';
(c) in the case of EINT2, determining whether OVINT occurs after EINT2;
(d) When OVINT occurs after EINT2, the variable value (M) indicating the overflow occurrence number of the counter is determined, the CF and CCF flags are set to 'LOW', and the counter value (N5) is read. Entering step;
(e) The first algorithm for reading the counter value (N1) and setting the variable value (M) to 0 when only EINT1 is applied, the interrupt that occurs at the last edge point in the square wave signal generated during one revolution of the fan (hereinafter, If only EINT2) is applied, the second algorithm reads the counter value N2 at the last edge point and determines the variable value M. If only OVINT is applied, the third algorithm increases one variable value M. Making;
(f) setting the CF and CCF flags to 'LOW'; And
(g) calculating the rotational speed of the fan using the counter value (N1), the counter value (N2), and the variable value (M).
제 9 항에 있어서,
상기 (c)단계는 마지막 에지 시점에서의 카운터값(N2)과 2(W-1)값(여기서, W는 상기 카운터의 비트(bit) 수)을 비교하여 상기 카운터값(N2)이 2(W-1)값보다 크면 EINT2 다음에 OVINT가 발생한 것으로 판단하는, 카운터를 이용한 팬의 회전속도 측정 방법.
The method of claim 9,
Step (c) compares the counter value N2 at the last edge point with 2 (W-1) values (where W is the number of bits of the counter) so that the counter value N2 is equal to 2 ( W-1) If it is greater than the value, it is determined that OVINT occurs after EINT2.
삭제delete 삭제delete 제 9 항에 있어서,
상기 (b)단계에서 EINT2이 아닌 것으로 판단된 경우, 또는 상기 (c)단계에서 EINT2 다음에 OVINT가 발생한 것이 아닌 것으로 판단된 경우, 상기 (e)단계로 분기하는, 카운터를 이용한 팬의 회전속도 측정 방법.
The method of claim 9,
If it is determined in step (b) that it is not EINT2, or in step (c) it is determined that OVINT does not occur after EINT2 in step (c), the rotation speed of the fan using the counter branching to step (e). How to measure.
제 9 항에 있어서,
상기 (a)단계에서 상기 CCF프래그와 CF프래그가 동시에 'HIGH'로 세팅되지 않은 것으로 판단된 경우, 상기 (e)단계로 분기하는, 카운터를 이용한 팬의 회전속도 측정하는 방법.
The method of claim 9,
If it is determined in step (a) that the CCF flag and CF flag is not set to 'HIGH' at the same time, branching to the step (e), measuring the rotational speed of the fan using a counter.
KR1020100131443A 2010-12-21 2010-12-21 Measuring rotation speed of fan usinging counter KR101273750B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020100131443A KR101273750B1 (en) 2010-12-21 2010-12-21 Measuring rotation speed of fan usinging counter

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020100131443A KR101273750B1 (en) 2010-12-21 2010-12-21 Measuring rotation speed of fan usinging counter

Publications (2)

Publication Number Publication Date
KR20120070049A KR20120070049A (en) 2012-06-29
KR101273750B1 true KR101273750B1 (en) 2013-06-12

Family

ID=46688002

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020100131443A KR101273750B1 (en) 2010-12-21 2010-12-21 Measuring rotation speed of fan usinging counter

Country Status (1)

Country Link
KR (1) KR101273750B1 (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20060085726A (en) * 2005-01-25 2006-07-28 삼성전자주식회사 Digital micromirror device assembly
KR20090043178A (en) * 2007-10-29 2009-05-06 주식회사 만도 The compensation unit of wheel speed
KR20090085909A (en) * 2008-02-05 2009-08-10 엘에스산전 주식회사 Method for calculating revolution per unit time using high speed counter

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20060085726A (en) * 2005-01-25 2006-07-28 삼성전자주식회사 Digital micromirror device assembly
KR20090043178A (en) * 2007-10-29 2009-05-06 주식회사 만도 The compensation unit of wheel speed
KR20090085909A (en) * 2008-02-05 2009-08-10 엘에스산전 주식회사 Method for calculating revolution per unit time using high speed counter

Also Published As

Publication number Publication date
KR20120070049A (en) 2012-06-29

Similar Documents

Publication Publication Date Title
US8661306B2 (en) Baseboard management controller and memory error detection method of computing device utilized thereby
US8606429B2 (en) System and method for controlling an electronic device fan
CN109667728B (en) Fault detection method and device for wind generating set rotating speed sensor
CN109213703B (en) Data detection method and data detection device
WO2019114474A1 (en) Method and device for correcting position of motor rotor, and equipment and storage medium
CN103185015A (en) Fan abnormity alarm system and method
JP2010507044A (en) Method and system for deriving wind speed in a stall controlled wind turbine
CN105022686A (en) Method and apparatus for determining CPU occupancy rate of process on android platform
CN112331249B (en) Method, device, terminal equipment and storage medium for predicting service life of storage device
KR101273750B1 (en) Measuring rotation speed of fan usinging counter
MX2015005729A (en) A method for operating a compressor in case of failure of one or more measure signal.
CN111473359B (en) Combustion control method and device, electrical equipment and storage medium
US9063708B2 (en) Electronic device, storage medium and method for validating speed of a fan thereof
CN114635865B (en) Fan alarm method, terminal and storage medium
US9382915B2 (en) Control method of fan rotation speed
CN106991028B (en) Method and system for processing temperature abnormity of computer
CN109167705B (en) Method and system for acquiring delay step time in storage module
CN109491870A (en) A kind of detection method and device of the access state of sensor
US11230012B2 (en) Servo calibration method and apparatus and robot using the same
EP3321764A1 (en) Clock frequency detection method and apparatus
WO2024032432A1 (en) Radio frequency power supply signal acquisition method and apparatus
CN116974353A (en) Multiplexing method, multiplexing system and multiplexing chip for voltage detection circuit and power-on reset circuit
CN109284239B (en) Method and system for acquiring delay step time in storage module
CN110928742B (en) Hard disk rechecking period determining method, device, equipment and readable storage medium
CN108710731B (en) Method for judging by-pass event by sections

Legal Events

Date Code Title Description
A201 Request for examination
E701 Decision to grant or registration of patent right
GRNT Written decision to grant
FPAY Annual fee payment

Payment date: 20161114

Year of fee payment: 4

FPAY Annual fee payment

Payment date: 20170102

Year of fee payment: 5

FPAY Annual fee payment

Payment date: 20180403

Year of fee payment: 6

FPAY Annual fee payment

Payment date: 20190401

Year of fee payment: 7