vision system for robotics and servo controller
TRANSCRIPT
VISION SYSTEM FOR ROBOTICS AND SERVO
MOTOR
By
C.S.Gowsick(16MI31)
Computer integrated Manufacturing
Department of Mechanical engineering
PSG college of Technology
Coimbatore
C.S.Gowsick 15MC25-Industrial Robotics
1
Topics
• Basic camera concept
• Lens
• Angle of view and Focal length
• Pixels and resolution
• Intensity
• Histogram
• Processing and analysis
• servo motor
• Servo motor controller
• Servo motor application
• Reference
2C.S.Gowsick 15MC25-
Industrial Robotics
Completed
Today’s topic
Basic Camera Concept
• A simplified camera setup consists of camera, lens, lighting, and object. The lighting illuminates the object and the reflected light is seen by the camera. The object is often referred to as target.
3C.S.Gowsick 15MC25-
Industrial Robotics
• The lens focuses the light that enters the camera in a way that creates a sharp image.
• An image in focus means that the object edges appear sharp. If the object is out of focus, the image becomes blurred. Lenses for photography often have auto-focus, whereas lenses for machine vision either have a fixed focus or manually adjustable focus.
C.S.Gowsick 15MC25-Industrial Robotics
4
Lens
• The angle of view determines how much of the visual scene the camera sees. A wide angle lens sees a larger part of the scene, whereas the small angle of view of a tele lens allows seeing details from longer distances.
C.S.Gowsick 15MC25-Industrial Robotics
5
Angle of View and Focal length
• The focal length is the distance between the lens and the focal point. When the focal point is on the sensor, the image is in focus.
• Focal length is related to angle of view in that a long focal length corresponds to a small angle of view, and vice versa.
C.S.Gowsick 15MC25-Industrial Robotics
6
Angle of View and Focal length
C.S.Gowsick 15MC25-Industrial Robotics
7
Angle of View and Focal length
• A pixel is the smallest element in a digital image.
• Pixel is an abbreviation of 'picture element'. Normally, the pixels are so small that they only become distinguishable from one another if the image is enlarged.
• Below, example of a very small image with dimension 8x8 pixels. The dimensions are called x and y, where x corresponds to the image columns and y to the rows.
C.S.Gowsick 15MC25-Industrial Robotics
8
Pixels and Resolution
• The brightness of a pixel is called intensity. The intensity information is stored for each pixel in the image and can be of different types. Examples:
C.S.Gowsick 15MC25-Industrial Robotics
9
Intensity
C.S.Gowsick 15MC25-Industrial Robotics
10
Intensity
C.S.Gowsick 15MC25-Industrial Robotics
11
Histogram
• A histogram is a diagram where the pixels are sorted in order of increasing intensity values. Below is an example image that only contains six different gray values. All pixels of a specific intensity in the image (left) become one bar in the histogram (right).
• Histograms for color images work the same way as for grayscale, where each color channel (R, G, B) is represented by its individual histogram.
• The optical axis is a thought line through the center of the lens, i.e. the direction the camera is looking.
• In the figure below, all light is reflected in one direction. This is called direct or specular reflection and is most prevalent when the object is glossy (mirror-like).
C.S.Gowsick 15MC25-Industrial Robotics
12
Reflection, Absorption, and Transmission
• When the surface is not glossy, i.e. has a matte finish, there is also diffuse reflection. Light that is not reflected is absorbed in the material.
• Transparent or semi-transparent materials also transmit light
C.S.Gowsick 15MC25-Industrial Robotics
13
Reflection, Absorption, and Transmission
• After the image has been grabbed, the next step is image analysis.
• This is where the desired features are extracted automatically by algorithms and conclusions are drawn.
• A feature is the general term for information in an image, for example a dimension or a pattern.
• Algorithms are also referred to as tools or functions.
IMAGE PROCESSING TECHNIQUE:
1.Pixel Counting
2.Edge finding
3.Pattern matching
4.Thersholds
5.Blob analysis
C.S.Gowsick 15MC25-Industrial Robotics
14
Processing and Analysis
• A ROI (Region of Interest) is a selected area of concern within an image. The purpose of using ROIs is to restrict the area of analysis and to allow for different analyses in different areas of the image.
• An image can contain any number of ROIs. Another term for ROI is AOI (Area of Interest).
C.S.Gowsick 15MC25-Industrial Robotics
15
Region of Interest
• Pixel counting is the most basic analysis method. The algorithmfinds the number of pixels within a ROI that have intensities within a certain gray level interval.
• Pixel counting is used to measure area and to find deviancesfrom a normal appearance of an object, for example missing pieces, spots, or cracks. A pixel counter gives the pixel sum or area as a result.
C.S.Gowsick 15MC25-Industrial Robotics
16
Pixel counting
• An edge is defined by a change in intensity (2D) or height (3D). An edge is also called a transition.
• The task of an edge finding function is to extract the coordinates where the edge occurs, for example along a line.
• Edge finding is used to locate objects, find features, and to measure dimensions.
• An edge finder gives the X and Y coordinates as a result.
C.S.Gowsick 15MC25-Industrial Robotics
17
Edge finding
• Pattern matching is the recognition of a previously taught pattern in an image
• Pattern matching can only be used when there is a reference object and the objects to inspect are (supposed to be) identical to the reference.
• Pattern matching is used to locate objects, verify their shapes, and to align other inspection tools
C.S.Gowsick 15MC25-Industrial Robotics
18
Pattern matching
• A threshold is a limit. Thresholds can either be absolute or relative. In the context of gray scale images, an absolute threshold refers to a gray value (e.g. 0-255) and a relative threshold to a gray value difference, i.e. one gray value minus another.
• A frequent use of thresholds is in binarization of gray scale images, where one absolute threshold divides the histogram into two intervals, below and above the threshold
C.S.Gowsick 15MC25-Industrial Robotics
19
Thresholds
• A blob(Binary Large OBject) is any area of connected pixels that fulfill one or more criteria.
• A blob analysis algorithm is used to find and count objects, and to make basic measurements of their characteristics.
• Blob analysis tools can yield a variety of results, for example:
1. Center of gravity: Centroid.
2. Pixel count: Area.
3. Perimeter: Length of the line that encloses the blob area.
4. Orientation: Rotation angle.
C.S.Gowsick 15MC25-Industrial Robotics
20
Blob analysis
• The 8-connectivity is more accurate than the 4-connectivity, but the 4-connectivity is often applied since it requires fewer computations, hence it can process the image faster
C.S.Gowsick 15MC25-Industrial Robotics
21
Blob analysis
• This is nothing but a simple electrical motor, controlled with the help of servomechanism. If the motor as controlled device, associated with servomechanism is DC motor, then it is commonly known DC Servo Motor. If the controlled motor is operated by AC, it is called AC Servo Motor.
• Some special type of application need electrical motor to rotate at certain angle for long period of time.
C.S.Gowsick 15MC25-Industrial Robotics
22
DC SERVO MOTOR
DC Motor Servomechanism DC Servo motor
• Servo motor is a special type of motor which is automatically operated up to certain limit for a given command with help of error-sensing feedback to correct the performance.
C.S.Gowsick 15MC25-Industrial Robotics
23
DC SERVO MOTOR
• Before understanding the working principle of servo motor we should understand first the basic of servomechanism.
• A servo system mainly consists of three basic components - a 1.controlled device
2.output sensor
3.feedback system.
• This is an automatic closed loop control system. Here instead of controlling a device by applying the variable input signal, the device is controlled by a feedback signal generated by comparing output signal and reference input signal.
C.S.Gowsick 15MC25-Industrial Robotics
24
SERVOMECHANISM
C.S.Gowsick 15MC25-Industrial Robotics
25
OPEN LOOP SYSTEM VS CLOSED LOOP SYSTEM
• The intelligent circuitry along with the potentiometer makes the servo to rotate according to our wishes
• The gear mechanism will take high input speed of the motor (fast) and at the output, we will get an output speed which is slower than original input speed but there is increase in torque.
C.S.Gowsick 15MC25-Industrial Robotics
26
Working Principle of Servo Motor
DC Servo motor unit
Small DC motor
PotentiometerGear
arrangementIntelligent circuitry
• The shaft of the DC motor is coupled with another shaft called output shaft, with the help of gear assembly.
• This gear assembly is used to step down the high rpm of the motor's shaft to low rpm at the output shaft of the servo system.
C.S.Gowsick 15MC25-Industrial Robotics
27
Servo motor control
• The voltage adjusting knob of a potentiometer is so arranged with the output shaft by means of another gear assembly, that during rotation of the shaft, the knob also rotates and creates an varying electrical potential according to the potentiometer.
C.S.Gowsick 15MC25-Industrial Robotics
28
Servo motor control
• This electrical potential or voltage is taken to the error detector feedback amplifier along with the input reference commends i.e. input signal voltage.
C.S.Gowsick 15MC25-Industrial Robotics
29
Servo motor control
• Although in practical servo motor control system, instead of using simple potentiometer we use digital or analog position sensor encoder.
• The current position will be compared with the desired position continuously with the help of an Error Detection Amplifier.
• If a mismatch is found, then an error signal is provided at the output of the error amplifier and the shaft will rotate to go the exact location required.
C.S.Gowsick 15MC25-Industrial Robotics
30
Servo motor control
“A servo motor controller is a circuit that is used to control the position of a servo motor. It is also called as a servo motor driver.
A servo motor controller consists of a controller, the potentiometer and the power supply unit.”
• Essential Components
1.A micro-controller
2.power supply unit
• Miscellaneous Components
1.potentiometer
2.Connectors, wires etc.
C.S.Gowsick 15MC25-Industrial Robotics
31
Servo motor controller
Micro-controller:
• A servo motor is driven by applying the voltage signal to it regular intervals.
• A pulse(voltage) of specific width has to be applied at specific intervals of time.
• The duration of pulse varies from 0ms to 2.2ms and the repetition rate is 50Hz to 60Hz.
• For precise position control, the controller that is chosen must have timers that have the required resolution.
• Also, if more than one motor has to be controlled simultaneously, the processor clock must be fast enough.
C.S.Gowsick 15MC25-Industrial Robotics
32
Servo motor controller
Power Supply:
• Servo motors operate from 4.8V to a 6V supply voltage. The typical value is 5V.
• Applying voltages greater than the supply voltage is not advisable as it may render the motor permanently useless.
• The current draw of the motor is variable and depends on the torque that it generates.
C.S.Gowsick 15MC25-Industrial Robotics
33
Servo motor controller
• The servo motor has three terminals
1.Position signal(PWM Pulses)
2.Vcc (From Power Supply)
3.Ground
• The servo motor angular position is controlled by applying PWM pulses of specific width.
• The duration of pulse varies from about 0.5 ms for 0 degree rotation to 2.2 ms for 180 degree rotation. The pulses need to be given at frequencies of about 50Hz to 60Hz.
C.S.Gowsick 15MC25-Industrial Robotics
34
Servo motor controller
• In order to generate the PWM (Pulse Width Modulation) waveform, as shown in figure , one can use either the internal PWM module of the micro-controller or the timers can be used.
C.S.Gowsick 15MC25-Industrial Robotics
35
Servo motor controller
1.Initialize the port pins for input/output.
2.Read the ADC for desired servo position.
3.Program the PWM registers for the desired value. As soon as you trigger the PWM module, the selected PWM channel pin goes high (logic 1) and after the required width is reached, it will again go low (logic 0). So after triggering the PWM, you must start a timer with a delay of about 19 ms and wait until the timer overflows
4.Go to step 2
C.S.Gowsick 15MC25-Industrial Robotics
36
Servo motor controller-Programming algorithm
• Pick and place robot is such a robotic machine which is used to pick an object from one position and place the object at different position.
• Now, in order to pick an object from position A and place it in position B the motors which are used to actuate the joints are servo motors.
• The controller will send PWM data to the individual motors of the robot. This gives precise angular control of the arm which is not possible with a regular DC motor.
C.S.Gowsick 15MC25-Industrial Robotics
37
Servo motor -Application #1
• Let’s consider an example of bottle filling process, in the process the bottle needs to be filled with the liquid and moved to the next stage which is mainly the packaging stage.
• So in order to achieve this conveyor belts are used with servo motors so that the bottle moves precisely to the desired location and stops so that the liquid can be poured into it and then it is guided to the next stage.
C.S.Gowsick 15MC25-Industrial Robotics
38
Servo motor -Application #2
• Today’s modern digital cameras are very advanced.
• One of the advanced features is its ability to auto focus on the object to be captured. When the image of the object is created within the digital signal processor of the camera, it is checked for sharpness.
• Basically, if the focal length (measured from camera lens) is not proper, the image appears to be blurred. Servo motor is used for focusing a image
C.S.Gowsick 15MC25-Industrial Robotics
39
Servo motor -Application #3
• www.sickivp.com
• www.slideshare.com
• www.nptel.com
• www.electric4u.com
C.S.Gowsick 15MC25-Industrial Robotics
40
Reference
THANK YOU
C.S.Gowsick 15MC25-Industrial Robotics
41