When connected to 12v supply, Gate is connected to negative with a 1k resistor to source, source connected to positive, drain to motor and motor to negative. This works OK. When I try with the speed controller it doesn't work(mosfet gets hot). I think, therefore, there is an issue with the negative to the gate when the speed controller is used(speed controller has to be connected to a 24v supply).