A controller for a refrigeration cycle apparatus that includes a refrigerant circuit in which a compressor, a condenser, an expansion valve, and an evaporator are connected by a refrigerant pipe, the controller is configured to:
- detect a discharge temperature of refrigerant discharged from the compressor from a sensor,
- output an opening-degree command for the expansion valve on a basis of a discharge-temperature deviation between the discharge temperature and a set discharge temperature, and at least two types of control parameters including a proportionality coefficient and an integral coefficient such that the discharge temperature becomes the set discharge temperature, and
- calculate the proportionality coefficient and the integral coefficient corresponding to a refrigerant flow rate of refrigerant circulating through the refrigerant circuit,
- the proportionality coefficient and the integral coefficient is calculated by correcting preset reference values such that a variation range of the integral coefficient within a variation range of the refrigerant flow rate is larger than a variation range of the proportionality coefficient within the variation range of the refrigerant flow rate.