Vous êtes sur la page 1sur 50

INTRODUCTION:

Electricity cannot be seen, felt, tasted, smelled, heard or (safely) touched. Providing Industrial Technology students with vivid, memorable, hands-on learning experiences in the area of electricity is a challenge for all educators in the Industrial Technology area. The traditional measuring instruments for electricity (oscilloscopes, voltmeters, ammeters, and power meters) and traditional signal sources (motors, transformers, resistors, inductors) are fine but have some drawbacks: They have a tendency to become repetitive and boring. They have an artificial, educational non-real-world feel. They may fail to convey the notion of the true complexity and interrelations of industrial electrical power systems. They may not capture the students attention and motivate learning. They may not give an intuitive feeling for what electrical quantities really mean physically. As the wind does not blow all the time nor does the sun shine all the time, solar and wind power alone are poor power sources. Hybridizing solar and wind power sources together with storage batteries to cover the periods of time without sun or wind provides a realistic form of power generation. This variable feature of wind turbine power generation is different from conventional fossil fuel, nuclear , or hydro-based power generation. Wind energy has become the least expensive renewable energy technology in existence and has peaked the interest of scientists and educators the world over. A simple relationship exists relating the power generated by a wind-turbine and the wind parameters: P = 0.5rA Cpv3hg hb (1) where, r = air density (about 1.225 kg/m3 at sea level, less at higher elevations). A = rotor swept area, exposed to the wind (m2). Cp = Coefficient of performance (.59 to .35 depending on turbine). v = wind speed in meters/sec hg = generator efficiency hb = gearbox/bearings efficiency

A mast-mounted anemometer (wind meter) allows the students to directly measure wind speed and to vividly relate this easily felt force-of nature to electrical measurements. Photo-Voltaic or PV cells, known commonly as solar cells, convert the energy from sunlight into DC electricity. PVs offer added advantages over other renewable energy sources in that they give off no noise and require practically no maintenance. PV cells are a familiar element of the scientific calculators owned by many students. Their operating principles and governing relationships are unfortunately not as pedagogically simple as that of windturbines. However, they operate using the same semiconductor principles that govern diodes and transistors and the explanation of their functioning is straightforward and helps to make more intuitive many of the principles covered in semiconductor electronic classes. Most industrial uses of electricity require AC or alternating 60 Hz power. Wind-turbines and PV cells provide DC power. A semiconductor-based device known as a power inverter is used to convert the DC power to AC power. This device has a relatively simple operation that is a vivid illustration of many topics traditionally covered in power electronics classes. The inverter also introduces the problem of power quality. Power quality is an extremely important issue in real-life industrial electric power systems. Power quality is the contamination of the voltage or frequency characteristics of electric power. The system exhibits many common problems of power quality such as voltage sag (sudden drops in voltage due to over demand of battery capacity and/or loss of wind or sun), harmonic contamination (errors in the 60 Hz frequency due to nonlinear loads such as computers, energy efficient light bulbs, laser printers, scanners), and voltage regulation problems (prolonged drops in voltage due to interactions of system elements). Power quality is an extremely important problem in industrial electricity applications and this setup offers unique opportunities for the students to study power quality problems in a real system. Three major phases of the development and implementation of this facility have been completed. First, the set-up itself has been constructed and debugged. Second instruments for hands-on measurement of electrical quantities in the system

have been acquired and deployed for hands-on lab use. And third, numerous simulations have been performed on PSCAD/ EMTDC (1996), a well-known power system computer simulation package used by industry and universities. This software allows the students to make an intuitive link between the physical system present in the hands-on labs and the more abstract mathematical equations presented in their lecture notes and texts.

The major components of this system are as follows. 1) LDR (light dependent resistor) 2) Microcontroller. 3) Output mechanical transducer (stepper motor). 4)wind fan
L29 3d

POWER SUPPLY

TRANSFORMER: A transformer is a device that transfers electrical energy from one circuit to another through inductively coupled conductors the transformer's coils or "windings". Except for air-core transformers, the conductors are commonly wound around a single iron-rich core, or around separate but magneticallycoupled cores. A varying current in the first or "primary" winding creates a varying magnetic field in the core (or cores)

of the transformer. This varying magnetic field induces a varying electromotive force (EMF) or "voltage" in the "secondary" winding. This effect is called mutual induction.

If a load is connected to the secondary circuit, electric charge will flow in the secondary winding of the transformer and transfer energy from the primary circuit to the load connected in the secondary circuit. The secondary induced voltage VS, of an ideal transformer, is scaled from the primary VP by a factor equal to the ratio of the number of turns of wire in their respective windings:

By appropriate selection of the numbers of turns, a transformer thus allows an alternating voltage to be stepped up by making NS more than NP or stepped down, by making it BASIC PARTS OF A TRANSFORMER In its most basic form a transformer consists of:

A primary coil or winding. A secondary coil or winding. A core that supports the coils or windings.

Refer to the transformer circuit in figure as you read the following explanation: The primary winding is connected to a 60-hertz ac voltage source. The magnetic field (flux) builds up (expands) and collapses (contracts) about the primary winding. The expanding and contracting magnetic field around the primary winding cuts the secondary winding and induces an alternating voltage into the winding. This voltage causes

alternating current to flow through the load. The voltage may be stepped up or down depending on the design of the primary and secondary windings.

THE COMPONENTS OF A TRANSFORMER Two coils of wire (called windings) are wound on some type of core material. In some cases the coils of wire are wound on a cylindrical or rectangular cardboard form. In effect, the core material is air and the transformer is called an AIR-CORE TRANSFORMER. Transformers used at low frequencies, such as 60 hertz and 400 hertz, require a core of low-reluctance magnetic material, usually iron. This type of transformer is called an IRON-CORE TRANSFORMER. Most power transformers are of the iron-core type. The principle parts of a transformer and their functions are: The CORE, which provides a path for the magnetic lines of flux. The PRIMARY WINDING, which receives energy from the ac source. The SECONDARY WINDING, which receives energy from the primary winding and delivers it to the load.

The ENCLOSURE, which protects the above components from dirt, moisture, and mechanical damage.

BRIDGE RECTIFIER A bridge rectifier makes use of four diodes in a bridge arrangement to achieve full-wave rectification. This is a widely used configuration, both with individual diodes wired as shown and with single component bridges where the diode bridge is wired internally.

Basic operation According to the conventional model of current flow originally established by Benjamin Franklin and still followed by most engineers today, current is assumed to flow through electrical conductors from the positive to the negative pole. In actuality, free electrons in a conductor nearly always flow from the negative to the positive pole. In the vast majority of applications, however, the actual direction of current flow is irrelevant. Therefore, in the discussion below the conventional model is retained. In the diagrams below, when the input connected to the left corner of the diamond is positive, and the input connected to the right corner is negative, current flows from the upper supply terminal to the right along the red (positive) path to the output, and returns to the lower supply terminal via the blue (negative) path.

When the input connected to the left corner is negative, and the input connected to the right corner is positive, current flows from the lower supply terminal to the right along the red path to the output, and returns to the upper supply terminal via the blue path.

In each case, the upper right output remains positive and lower right output negative. Since this is true whether the input is AC or DC, this circuit not only produces a DC output from an AC input, it can also provide what is sometimes called "reverse polarity protection". That is, it permits normal functioning of DC-powered equipment when batteries have been installed backwards, or when the leads (wires) from a DC power source have been reversed, and protects the equipment from potential damage caused by reverse polarity. Prior to availability of integrated electronics, such a bridge rectifier was always constructed from discrete components. Since about 1950, a single four-terminal component containing the four diodes connected in the bridge configuration became a standard commercial component and is now available with various voltage and current ratings. Output smoothing For many applications, especially with single phase AC where the full-wave bridge serves to convert an AC input into a DC output, the addition of a capacitor may be desired because the bridge alone supplies an output of fixed polarity but continuously varying or "pulsating" magnitude (see diagram above).

The function of this capacitor, known as a reservoir capacitor (or smoothing capacitor) is to lessen the variation in (or 'smooth') the rectified AC output voltage waveform from the bridge. One explanation of 'smoothing' is that the capacitor provides a low impedance path to the AC component of the output, reducing the AC voltage across, and AC current through, the resistive load. In less technical terms, any drop in the output voltage and current of the bridge tends to be canceled by loss of charge in the capacitor. This charge flows out as additional current through the load. Thus the change of load current and voltage is reduced relative to what would occur without the capacitor. Increases of voltage correspondingly store excess charge in the capacitor, thus moderating the change in output voltage / current. The simplified circuit shown has a well-deserved reputation for being dangerous, because, in some applications, the capacitor can retain a lethal charge after the AC power source is removed. If supplying a dangerous voltage, a practical circuit should include a reliable way to safely discharge the capacitor. If the normal load cannot be guaranteed to perform this function, perhaps because it can be disconnected, the circuit should include a bleeder resistor connected as close as practical across the capacitor. This resistor should consume a current large enough to discharge the capacitor in a reasonable time, but small enough to minimize unnecessary power waste.

Because a bleeder sets a minimum current drain, the regulation of the circuit, defined as percentage voltage change from minimum to maximum load, is improved. However in many cases the improvement is of insignificant magnitude. capacitor and the load resistance have a typical time constant = RC where C and R are the capacitance and load resistance respectively. As long as the load resistor is large enough so that this time constant is much longer than the time of one ripple cycle, the above configuration will produce a smoothed DC voltage across the load. In some designs, a series resistor at the load side of the capacitor is added. The smoothing can then be improved by adding additional stages of capacitorresistor pairs, often done only for sub-supplies to critical high-gain circuits that tend to be sensitive to supply voltage noise. The idealized waveforms shown above are seen for both voltage and current when the load on the bridge is resistive. When the load includes a smoothing capacitor, both the voltage and the current waveforms will be greatly changed. While the voltage is smoothed, as described above, current will flow through the bridge only during the time when the input voltage is greater than the capacitor voltage. For example, if the load draws an average current of n Amps, and the diodes conduct for 10% of the time, the average diode current during conduction must be 10n Amps. This non-sinusoidal current leads to harmonic distortion and a poor power factor in the AC supply. In a practical circuit, when a capacitor is directly connected to theoutput of a bridge, the bridge diodes must be sized to withstand the current surge that occurs when the power is turned on at the peak of the AC voltage and the capacitor is fully discharged. Sometimes a small series resistor is included before the capacitor to limit this current, though in most applications the power supply transformer's resistance is already sufficient. Output can also be smoothed using a choke and second capacitor. The choke tends to keep the current (rather than the voltage) more constant. Due to the relatively high cost of an

effective choke compared to a resistor and capacitor this is not employed in modern equipment. Some early console radios created the speaker's constant field with the current from the high voltage ("B +") power supply, which was then routed to the consuming circuits, (permanent magnets were then too weak for good performance) to create the speaker's constant magnetic field. The speaker field coil thus performed 2 jobs in one: it acted as a choke, filtering the power supply, and it produced the magnetic field to operate the speaker.

REGULATOR IC (7805) It is a three pin IC used as a voltage regulator. It converts unregulated DC current into regulated DC current.

Normally we get fixed output by connecting the voltage regulator at the output of the filtered DC (see in above diagram). It can also be used in circuits to get a low DC voltage from a high DC voltage (for example we use 7805 to get 5V from 12V). There are two types of voltage regulators 1. fixed voltage regulators (78xx, 79xx) 2. variable voltage regulators (LM317) In fixed voltage regulators there is another classification 1. +ve voltage regulators 2. -ve voltage regulators POSITIVE VOLTAGE REGULATORS This include 78xx voltage regulators. The most commonly used ones are 7805 and 7812. 7805 gives fixed 5V DC voltage if input voltage is in (7.5V, 20V).

The Capacitor Filter The simple capacitor filter is the most basic type of power supply filter. The application of the simple capacitor filter is very limited. It is sometimes used on extremely high-voltage, low-current power supplies for cathode ray and similar electron tubes, which require very little load current from the supply. The capacitor filter is also used where the power-supply ripple frequency is not critical; this frequency can be relatively high. The capacitor (C1) shown in figure 4-15 is a simple filter connected across the output of the rectifier in parallel with the load.

Full-wave rectifier with a capacitor filter. When this filter is used, the RC charge time of the filter capacitor (C1) must be short and the RC discharge time must

be long to eliminate ripple action. In other words, the capacitor must charge up fast, preferably with no discharge at all. Better filtering also results when the input frequency is high; therefore, the full-wave rectifier output is easier to filter than that of the half-wave rectifier because of its higher frequency. For you to have a better understanding of the effect that filtering has on Eavg, a comparison of a rectifier circuit with a filter and one without a filter is illustrated in views A and B of figure 4-16. The output waveforms in figure 4-16 represent the unfiltered and filtered outputs of the half-wave rectifier circuit. Current pulses flow through the load resistance (RL) each time a diode conducts. The dashed line indicates the average value of output voltage. For the half-wave rectifier, Eavg is less than half (or approximately 0.318) of the peak output voltage. This value is still much less than that of the applied voltage. With no capacitor connected across the output of the rectifier circuit, the waveform in view A has a large pulsating component (ripple) compared with the average or dc component. When a capacitor is connected across the output (view B), the average value of output voltage (Eavg) is increased due to the filtering action of capacitor C1.

UNFILTERED

Half-wave rectifier with and without filtering. FILTERED

The value of the capacitor is fairly large (several microfarads), thus it presents a relatively low reactance to the pulsating current and it stores a substantial charge. The rate of charge for the capacitor is limited only by the resistance of the conducting diode, which is relatively low. Therefore, the RC charge time of the circuit is relatively short. As a result, when the pulsating voltage is first applied to the circuit, the capacitor charges rapidly and almost reaches the peak value of the rectified voltage within the first few cycles. The capacitor attempts to charge to the peak value of the rectified voltage anytime a diode is conducting, and tends to retain its charge when the rectifier output falls to zero. (The capacitor cannot discharge immediately.) The capacitor slowly

discharges through the load resistance (RL) during the time the rectifier is non-conducting. The rate of discharge of the capacitor is determined by the value of capacitance and the value of the load resistance. If the capacitance and load-resistance values are large, the RC discharge time for the circuit is relatively long. A comparison of the waveforms shown in figure 4-16 (view A and view B) illustrates that the addition of C1 to the circuit results in an increase in the average of the output voltage (Eavg) and a reduction in the amplitude of the ripple component (Er), which is normally present across the load resistance. Now, let's consider a complete cycle of operation using a halfwave rectifier, a capacitive filter (C1), and a load resistor (RL). As shown in view A of figure 4-17, the capacitive filter (C1) is assumed to be large enough to ensure a small reactance to the pulsating rectified current. The resistance of RL is assumed to be much greater than the reactance of C1 at the input frequency. When the circuit is energized, the diode conducts on the positive half cycle and current flows through the circuit, allowing C1 to charge. C1 will charge to approximately the peak value of the input voltage. (The charge is less than the peak value because of the voltage drop across the diode (D1)). In view A of the figure, the heavy solid line on the waveform indicates the charge on C1. As illustrated in view B, the diode cannot conduct on the negative half cycle because the anode of D1 is negative with respect to the cathode. During this interval, C1 discharges through the load resistor (RL). The discharge of C1 produces the downward slope as indicated by the solid line on the waveform in view B. In contrast to the abrupt fall of the applied ac voltage from peak value to zero, the voltage across C1 (and thus across RL) during the discharge period gradually decreases until the time of the next half cycle of rectifier operation. Keep in mind that for good filtering, the filter capacitor should charge up as fast as possible and discharge as little as possible. Figure. - Capacitor filter circuit (positive and negative half cycles). POSITIVE HALF-CYCLE

Figure. - Capacitor filter circuit (positive and negative half cycles). NEGATIVE HALF-CYCLE

Since practical values of C1 and RL ensure a more or less gradual decrease of the discharge voltage, a substantial charge remains on the capacitor at the time of the next half cycle of operation. As a result, no current can flow through the diode until the rising ac input voltage at the anode of the diode exceeds the voltage on the charge remaining on C1. The charge on C1 is the cathode potential of the diode. When the potential on the anode exceeds the potential on the cathode (the charge on C1), the diode again conducts, and C1 begins to charge to approximately the peak value of the applied voltage. After the capacitor has charged to its peak value, the diode will cut off and the capacitor will start to discharge. Since the fall of the ac input voltage on the anode is considerably more rapid than the decrease on the capacitor voltage, the cathode quickly

become more positive than the anode, and the diode ceases to conduct. Operation of the simple capacitor filter using a full-wave rectifier is basically the same as that discussed for the halfwave rectifier. Referring to figure, you should notice that because one of the diodes is always conducting on alternation, the filter capacitor charges and discharges during each half cycle. (Note that each diode conducts only for that portion of time when the peak secondary voltage is greater than the charge across the capacitor.) Figure - Full-wave rectifier (with capacitor filter).

Another thing to keep in mind is that the ripple component (E r) of the output voltage is an ac voltage and the average output voltage (Eavg) is the dc component of the output. Since the filter capacitor offers relatively low impedance to ac, the majority of the ac component flows through the filter capacitor. The ac component is therefore bypassed (shunted) around the load resistance, and the entire dc component (or Eavg) flows through the load resistance. This statement can be clarified by using the formula for XC in a half-wave and full-wave rectifier. First, you must establish some values for the circuit. As you can see from the calculations, by doubling the frequency of the rectifier, you reduce the impedance of the capacitor by one-half. This allows the ac component to pass through the capacitor more easily. As a result, a full-wave

rectifier output is much easier to filter than that of a half-wave rectifier. Remember, the smaller the XC of the filter capacitor with respects to the load resistance, the better the filtering action. Since

the largest possible capacitor will provide the best filtering. Remember, also, that the load resistance is an important consideration. If load resistance is made small, the load current increases, and the average value of output voltage (Eavg) decreases. The RC discharge time constant is a direct function of the value of the load resistance; therefore, the rate of capacitor voltage discharge is a direct function of the current through the load. The greater the load current, the more rapid the discharge of the capacitor, and the lower the average value of output voltage. For this reason, the simple capacitive filter is seldom used with rectifier circuits that must supply a relatively large load current. Using the simple capacitive filter in conjunction with a full-wave or bridge rectifier provides improved filtering because the increased ripple frequency decreases the capacitive reactance of the filter capacitor. APPENDIX 1. Software used in the project codevisionavr codevisionavr software to provide you with software development tools for avr based microcontrollers. With the this tools, you can generate embedded applications for virtually every avr derivative. The supported microcontrollers are listed in the codeVision Device Database. The codevision Software avr development tools are designed for the professional software developer, but any level of programmer can use them to get the most out of the avr microcontroller architecture. Codevision software burn the C-codes in avr directly.

Datasheets

A BRIEF INTRODUCTION TO ATMEGA32 MICROCONTROLLER-: When we have to learn about a new computer we have to familiarize about the machine capability we are using, and we can do it by studying the internal hardware design (devices architecture), and also to know about the size, number and the size of the registers.

A microcontroller is a single chip that contains the processor (the CPU), non-volatile memory for the program (ROM or flash), volatile memory for input and output (RAM), a clock and an I/O control unit. Also called a "computer on a chip," billions of microcontroller units (MCUs) are embedded each year in a myriad of products from toys to appliances to automobiles. For example, a single vehicle can use 70 or more microcontrollers. The following picture describes a general block diagram of microcontroller. ATMEGA32: The ATMEGA32 is a low-power, highperformance advance RISC 8-bit microcontroller with 32K bytes of in-system programmable Flash memory. The on-chip Flash allows the program memory to be reprogrammed in-system or by a conventional nonvolatile memory pro-grammer. By combining a versatile 8-bit CPU with in-system programmable Flash on a monolithic chip, the Atmel ATMEGA32 is a powerful microcontroller, which provides a highly flexible and costeffective solution to many, embedded control applications. The ATMEGA32 provides the following standard features: 32K bytes of Flash, 1024 byte of EEPROM & 2KB INTERNAL S RAM , 32 I/O lines, Watchdog timer, two data pointers, two 16-bit timer/counters, a six-vector two-level interrupt architecture, a full duplex serial port, on-chip oscillator,8-channel 10 bit ADC and clock circuitry. In addition, the ATMEGA32 is designed with static logic for operation down to zero frequency and supports two software selectable power saving modes. The Idle Mode stops the CPU while allowing the RAM, timer/counters, serial port, and interrupt system to continue functioning. The Power-down mode saves the RAM con-tents but freezes the oscillator, disabling all other chip functions until the next interrupt

4L. LCD DISPLAY 2.LCD

The liquid - crystal display (LCD) consist of a liquid crystal material (normally organic for LCDs) that will flow like a

liquid but whose molecular structure has some properties normally associated with solids. The LCD does not generate its own light but depends on an external or internal source. Under dark conditions, it would be necessary for the unit to have its own internal light source either behind or to the side of the LCD. During the day, or in the lighted areas, a reflector can be put behind the LCD to reflect the light back through the display for maximum intensity.

The LCD has the distinct advantage of having the lower power requirement than the LED. It is typical in the order of microwatts for the display, as compared to the same order of milliwatts for LEDs. LCD is limited to a temperature range of about 0 to 60 C. Lifetime is an area of concern because LCDs can chemically degrade. LCDs can add a lot to out applications in terms of providing an useful interface for the user, debugging an application or just giving it a "professional" look. The most common type of LCD controller is the Hitatchi 44780 which provides a relatively simple interface between a processor and an LCD. Besides this there are several other reasons for LCDs replacing LEDs(seven segment LEDs or other multisegment LEDs).This is due the following reasons : The declining prices of LCDs. The ability to display numbers, characters and graphics. This is in contrast to LEDs , which are limited to numbers and a few characters. In corporation of a refreshing controller into the LCD , thereby relieving the CPU of the task of refreshing the LCD in contrast, the LED must be refreshed by the CPU (or in some other way) to keep displaying the data. Ease of programming for characters and graphics.

LCD PIN DESCRIPTIONS Fig 1. Shows the pin diagram of a 14 pin LCD.

The LCD used here has 14 pins. The functions of each pin are given below: VCC, VSS, and VEE : While Vcc and Vss provide +5V and ground, respectively, VEE is used for controlling LCD contrast. RS, register select: There are two very important registers inside the LCD. The RS pin is used for their selection as follows .If RS = 0 , then instruction command code register is selected , allowing the user to send the command such as clear display, cursor at home, etc. If RS = 1 the data register is selected, allowing the user to send data to be displayed on the LCD. R/W, read/write: R/W input allows the user to write information to the LCD or read information from it. R/W =1 when reading ; R/W = 0 when writing. E, enable: The enable pin is used by the LCD to latch information presented to its data pins. When data is supplied to data pins, a high to low pulse must be applied to this pin in order for the

LCD to latch in the data present at the data pins. This pulse must be a minimum of 450 ns wide. D0 D7: The 8 bit data pins , D0 D7, are used to send information to the LCD or read the contents of the LCD's internal registers. To display letters and numbers, we send ASCII codes for the letters A- Z, a-z, and 0-9 to these pins while making RS = 1. There are also instruction commands codes that can be send to the LCD to clear the display or force to cursor to the home position or blink the cursor. We also use RS=0 to check the busy flag bit to see if the LCD is ready to receive information. The busy flag is D7 and can be read when R/W=1.RS=0, as follows: if R/W=1 and RS=0.When D7=1 (busy flag=1), the LCD is busy taking care of internal operations and will not accept any new information. When D7 = 0, the LCD is ready to receive new information.

PIN DESCRIPTION FOR LCD Pi n 1 2 3 4 5 6 7 8 9 10 Sym bol Vss Vcc VEE RS R/W E DB0 DB1 DB2 DB3 I/O ---I I I/O I/O I/O I/O I/O Description Ground +5V power supply Power supply to control contrast RS=0 for command register, RS=1 for data register R/W+0 for write, R/W+1 for read Enable The 8-bit data bus The 8-bit data bus The 8-bit data bus The 8-bit data bus

11 12 13 14

DB4 DB5 DB6 DB7

I/O I/O I/O I/O

The The The The

8-bit 8-bit 8-bit 8-bit

data data data data

bus bus bus bus

LCD Command Codes Code (Hex) 1 2 4 6 5 7 8 A C E F 10 14 18 1C 80 C0 38 Command to LCD Instruction Register Clear display screen Return home Decrement cursor(shift cursor to left) Increment cursor(shift cursor to right) Shift display left Shift display left Display off, cursor off Display off, cursor on Display on, cursor off Display on Display on, cursor blinking Shift cursor position to left Shift cursor position to right Shift the entire display to the left Shift the entire display to the right Force cursor to beginning of first line Force cursor to beginning of second line 2 lines and 5x7 matrix

WORKING:

The interface used by LCD is a parallel bus, allowing simple and fast reading/writing of data to and from the LCD.

This waveform will write an ASCII Byte out to the LCD's screen. The ASCII code to be displayed is eight bits long and is sent to the LCD either four or eight bits at a time. If four bit mode is used, two "nibbles" of data (Sent high four bits and then low four bits with an "Enable" Clock pulse with each nibble) are sent to make up a full eight bit transfer. The "Enable" Clock is used to initiate the data transfer within the LCD. Sending parallel data as either four or eight bits are the two primary modes of operation. While there are secondary considerations and modes, deciding how to send the data to the LCD is most critical decision to be made for an LCD interface application. Eight bit mode is best used when speed is required in an application and at least ten I/O pins are available. Four bit mode requires a minimum of six bits. To wire a microcontroller to an LCD in four bit mode, just the top four bits (DB4-7) are written to. The "RS" bit is used to select whether data or an instruction is being transferred between the microcontroller and the LCD. If

the Bit is set, then the byte at the current LCD "Cursor" Position can be read or written. When the Bit is reset, either an instruction is being sent to the LCD or the execution status of the last instruction is read back (whether or not it has completed). Reading Data back is best used in applications which required data to be moved back and forth on the LCD (such as in applications which scroll data between lines).In our Project we have permanently grounded R/W pin which means we are not retrieving any data from LCD. The LCD can be thought of as a "Teletype" display because in normal operation, after a character has been sent to the LCD, the internal "Cursor" is moved one character to the right. The "Clear Display" and "Return Cursor and LCD to Home Position" instructions are used to reset the Cursor's position to the top right character on the display. To move the Cursor, the "Move Cursor to Display" instruction is used. For this instruction, bit 7 of the instruction byte is set with the remaining seven bits used as the address of the character on the LCD the cursor is to move to. These seven bits provide 128 addresses, which matches the maximum number of LCD character addresses available.

Eight programmable characters are available and use codes 0x000 to 0x007. They are programmed by pointing the LCD's "Cursor" to the Character Generator RAM

The last aspect of the LCD to discuss is how to specify a contrast voltage to the Display. I typically use a potentiometer wired as a voltage divider. This will provide an easily variable voltage between Ground and Vcc, which will be used to specify the contrast (or "darkness") of the characters on the LCD screen. You may find that different LCDs work differently with lower voltages providing darker characters in some and higher voltages do the same thing in others

L293D

The L293 and L293D are quadruple high-current half-H drivers. The L293 is designed to provide bidirectional drive currents of up to 1 A at voltages from 4.5 V to 36 V. The L293D is designed to provide bidirectional drive currents of up to 600-mA at voltages from 4.5 V to 36 V. Both devices are designed to drive inductive loads such as relays, solenoids, dc and bipolar stepping motors, as well as other high-current/high-voltage loads in positive-supply applications. All inputs are TTL compatible. Each output is a complete totempole drive circuit, with a Darlington transistor sink and a pseudo-Darlington source. Drivers are enabled in pairs, with drivers 1 and 2 enabled by 1,2EN and drivers 3 and 4 enabled by 3,4EN. When an enable input is high, the associated drivers are enabled and their outputs are active and in phase with their inputs. When the enable input is low, those drivers are disabled and their outputs are off and in the high-impedance state. With the proper data inputs, each pair of drivers forms a full-H (or bridge) reversible drive suitable for solenoid or motor applications. On the L293, external high-speed output clamp diodes should be used for inductive transient suppression. A VCC1 terminal,

separate from VCC2, is provided for the logic inputs to minimize device power dissipation.

Stepper motor A stepper motor (or step motor) is a brushless, synchronous electric motor that can divide a full rotation into a large number of steps. The motor's position can be controlled precisely, without any feedback mechanism (see Open-loop controller). Stepper motors are similar to switched reluctance motors (which are very large stepping motors with a reduced pole count, and generally are closed-loop commutated.) Fundamentals of Operation Stepper motors operate differently from DC brush motors, which rotate when voltage is applied to their terminals. Stepper motors, on the other hand, effectively have multiple "toothed" electromagnets arranged around a central gear-shaped piece of iron. An external control circuit, such as a microcontroller, energizes the electromagnets. To make the motor shaft turn, first one electromagnet is given power, which makes the gear's teeth magnetically attracted to the electromagnet's teeth. When the gear's teeth are thus 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 slight 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.

Stepper motor characteristics 1. Stepper motors are constant power devices. 2. As motor speed increases, torque decreases. 3. The torque curve may be extended by using current limiting drivers and increasing the driving voltage. 4. Steppers exhibit more vibration than other motor types, as the discrete step tends to snap the rotor from one position to another. 5. This vibration can become very bad at some speeds and can cause the motor to lose torque. 6. The effect can be mitigated by accelerating quickly through the problem speeds range, physically damping the system, or using a micro-stepping driver. 7. Motors with a greater number of phases also exhibit smoother operation than those with fewer phases. Open-loop versus closed-loop commutation Steppers are generally commutated open loop, ie. the driver has no feedback on where the rotor actually is. Stepper motor systems must thus generally be over engineered, especially if the load inertia is high, or there is widely varying load, so that there is no possibility that the motor will lose steps. This has often caused the system designer to consider the trade-offs between a closely sized but expensive servomechanism system and an oversized but relatively cheap stepper. A new development in stepper control is to incorporate a rotor position feedback (eg. an encoder or resolver), so that the commutation can be made optimal for torque generation

according to actual rotor position. This turns the stepper motor into a high pole count brushless servo motor, with exceptional low speed torque and position resolution. An advance on this technique is to normally run the motor in open loop mode, and only enter closed loop mode if the rotor position error becomes too large -- this will allow the system to avoid hunting or oscillating, a common servo problem. There are three main types of stepper motors: Permanent Magnet Stepper Hybrid Synchronous Stepper Variable Reluctance Stepper Permanent magnet motors use a permanent magnet (PM) in the rotor and operate on the attraction or repulsion between the rotor PM and the stator electromagnets. Variable reluctance (VR) motors have a plain iron rotor and operate based on the principle of that minimum reluctance occurs with minimum gap, hence the rotor points are attracted toward the stator magnet poles. Hybrid stepper motors are named because they use use a combination of PM and VR techniques to achieve maximum power in a small package size. Two-phase stepper motors There are two basic winding arrangements for the electromagnetic coils in a two phase stepper motor: bipolar and unipolar. Unipolar motors A unipolar stepper motor has two windings per phase, one for each direction of magnetic field. Since in this arrangement a magnetic pole can be reversed without switching the direction of current, the commutation circuit can be made very simple (eg. a single transistor) for each winding. Typically, given a phase, one end of each winding is made common: giving three leads per phase and six leads for a typical two phase motor. Often, these two phase commons are internally joined, so the motor has only five leads.

A microcontroller or stepper motor controller can be used to activate the drive transistors in the right order, and this ease of operation makes unipolar motors popular with hobbyists; they are probably the cheapest way to get precise angular movements.

Unipolar stepper motor coils (For the experimenter, one way to distinguish common wire from a coil-end wire is by measuring the resistance. Resistance between common wire and coil-end wire is always half of what it is between coil-end and coil-end wires. This is due to the fact that there is actually twice the length of coil between the ends and only half from center (common wire) to the end.) A quick way to determine if the stepper motor is working is to short circuit every two pairs and try turning the shaft, whenever a higher than normal resistance is felt, it indicates that the circuit to the particular winding is closed and that the phase is working. Bipolar motor Bipolar motors have a single winding per phase. The current in a winding needs to be reversed in order to reverse a magnetic pole, so the driving circuit must be more complicated, typically with an H-bridge arrangement. There are two leads per phase, none are common. Static friction effects using an H-bridge have been observed with certain drive topologies Because windings are better utilised, they are more powerful than a unipolar motor of the same weight. 8-lead stepper An 8 lead stepper is wound like a unipolar stepper, but the leads are not joined to common internally to the motor. This kind of motor can be wired in several configurations:

Unipolar. Bipolar with series windings. This gives higher inductance but lower current per winding. Bipolar with parallel windings. This requires higher current but can perform better as the winding inductance is reduced. Bipolar with a single winding per phase. This method will run the motor on only half the available windings, which will reduce the available low speed torque but require less current. Higher-phase count stepper motors Multi-phase stepper motors with many phases tend to have much lower levels of vibration, although the cost of manufacture is higher.

Stepper motor drive circuits Stepper motor performance is strongly dependent on the drive circuit. Torque curves may be extended to greater speeds if the stator poles can be reversed more quickly, the limiting factor being the winding inductance. To overcome the inductance and switch the windings quickly, one must increase the drive voltage. This leads further to the necessity of limiting the current that these high voltages may otherwise induce. L/R drive circuits L/R drive circuits are also referred to as constant voltage drives because a constant positive or negative voltage is applied to each winding to set the step positions. However, it is winding current, not voltage that applies torque to the stepper motor shaft. The current I in each winding is related to the applied voltage V by the winding inductance L and the winding resistance R. The resistance R determines the maximum current according to Ohm's law I=V/R. The inductance L determines the maximum rate of change of the current in the winding according to the formula for an Inductor dI/dt = V/L. Thus when controlled by an L/R drive, the maximum speed of a stepper motor is limited by its inductance since at some speed,

the voltage V will be changing faster than the current I can keep up. With an L/R drive it is possible to control a low voltage resistive motor with a higher voltage drive simply by adding an external resistor in series with each winding. This will waste power in the resistors, and generate heat. It is therefore considered a low performing option, albeit simple and cheap. Chopper drive circuits Chopper drive circuits are also referred to as constant current drives because they generate a somewhat constant current in each winding rather than applying a constant voltage. On each new step, a very high voltage is applied to the winding initially. This causes the current in the winding to rise quickly since dI/dt = V/L where V is very large. The current in each winding is monitored by the controller, usually by measuring the voltage across a small sense resistor in series with each winding. When the current exceeds a specified current limit, the voltage is turned off or "chopped", typically using power transistors. When the winding current drops below the specified limit, the voltage is turned on again. In this way, the current is held relatively constant for a particular step position. This requires additional electronics to sense winding currents, and control the switching, but it allows stepper motors to be driven with higher torque at higher speeds than L/R drives. Integrated electronics for this purpose are widely available. Phase current waveforms A stepper motor is a polyphase AC synchronous motor (see Theory below), and it is ideally driven by sinusoidal current. A full step waveform is a gross approximation of a sinusoid, and is the reason why the motor exhibits so much vibration. Various drive techniques have been developed to better approximate a sinusoidal drive waveform: these are half stepping and microstepping. Full step drive (two phases on) This is the usual method for full step driving the motor. Both phases are always on. The motor will have full rated torque.

Wave drive In this drive method only a single phase is activated at a time. It has the same number of steps as the full step drive, but the motor will have significantly less than rated torque. It is rarely used. Half stepping When half stepping, the drive alternates between two phases on and a single phase on. This increases the angular resolution, but the motor also has less torque at the half step position (where only a single phase is on). This may be mitigated by increasing the current in the active winding to compensate. The advantage of half stepping is that the drive electronics need not change to support it. Microstepping What is commonly referred to as microstepping is actual "sine cosine microstepping" in which the winding current approximates a sinusoidal AC waveform. Sine cosine microstepping is the most common form, but other waveforms are used. Regardless of the waveform used, as the microsteps become smaller, motor operation becomes more smooth, thereby greatly reducing resonance in any parts the motor may be connected to, as well as the motor itself. It should be noted that while microstepping appears to make running at very high resolution possible, this resolution is rarely achievable in practice regardless of the controller, due to mechanical stiction and other sources of error between the specified and actual positions. In professional equipment gearheads are the preferred way to increase angular resolution. Step size repeatability is an important step motor feature and a fundamental reason for their use in positioning. Example: many modern hybrid step motors are rated such that the travel of every Full step (example 1.8 Degrees per Full step or 200 Full steps per revolution) will be within 3% or 5% of the travel of every other Full step; as long as the motor is operated with in its specified operating ranges. Several manufacturers show that their motors can easily maintain the 3% or 5% equality of step

travel size as step size is reduced from Full stepping down to 1/10th stepping. Then, as the microstepping divisor number grows, step size repeatability degrades. At large step size reductions it is possible to issue many microstep commands before any motion occurs at all and then the motion can be a "jump" to a new position. Theory A step motor can be viewed as a synchronous AC motor with the number of poles (on both rotor and stator) increased, taking care that they have no common denominator. Additionally, soft magnetic material with many teeth on the rotor and stator cheaply multiplies the number of poles (reluctance motor). Modern steppers are of hybrid design, having both permanent magnets and soft iron cores. To achieve full rated torque, the coils in a stepper motor must reach their full rated current during each step. Winding inductance and reverse EMF generated by a moving rotor tend to resist changes in drive current, so that as the motor speeds up, less and less time is spent at full current -- thus reducing motor torque. As speeds further increase, the current will not reach the rated value, and eventually the motor will cease to produce torque. Pull-in torque This is the measure of the torque produced by a stepper motor when it is operated without an acceleration state. At low speeds the stepper motor can synchronise itself with an applied step frequency, and this Pull-In torque must overcome friction and inertia. Pull-out torque The stepper motor pull-out torque is measured by accelerating the motor to the desired speed and then increasing the torque loading until the motor stalls or "pulls out of synchronism" with the step frequency. This measurement is taken across a wide range of speeds and the results are used to generate the stepper motor's dynamic performance curve. As noted below

this curve is affected by drive voltage, drive current and current switching techniques. It is normally recommended to use a safety factor of between 50% and 100% when comparing your desired torque output to the published "pull-Out" torque performance curve of a step motor.

Detent torque Synchronous electric motors using permanent magnets have a remnant position holding torque (called detent torque, and sometimes included in the specifications) when not driven electrically. Soft iron reluctance cores do not exhibit this behavior. Stepper motor ratings and specifications Stepper motors nameplates typically give only the winding current and occasionally the voltage and winding resistance. The rated voltage will produce the rated winding current at DC: but this is mostly a meaningless rating, as all modern drivers are current limiting and the drive voltages greatly exceed the motor rated voltage. A stepper's low speed torque will vary directly with current. How quickly the torque falls off at faster speeds depends on the winding inductance and the drive circuitry it is attached to, especially the driving voltage. Steppers should be sized according to published torque curve, which is specified by the manufacturer at particular drive voltages and/or using their own drive circuitry. It is not guaranteed that you will achieve the same performance given different drive circuitry, so the pair should be chosen with great care. Applications

Computer-controlled stepper motors are one of the most versatile forms of positioning systems. They are typically digitally controlled as part of an open loop system, and are simpler and more rugged than closed loop servo systems. Industrial applications are in high speed pick and place equipment and multi-axis machine CNC machines often directly driving lead screws or ballscrews. In the field of lasers and optics they are frequently used in precision positioning equipment such as linear actuators, linear stages, rotation stages, goniometers, and mirror mounts. Other uses are in packaging machinery, and positioning of valve pilot stages for fluid control systems. Commercially, stepper motors are used in floppy disk drives, flatbed scanners, computer printers, plotters, slot machines, and many more devices. TROUBLESHOOT Care should be taken while soldering. There should be no shorting of joints. Proper power supply should maintain. Project should be handled with care since IC are delicate Component change and check again circuit

Introduction to matlab-:
A graphical user interface (GUI) is a pictorial interface to a program. A good GUI can make programs easier to use by providing them with a consistent appearance and with intuitive controls like pushbuttons, list boxes, sliders, menus, and so forth. The GUI should behave in an understandable and predictable manner, so that a user knows what to expect when he or she performs an action. For example, when a mouse click occurs on a pushbutton, the GUI should initiate the action described on the label of the button. This

chapter introduces the basic elements of the MATLAB GUIs. The chapter does not contain a complete description of components or GUI features, but it does provide the basics required to create functional GUIs for your programs 1.1 How a Graphical User Interface Works A graphical user interface provides the user with a familiar environment in which to work. This environment contains pushbuttons, toggle buttons, lists, menus, text boxes, and so forth, all of which are already familiar to the user, so that he or she can concentrate on using the application rather than on the mechanics involved in doing things. However, GUIs are harder for the programmer because a GUI-based program must be prepared for mouse clicks (or possibly keyboard input) for any GUI element at any time. Such inputs are known as events, and a program that responds to events is said to be event driven. The three principal elements required to create a MATLAB Graphical User Interface are 1. Components. Each item on a MATLAB GUI (pushbuttons, labels, edit boxes, etc.) is a component. The types of components include graphical controls (pushbuttons, edit boxes, lists, sliders, etc.), static elements (frames and text strings), menus, and axes. Graphical controls and static elements are created by the function uicontrol, and menus are created by the functions uimenu and uicontextmenu. Axes, which are used to display graphical data, are created by the function axes. 2. The components of a GUI must be arranged within a figure, which is a window on the computer screen. In the past, figures have been created automatically whenever we have plotted data. However, empty figures can be created with the function figure and can be used to hold any combination of components. 3. Callbacks. Finally, there must be some way to perform an action if a user clicks a mouse on a button or types information on a keyboard. A mouse click or a key press is an event, and the MATLAB program must respond to each event if the program is to perform its function. For example, if a user clicks on a button, that event must cause the MATLAB code that implements the function of the button to be executed. The code executed in response to an event is known as a call back. There

must be a callback to implement the function of each graphical component on the GUI. The basic GUI elements. We will be studying examples of these elements and then build working GUIs from them. 1.2 Creating and Displaying a Graphical User Interface MATLAB GUIs are created using a tool called guide, the GUI Development Environment. This tool allows a programmer to layout the GUI, selecting and aligning the GUI components to be placed in it. Once the components are in place, the programmer can edit their properties: name, color, size, font, text to display, and so forth. When guide saves the GUI, it creates working program including skeleton functions that the programmer can modify to implement the behavior of the GUI. When guide is executed, it creates the Layout Editor, shown in Figure 1.2. The large white area with grid lines is the layout area, where a programmer can layout the GUI. The Layout Editor window has a palate of GUI components along the left side of the layout area. A user can create any number of GUI components by first clicking on the desired component, and then dragging its outline in the layout area. The top of the window has a toolbar with a series of useful tools that allow the user to distribute and align GUI components, modify the properties of GUI components, add menus to GUIs, and so on. The basic steps required to create a MATLAB GUI are: 1. Decide what elements are required for the GUI and what the function of each element will be. Make a rough layout of the components by hand on a piece of paper.

Figure 1.1 A Figure Window showing examples of MA TLAB GUI elements. From top to bottom and left to right, the elements are: (1) a pushbutton; (2) a toggle button in the 'on' state; (3) two radio buttons surrounded by a frame; (4) a check box; (5) a text field and an edit box; (6) a slider; (7) a set of axes; and (8) a list box. 2. Use a MATLAB tool called guide (GUI Development Environment) to layout the Components on a figure. The size of the figure and the alignment and spacing of components on the figure can be adjusted using the tools built into guide. 3. Use a MATLAB tool called the Property Inspector (built into guide) to give each component a name (a "tag") and to set the characteristics of each component, such as its color, the text it displays, and so on. 4. Save the figure to a file. When the figure is saved, two files will be created on disk with the same name but different extents. The fig file contains the actual GUI that you have created, and the M-file contains the code to load the figure and skeleton call backs for each GUI element.

5. Write code to implement the behavior associated with each callback function.

Circuit diagram

WORKING-:

The solar and wind energy systems both have their benefits and disadvantages, so it is possible to build a hybrid system that combines the 2 of them. The advantage with this combination system is that it will still function in the event that there is no wind or sun energy. This hybrid system is good for helping to even out the peaks and valleys in levels of power produced by the 2 systems. The solar panels can only generate electricity

when they are exposed to sunlight, and become useless in cloudy day and at night. This also applies to a wind power system when there is a lack of wind. A combination system has a much lower chance of failing to produce power in any time of the day. It is very important that you do careful planning before deciding on the type of home energy system that you want to build. This planning phase includes calculating the total power that your home requires, how much power you plan to produce with the system and how much reserve power your home will need. Thousands of people have already eliminated their own home electricity bills with the free energy system that they learned how to build with a step-by-step guide online. You can find out more about how to build this homemade power system at the website link below

REFERENCES

Introduction MAZIDI.

to Microcontroller by MAZIDI AND

Microprocessors & Microcontroller by U.S.SHAH.

WEBSITES www.atmel.com www.seimens.com www.philipsemiconductors.com www.howstuffworks.com www.alldatasheets.com www.efyprojects.com www.thomson.com/learning www.google.com

Vous aimerez peut-être aussi