When the
throttle position sensor fails, the engine's computer tends to overcompensate with fuel, leading black exhaust coming from the tailpipe. There is a strong possibility of engine misfires, and the check engine light will come on.
Throttle position sensors can also develop "dead spots," or certain places along the throttle curve where it doesn't get a reading. When this happens, the above symptoms can occur but then stop when you further press or let off the gas pedal.