I had a friend that had the same problem w/an F7 for DC or DCC. I took the shell off & there was a lot of corrosion between the frames(HD double frame). I took it apart & thouroughly cleaned everything. I also found that the ground to the frame was loose.
I fixed everything & it ran real good for about 3 months & we started having the same problem again. I tried to fix it again, but the armature in the motor had gotten real hot & it left a film of carbon in the grooves. I cleaned it out again & now it runs real good, so far. Not saying the same thing is wrong w/yours. It seems like when an engine won't run, it's usually a bad ground or dirty wheels or a bad picup.
Larry C.