Q: loud rattle and grinding sound from engine on 2008 Jeep Patriot

Rookie cbe0621eac06868b3efe0d8d1d3611e23c60d3114864ea2ec19a68cfbd3eebab
sound started soft for about a month then got louder, noise is constant from start and does not change at any rpm range. All systems operational normal, no visual fault indications given. just the other day driving in stop and go traffic the smell of some kind of electrical burning was present and then five minutes after the battery light came on. Continue to drive for five minutes more than noise went away,drove just for 5 minutes more to destination w/battery light on no noise. 1 hr after started car noise came back no battery light on checked system all normal turn lights on than started to drive. 5 minutes into night driving my car started to hesitate on freeway than the instrumentation lights all came on and off momentarily than the car stalled. Pulled over to the side off freeway to restart the vehicle but was not able to due to depleted battery.
(3) Answers
I have a 2008 Jeep patriot and mine done the same thing. It was an alternator I think it was around $160 for the part. A friend put it in sort of a pain to put in but got it done and no more noise.