主权项 |
1. An image forming apparatus comprising:
an image forming unit including a containing unit that contains toner, and configured to form an image based on image data, by using the toner contained in the containing unit; a replenishment unit configured to replenish the containing unit with the toner; a first determination unit configured to determined, based on the image data, an amount of the toner consumed in the containing unit in a case where the image forming unit forms the image based on the image data; a detection unit configured to detect an amount of the toner contained in the containing unit; a first calculation unit configured to calculate a difference between the amount of the toner detected by the second detection unit and a target amount; a second calculation unit configured to calculate a cumulative value of the difference calculated by the first calculation unit; a second determination unit configured to determine a determination value used for determining whether the replenishment unit replenishes the containing unit with the toner, based on the consumption amount determined by the first determination unit, the difference calculated by the first calculation unit, and the cumulative value calculated by the second calculation unit; a prevention unit configured to prevent, in a case where a first determination value determined by the second determination unit at first timing is less than a threshold, the second calculation unit from accumulating the difference calculated by the first calculation unit at second timing following the first timing; and a controller configured to control the replenishment unit, based on the determination value determined by the second determination unit, wherein in a case where the first determination value determined by the second determination unit at the first timing is less than the threshold, the second calculating unit is prevented from accumulating the difference calculated by the first calculating unit at the second timing following the first timing, on the cumulative value calculated at the first timing. |