If the second pulse generator 125 determines that the actually-measured value in the current time is smaller than the above-described average as a result of the process of Step S27 (Yes in Step S27), the second pulse generator 125 adds a difference (count value corresponding to the difference) between the actually-measured value in the current time and the above-described average, to the count value of the second counter (Step S28). Then, the second pulse generator executes the process of Step S30 described later.
If the second pulse generator 125 determines that the actually-measured value in the current time is larger than the above-described average as a result of the above-described process of Step S26 (Yes in Step S26), the second pulse generator 125 corrects the count value of the second counter by subtracting a difference (count value corresponding to the difference) between the actually-measured value in the current time and the above-described average, from the count value of the second counter (Step S29).
Then, the second pulse generator 125 determines whether or not the corrected count value of the second counter reaches the count value Ct corresponding to one control cycle (Step S30). If the second pulse generator 125 determines that the count value of the second counter does not reach the count value Ct corresponding to one control cycle as a result of the process of Step S30 (No in Step S30), the second pulse generator 125 adds 1 to the count values of the first counter and the second counter (Step S31), and then executes the process of Step S30 again.