PID Control of a Remote Controlled Car John J. Noegel
Purpose • To become familiar with the operation of a handy board and the coding involved in controlling a system.
Problem Statement • To use a Handy board to control a remote control vehicle to follow a wall at a specified distance and follow codes by priority
Test Background • Remote control vehicle with one motor for turning and one for forward and reverse motion • Two IR sensors – One for staying a specified distance from the wall and the other for obstacles • Involve priority coding in the program
PID Programming • Set Point = 228 (desired distance for IR) • Kp = 32, Ki = 2, Kd = 0.1, • ts = 0.001 • c_error = set-y; ( y = analog input of IR) • power = (Kp*c_error)+Ki*(integral)+de_dt*(Kd); • integral = 0.5*(c_error+p_error)*ts; • de_dt = (c_error-p_error)/ts; • motor(1,(int)power); (turn motor)
Conclusions • Attempted to tune PID three times unsuccessfully • Motor unacceptable to program for true PID control • System can be made to operate without constraints of testing, but operation could be much cleaner
Recommendations • Use a system without a 3 position motor (all on right, all on left, or off) • Use a system preferably with position sensitive motor or install an actuator to control position of motor