Does the fan vent cover close when the fan shuts down. If so, the control board is telling the fan to shut down by closing the cover. The actual shut off switch for the fan is under the lid.
Don't know if this will solve your problem. Try going up on the roof with a small wrench, not sure of the size, and slightly tighten the nut on the switch under the cover. You may have to disengage the lift mechanism by taking out the two screws on the metal plate attached to the cover to allow the cover to completely open up. That's how I do mine when I play with that switch. The switch is the ground for the motor and when you get some corrosion on the contacts the motor will fail to run.
Pete - Full Timing
2000 Country Coach Magna 40', CAT C10, #5892
2006 Jeep Liberty