Showing posts with label motors. Show all posts
Showing posts with label motors. Show all posts

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.

Thursday, 12 June 2014

The basics of working of a simple robot

We learnt about the different types of robots , their uses and their possible disadvantages as well. Now the important thing is what are the important components of a robot?

As this blog is made for tutorial purposes ,  we will start from the basics and tell you about the components a most basic robot should have.


To start with , let us consider these points :-

A. To work a robot needs an electronic brain which decides what to do and when to do ? for this purpose a robot has a microcontroller. The microcontrollers availaible are of different type and memory sizes. In our tutorials we will be using AVR microcontrollers namely Atmega8/16/32.

B. To get the data from the nearby surrounding , the robot needs to sense them first. Similar to the sensing ability our body has , after the microcontroller the sensors are the most important component.
A robot can have several type of sensors : IR sensors , ultrasonic sensors , thermal sensors , light sensors etc.

C. After the data recieved from the sensors have been processed an output component is required so as the robot does the desired output functions.For this purposes we connect motors etc with the robot. The motors available are of different types namely stepper motor , geared motor , servo motors etc. In case of robots like mechanical hand the output is achieved by use of actuators ( a type of motor itself ).

D. The power source . No doubt if your robot has high grade above mentioned components but the robot is completely useless if it doesnt have a power source.


 Now we will discuss a bit in detail about the several components used :


  • Microcontroller :-


microcontroller (sometimes abbreviated µCuC or MCU) is a small computer on a single integrated circuit containing a processor core, memory, and programmable input/output peripherals. Program memory in the form of NOR flash is also often included on chip, as well as a typically small amount of RAM. Microcontrollers are designed for embedded applications, in contrast to the microprocessors used in PCs or other general purpose applications.
Block diagram of Microcontroller

Even though there is a large number of different types of microcontrollers and even more programs created for their use only, all of them have many things in common. Thus, if you learn to handle one of them you will be able to handle them all. A typical scenario on the basis of which it all functions is as follows:

  1. Power supply is turned off and everything is still…the program is loaded into the microcontroller, nothing indicates what is about to come…
  2. Power supply is turned on and everything starts to happen at high speed! The control logic unit keeps everything under control. It disables all other circuits except quartz crystal to operate. While the preparations are in progress, the first milliseconds go by.
  3. Power supply voltage reaches its maximum and oscillator frequency becomes stable. SFRs are being filled with bits reflecting the state of all circuits within the microcontroller. All pins are configured as inputs. The overall electronis starts operation in rhythm with pulse sequence. From now on the time is measured in micro and nanoseconds.
  4. Program Counter is set to zero. Instruction from that address is sent to instruction decoder which recognizes it, after which it is executed with immediate effect.
  5. The value of the Program Counter is incremented by 1 and the whole process is repeated...several million times per second.

  • Sensors :

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. For example, a mercury in glass thermometer converts the measured temperature into expansion and contraction of a liquid which can be read on a calibrated glass tube. A  thermocouple converts temperature to an output voltage which can be read by a voltmeter. For accuracy, most sensors are calibrated against known standards.
The different type of sensors availaible to us are: 

1. IR sensors ( Infrared sensors)
2. Thermal sensors
3.Proximity sensors
4. Light sensors
5. Moisture sensors
6. smoke sensors
7. ultrasonic sensors etc.

For the beginner purposes , we will talk only about the IR sensors.

Working Principle

Working of an IR sensor
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.

  • Motors :-
motor is an electric machine that converts electrical energy into mechanical energy.In robotics several type of motors are used for various purposes.For instance the geared motor is what we commonly use for robot's locomotion.

The 3 main types of motors that are commonly used for robotic purposes are :-



DC geated motor
1. DC geared motors :- Geared DC motors can be defined as an extension of DC motor which already had its . A geared DC Motor has a gear assembly attached to the motor. The speed of motor is counted in terms of rotations of the shaft per minute and is termed as RPM .The gear assembly helps in increasing the torque and reducing the speed. Using the correct combination of gears in a gear motor, its speed can be reduced to any desirable figure. This concept where gears reduce the speed of the vehicle but increase its torque is known as gear reduction.  This Insight will explore all the minor and major details that make the gear head and hence the working of geared DC motor.



2. Stepper motor :- 

stepper motor  is a brushless DC electric motor that divides a full rotation into a number of equal steps. The motor's position can then be commanded to move and hold at one of these steps without any feedback sensor (an open loop controller), as long as the motor is carefully sized to the application. DC brushed motors rotate continuously when voltage is applied to their terminals.


Stepper motor
The stepper motor is known by its important property to convert a train of input pulses (typically square wave pulses) into a precisely defined increment in the shaft position. Each pulse moves the shaft through a fixed angle. Stepper motors effectively have multiple "toothed" electromagnets arranged around a central gear-shaped piece of iron. The electromagnets are energized by an external control circuit, such as a microcontroller. To make the motor shaft turn, first, one electromagnet is given power, which magnetically attracts the gear's teeth. When the gear's teeth are aligned to the first electromagnet, they are slightly offset from the next electromagnet. So when the next electromagnet is turned on and the first is turned off, the gear rotates slightly to align with the next one, and from there the process is repeated. Each of those rotations is called a "step", with an integer number of steps making a full rotation. In that way, the motor can be turned by a precise angle.

Servo motor

3. Servomotor : A servomotor is a rotor 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.




In our next post we will be discussing in detail about the microcontrollers , their types and their architectures.


Comments and views will be appreciated.