Apparatus and method for controlling motor

There is provided an apparatus and a method for controlling a motor. The apparatus for controlling a motor includes a signal detection unit detecting a first signal, a sampling unit acquiring the number of pulses of the first signal included in a predetermined sampling period, and an operation unit dividing the sampling period into a predetermined number of, a plurality of sub periods, and computing a speed of a motor by allocating predetermined weights to the number of pulses of the first signal included in the plurality of respective sub periods, wherein the operation unit computes the speed of the motor by controlling at least one of the weights and the number of sub periods when the number of pulses of the first signal included in the plurality of respective sub periods is different.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application claims the priority of Korean Patent Application No. 10-2012-0138922 filed on Dec. 3, 2012, in the Korean Intellectual Property Office, the disclosure of which is incorporated herein by reference.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention relates to an apparatus and a method for controlling a motor, capable of accurately detecting a speed of a motor, by computing the number of pulses of a first signal included in respective sub periods by dividing a predetermined sampling period into a plurality of sub periods, in connection with a first signal having a pulse form indicating a speed of a motor, in detecting the speed of the motor, method of and when the number of pulses of the first signal included in respective sub periods is different, that is, when the speed of the motor is not constant but changed, by allocating different weights to the number of pulses included in respective sub periods or controlling the number of sub periods dividing a sampling period.

2. Description of the Related Art

When a motor is operated, an output signal of a sensor detecting a position and a speed of a rotor may be generated in pulse form. A speed of a motor, a position of a rotor, and the like, are detected by using the sensor signal generated in pulse form, such that the motor may be controlled so as to be operated at a required speed. Therefore, in order for a motor to be precisely controlled at a required state, the speed, the position, and the like, of the motor, need to be accurately detected.

When the number of pulses included in the sensor signal at the time of rotating the rotor once is defined as pulses per rotation (PPR), revolutions per minute (RPM) of the motor may be defined as follows.

In Equation 1, Tc represents a sampling period detecting the number of pulses included in the sensor signal and n represents the number of pulses included in one sampling period.

When the number of pulses included in a predetermined sampling period is detected, the sampling period and the pulse are not synchronized with each other, such that an error may occur in terms of the number of pulses. In particular, in the above Equation 1, when n=1, a relatively larger error may occur in detection of RPM of the motor and the error in the RPM of the motor may be reduced by increasing the PPR, simply by increasing Tc. However, when Tc is increased, the sampling period detecting the number of pulses may be relatively long, affecting the computation of the speed of the motor from the detection time of the speed of the motor to the previously generated pulse. Therefore, there is a problem in that Tc may not increase infinitely in order to reduce the error in the detection of RPM of the motor.

The related art document below relates to a sensor module and discloses that a sensor module detects the speed of a motor by changing a sampling period. However, the related art document below only discloses detecting the speed of a motor based on a variable sampling period and does not disclose accurately detecting the speed of a motor without significantly increasing the sampling period by dividing one sampling period into a plurality of sub periods while leaving the entire sampling period the same.

SUMMARY OF THE INVENTION

An aspect of the present invention is to provide an apparatus and a method for controlling a motor, capable of precisely controlling the motor, by computing the number of pulses of a first signal included in a predetermined sampling period, in connection with a first signal having a pulse form reflecting a speed of a motor, method of dividing a sampling period into a plurality of sub periods, allocating weights to the number of pulses included in each sub period, and computing the speed of the motor, based on the allocated weights, to reduce an error between an actual speed and a detected speed at the time of detecting the speed of the motor without significantly increasing the sampling period.

According to an aspect of the present invention, there is provided an apparatus for controlling a motor, including: a signal detection unit detecting a first signal; a sampling unit acquiring the number of pulses of the first signal included in a predetermined sampling period; and an operation unit dividing the sampling period into a predetermined number of, a plurality of sub periods, and computing a speed of a motor by allocating predetermined weights to the number of pulses of the first signal included in the plurality of respective sub periods, wherein the operation unit computes the speed of the motor by controlling at least one of the weights and the number of sub periods when the number of pulses of the first signal included in the plurality of respective sub periods is different.

The operation unit may compute the speed of the motor by allocating different weights to the number of pulses of the first signal included in the plurality of respective sub periods.

The operation unit may allocate higher weights to the number of pulses of the first signal included in a sub period close to an end of the sampling period among the plurality of sub periods.

The operation unit may allocate higher weights to the plurality of respective sub periods in the case that the respective sub periods include a larger number of pulses of the first signal when the number of pulses of the first signal included in the plurality of respective sub periods is different.

The operation unit may divide the sampling period into a larger number of sub periods than the number of the sub periods in the case that the number of pulses of the first signal included in the plurality of respective sub periods is different.

The operation unit may compute the speed of the motor for the entire sampling period.

According to another aspect of the present invention, there is provided a method of controlling a motor, including: detecting a first signal; acquiring the number of pulses of the first signal included in a predetermined sampling period; dividing one sampling period into a predetermined number of, a plurality of sub periods; and computing a speed of a motor by allocating predetermined weights to the number of pulses of the first signal included in the plurality of respective sub periods.

In the computation of the speed of the motor, the speed of the motor may be computed by controlling at least one of the weights and the number of sub periods when the number of pulses of the first signal included in the respective sub periods is different.

In the computation of the speed of the motor, the speed of the motor may be computed by allocating different weights to the number of pulses of the first signal included in the plurality of respective sub periods.

In the computation of the speed of the motor, higher weights may be allocated to the number of pulses of the first signal included in a sub period close to an end of the sampling period among the plurality of sub periods.

In the computation of the speed of the motor, higher weights may be allocated to the sub periods including a larger number of pulses of the first signal when the number of pulses of the first signal included in the plurality of respective sub periods is different.

In the computation of the speed of the motor, the sampling period may be divided into a larger number of sub periods as the difference in the number of pulses of the first signal included in the plurality of respective sub periods is increased.

The speed of the motor may be the speed of the motor for the entire sampling period.

The number of plurality of sub periods may be 2n(n is an integer of 1 or more) and the weights allocated to the plurality of respective sub periods may have a value of 2m(m is an integer of 0 or more).

DETAILED DESCRIPTION OF THE EMBODIMENTS

FIG. 1is a block diagram schematically illustrating an apparatus for controlling a motor according to an embodiment of the present invention.

Referring toFIG. 1, an apparatus100for controlling a motor according to an embodiment of the present invention may include a signal generation unit110, a sampling unit120, an operation unit130, and a control unit140. The control unit140controls an operation of a motor150and the signal generation unit110may use a signal output from the motor150to generate a first signal indicating a position, a speed, and the like of a rotor of a motor.

The first signal output by the signal generation unit110, which is a signal determined by the speed, the position, and the like, of the rotor, may be a signal of a form including a plurality of pulses. For example, as the rotor rotates relatively fast, the first signal may include a larger number of pulses, such that the speed of the rotor of the motor may be measured by counting the number of pulses detected in the first signal within a specific time.

In order to accurately detect the speed of the rotor, the time of detecting the number of pulses of the first signal may be significantly increased. For example, the speed of the rotor may be more accurately detected by counting the number of pulses appearing in the first signal for 30 μs than by counting the number of pulses appearing in the first signal for 10 μs. However, the method may be applied only to the case in which the speed of the rotor is constantly maintained without being significantly changed. When the speed of the rotor is significantly changed, it may be difficult to detect the accurate speed of the motor even in the case in which the time of detecting the number of pulses of the first signal is increased.

When the speed of the rotor is significantly changed, the number of pulses of the first signal is significantly increased or reduced. That is, when the speed of the rotor is increased, the first signal includes a larger number of pulses within the same time, and when the speed of the rotor is reduced, the first signal includes a smaller number of pulses within the same time.

It is assumed that after the rotor rotates relatively fast and then the speed of the motor is suddenly reduced, the speed of the motor is actually relatively slow at the specific time when the apparatus100for controlling a motor detects the speed of the rotor. In this case, in order to accurately measure the speed of the rotor, when the detection time of the number of pulses of the first signal is set long, a larger number of pulses may be provided than those in the current speed within the detection time due to the inclusion of the past pulse in which the rotor rotates fast, within the corresponding detection time. Therefore, the apparatus100for controlling a motor may not accurately control the operation of the motor, that is, detect a faster speed of the rotor than the current actual speed at which the rotor of the motor is actually operated.

In order to solve the defect, in the present embodiment, the entire sampling period is divided into at least two sub periods, in the sampling operation of detecting the number of pulses included in the first signal generated by the signal generation unit110. The number of pulses of the first signal included in each of at least two sub periods is separately counted and the speed of the motor150is measured by the computation based on the number of pulses detected in each sub period, thereby reducing the error occurring at the time of measuring the speed of the motor. Further, the measurement accuracy of the speed of the motor may be increased without increasing the entire sampling period.

Therefore, the sampling unit120receives the first signal to detect the number of pulses appearing in the first signal for the predetermined sampling period Tc but computes the number of pulses of the first signal included in respective sub periods TS1to TSNby re-dividing the sampling period Tc into the plurality of sub periods TS1to TSN. The operation unit130computes the speed of the motor150by using the number of pulses of the first signal included in respective sub periods TS1to TSNand may simply compute the speed of the motor150from an average or a weighted average of the number of pulses included in respective sub periods TS1to TSN. This will be described below with reference toFIG. 2.

The control unit140controls the operation of the motor150by using the speed of the motor150computed by the operation unit130. Even in a case in which the speed of the motor150measured by the operation unit130includes a slight error, the speed of the motor150is assumed to be a speed at a specific time rather than a specific time period, and the control unit140may control the speed of the motor150, and the like, from results computed by the operation unit130. In this case, overshoot, and the like, may occur, or noise, vibrations, and the like may be adversely affected, due to a relatively large difference between the result computed by the operation unit130and the actual speed of the motor150. Therefore, the speed of the motor150may be measured by using the number of pulses of the first signal detected in the plurality of sub periods as described above for the operation unit130to compute the speed of the motor150with the relatively smaller possible error.

FIG. 2is a graph for describing an operation of the apparatus for controlling a motor according to an embodiment of the present invention.

Referring toFIG. 2, the first signal is a signal having a pulse form in which the plurality of pulses repeatedly appear.

When the first signal is generated by the signal generation unit110as illustrated inFIG. 2, the sampling unit120counts the number of pulses appearing in the first signal for the sampling period Tc. The operation unit130may use the number of pulses detected in the sampling period Tc to compute the speed of the motor150. The method may simply detect the speed of the motor150but may include lots of errors.

The sampling unit120counts the number of pulses appearing in the first signal for the sampling period Tc and the speed of the motor150computed by the operation unit130is applied as the speed of the motor150at the end of the sampling period Tc rather than the speed of the motor for the sampling period Tc. Further, in order for the operation unit130to accurately detect the speed of the motor150, a relatively long sampling period Tc is required.

However, when the sampling period Tc is set to be excessively long, the pulse of the first signal generated long before the end of the sampling period Tc at which the speed of the motor150is detected also affects the computation of the speed of the motor150. Therefore, the present embodiment proposes a method of computing the speed of the motor150by dividing the sampling period Tc into a plurality of sub periods TS1, TS2, and TS3rather than simply setting the sampling period Tc to be long. Further, dividing the sampling period Tc into three sub periods is by way of example only, and therefore the sampling period Tc may be divided into sub periods smaller or larger than three.

Hereinafter, for the convenience of explanation, it is assumed that the number of pulses is included in individual sub periods TS1, TS2, and TS3among the plurality of sub periods as in the following Table 1, in connection with first to third cases.

Referring to Table 1, in the first case, the same number of pulses is detected in respective sub periods TS1, TS2, and TS3, and in the second and third cases, different numbers of pulses are detected in respective sub periods TS1, TS2, and TS3. That is, it is assumed that the first case corresponds to the case in which the speed of the motor150is almost constant without being significantly changed, the second case corresponds to the case in which the speed of the motor150is increased, and the third case corresponds to the case in which the speed of the motor150is reduced.

The operation unit130may compute the speed of the motor150by a weighted average method of allocating predetermined weights to the number of pulses calculated in respective sub periods TS1, TS2, and TS3, and TS3and computing an average thereof. In this case, the speed of the motor150computed by the operation unit130is an instantaneous speed at the end of Tc rather than the average speed for the entire sampling period Tc, such that a relatively large weight may be allocated to the number of pulses of the final sub period TS3that is close to the end of Tc in order to significantly reduce the errors. In the first case, in the case that the weights of 1, 2, and 6 are sequentially allocated to respective sub periods, the speed of the motor150is computed as follows.

Meanwhile, the speed of the motor150is also computed as 40 in the first case, even in a case in which the general arithmetic average is computed without allocating the weights to each sub period. That is, when the speed of the motor150is substantially maintained constantly without being significantly changed, the operation unit130computes the same speed independent of the allocation of weights. On the other hand, in the second case, when the weights of 1, 2, and 6 are allocated to respective sub periods, the speed of the motor150is as follows.

When the weights are applied, the speed of the motor150is computed as 50, while when the speed of the motor150is computed by only the arithmetic average without the weights, the speed of the motor150is computed as 40. The speed of the motor may constantly increase at the end of the sampling period Tc at which the speed of the motor150is detected, such that the speed of the motor150may be computed with a relatively smaller error when the weights are applied.

The third case is also similar to the second case. When the weights are applied, the speed of the motor150is computed as about 28.9, while when the speed of the motor is computed by the arithmetic average without the weights, the speed of the motor150becomes 40. Therefore, when only the arithmetic average is applied, the speed of the motor150that is slow while entering the third sub period TS3is not reflected, and more accurate computation results may be obtained when the weighted average method is applied.

FIG. 3is a flow chart for describing a method of controlling a motor according to another embodiment of the present invention.

Referring toFIG. 3, the method of controlling a motor according to the embodiment of the present invention starts as computing the number of pulses of the first signal included in the sampling period Tc (S30). The sampling unit120receives the first signal output by the signal generation unit110and counts the number of pulses appearing in the first signal for the predetermined sampling period Tc.

The operation unit130receives the sampling results, divides the sampling period Tc into the plurality of sub periods (S32), and determines whether the entire sampling period Tc lapses (S33). When the entire sampling period Tc lapses, the weights are applied to the number of pulses of the first signals included in respective sub periods (S36). In this case, as described above, the speed of the motor150to be computed by the operation unit130is the instantaneous speed at the end of the entire sampling period Tc, such that relatively highest weights may be allocated to the number of pulses included in the sub period closest to the entire sampling period Tc.

Meanwhile, in S32, when the sampling period Tc is divided into the plurality of sub periods, the number of sub periods may be set to be 2n(n is a natural number) in consideration of the computational amount of the operation unit130. In this case, the operation unit130may be substituted by a shift operation for a division operation and for the same reason, the weights allocated to the number of pulses included in respective sub periods may also be set to a value of 2m(m is an integer of 0 or more).

As described above, the operation unit130computes the speed of the motor150using the weighted average method (S38) and the control unit140controls the operation of the motor150based on the computed speed. The speed of the motor150may be accurately computed without setting the entire sampling period Tc to be excessively long, by applying the method proposed by the embodiment of the present invention, such that the operation of the motor150may be precisely controlled.

As set forth above, according to the embodiment of the present invention, the first signal reflecting the speed of the motor may be detected and the number of pulses of the first signals detected for the sampling period having the plurality of sub periods is counted. In this case, the number of pulses of the first signal included in the plurality of respective sub periods may be separately counted and the speed of the motor may be computed by separately allocating the weights to respective sub periods according to the number of pulses included in respective sub periods to precisely detect the speed of the motor without significantly increasing the sampling speed.