SlideShare a Scribd company logo
1 of 1
Download to read offline
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

More Related Content

Similar to Code

PID Tuner: A practical guide
PID Tuner: A practical guidePID Tuner: A practical guide
PID Tuner: A practical guideRudolfKalman
 
PID Controller and its design
PID Controller and its designPID Controller and its design
PID Controller and its designKonirDom1
 
Pf700 energy savings_lab
Pf700 energy savings_labPf700 energy savings_lab
Pf700 energy savings_labconfidencial
 
How to tune pid loops
How to tune pid loopsHow to tune pid loops
How to tune pid loopssaeed shafiei
 
How to tune PID loops
How to tune PID loopsHow to tune PID loops
How to tune PID loopssaeed shafiei
 
Pid controller by Mitesh Kumar
Pid controller by Mitesh KumarPid controller by Mitesh Kumar
Pid controller by Mitesh KumarMitesh Kumar
 
control technology of bachlor of engineering technology
control technology of bachlor of engineering technologycontrol technology of bachlor of engineering technology
control technology of bachlor of engineering technologyengineerfazi245
 
Textile lab machines operation procedure
Textile lab machines operation procedureTextile lab machines operation procedure
Textile lab machines operation procedureMd Fahimuzzaman
 
solar tracker manual with wind sensor
solar tracker manual with wind sensorsolar tracker manual with wind sensor
solar tracker manual with wind sensorMangesh Islur
 
Pid logix wp008--en-p
Pid logix wp008--en-pPid logix wp008--en-p
Pid logix wp008--en-pbenditasea
 
Pf400 process pid_for_fans_lab
Pf400 process pid_for_fans_labPf400 process pid_for_fans_lab
Pf400 process pid_for_fans_labconfidencial
 
Automotive aerodynamics-optimization---2013-07-17
Automotive aerodynamics-optimization---2013-07-17Automotive aerodynamics-optimization---2013-07-17
Automotive aerodynamics-optimization---2013-07-17Sandeep Sovani, Ph.D.
 
Report - Line Following Robot
Report - Line Following RobotReport - Line Following Robot
Report - Line Following RobotDivay Khatri
 

Similar to Code (20)

PID Tuner: A practical guide
PID Tuner: A practical guidePID Tuner: A practical guide
PID Tuner: A practical guide
 
PID Controller and its design
PID Controller and its designPID Controller and its design
PID Controller and its design
 
Pf700 energy savings_lab
Pf700 energy savings_labPf700 energy savings_lab
Pf700 energy savings_lab
 
How to tune pid loops
How to tune pid loopsHow to tune pid loops
How to tune pid loops
 
How to tune PID loops
How to tune PID loopsHow to tune PID loops
How to tune PID loops
 
4470838.ppt
4470838.ppt4470838.ppt
4470838.ppt
 
Pid controller by Mitesh Kumar
Pid controller by Mitesh KumarPid controller by Mitesh Kumar
Pid controller by Mitesh Kumar
 
Pf40 pid lab fan
Pf40 pid lab fanPf40 pid lab fan
Pf40 pid lab fan
 
control technology of bachlor of engineering technology
control technology of bachlor of engineering technologycontrol technology of bachlor of engineering technology
control technology of bachlor of engineering technology
 
Textile lab machines operation procedure
Textile lab machines operation procedureTextile lab machines operation procedure
Textile lab machines operation procedure
 
Trapezoidal Velocity.pptx
Trapezoidal Velocity.pptxTrapezoidal Velocity.pptx
Trapezoidal Velocity.pptx
 
SMED
SMEDSMED
SMED
 
solar tracker manual with wind sensor
solar tracker manual with wind sensorsolar tracker manual with wind sensor
solar tracker manual with wind sensor
 
Pid logix wp008--en-p
Pid logix wp008--en-pPid logix wp008--en-p
Pid logix wp008--en-p
 
Pf400 process pid_for_fans_lab
Pf400 process pid_for_fans_labPf400 process pid_for_fans_lab
Pf400 process pid_for_fans_lab
 
ControlProject
ControlProjectControlProject
ControlProject
 
Mahindra projects
Mahindra projectsMahindra projects
Mahindra projects
 
Automotive aerodynamics-optimization---2013-07-17
Automotive aerodynamics-optimization---2013-07-17Automotive aerodynamics-optimization---2013-07-17
Automotive aerodynamics-optimization---2013-07-17
 
Pi dfor dummies
Pi dfor dummiesPi dfor dummies
Pi dfor dummies
 
Report - Line Following Robot
Report - Line Following RobotReport - Line Following Robot
Report - Line Following Robot
 

Recently uploaded

University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdfKamal Acharya
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Bookingdharasingh5698
 
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Bookingroncy bisnoi
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdfKamal Acharya
 
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoorTop Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoordharasingh5698
 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityMorshed Ahmed Rahath
 
Minimum and Maximum Modes of microprocessor 8086
Minimum and Maximum Modes of microprocessor 8086Minimum and Maximum Modes of microprocessor 8086
Minimum and Maximum Modes of microprocessor 8086anil_gaur
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxJuliansyahHarahap1
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VDineshKumar4165
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . pptDineshKumar4165
 
Unit 2- Effective stress & Permeability.pdf
Unit 2- Effective stress & Permeability.pdfUnit 2- Effective stress & Permeability.pdf
Unit 2- Effective stress & Permeability.pdfRagavanV2
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptDineshKumar4165
 
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Arindam Chakraborty, Ph.D., P.E. (CA, TX)
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTbhaskargani46
 
Block diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptBlock diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptNANDHAKUMARA10
 

Recently uploaded (20)

University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdf
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
 
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdf
 
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoorTop Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna Municipality
 
Minimum and Maximum Modes of microprocessor 8086
Minimum and Maximum Modes of microprocessor 8086Minimum and Maximum Modes of microprocessor 8086
Minimum and Maximum Modes of microprocessor 8086
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptx
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
 
Unit 2- Effective stress & Permeability.pdf
Unit 2- Effective stress & Permeability.pdfUnit 2- Effective stress & Permeability.pdf
Unit 2- Effective stress & Permeability.pdf
 
Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
 
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced LoadsFEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
 
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
 
Block diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptBlock diagram reduction techniques in control systems.ppt
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