Thursday, 26 June 2014

In earlier posts we discussed about the motors , the H bridge but the most important component in the working of motors is the IC called the L293D motor IC.
L293D is a dual H-bridge motor driver integrated circuit (IC). Motor drivers act as current amplifiers since they take a low-current control signal and provide a higher-current signal. This higher current signal is used to drive the motors.
L293D contains two inbuilt H-bridge driver circuits. In its common mode of operation, two DC motors can be driven simultaneously, both in forward and reverse direction. The motor operations of two motors can be controlled by input logic at pins 2 & 7 and 10 & 15. Input logic 00 or 11 will stop the corresponding motor. Logic 01 and 10 will rotate it in clockwise and anticlockwise directions, respectively.

The L293D IC

Enable pins 1 and 9 (corresponding to the two motors) must be high for motors to start operating. When an enable input is high, the associated driver gets enabled. As a result, the outputs become active and work in phase with their inputs. Similarly, when the enable input is low, that driver is disabled, and their outputs are off and in the high-impedance state.

Working of L293D

The there 4 input pins for this l293d, pin 2,7 on the left and pin 15 ,10 on the right as shown on the pin diagram. Left input pins will regulate the rotation of motor connected across left side and right input for motor on the right hand side. The motors are rotated on the basis of the inputs provided across the input pins as LOGIC 0 or LOGIC 1.
In simple you need to provide Logic 0 or 1 across the input pins for rotating the motor.

L293D Logic Table.

Lets consider a Motor connected on left side output pins (pin 3,6). For rotating the motor in clockwise direction the input pins has to be provided with Logic 1 and Logic 0.   
Motor control through L293D IC
• Pin 2 = Logic 1 and Pin 7 Logic 0 | Clockwise Direction
• Pin 2 = Logic 0 and Pin 7 Logic 1 | Anticlockwise Direction
 Pin 2 Logic 0 and Pin 7 = Logic 0 | Idle [No rotation] [Hi-Impedance state]
• Pin 2 Logic 1 and Pin 7 = Logic 1 | Idle [No rotation]
In a very similar way the motor can also operated across input pin 15,10 for motor on the right hand side.


  



Thursday, 19 June 2014

The H bridge

In today's post we will learn about what an H bridge is and how does it functions.

An H bridge is an electronic circuit that enables a voltage to be applied across a load in either direction. These circuits are often used in robotics and other applications to allow DC motors to run forwards and backwards.


High current DC motor speed controls, controlled with low power electronics can be quite difficult at first, but it's not really that hard to make an efficient controller at all.

Let us first show you what a H Bridge is, and then you'll see what a useful topology it is.


Switches are connected on either side, above and below the motor. When you switch on A1 and A2, the motor spins clockwise, when you switch on B1 and B2, can you guess? The motor spins counter-clockwise. When using transistors with diodes across the Source and Drain, when both switches are closed and we attempt to spin the motor, back emf generated by the motor flows through the diodes and back round to the opposite terminal of the motor, thus causing it to "short" itself and hence making the motor more difficult to turn. This is known as "Regeneritive braking" and is proportional to the back emf, eg the harder you attempt to spin the motor, the more it resists. Some Hybrid cars are now using this system to generate power when driving down hills.


Now, if we put MOSFET transistors in place of the switches, we can control a motors direction quite simply by applying voltages to the Gates of each pair of transistors. We can also vary the speed in either direction, by using a PWM signal with variable duty cycle. It only needs to be few to either one of the 2 lower mosfets, while the upper 2 remain high.

The accepted way to use Mosfets in a H bridge, is to use 4 N channel Mosfets with high current/voltage ratings and Low Rds values (on resistance, the lower it is, the more current can flow with less heat dissipations).

There lies the problem. N channel Mosfets are supposed to conduct to a ground reference. ie, the Gate voltage must be at least 10V higher than the Source (normally 0V). If we raise the S-D voltage, we have to apply 10V higher than the Drain voltage to turn the mosfet on.

The answer, is to let a H Bridge controller IC do all the work for you. A H Bridge controller IC has an inbuilt buck-boost convertor (a method of transforming a voltage to higher potential than the input) to generate the 10V (normally 15V to turn the Mosfet fully on) higher than the D-S voltage you intend to switch.

The most useful, and most known H Bridge controller IC used in motor control and robotics is the HIP4081 Dual Controller made by Intersil. we have used this chip and it seems well behaved and easy to integrate into your designs. The only down side is the chip is reasonably expensive at £7 each, but it does what it says.


 Operation of a H bridge :-

The H-bridge arrangement is generally used to reverse the polarity of the motor, but can also be used to 'brake' the motor, where the motor comes to a sudden stop, as the motor's terminals are shorted, or to let the motor 'free run' to a stop, as the motor is effectively disconnected from the circuit. The following table summarises operation, with S1-S4 corresponding to the diagram above.
H Bridge structure
Driving N-Channel gates is essentially like driving a capacitance to a sufficient voltage in order to get the channel fully on. Dissipation is kept down to a minimum level when driving the gates to +15 volts (with respect to the sources), assuring that the transistors are on. Most of the same applies to driving both N-Channel gates and P-Channel gates, but the only difference is that the P-Channel gate to source voltage needs to be negative.
S1S2S3S4Result
1001Motor moves right
0110Motor moves left
0000Motor free runs
0101Motor brakes
1010Motor brakes
1100Shoot-through
0011Shoot-through
1111Shoot-through


Using the same logic in turning various transistors ON and OFF will allow sufficient "dead time" between a high side transistor and its low side transistor. This will then ensure that they are both ON at any given time.

Tuesday, 17 June 2014

Basics of motors

In today's post we will be learning about the different types of motors and their principles of working .

Let us start by defining what a motor is.


"An electric motor is an electrical machine that converts electrical energy into mechanical energy."


Some of the motors that we commonly use for  robotic purposes are


1. Servo motor

2. Stepper motor
3. DC motors

Let us discuss the working of these motors in detail.



Servo Motors :-


A servomotor is a rotary actuator that allows for precise control of angular position, velocity and acceleration .It consists of a suitable motor coupled to a sensor for position feedback. It also requires a relatively sophisticated controller, often a dedicated module designed specifically for use with servomotors.
Servomotors are not a specific class of motor although the term servomotor is often used to refer to a motor suitable for use in a closed-loop control system.
Servomotors are used in applications such as robotics, CNC machinery or automated manufacturing.



  1. Types of Servomotors

dc servomotor
A servo motor
Unlike large industrial motors, servomotors are not used for continuous energy conversion . The basic operating principle is same as other electromagnetic motors . Design, construction and mode of operation are different. The rotors of this kind of motor are designed with long rotor lengths and smaller diameters . They have large size than that of conventional motors of same power ratings . There are various types of servomotors which are – series motors, split series motors, shunt control motor and permanent magnet shunt motor. We will now discuss these types of dc servomotors in brief.
  • Series motors: The series motor has a high starting torque and draws large current .Speed regulation of this kind of motor is poor . Reversal can be obtained by reversing the polarity of field voltage with split series field winding (i.e one winding for direction of rotation). This method reduces motor efficiency to some extent .
  • Split series motors: Split series motor are the dc series motor with split-field rated with some fractional kilowatt . This type of motor can operate as a separately excited field-controlled motor. The armature is supplied with a constant current source. Split series motor has a typical torque-speed curve . This curve denotes high stall torque and a rapid reduction in torque with increase in speed. This results in good damping.
  • Shunt control motor : DC shunt type servomotor is not different from any other dc shunt motor . It has two separate windings – field windings placed on stator and armature winding placed on the rotor of the machine . Both windings are connected to a dc supply source. In a conventional dc shunt motor , the two windings are connected inparallel across the dc supply . In case of a servomotor , the windings are supplied with separate dc source.
  •  Permanent magnet shunt motor: Permanent magnet shunt motor is a fixed excitation motor where the field is actually supplied by a permanent magnet . Performane is similar to armature controlled fixed field motor that we are going to know in the next section

2. Mechanism of working


As the name suggests, a servomotor is a servomechanism. More specifically, it is a closed-loop servo mechanism that uses position feedback to control its motion and final position. The input to its control is some signal, either analogue or digital, representing the position commanded for the output shaft.

There are two fundamental characteristics of any servo motor. These are:
  •   The motor output torque is proportional to the voltage applied to it ( i.e     control voltage developed by amplifier in response to an error signal ) .
  •   The instantaneous polarity of control voltage governs the direction of         torque developed by servomotors.
A servo motor is basically a DC motor(in some special cases it is AC motor) along with some other special purpose components that make a DC motor a servo. In a servo unit, you will find a small DC motor, a potentiometer, gear arrangement and an intelligent circuitry. The intelligent circuitry along with the potentiometer makes the servo to rotate according to our wishes.
As we know, a small DC motor will rotate with high speed but the torque generated by its rotation will not be enough to move even a light load. This is where the gear system inside a servomechanism comes into picture. The gear mechanism will take high input speed of the motor (fast) and at the output, we will get a output speed which is slower than original input speed but more practical and widely applicable.
Say at initial position of servo motor shaft, the position of the potentiometer knob is such that there is no electrical signal generated at the output port of the potentiometer. This output port of the potentiometer is connected with one of the input terminals of the error detector amplifier. Now an electrical signal is given to another input terminal of the error detector amplifier. Now difference between these two signals, one comes from potentiometer and another comes from external source, will be amplified in the error detector amplifier and feeds the DC motor. This amplified error signal acts as the input power of the dc motor and the motor starts rotating in desired direction. As the motor shaft progresses the potentiometer knob also rotates as it is coupled with motor shaft with help of gear arrangement. As the position of the potentiometer knob changes there will be an electrical signal produced at the potentiometer port. As the angular position of the potentiometer knob progresses the output or feedback signal increases. After desired angular position of motor shaft the potentiometer knob is reaches at such position the electrical signal generated in the potentiometer becomes same as of external electrical signal given to amplifier. At this condition, there will be no output signal from the amplifier to the motor input as there is no difference between external applied signal and the signal generated at potentiometer. As the input signal to the motor is nil at that position, the motor stops rotating. This is how a simple conceptual servo motor works.

Stepper motor :-

Dynamics of a stepper motor

A stepper motor is an electromechanical device which converts electrical pulses into discrete mechanical movements. The shaft or spindle of a stepper motor rotates in discrete step increments when electrical command pulses are applied to it in the proper sequence. The motors rotation has several direct relationships to these appliedinput pulses. The sequence of the appliedpulses is directly related to the directiionmotor shafts rotation. The speed of themotor shafts rotation is directly related to the frequency of the input pulses and thelength of rotation is directly related to the number of input pulses applied.

Types of Stepper Motors :


A stepper motor is an electromechanical device which converts electrical pulses into discrete mechanical movements. The shaft or spindle of a stepper motor rotates in discrete step increments when electrical command pulses are applied to it in the proper sequence. The motors rotation has several direct relationships to these appliedinput pulses. The sequence of the appliedpulses is directly related to the directiionmotor shafts rotation. The speed of themotor shafts rotation is directly related to the frequency of the input pulses and thelength of rotation is directly related to the number of input pulses applied.

There are three basic types of step motors: variable reluctance, permanent magnet, and hybrid. This discussion will concentrate on the hybrid motor, since these step motors combine the best characteristics of the variable reluctance and permanent magnet motors. They are constructed with multi-toothed stator poles and a permanent magnet rotor. Standard hybrid motors have 200 rotor teeth and rotate at 1.8º step angles. Because they exhibit high static and dynamic torque and run at very high step rates, hybrid step motors are used in a wide variety of commercial applications including computer disk drives, printers/plotters, and CD players. Some industrial and scientific applications of stepper motors include robotics, machine tools, pick and place machines, automated wire cutting and wire bonding machines, and even precise fluid control devices. 


Principle of working :

There are many kind of stepper motors. Unipolar type, Bipolar type, Single-phase type, Multi-phase type... Single-phase stepper motor is often used for quartz watch.
On this page, I will explain the operation principle of the 2-phase unipolar PM type stepper motor.

In the PM type stepper motor, a permanent magnet is used for rotor and coils are put on stator. The stepper motor model which has 4-poles is shown in the figure on the left. In case of this motor, step angle of the rotor is 90 degrees.

As for four poles, the top and the bottom and either side are a pair.  coil,  coil and  coil,  coil correspond respectively. For example,  coil and  coil are put to the upper and lower pole.  coil and coil are rolled up for the direction of the pole to become opposite when applying an electric current to the coil and applying an electric current to the  coil. It is similar about  and , too.
The turn of the motor is controlled by the electric current which pours into  and . The rotor rotational speed and the direction of the turn can be controlled by this control.


 Clockwise control

 and  are controlled in the following order.
Step angle
0101
100190°
1010180°
0110270°

"0" means grounding.


 Counterclockwise control

 and  are controlled in the following order.
Step angle
0101
0110-90°
1010-180°
1001-270°

"0" means grounding.

You can find by the figure, the rotor is stable in the middle of 2 poles of stator. When one side of the stator polarity is changed, the bounce by the magnetism occurs. As a result, the direction of rotor's turn is fixed.

The characteristic of stepper motor is the angle can be correctly controlled and to be stable rotates ( It is due to the reliability of the control signal ). Moreover, because the rotor is fixed by the magnetism in the stationary condition as shown in the principle, the stationary power(Stationary torque) is large. It suits the use to make stop at some angle.




DC Motors :

Electrical motors are everywhere around us. Almost all the electro-mechanical movements we see around us are caused either by an A.C. or a DC motor. Here we will be exploring this kind of motors. This is a device that converts DC electrical energy to a mechanical energy.

Principle of DC Motor
Fleming left hand ruleThis DC or direct current motor works on the principal, when a current carrying conductor is placed in a magnetic field, it experiences a torque and has a tendency to move. This is known as motoring action. If the direction of electric current in the wire is reversed, the direction of rotation also reverses. When magnetic field and electric field interact they produce a mechanical force, and based on that the working principle of dc motorestablished. The direction of rotation of a this motor is given by Fleming’s left hand rule, which states that if the index finger, middle finger and thumb of your left hand are extended mutually perpendicular to each other and if the index finger represents the direction of magnetic field, middle finger indicates the direction of electric current, then the thumb represents the direction in which force is experienced by the shaft of thedc motor.
Structurally and construction wise a direct current motor is exactly similar to a DC generator, but electrically it is just the opposite. Here we unlike a generator we supply electrical energy to the input port and derive mechanical energy from the output port. We can represent it by the block diagram shown below.
Here in a DC motor, the supply voltage E and electric current I is given to the electrical port or the input port and we derive the mechanical output i.e. torque T and speed ω from the mechanical port or output port.
The input and output port variables of the direct current motor are related by the parameter K.
So from the picture above we can well understand that motor is just the opposite phenomena of a DC generator, and we can derive both motoring and generating operation from the same machine by simply reversing the ports.



In our next post we will discuss about the H-bridge and its operation.

Saturday, 14 June 2014

Basics of sensors.

In today's post we will be discussing about the working of different types of sensors.
To start with let us discuss the definition of a simple sensor.
  
"sensor is a converter that measures a physical quantity and converts it into a signal which can be read by an observer or by an (today mostly electronic) instrument."

Its not necessary that a sensor will always be an electronic component. Sensors can be of natural type too. Our body too exhibit different sensing capabilities.

Electronically speaking a sensor is a device, which responds to an input quantity by generating a functionally related output usually in the form of an electrical or optical signal. A sensor's sensitivity indicates how much the sensor's output changes when the measured quantity changes.

The different types of sensors that we use for robotic purposes are:-

1. Infrared sensors
2. Thermal sensors
3. Sound sensors
4. Pressure sensors
5. Ultrasonic sensors etc

For basic purposes like creating grid solvers , obstacle avoiders etc the IR sensors are commonly used . The other named sensors are used for advanced purposes.

Now we will study the working of an IR sensor with its circuitory.         


Working  principle of an IR sensor :

Infra red circuit diagram

A typical system for detecting infrared radiation using infrared sensors includes the infrared source such as blackbody radiators, tungsten lamps, and silicon carbide. In case of active IR sensors, the sources are infrared lasers and LEDs of specific IR wavelengths. Next is the transmission medium used for infrared transmission, which includes vacuum, the atmosphere, and optical fibers.

Thirdly, optical components such as optical lenses made from quartz, CaF2, Ge and Si, polyethylene Fresnel lenses, and Al or Au mirrors, are used to converge or focus infrared radiation. Likewise, to limit spectral response, band-pass filters are ideal.

Finally, the infrared detector completes the system for detecting infrared radiation. The output from the detector is usually very small, and hence pre-amplifiers coupled with circuitry are added to further process the received signals.



 
There are different types of IR sensors working in various regions of the IR spectrum              but the physics behind "IR sensors" is governed by three laws
:

1.         Planck’s radiation law:

Every object at a temperature T not equal to 0 K emits radiation. Infrared radiant energy is determined by the temperature and surface condition of an object. Human eyes cannot detect differences in infrared energy because they are primarily sensitive to visible light energy from 400 to 700 nm. Our eyes are not sensitive to the infrared energy.
2.         Stephan Boltzmann Law

The total energy emitted at all wavelengths by a black body is related to the absolute temperature as
IR Sensor2
3.         Wein’s Displacement Law

Wein’s Law tells that objects of different temperature emit spectra that peak at different wavelengths. It provides the wavelength for maximum spectral radiant emittance for a given temperature.
The relationship between the true temperature of the black body and its peak spectral exitance or dominant wavelength is described by this law
IR Sensor3The world is not full of black bodies; rather it comprises of selectively radiating bodies like rocks, water, etc. and the relationship between the two is given by emissivity (E).
IR Sensor4Emissivity depends on object color, surface roughness, moisture content, degree of compaction, field of view, viewing angle & wavelength.


ELEMENTS OF INFRARED DETECTION SYSTEM


A typical system for detecting infrared radiation is given in the following block diagram :Elements of IR Detection System
1. Infrared Source: All objects above 0 K radiate infrared energy and hence are infrared sources. Infrared sources also include blackbody radiators, tungsten lamps, silicon carbide, and various others. For active IR sensors, infrared Lasers and LEDs of specific IR wavelengths are used as IR sources. 

2. Transmission Medium: Three main types of transmission medium used for Infrared transmission are vacuum, the atmosphere, and optical fibers.The transmission of IR – radiation is affected by presence of CO2, water vapour and other elements in the atmosphere. Due to absorption by molecules of water carbon dioxide, ozone, etc. the atmosphere highly attenuates most IR wavelengths leaving some important IR windows in the electromagnetic spectrum; these are primarily utilized by thermal imaging/ remote sensing applications.
• Medium wave IR (MWIR:3-5 µm)     •  Long wave IR (LWIR:8-14 µm)IR Sensor5Choice of IR band or a specific wavelength is dictated by the technical requirements of a specific application. 
3. Optical Components: Often optical components are required to converge or focus infrared radiations, to limit spectral response, etc. To converge/focus radiations, optical lenses made of quartz, CaF2, Ge and Si, polyethylene Fresnel lenses, and mirrors made of Al, Au or a similar material are used. For limiting spectral responses, bandpass filters are used. Choppers are used to pass/ interrupt the IR beams. 

4. Infrared detectors: Various types of detectors are used in IR sensors. Important specifications of detectors are:
• Photosensitivity or ResponsivityResponsivity is the Output Voltage/Current per watt of incident energy. Higher the better. 

• Noise Equivalent Power (NEP)NEP represents detection ability of a detector and is the amount of incident light equal to intrinsic noise level of a detector.

• Detectivity(D*: D-star)D* is the photosensitivity per unit area of a detector. It is a measure of S/N ratio of a detector. D* is inversely proportional to NEP. Larger D* indicates better sensing element. In addition, wavelength region or temperature to be measured, response time, cooling mechanism, active area, no of elements, package, linearity, stability, temperature characteristics, etc. are important parameters which need attention while selecting IR detectors.

5.Signal Processing: Since detector outputs are typically very small, preamplifiers with associated circuitry are used to further process the received signals.

Application of IR sensors :-


In robtics the IR sensors are used for various detecting purposes , for e.g to detect nereby objects , in construction of edge avoiders and also in making grid solving intelligent robots.



In our next post we will be discussing about the working of DC geared motors and also the working of the H bridge circuit.

Comments and views will be appreciated.