A drive controller for a motor of a compressor, the drive controller comprising: a drive circuit configured to apply voltages to windings of the motor; a speed control module configured to control the drive circuit to rotate the motor at a requested speed; a speed determination module configured to generate the requested speed; and a defrost module configured to enable a defrost mode in response to a defrost command received from a system controller; characterised in that : the speed determination module is configured to, in response to the defrost mode being enabled, ramp the requested speed down from a speed demand to a defrost speed, wherein the defrost speed is set according to a programmed value and the speed demand is provided to the drive controller by the system controller, wherein a refrigerant reversing valve is actuated by the system controller while the defrost mode is enabled, the speed determination module is configured to, in response to the requested speed reaching the defrost speed, maintain the requested speed at the defrost speed until conclusion of the defrost mode, and the speed determination module is configured to, in response to conclusion of the defrost mode, ramp the requested speed up to the speed demand. a drive circuit configured to apply voltages to windings of the motor; a speed control module configured to control the drive circuit to rotate the motor at a requested speed; a speed determination module configured to generate the requested speed; and a defrost module configured to enable a defrost mode in response to a defrost command received from a system controller; characterised in that : the speed determination module is configured to, in response to the defrost mode being enabled, ramp the requested speed down from a speed demand to a defrost speed, wherein the defrost speed is set according to a programmed value and the speed demand is provided to the drive controller by the system controller, wherein a refrigerant reversing valve is actuated by the system controller while the defrost mode is enabled, the speed determination module is configured to, in response to the requested speed reaching the defrost speed, maintain the requested speed at the defrost speed until conclusion of the defrost mode, and the speed determination module is configured to, in response to conclusion of the defrost mode, ramp the requested speed up to the speed demand. the speed determination module is configured to, in response to the defrost mode being enabled, ramp the requested speed down from a speed demand to a defrost speed, wherein the defrost speed is set according to a programmed value and the speed demand is provided to the drive controller by the system controller, wherein a refrigerant reversing valve is actuated by the system controller while the defrost mode is enabled, the speed determination module is configured to, in response to the requested speed reaching the defrost speed, maintain the requested speed at the defrost speed until conclusion of the defrost mode, and the speed determination module is configured to, in response to conclusion of the defrost mode, ramp the requested speed up to the speed demand. <EOS>