A method of controlling a motor comprising a number of phases (1, 2, 3), each phase (1, 2, 3) being connected to a first voltage through a top switching device and to a second voltage through a bottom switching device, the method comprising the steps of: calculating a respective phase voltage demand value (V 1, V 2, V 3) for each phase (1, 2, 3) of the motor indicative of the net voltage to be applied to the phase; calculating the duty period value (T 1, T 2, T 3) of a pulse width modulated signal for the top switching device and the duty period value (B 1, B 2, B 3) of a pulse width modulated signal for the bottom switching device of each phase (1, 2, 3) needed to apply a net voltage to the phase corresponding to the voltage demand value; the method comprising processing the duty period value (T 1, T 2, T 3, B 1, B 2, B 3) to define for each phase the time delay between a first switching edge for the top switching device where it is switched from an off state to an on state and a second switching edge for the top switching device where it is switched back to the off state and the time delay between a third switching edge for the bottom switching device where it is switched from an on state to an off state and a fourth switching edge for the bottom switching device where it is switched back to the on state, the position of the edges defining a cycle of a PWM signal; calculating the positions of the edges of the signals for one phase (1, 2, 3) relative to the edges of the signals for the other phases (1, 2, 3) so that at a first instance the total current flowing into or out of the motor is indicative of the current in a single phase (1, 2, 3) and at a second instance the total current flowing in the motor is indicative of the current flowing in a second, different, phase (1, 2, 3); and modulating each switching device (T, B) with its respective PWM signal, in which the edges within a cycle are positioned relative to each other so that at a third instance substantially zero total current is flowing into or out of the motor, in which at said third instance all the top switching devices are switched on whilst the bottom switching devices are switched off, and in which the edges are aligned so that at a fourth instance all the top switching devices are switched off whilst the bottom switching devices are switched on, characterised in that the method further comprising the steps of taking two sample measurements of the total current flowing into or out of the motor using a current measurement circuit sample at the third instance and the other sample at the fourth instance and from which two streams of data corresponding to zero current are generated, wherein each stream of data is separately filtered and averaged to allow a compensating value to track changes in the zero output of the current measurement circuit. calculating a respective phase voltage demand value (V 1, V 2, V 3) for each phase (1, 2, 3) of the motor indicative of the net voltage to be applied to the phase; calculating the duty period value (T 1, T 2, T 3) of a pulse width modulated signal for the top switching device and the duty period value (B 1, B 2, B 3) of a pulse width modulated signal for the bottom switching device of each phase (1, 2, 3) needed to apply a net voltage to the phase corresponding to the voltage demand value; the method comprising processing the duty period value (T 1, T 2, T 3, B 1, B 2, B 3) to define for each phase the time delay between a first switching edge for the top switching device where it is switched from an off state to an on state and a second switching edge for the top switching device where it is switched back to the off state and the time delay between a third switching edge for the bottom switching device where it is switched from an on state to an off state and a fourth switching edge for the bottom switching device where it is switched back to the on state, the position of the edges defining a cycle of a PWM signal; calculating the positions of the edges of the signals for one phase (1, 2, 3) relative to the edges of the signals for the other phases (1, 2, 3) so that at a first instance the total current flowing into or out of the motor is indicative of the current in a single phase (1, 2, 3) and at a second instance the total current flowing in the motor is indicative of the current flowing in a second, different, phase (1, 2, 3); and modulating each switching device (T, B) with its respective PWM signal, in which the edges within a cycle are positioned relative to each other so that at a third instance substantially zero total current is flowing into or out of the motor, in which at said third instance all the top switching devices are switched on whilst the bottom switching devices are switched off, and in which the edges are aligned so that at a fourth instance all the top switching devices are switched off whilst the bottom switching devices are switched on, characterised in that the method further comprising the steps of taking two sample measurements of the total current flowing into or out of the motor using a current measurement circuit sample at the third instance and the other sample at the fourth instance and from which two streams of data corresponding to zero current are generated, wherein each stream of data is separately filtered and averaged to allow a compensating value to track changes in the zero output of the current measurement circuit.