Thanks for using Just Answer. I will be glad to assist you.
The idle on your engine is controlled by the idle air control valve, not the throttle position sensor. It sounds like the idle air control valve is failing.
Here is some information about the idle air control valve:
The PCM controls engine idle speed by controlling current to two stepper coils contained within the idle air control valve assembly.
The PCM controls a two-coil stepper motor, which controls the bypass air intake into the throttle body, to decrease or increase engine idle speed. The motor allows air to bypass the throttle plate and enter the intake manifold. The determination of how much air is allowed to enter the engine is based on current engine speed, A/C compressor operation (On/Off), coolant temperature, throttle position or if the transaxle controller requests greater engine torque during power-off downshifts (automatic trans axle vehicles only). The PCM/TC will also use the Idle Air Control (IAC) Motor to control coast down shifts.
IDLE AIR CONTROL SYSTEM
The purpose of the idle air control system is to control engine idle speed, while compensating for changes in engine load.
The idle air control (IAC) valve, mounted in the throttle body, controls bypass air around the throttle plate. By moving a conical valve, called a pintle, in towards the seat will decrease airflow. If the pintle is moved outwards from the seat a controlled amount of air is allowed to bypass the throttle plate. If the PCM determines that rpm is too low, more air is allowed to bypass the throttle to increase rpm. If rpm is too high, less air is allowed to bypass the throttle plate decreasing rpm.
During idle, the proper position of the IAC valve is calculated by the PCM, based on battery voltage, coolant temperature, engine load and engine rpm. If the rpm drops below specification and the throttle valve is closed, the PCM moves the IAC valve to control speed.
Once the PCM has sought a desired idle it can retard or advance spark timing to smooth the idle out in slight changes. This operation keeps the IAC valve from continuously moving in and out. The PCM will learn the IAC position for both A/C and non-A/C operations. These values can be displayed using a Scan tool.
An unstable TP sensor at idle, varying more than four counts (TP counts read on Scan tool), will disrupt closed loop engine idle control.