1 of 42

VISION BASED �CONTROL OF SERVO MOTOR��

2 of 42

GROUP MEMBERS

  • ANKUR DAS

ROLL-14/EE/13

  • STAV GOSWAMI

ROLL-14/EE/20

  • AGNIBHA CHATTERJEE

ROLL-14/EE/19

  • KOUSIK PAKHIRA

ROLL-14/EE/47

3 of 42

MENTORS

  • Dr. Pradipta Kumar Banerjee

  • Ms. Debosmita Chakroborty

4 of 42

I would like to express my special thanks of gratitude to my professors who gave me the golden opportunity to do this wonderful project on this topic, which also helped me in doing a lot of Research and I came to know about many new things. I am really thankful to them.

ACKNOWLEDGEMENT

5 of 42

OBJECTIVE

  • Controlling the degree of servo motor with the help of gestures

  • By showing different gestures to the camera we can rotate the motor to our desired positions in our desired direction

6 of 42

WORKFLOW

IMAGE CAPTURE AND

GESTURE DETECTION

WIRELESS DATA TRANSFER

PRECISE SERVO MOTOR CONTROL

7 of 42

SERVO MOTOR CONTROL -�BLOCK DIAGRAM

INPUT

OUTPUT

ARDUINO

MOTOR

H-BRIDGE

(DESIRED POSITION)

0 1 - CCW

1 0 - CW

(OBTAINED POSITION)

8 of 42

BLOCK DIAGRAM

-

INPUT

ENCODER

OUTPUT

+

ARDUINO

MOTOR

H-BRIDGE

(DESIRED POSITION)

(OBTAINED POSITION)

ERROR

9 of 42

SERVOMECHANISM

  • Servomechanism, sometimes shortened to servo, is an automatic device that uses error-sensing negative feedback to correct the action of a mechanism.

  • It usually includes a built-in encoder or other position feedback mechanism to ensure the output is achieving the desired effect.

  • servomotor is a specific type of motor that is combined with a rotary encoder or a potentiometer to form a servomechanism.

10 of 42

BLOCK DIAGRAM OF SERVOMECHANISM

11 of 42

QUADRATURE ENCODER

  • Quadrature Encoders are handy sensors that let you measure the speed and direction of a rotating shaft (or linear motion) and keep track of how far you have moved.

  • A quadrature encoder normally has at least two outputs - Channel A and B - each of which will produce digital pulses when the thing they are measuring is in motion. 

  • These pulses will follow a particular pattern that allows you to tell which direction the thing is moving, and by measuring the time between pulses, or the number of pulses per second, you can also derive the speed.

12 of 42

13 of 42

14 of 42

H BRIDGE

Structure of an H bridge 

The two basic states of an H bridge

15 of 42

Truth table of H-Bridge

16 of 42

CIRCUIT DIAGRAM

17 of 42

  • PID control system is one of the most mature and commonly used control strategies in the industrial for decades thanks to its simple but effective algorithm
  • In order to control the motor speed, we need to close the loop by adding feedback of the actual motor speed to the controller.
  • Besides speed control, PID control system can also be used to control other parameters such as position, temperature, water level, stability, etc. 
  • The PID controller, just like its name, comprises a proportional (P), an integral (I) and a derivative (D) part. The controller parts are introduced in the following sections individually and in combined operation.

INTRODUCTION OF PID CONTROLLER

18 of 42

  • There are a few terms commonly used to describe the PID control loops, such as:
  • Control Variable (CV) – This is the output of the control loop. In this case, the CV is the duty cycle of the PWM signal that drives the motor.
  • Process Variable (PV) – This is the feedback value returned by the system to the controller. In this example, the PV is the current angle of the motor shaft.
  • Set Point (SP) – Set point is the value that we desire for the system. In our case, the SP is the target position of the motor shaft in angle.
  • Error (E) – Error refers to the difference between the set point and the process variable. In another words, it means how far the current position of the motor shaft from the target position.

19 of 42

PROPORTIONAL CONTROLLER

  • Proportional controller is called so, because the power we apply to the motor is proportional to the error of the system.

  • Error = Set Point – Process Variable

  • Control Variable = Kp * Error

20 of 42

  • To overcome the problem of steady state error for the P controller, I controller is being introduced. As its name suggests, the integral is merely an accumulated error signals encountered since start-up.

  • Integral = ∑(Error)

  • The equations for PI controller are as follow:

Error = Set Point – Process Variable

Integral = Integral + Error

Control Variable = (Kp * Error) + (Ki * Integral)

INTEGRAL CONTROLLER

21 of 42

  • The derivative of any variable describes how that variable changes over time. In a PID controller, the derivative is the rate of change of the error. In digital form, it can be described as:

  • Derivative = Error – Last Error,

where Error is the current error value and Last Error is the error value for the previous iteration.

  • The equations for the PD controller are as follow:

Last Error = Error

Error = Set Point – Process Variable

Derivative = Error – Last Error

Control Variable = (Kp * Error) + (Kd * Derivative)

DERIVATIVE CONTROLLER

22 of 42

  • By joining the P, I and D controller, we can take the advantages of the combined benefits from each controller. We have the P controller for fast system response, I controller to correct the steady state error and D controller to dampen the system and reduce overshoot.

  • The equations for the PID loop are illustrated below:

Last Error = Error

Error = Set Point – Process Variable

Integral = Integral + Error

Derivative = Error – Last Error

Control Variable = (Kp * Error) + (Ki * Integral) + (Kd * Derivative)

PID CONTROLLER

23 of 42

Block diagram of PID controller

24 of 42

25 of 42

  • We are going to recognize hand gestures from a video sequence
  • To recognize these gestures from a live video sequence, we first need to take out the hand region alone removing all the unwanted portions in the video sequence. 
  • After segmenting the hand region, we then count the fingers shown in the video sequence to instruct a robot based on the finger count. Thus, the entire problem could be solved using 2 simple steps –

1. Find and segment the hand region from the video sequence.

2. Count the number of fingers from the segmented hand region in the video sequence.

HAND GESTURE RECOGNITION

26 of 42

FLOWCHART

27 of 42

  • BACKGROUND SUBTRACTION :-

    • We need an efficient method to separate foreground from background. To do this, we use the concept of running averages.
    • We make our system to look over a particular scene for 30 frames. During this period, we compute the running average over the current frame and the previous frames.
    • By doing this, we essentially tell our system that -The video sequence that you stared at (running average of those 30 frames) is the background

SEGMENTATION OF

HAND REGION

28 of 42

  • MOTION DETECTION AND THRESHOLDING :-

    • After figuring out the background model using running averages, we use the current frame which holds the foreground object (hand in our case) in addition to the background.
    • We calculate the absolute difference between the background model (updated over time) and the current frame (which has our hand) to obtain a difference image that holds the newly added foreground object (which is our hand). This is what Background Subtraction is all about.
    • To detect the hand region from this difference image, we need to threshold the difference image, so that only our hand region becomes visible and all the other unwanted regions are painted as black. This is what Motion Detection is all about.

29 of 42

BACKGROUND SUBTRACTION AND THRESHOLDING

30 of 42

  • CONTOUR EXTRACTION :-

    • After thresholding the difference image, we find contours in the resulting image. The contour with the largest area is assumed to be our hand.
    • Contour is the outline or boundary of an object located in an image.

31 of 42

Segmenting hand region in a real-time video sequence

32 of 42

  • Find the convex hull of the segmented hand region (which is a contour) and compute the most extreme points in the convex hull (Extreme Top, Extreme Bottom, Extreme Left, Extreme Right).
  • Find the center of palm using these extremes points in the convex hull.
  • Using the palm’s center, construct a circle with the maximum Euclidean distance (between the palm’s center and the extreme points) as radius.
  • Perform bitwise AND operation between the thresholded hand image (frame) and the circular ROI (mask). This reveals the finger slices, which could further be used to calculate the number of fingers shown.

COUNTING THE FINGER

33 of 42

WORKING OF HAND GESTURE RECOGNITION

1. Background image is captured first

34 of 42

2. One finger recognized correctly

35 of 42

3. Two fingers are recognized correctly

36 of 42

CONFIGURING THE HC-05 BLUETOOTH MODULE – AT COMMANDS

  • We need to connect the Bluetooth module to the Arduino.

  • Connect the “EN” pin of the Bluetooth module to 5 volts and also switch the TX and RX pins at the Arduino Board.

  • The RX pin of the Arduino needs to be connected to the RX pin of the Bluetooth module, through the voltage divider, and the TX pin of the Arduino to the TX pin of the Bluetooth module.

  • While holding the small button over the “EN” pin we need to power the module and that’s how we will enter the command mode.

37 of 42

  • After this we need to upload an empty sketch to the Arduino but don’t forget to disconnect the RX and TX lines while uploading.

  • Then we need to run the Serial Monitor and there select “Both NL and CR”, as well as, “38400 baud” rate which is the default baud rate of the Bluetooth module.

  • Now we are ready to send commands and their format is as following.

38 of 42

SLAVE CONFIGURATION

  • We type just “AT” which is a test command we should get back the message “OK”.

  • Then if we type “AT+UART?” we should get back the massage that shows the default baud rate which is 38400. Then if we type “AT+ROLE?” we will get back a massage “+ROLE=0” which means that the Bluetooth device is in slave mode.

  • If we type “AT+ADDR?” we will get back the address of the Bluetooth module and it should looks something like this: 98d3:31:9069b0.

39 of 42

MASTER CONFIGURATION

  • To configure the other Bluetooth module as a master device. First we will check the baud rate to make sure it’s the samethe slave device. Then by typing “AT+ROLE=1” we will set the Bluetooth module as a master device.

  • After this using the “AT+CMODE=0” we will set the connect mode to “fixed address” and using the “AT+BIND=” command we will set the address of the slave device that we previously wrote down.

40 of 42

EXAMPLE OF

COMMUNICATION BETWEEN TWO

HC-05 BLUETOOTH MODULE

41 of 42

FUTURE ASCPECT

  • Using Artificial Neural Network (ANN) to make gesture recognition more accurate.
  • Extending the range of wireless communication between input and motor by using Internet Of Things ( IOT ).

42 of 42

THANK YOU