An adaptie control can be very useful in applications where the characteristic of the controlled plant is changing over time. this paper describes one implementation of an adaptive proportional-integral-derivative (PID) controller using simultaneous perturbation stochastic approximation algorithm (SPSA). the SPSA algorithm is appropriate for this applications because it is usually difficult to obtain the deteiled nonlinear model of the system response with respect to the PID gains, and the number of measurements required is relatively small. the proposed adaptive controller is a model reference adaptive control using a realistic target response instead of an ideal step function. the evaluation showed that the proposed adaptive controller is able to optimize the PID gains with the output position response approaching the target position responce.