﻿ PID Control
 PID Control
 Note: The PID output control is an advanced parameter.  It is recommended that you use the non-PID output control at first until the traction control operates in a satisfactory manner.   PID   PID is the name for a general control algorithm which uses proportional, integral and derivative terms to control an output.  For traction control, PID can be used to control the over slip output value to the ECU based on the actual and target wheel slip.   Each term (proportional, integral and derivative) has a gain which determines how much effect each term has on the output.  The gain may be set to 0, which disables the term, or any value higher than zero.  A value of 1 is considered nominal. The PID control works by first calculating the difference between the target and actual wheel slip (this value is the system 'error'). Eg if the target slip is 2% and the actual slip is 6%, the error value is 4%.   The proportional term value is the error value multiplied by the proportional gain. The proportional term provides the bulk of the output value. Eg if the error value is 4% and the proportional gain is 1, then the proportional term value is 4.   The integral term is the sum of previous error values, divided by the frequency of the control and then multiplied by the integral gain. The integral term will sum errors of time, so that the actual slip will get closer to the target slip. Eg is the previous integral term is 0, and the error value is 4, and the control algorithm runs at 100 Hz, then the integral term will be 0.04.   The derivative term is the difference between the error value the last time the control algorithm ran and the current error value, multiplied by the derivative gain.  Eg if the previous error value was 3%, and the current error value is 4%, then the derivative term will be -1%. The derivative term will tend to stop the output value from 'overshooting' the target.   The derivative smoothing factor sets the exponential rolling average time used for derivative calculation.  A higher value will smooth the derivative term.   The ECU output is the sum of each term (p, i, d).  Eg, if the proportional term is 4, integral term is 0.04 and the derivative term is -1 then the ECU output will be 3.04%   Using PID Control   It is recommended to set the proportional gain to 1.   Since traction control is usually short acting, the error of time tend to be small, and integral gain can usually be set to 0 so that it is not used.   The derivative term will tend to dampen the ECU output as the wheel slip increases sharply.  This will reduce the tendency for the traction control to over shoot the target and oscillate.  A derivative gain of 0.1 to 0.5 normally works well.   The derivative smoothing factor should be set to give the least oscillation with the derivative term.  Normally 2 to 5 works well.   Values of P=1, I=0, D=0 will give the same output as the non-PID control algorithm.