My living room ceiling fan died a few days ago and I could small burning electrical coming from it.. I have 3 identical 52" Harbor Breeze ceiling fans so I figured I would just swap out the ceiling fan from the spare room to replace the bad one in the living room.
Had a friend come over to help me swap them and discovered the capacitor in the bad living room ceiling fan had gotten so hot it was melted and that was causing the electrical smell.. In fact it was probably very close to catching on fire

Since that appears to be the issue and not a bad motor as initially thought, I found a replacement capacitor on ebay for less than $8 dollars with the exact microfarads (Red 5µF, Yellow 6.5µF, Purple 6.5µF) though the yellow and purple wires are reversed on the replacement capacitor (Red, Purple, Yellow) but from what I've researched, that shouldn't be a problem so long as they are the exact microfarads.
I'll install it once it arrives next week and see how it works.