Mazda CX-7 nearly stalling…Help!

Sometimes is starts and runs fine. Most times on start up it will rev to about 1200 and quickly fall off to 4-500 where it struggles to stay on. When it does this it will not go past 25 km/hr. It has a couple times fallen into this state when driving. The CEL is solid on and the TCS light is flashing. OBD2 code reader shows the following:
CODE #1: P0220 (Throttle/Pedal Position - Switch B circuit) The extra data on this code shows ... Calculated load 45%, ECT 84.2ºF, ENG RPM 1107, Vehicle speed 2 mph, TPS 16%, RUN TIME 54 seconds, ECU VOLTS 14.32 V.
CODE #2: P2100 (Throttle Actuator Control Motor Circuit /Open
CODE #3 P050A (Cold Start Idle Air control system performance)
CODE #4: P0455 (Permanent Evap emission system leak detected - Gross leak, No Flow)
Cleaned the MAF to no avail.
I have since removed the throttle body, cleaned it really good as per a Youtube video, opened and inspected the sensor carefully in good condition, re-installed. Start attempt same results. Next I removed the accelerator pedal, checked the voltage ok, opened it up and inspected ok, re-installed and test to no avail. I was unable to test the Throttle body/accelerator pedal sensor with a meter as it is not a potentiometer type. Ie; they are both Hall Effect type sensors. I watched a video where this guy had a similar problem and it turned out to be his battery. My battery is brand new and holds really good charge so I started thinking it may be the spark plugs. I replaced all plugs and you guessed it, same results.
I also tried this relearn procedure I found ..
To do a Mazda throttle body relearn procedure
1. Perform a hard PCM reset by disconnecting the battery cables from the battery and touching them together. This will drain the capacitors in the PCM to wipe out adaptive memory.
2. Reconnect the battery and turn the key on but do not start the engine. Immediately depress the throttle to the floor (wide open throttle) 3 times. This will set the TPS angle.
3. Start the engine with no loads on (no lights, blower, defroster, etc) and allow it to come up to full operating temperature (wait for the radiator fans to come on.
4. Then add loads to the engine by turning on lights, AC, brake application, steering input, one at a time.
This will cause engine load and the throttle body will open to compensate for the increased load. The throttle body relearn is now done.
Any help is greatly appreciated.
 
Back