System for controlling an electric motor, wherein the system includes an electric motor in the form of a compressor of a heat pump and/or the system is a heat pump, comprising: - an inverter bridge for transforming electrical energy for driving the electric motor, - a control unit for controlling the inverter bridge, - a safety unit for monitoring the driving of the electric motor, - a regulating unit for regulating the electric motor by means of the control unit and the inverter bridge, wherein, for signal transmission, the regulating unit is connected to the control unit and the safety unit is connected to the control unit, the safety unit monitors the driving of the electric motor independently of the regulating unit, the control unit is configured to operate the electric motor in a field weakening mode, and/or the electric motor is configured to be operated in a field weakening mode, one or more pressure sensors are arranged on a refrigeration circuit of the heat pump for pressure monitoring in the refrigeration circuit and/or a temperature sensor is arranged on the compressor of the heat pump for temperature monitoring of the compressor and are connected to the safety unit for signal transmission, and the safety unit is configured to detect the presence of a fault as a function of one or more sensor values of the one or more pressure sensors and/or of the temperature sensor and to set the electric motor of the compressor into a predefined state by means of the inverter bridge as a function of the fault by transmitting and/or not transmitting a signal to the control unit, characterized in that the control unit is configured to control the electric motor by means of the inverter bridge according to the control of the safety unit if a control of the electric motor by the regulating unit conflicts with a control by the safety unit. - an inverter bridge for transforming electrical energy for driving the electric motor, - a control unit for controlling the inverter bridge, - a safety unit for monitoring the driving of the electric motor, - a regulating unit for regulating the electric motor by means of the control unit and the inverter bridge, wherein, for signal transmission, the regulating unit is connected to the control unit and the safety unit is connected to the control unit, the safety unit monitors the driving of the electric motor independently of the regulating unit, the control unit is configured to operate the electric motor in a field weakening mode, and/or the electric motor is configured to be operated in a field weakening mode, one or more pressure sensors are arranged on a refrigeration circuit of the heat pump for pressure monitoring in the refrigeration circuit and/or a temperature sensor is arranged on the compressor of the heat pump for temperature monitoring of the compressor and are connected to the safety unit for signal transmission, and the safety unit is configured to detect the presence of a fault as a function of one or more sensor values of the one or more pressure sensors and/or of the temperature sensor and to set the electric motor of the compressor into a predefined state by means of the inverter bridge as a function of the fault by transmitting and/or not transmitting a signal to the control unit, characterized in that the control unit is configured to control the electric motor by means of the inverter bridge according to the control of the safety unit if a control of the electric motor by the regulating unit conflicts with a control by the safety unit.