IRF510 ..... RdsON 0,6 ohm, current 4A ..... not the better one, but i think it had to resist, at least if your motor don't need to make a lot of efforts for turn ,,,,, BTW, what motor are you using, normal DC small motor with a demoltiplication gearbox ? ..... or something that requires high currents ?
Anyway, IRF510 still need to be heatsinked, imho, cause with 600 milliohm of RdsON, it will produce a lot of heat (600mW each A, may not look so much, but are 600mw/SECOND, after all) ..... and a DC motor can require much more current under effort than the one rated for free-running (i have small DC motors that are rated 500mA in free running, that are also rated 4,5A in max torque cycle and 14A in stopped rotor condition, ofcourse this burn the motor in minutes, if you power up it with blocked rotor, but the currents are these ones).
A more powerful mosfet will be much better, like as example these ones (and remember that less is the RdsON, less is the power turned in heat from the mosfet itself in ON condition):
IRF1010: 60V, 84A max, 12 milliohm RdsON
IRF1104: 40V, 100A max, 9 milliohm RdsON
IRF2805: 55V, 75A max, 4.7 milliohm RdsON
IRF1503: 30V, 75A max, 3.3 ohm RdsON
and so on ..... still need a heatsink, imho, but these ones have also enough current for work without blow up in seconds also without a heatsink (also if probably they will become hot).
Also, if you can access an oscilloscope, try to check the waveform that drive the mosfet ..... more the fronts (up and down part of the waveform) are vertical and "quick", and with no spikes, and better it is ..... remember that a PWM circuit dissipate more energy in heat in the rising and falling times of the waveform, than in the ON state, so, more they are quick and clean, and better it is.