As long as you have the motherboard type set to a ramps board this is a hardware fault. probably a dead mosfet on d10
Or could be as simple as not having the ramps on the mega firmly.
Or could be as simple as not having the ramps on the mega firmly.