A MAC valve — usually a 3-port solenoid — is the go-between for your ECU and your wastegate actuator. The ECU pulses it at a fixed frequency, and how long that pulse stays "on" (the duty cycle) decides how long the wastegate stays closed. More duty, generally, means more boost. Getting a closed-loop PID boost controller to hold a target cleanly — without overshoot, hunting, or a slow crawl to setpoint — comes down to tuning three values: Kp (Proportional), Ki (Integral), and Kd (Derivative). Before you touch any of them, try it above in the P.I.D. Tuning Simulator — it lets you drag all three gains against a simulated motor so you can see overshoot, droop, and oscillation happen in real time before you're doing it on a real car.
Most MAC-style boost solenoids run happiest somewhere between 20 and 30 Hz, with 30 Hz being a common sweet spot — go too low or too high and you shrink the usable duty-cycle window the valve will actually respond to[1]. Before closed-loop PID ever gets involved, build an open-loop base duty table that gets you close to your boost target on its own. PID should only be cleaning up the error that's left over, not doing all the work.
Kp reacts to the size of the error right now — the bigger the gap between target and actual boost, the harder it pushes. Start with Ki and Kd at or near zero, then bring Kp up gradually while running step tests. Too little Kp and you get sluggish spool with steady-state droop below target; too much and the boost trace starts "hunting" — rapid oscillation around the setpoint. Tune Kp until the response is fast without ringing, then back off slightly before moving on.
Kd looks at the rate of change of the error and applies a damping effect, which is what keeps an aggressive Kp from overshooting. Introduce it in small steps and watch how the boost trace approaches target during a hard pull. Too little and you'll see the overshoot/ringing that a strong Kp leaves behind; too much and the response goes sluggish or won't quite reach target. Derivative is often left low (or at zero) on slower, pneumatic wastegate setups — it matters more on fast-responding systems.
Ki accumulates error over time, which is what finally erases any steady-state droop and settles boost exactly on target. Add it in small amounts once Kp and Kd are stable, and watch sustained pulls at a held RPM/load rather than transients. Too little Ki and you'll live with a small persistent undershoot; too much and you'll get slow oscillations. This is also where integral windup shows up: if the valve is already saturated (at 0% or 100% duty) while a large error persists, the integral term keeps accumulating and overshoots badly once the actuator can respond again. Many ECUs guard against this with an overboost cutoff or a duty-cycle clamp on the integral term — it's worth understanding the mechanism even if your ECU handles it for you[2].
Quick-reference checklist:
• Tune order: Kp → Kd → Ki, one at a time
• Kp too high: rapid oscillation / hunting around target
• Kd too high: sluggish, slow to settle, may undershoot
• Ki too high: slow oscillation and overshoot, risk of windup
• Build an open-loop base duty table before enabling closed-loop PID
• Revisit all three gains once the base tune is stable — they interact
A step response test is the standard way to validate a boost PID: hold a steady, part-throttle RPM where boost sits below target, then snap to full throttle (or force a large jump in the target, if your ECU allows it) while logging manifold pressure, target, boost error, duty cycle, and the individual PID terms. The resulting trace shows you rise time, overshoot, and settling time in one shot — a high Kp or Ki shows up as overshoot, a weak Kd shows up as ringing. Do this on a dyno or a safe, closed road with a wideband, EGTs, knock monitoring, and your overboost protection armed and verified before you start. Make one change at a time and repeat the same test so you're comparing apples to apples.
Ambient air temperature changes air density slightly — cooler, denser air spools a touch quicker, while heat soak works against you. Oil temperature matters more than most people expect: turbo bearings want to see roughly 190–220°F oil to lubricate properly, and cold oil is thick enough to cause sluggish, delayed lubrication at startup, while overheated oil breaks down and increases wear[3]. Warm the whole drivetrain up before you start any aggressive step testing. Elevation is the big one: air gets thinner as you climb, so the turbo has to work harder to hit the same manifold pressure, and a boost target dialed in at sea level will spool and hold differently a few thousand feet up[4].
If you're chasing consistent boost across a real elevation change — driving up a mountain, for example — a barometric pressure (baro) sensor lets the ECU correct for it. Haltech's NSP software supports this under the sensor inputs[5], and the same physical MAP sensor hardware is often reused for the job[6]:
• Enable the Barometric Pressure function under sensor inputs
• Wire the sensor to an Analog Voltage Input (AVI), pull-up usually disabled
• Calibrate key-on/engine-off — it should read close to 100 kPa at sea level
• Feed baro into your fuel and ignition correction tables
• For boost specifically, map your target duty against baro for large elevation swings — closed-loop PID will pick up the smaller day-to-day variation on its own
Baseline the tune at low elevation first, then verify at altitude with the same kind of logging you used for your step tests — MAP, baro, and boost error all together. These pages on this site can help you with configuring your MAP and Temp sensors: MAP/Pressure Sensors for the sensor side, and Temp Sensors for oil and air temp inputs.
Always run with overboost protection armed, log everything, and lean on your ECU manufacturer's documentation or a professional tuner for settings specific to your hardware. Want to see this play out before touching a real ECU? Head back to the top of this page for the P.I.D. Tuning Simulator and try pushing Kp, Ki, and Kd past the point of stability — it's a much cheaper way to learn what windup and oscillation look like.
[1] DSPORT Magazine, "Science of Boost, Part 1: Solenoids" — how PWM frequency and duty cycle drive a boost control solenoid.
[2] Instrumentation Tools, "What is Integral Wind Up?" — a plain-language explanation of integral windup and anti-windup.
[3] Rick's Free Auto Repair Advice, "Oil Temperature: Key to Engine Performance" — ideal oil temperature range for turbocharged engines.
[4] Garrett Motion, "Turbocharging At Elevation" — how air density loss at altitude affects boost requirements.
[5] Haltech Support, Barometric Pressure Sensor — NSP setup for altitude/baro compensation.
[6] Haltech Support, Manifold Absolute Pressure (MAP) Sensor — sensor wiring and calibration.
[7] Haltech Support, Boost Control — Elite/NSP boost control function reference, including overboost offset and closed-loop parameters.
[8] Haltech Support, PID Control Mapping — how Kp/Ki/Kd map onto Haltech's closed-loop boost control.
[9] StrikeEngine, PID Tuning: A Beginner's Guide to Boost Control — a plain-English walkthrough of the same Kp/Ki/Kd tuning order covered above.
For the underlying control theory — where the P, I, and D terms come from mathematically, and why they behave the way they do — see Karl Åström and Richard Murray's PID chapter from Feedback Systems: An Introduction for Scientists and Engineers (Caltech): PID Control (PDF).