Professional Documents
Culture Documents
Sathish K Shanmugasundaram
Department of Industrial Engineering, 2000
Introduction
Bearcat II Control systems in mobile robots Need for feedback control Manipulating the error and need for a good control system Use of the Proportional-Integral-Derivative algorithm or PID controller Optimization approach
Tuning Methods
Bearcat II
Autonomous mobile robot Motors, drive train and control system Vision guidance system
ISCAN Sonar
Sens or L1
Sens or L2
+
Battery 12 V Inv ertor 120 VAC
ISCAN Interfac e
DMC103 0
CPU
4 port RS232 Sens or R2
Backup Battery 12 V
+ -
Key board
Mouse
Left Wheel
Gear box
Motor
Motor
Gear box
Right Wheel
Encoder
Encoder
Designed to generate an output Corrective effort to be applied Drives variable to set point Actuator to actuate and sensor to sense Input Controller Plant to be controlled Measurement device Output Reward function
PID Controller
Proportional, Integral and Derivative Closed loop controller with elaborate algorithm for output determination Current value of error Integral value of error over recent time interval Current derivative of the signal to determine length of time and an amount of correction
Three quantities multiplied by tuning constants P is proportional constant I is the integral constant D is the derivative constant
PID explained
With proportional band, controller output is proportional to the error or change in measurement O = E*100/P With integral action, the controller output is proportional to the amount of time error is present. It eliminates the offset by the prop. band With derivative action, the controller output is proportional to the rate of change of measurement with time O = D (dm/dt)
Very important to get a well-designed loop Thats all there is on a PID controller Tricky part is setting the P, I, D constants Idea is to weight the sum of of PID terms so as to produce a controller output that steadily drives the process variable to eliminate error
Possible solutions
Use largest possible values of tuning constants Controller amplifies every error Initiates extremely aggressive efforts to eliminate discrepancy between set point and process variable But, aggressive controller will drive the variable past the set point On the other hand, conservative tuning may be unable to eliminate an error before next appears Controller should work between these extremes
Tuning methods
Three methods
In first method just tweak the constants and watch the controller handle the next error Uses the experience of people to correct the error, but affects the other terms Involves mathematical modeling of the process that relates the current value of variable to history of the controllers output
Serial motion controller, plugs into a PC bus Available for 1, 2, 3, or 4 axes per card Can interface to a variety of motors and drives Accepts feedback from linear or rotary encoder Provides many modes of motion Easy to program, instruction represented by easy two letter commands Provided motion smoothening to eliminate jerk
32-bit Motorola 68331 series with 64K RAM Motor interface Communication is using a bi-directional FIFO and PC interrupt handling General I/O Amplifier converts a +/- 10v signal into current to drive the motors. Encoder translates motion to electrical pulses to be fed into the DMC 1000
Trial-and-error, iterative Uses a software called Windows Servo Design Kit (WSDK) First a sinusoidal input is supplied to the motors This causes the wheel to rotate back and forth The system response is collected Done with wheels off the ground, on the ground Various surfaces that the robot encounters are grass, asphalt, wood, tarp, sand and polished surfaces
Tuning continued
System response is collected Using these values a bode plot frequency response is plotted Overshoot level is inspected visually If it is okay then the PID value are used in the main program
Parameter slides can be changed to adjust the PID constants It is iterative. If the plot is not good then the values have to be adjusted to get a good plot If there is a change in the drive system hardware or the load then the whole process would have to be repeated again To eliminate a new optimized process is dealt next
Model of the system setup using Mat lab's Simulink toolbox Optimization using the Optimization toolbox Mat lab file that has the models transfer function Mat lab file converting the digital gains to analog signals Simulink graphics model which takes the analog gains and simulates the step response
Model explanation
Step input signal fed to a summation block Constant values to be used are calculated using a separate M-file Analog values in the Mat lab kernel Zero on hold DAC Amplifier Encoder feedback fed to the summation block for correction
Model to be optimized
Shows the output response Ideally we would like the response to rise immediately to the signal This gives rise to error
Time (seconds)
Non-linear model Enables the system to track a unit step input into the system Two methods are used lsqnonlin is the non-linear least squares method. It minimizes the error between the output and input fminmax minimizes the maximum value of the output at anytime. The first method is chosen It is a multi-objective function because the error needs to be minimized for all time steps
Lsqnonlin method
function F = lsq(pid, a1, a2) Kp = pid(1); % Move variables into model parameters Ki = pid(2); Kd = pid(3); % choose solver and set model workspace to this function opt = simset('solver', 'ode5', 'SrcWorkspace', 'Current'); [tout, xout, yout] = sim('optsim', [0 100], opt); F = yout-1; % compute error signal
Step 2: The second file invokes the model and the optimizing routine
kolmodel % loads the model
pid0 = [1 10 12] % setting initial values a1 = 0; a2 = 0.0005; options = optimset('LargeScale', 'off', 'Display', 'iter', 'TolX', 0.001, 'TolFun', 0.001); pid = lsqnonlin('lsq', pid0, [], [], options, a1, a2) % put variables back into the base workspace Kp = pid(1); Ki = pid(2); Kd = pid(3);
Optimization results
Iteration Func-count Residual 1 3 4.76719e+012 2 10 4.70723e+012 3 17 4.65431e+012 4 24 4.58281e+012 5 31 4.56367e+012 6 39 4.53102e+012 7 55 4.53102e+012 Optimization terminated successfully: Search direction less than tolX pid = 0.7234
4.9399 10.0233
Results
The results obtained are nearly the best approximation for a stable system because of error minimization It is a more scientific and logical method Better than the current trial and error method The values can be directly used on the WSDK kit to see how they fit
Due to difficulty of using a specific model a generic model was chosen. Future team members could try to work on the specific model Thought the iterative steps were eliminated, still the initial value had to be chosen. Only one method was dealt with. More methods can be used and compared for the best results
Acknowledgements
Dr. Hall, Dr. Shell and Dr. Huston Robotics team members, past and present MINE department staff