Block diagram reduction techniques in control systems.ppt
Code
1. The whole process is orchestrated by a manager (manager.py file). This manages four processes: a
process that find the face in the frame; a process which calculates panning angles using a PID; a process
which calculates tilting angles using a PID; finally, a process which operates the servos so that the face is
in the centre. Here is an explanation for the code:
1
2
3
4
5
Center of the frame is calculated
PID controller is initialized
Loop used so error value for the
PID is continuously calculated
Servomotors are enabled
Set initial bounding box
coordinates to center of
frame
Pan and tilt angles
initialized to zero, and will
be updated by independent
PID processes
The PID constants (which I
derived by manually tuning
the PIDs) are set
The processes are executed
Tuning of the PID:
1. Set all the gains (I and
D) to zero
2. Incrementally
increased the P gain
until the servo started
to oscillate steadily.
3. Incrementally
increased the D gain
until the servo stopped
oscillating
4. Repeated this process
until the D gain doesn’t
stop the oscillations
5. Set P and D to last
stable values
6. Increased I until the
offsets are corrected
quickly