11/2021 i changed the TPS (Motorcraft) it definitly fixed my idling. I was distressed to hear when i picked it up from shop they replaced it about 6 months ago with a probably low line Napa. So PO'd i did not pay for that...they said they adjusted it...i'm still wondering how can you adjust that TPS? A couple of weeks ago i ordered a new Motorcraft and have that on hand because the idling thing was happening again but i tapped on the TPS and now it works ok. (makes me wonder about that connector even though it looks decent, it has not been replaced) That reminds me that earlier this year i remember pulling out of the driveway and it stalled as i pulled out of driveway thru the dip type gutter. It would not readily restart. And that made me think of a bad wire, but where?
If it will run for up to 80 minutes now it sounds as though you're very close to having it solved.
If tapping on the TPS made it function properly, perhaps the TPS mounting surface is oxidized and base of the sensor/switch isn't making good electriucal contact. (I don't remember if the TPS's base is metal or not-some are some aren't.) Another thing to try is burnishing the contacts on both the TPS and the pigtail it plugs into-by connecting and disconnecting them several times.
If the plug is oxidized inside and not making good electrical contact with those from the TPS, that could cause or add to the problem. It wouldn't hurt to
clean out the connector as the original ones, which usually have thick white grease in them may not have ANY and if there's any green present there, the brass in the contacts has been oxidizing. Even a thin film of oxidation can make for a poor electrical connection. Often simply sliding the connectors together and apart a few times will improve contact, BUT if one of the contacts is BADLY oxidized or has been arcing the metal may be very thin or weak and a few more times connecting it may break the connection entirely.
Luckily there are replacement pigtails available.
Tail light wiring and sockets are especially prone to this "oxidation/erosion" in salt belt areas because of their location, but it can happen in unexpected places too.
Moving on.
On many vehicles the throttle position sensor is mounted with screws or bolts that go through holes in the sensor mounting that are larger than they need to be simply to hold it in place. Some are actually slots rather than round holes. (My wife's Nissan had one with long slots.)
Round hole or slot, there has to be at least enough rotation available to allow SOME adjustment to compensate for manufacturing tolerances and to take up the slack or "dead range" that is almost always present at the beginning of the switch's rotation.
At the beginning of its range of rotation the throttle position sensor/switch will allow some degree of movement before it begins to alter the electrical signal from its "at rest/idle" position.
When the mounting screws/bolts are NOT in place you can usually rotate the switch manually and feel at what point spring tension begins. The IDLE position for the sensor is generally-but not always, at the very beginning of where you start to feel the spring pressure. Depending on how the sensor/switch is mounted say on a metal plate, it may be possible to file the holes/slots wider to allow for more adjustment.
If the "slack" in the TPS's mounting position
isn't taken up, and your throttle cable or linkage is adjusted properly, there will be excess pedal movement needed to get the engine's speed off idle. On teh other hand, if the TPS is adjusted too tightly, it will already be signalling the computer that you
want to be off idle.
Lastly, hitting that dip and the engine instantly dying also points to a weak connection-IMHO more likely a GROUND connection as the vehicle's body and frame will both flex when that happens, so I'd look there first. Unless you happen to have a battery hanging from its cables.