Aim of this project is control the unmanned rail gate automatically using embedded platform. Today often we see news papers very often about the railway accidents happening at un- attended railway gates. Present project is designed to avoid such accidents if implemented in spirit. This project utilizes two powerful IR transmitter and two receivers, one pair of transmitter and receiver is fixed at upside (from the train comes) at a level higher than human being in exact alignment and similarly other pair is fixed at down side of the train direction sensor activation time is so adjusted by calculating the time taken at a certain speed to cross at least one compartment of standard minimum size of the Indian railway, normally 5 seconds. The sensors are fixed at 1000 meters on both sides of the gate, we call fore side sensor pair for common towards gate train, and aft side sensors for the train just Crosses the gate. When train cross the fore side sensor it gives signal to the gate receiver to close the gate. The buzzer is activated to clear the gate area for drivers about 5 seconds. Gate motor is turned on in one direction and gate is closed, and stay closed till train crosses the gate and reaches aft side sensors when aft side receiver get activated motor turns in opposite direction and gate opens and motor stops . If there is any problem in the gate means it will operate red signal on both side fro the driver indication. Train arrival and departure sensing can be achieved by means of Relay techniques. When the wheels of the train moves over, both tracks are shorted to ground and this acts as a signal to microcontroller (89C51) indicating train arrival. RED signal appears for the road user, once the train cuts the relay sensor placed before the 5Kms before the gate .A buzzer is made on as a pre cautionary measure for the road users.
Chapter 1 INTRODUCTION
INTRODUCTION Present project is designed using AT89C51 microcontroller to avoid railway accidents happening at unattended railway gates, if implemented in spirit. This project utilizes two powerful IR transmitters and two receivers; one pair of transmitter and receiver is fixed at up side (from where the train comes) at a level higher than a human being in exact alignment and similarly the other pair is fixed at down side of the train direction. Sensor activation time is so adjusted by calculating the time taken at a certain speed to cross at least one compartment of standard minimum size of the Indian railway. We have considered 5 seconds for this project. Sensors are fixed at 1km on both sides of the gate. We call the sensor along the train direction as Ëœforeside sensorâ„¢ and the other as Ëœaft side sensorâ„¢. When foreside receiver gets activated, the gate motor is turned on in one direction and the gate is closed and stays closed until the train crosses the gate and reaches aft side sensors. When aft side receiver gets activated motor turns in opposite direction and gate opens and motor stops. Buzzer will immediately sound at the fore side receiver activation and gate will close after 5 seconds, so giving time to drivers to clear gate area in order to avoid trapping between the gates and stop sound after the train has crossed. The same principle is applied for track switching. Considering a situation wherein an express train and a local train are traveling in opposite directions on the same track; the express train is allowed to travel on the same track and the local train has to switch on to the other track. Two sensors are placed at the either sides of the junction where the track switches. If thereâ„¢s a train approaching from the other side, then another sensor placed along that direction gets activated and will send an interrupt to the controller. The interrupt service routine switches the track. Indicator lights have been provided to avoid collisions. Here the switching operation is performed using a stepper motor. Assuming that within a certain delay, the train has passed the track is switched back to its original position, allowing the first train to pass without any interruption. This concept of track switching can be applied at 1km distance from the stations.
Gate Control: Railways being the cheapest mode of transportation are preferred over all the other means .When we go through the daily newspapers we come across many railway accidents occurring at unmanned railway crossings. This is mainly due to the carelessness in manual operations or lack of workers. We, in this project has come up with a solution for the same. Using simple electronic components we have tried to automate the control of railway gates. As a train approaches the railway crossing from either side, the sensors placed at a certain distance from the gate detects the approaching train and accordingly controls the operation of the gate. Also an indicator light has been provided to alert the motorists about the approaching train. Track Switching: Using the same principle as that for gate control, we have developed a concept of automatic track switching. Considering a situation wherein an express train and a local train are traveling in opposite directions on the same track; the express train is allowed to travel on the same track and the local train has to switch on to the other track. Indicator lights have been provided to avoid collisions .Here the switching operation is performed using a stepper motor. In practical purposes this can be achieved using electromagnets. Signaling using LCD: Train arrival and departure message is needed at the platform for the passengers and also a announcement is required. By detecting the signal at tracks by sensors a command is sent to the micro controller which enables the LCD to display the arrival message. We can also use another sensor after the station to display the departure message. And a buzzer can be connected across it to give a announcement. A specified delay is given to message so that can be displayed for that much time.
Micro-controllers are also being used increasingly as tools for analysis and design of control systems. The control engineer thus has much more powerful tools available now than in the past. Digital computers are still in a state of rapid development because of the progress in very large-scale integration (VLSI) technology. Thus substantial technological improvements can be expected in the future. Because of these developments, the approach to analysis, design, and implementation of control systems is changing drastically. Originally it was only a matter of translating the earlier analog designs into the new technology. technology. However, it has been realized that there is much to be gained by exploiting the full potential of the new Fortunately, control theory has also developed substantially over the past 35 years. For a while it was quite unrealistic to implement the type of regulators that the new theory produced except in a few exotic mostly in aerospace or advanced process control. However, due to the revolutionary development of microelectronics, advanced regulators can be implemented even for basic applications. It is also possible to do analysis and design at a reasonable cost with the interactive design tools that are becoming increasingly available. The purpose of this project work is to present control theory that is relevant to the analysis and design of Micro-controller system with an emphasis on basic concept and ideas. It is assumed that a Microcontroller with reasonable software is available for computations and simulations so that many tedious details can be left to the Microcontroller. The control system design is also carried out up to the stage of implementation in the form of controller programs in assembly language. Micro-controllers are "embedded" inside some other device so that they can control the features or actions of the product. Another name for a micro-controller, therefore, is "embedded controller". Micro-controllers are dedicated to one task and run one specific program. The program is stored in ROM (read-only memory) and generally does not change. Micro-controllers are often low-power devices. A battery-operated Microcontroller might consume 50 mille watts. A micro-controller has a dedicated input
device and often (but not always) has a small LED or LCD display for output. A microcontroller also takes input from the device it is controlling and controls the device by sending signals to different components in the device.
1.2 Scope of project: This project is developed in order to help the INDIAN RAILWAYS in making its present working system a better one, by eliminating some of the loopholes existing in it. Based on the responses and reports obtained as a result of the significant development in the working system of INDIAN RAILWAYS, this project can be further extended to meet the demands according to situation. This can be further implemented to have control room to regulate the working of the system. Thus becomes the user friendliness. This circuit can be expanded and used in a station with any number of platforms as per the usage. Additional modules can be added with out affecting the remaining modules. This allows the flexibility and easy maintenance of the developed system. This system consists of following features over manual system: There is no time lag to operate the device. Accuracy.
1.3 Contents of the Thesis: Chapter 2 describes the block diagram and operation of different units like gate control, track switching and etc., with block diagrams. Chapter 3 describes power supply part that we used in this project, with different parts of it, with ratings. Chapter 4 presents how the LCD interfaced with 89c51, which we used in this project for displaying train status message and explanation for program. Chapter 5 presents stepper motor interfacing and explanation for program written. Chapter 6 presents detailed explanation about infrared sensors and its parts with circuit diagrams. Chapter 7 gives detailed presentation of all hardware components that we use in this project. Chapter 8 gives the conclusions and future scope of this project.
Chapter 2 BLOCK DIAGRAM AND GENERAL DESCRIPTION
Block diagram and General description 2.1 Block diagram introduction:
TheFIG2.1shows the general block diagram of unmanned railway gate control, the various blocks of this are: 1. Power supply unit 2. Gate control unit 3. Track changing unit 4. LCD Message display unit This project uses AT89C51 microcontroller for programming and operation. And ULN2003 driver.
The Block diagram consists of the power supply, which is of single-phase 230V ac. This should be given to step down transformer to reduce the 230V ac voltage to lower value. i.e., to 9V or 18V ac this value depends on the transformer inner winding. The output of the transformer is given to the rectifier circuit. This rectifier converts ac voltage to dc voltage. But the voltage may consist of ripples or harmonics. To avoid these ripples, the output of the rectifier is connected to filter. The filter thus removes the harmonics. This is the exact dc voltage of the given specification. But the controller operates at 5V dc and the relays and driver operates at 12V dc voltage. So the regulator is required to reduce the voltage. Regulator 7805 produces 5V dc and regulator 7812 produces 12V dc. Both are positive voltages. The supply from 7805 regulator is used for the purpose of track changing which consists of a stepper motor driven with ULN2003 the current driver chip. The supply of 12v is given to drive the stepper motor for the purpose of gate control. Through uln2003
Fig 2.2. shows the of view of model project.
T his project utilizes two powerful IR transmitters and two receivers; one pair
of transmitter and receiver is fixed at up side (from where the train comes) at a level higher than a human being in exact alignment and similarly the other pair is fixed at down side of the train direction. Sensor activation time is so adjusted by calculating the time taken at a certain speed to cross at least one compartment of standard minimum size
of the Indian railway. We have considered 5 seconds for this project. Sensors are fixed at 1km on both sides of the gate. We call the sensor along the train direction as Ëœforeside sensorâ„¢ and the other as Ëœaft side sensorâ„¢. When foreside receiver gets activated, the gate motor is turned on in one direction and the gate is closed and stays closed until the train crosses the gate and reaches aft side sensors. When aft side receiver gets activated motor turns in opposite direction and gate opens and motor stops. Buzzer will immediately sound at the fore side receiver activation and gate will close after 5 seconds, so giving time to drivers to clear gate area in order to avoid trapping between the gates and stop sound after the train has crossed. The same principle is applied for track switching. Considering a situation wherein an express train and a local train are traveling in opposite directions on the same track; the express train is allowed to travel on the same track and the local train has to switch on to the other track. Two sensors are placed at the either sides of the junction where the track switches. If thereâ„¢s a train approaching from the other side, then another sensor placed along that direction gets activated and will send an interrupt to the controller. The interrupt service routine switches the track. Indicator lights have been provided to avoid collisions. Here the switching operation is performed using a stepper motor. Assuming that within a certain delay, the train has passed the track is switched back to its original position, allowing the first train to pass without any interruption. This concept of track switching can be applied at 1km distance from the stations.
In this project Atmel 89c51 Micro controller Integrated Chip plays the main role. The program for this project is embedded in this Micro controller Integrated Chip and interfaced to all the peripherals. The timer program is inside the Micro controller IC to maintain all the functions as per the scheduled time. The Liquid crystal Display (LCD) is interfaced to Atmel 89c51 Micro controller to display the message, stepper motors are used for the purpose of gate control and track changing interfaced with current drivers chip ULN2003 itâ„¢s a 16 pin ic.
Infrared sensors are used in this for the detection of the train when ever it sends a signal to microcontroller the stepper motor should operate or message will be displayed on LCD. It consists of units called transmitter and receiver circuit. Infrared sensor circuit consists of IC555 timer C 555 is used to construct an astable multivibrator which has two quasi-stable states. It generates a square wave of frequency 38 kHz and amplitude 5Volts. It is required to switch ËœONâ„¢ the IR LED. A stepper motor is a widely used device that translates electrical pulses into mechanical movement. They function as their name suggests - they step a little bit at a time. The software is written in C-language and is dumped to the microcontroller to run the project. Operation of this project can be explained through three units: 1. Gate control unit 2. Track changing unit 3. Announcement unit 4. Two trains opposite on same track case 2.2.1 Gate control unit:
Railways being the cheapest mode of transportation are preferred over all the other means .When we go through the daily newspapers we come across many railway accidents occurring at unmanned railway crossings. This is mainly due to the carelessness in manual operations or lack of workers. We, in this project have come up with a solution for the same. Using simple electronic components we have tried to automate the control of railway gates. As a train approaches the railway crossing from either side, the sensors placed at a certain distance from the gate detects the approaching train and accordingly controls the operation of the gate. Also an indicator light has been provided to alert the motorists about the approaching train. The above figure shows the gate controlling unit block diagram. Its operation can be explained through that. As the figure shows it consists of two pairs of infrared sensors placed at two sides of gate. They should keep at a distance of 9 cm (2km in usual case) from the gate. and a stepper motor is used for the purpose of the gate closing and opening. Interfaced to the ULN2003. When train reaches the sensor, it is detected by IR sensors placed 9 cm before the station and led in the sensor will glow because the 555 timer works into quasi state of operation. such that the IR LED should glow till the timer works in quasi state i.e., when train passes away the sensors it again into normal state then it receives 5v at terminals that pin at the 89c51 terminal goes high which enables the power to the stepper motor to rotate in steps which drives gate to close similarly when it reaches the second pair of sensors it senses and send the signal to the microcontroller to enable the current driver to open the gate by rotating the stepper motor in steps to get back in to original position.
2.2.2 Track changing unit:
FIG: 2.2.2 Using the same principle as that for gate control, we have developed a concept of automatic track switching. Considering a situation wherein an express train and a local train are traveling in opposite directions on the same track; the express train is allowed to travel on the same track and the local train has to switch on to the other track. Indicator lights have been provided to avoid collisions .Here the switching operation is performed using a stepper motor. In practical purposes this can be achieved using electromagnets. For the ease of description we are considering only two plat forms thus this can be implemented to any number of platforms. When train reaches the platform before a 10cm distance apart a set of sensors are placed to detect the train and two pair of sensors are placed on each of track at platforms. When the train is at the first pair of
sensors it sends a signal to microcontroller to know the availability of plat form. Here after checking availability microcontroller operates stepper motor to change the track. The mechanism is arranged as shown in fig. but in this case the track changing is done due to second sensor that used to open the gate. It consists of 5v driven stepper motor, ULN 2003 current driver chip and pulley for track changing mechanism. 2.2.3 Announcement unit: Usually, announcement made at the station for the information of train arrival and departure. In this model we are using a buzzer for the announcement and LCD for the purpose of display message. LCD is interfaced to 89C51 microcontroller. The announcement and display message is according to the second sensor which should be used for the purpose of gate opening.
184.108.40.206 Train arrival detection:: Detection of train approaching the gate can be sensed by means of sensors R1, R2, R3&R4 placed on either side of the gate. In particular direction of approach, R1 is used to sense the arrival; R3 is used to sense the departure of the train. In the same way R4&R2 senses arrival and departure in the other direction. Train arrival and departure sensing can be achieved by means of relay technique. A confined part of parallel track is supplied with positive voltage and ground. As wheels of the train, is made up of aluminum which is a conducting material, it shorts two parallel tracks. When the wheels of the train moves over it, both tracks are shorted to ground and this acts as a signal to microcontroller (89C51) indicating train arrival. The train detection in the other direction is done in the same way by the sensors R1 & R4. These sensors are placed five kilometers before the gate. 220.127.116.11 warning for road users: At that moment the train arrival is sensed on either of the gate, road users are warned about the train approach by RED signal placed to caution
the road users passing through the gate .RED signal appears for the road user, once the train cuts the relay sensor placed before the 5Kms before the gate .A buzzer is for train, when there is any obstacle; signal is made RED for train in order to slow done its speed before 5km from gate. 18.104.22.168 Train departure detection: Detection of train is also done using relay techniques as explained the head of train arrival detection. Sensor R3&R2 respectively considering direction of train approach do train departure. A message is displayed on LCD when train reaches the platform. Sensed by IR sensors. Future enhancement: In our technique though it has many merits, but still the power supply of 223V AC POWER is required for functioning of the motor. It can be avoided with the help of a battery charged by a Solar Cell. Since solar energy is an inexhaustible natural source of energy. 2.2.4 Two trains opposite on same track: We know that the rate of accidents increasing day by day, in this because failure of mechanism at track changing two trains coming on same track. This can also happens some times due to human negligence. This can avoided by using the following unmanned detection for two trains coming on same track case. In our model of project, we are using the gate controlling pair of sensors to execute this method. i.e., when two trains are coming same track at that location the two sensors will operate at a time i.e., two 555 timers of circuit are driven in to quasi stable state and thus corresponding two buzzer will operate at a time and two IR LED will operate and hence signal sends to micro processor to operate the stepper motor at tack changing. The components that we use in order to execute are stepper motor 5v, ULN2003, AT89C51 AND IR sensors. 2.2.5 Initial signal display: Signals are placed near gate each at a specified distance. Train may be approaching gate at either direction so all four signals are made RED initially to indicate gate is OPENED and vehicles are going through gate. The road user signals are made
GREEN so that they freely move through gate. Buzzer is OFF since there is no approach of train and users need not be warned.
3.1 Circuit Diagram and introduction:
FIG: 3.1 Power supply unit consists of following units
i) Step down transformer ii) Rectifier unit iii) Input filter iv) Regulator unit v) Output filter 3.2: STEPDOWN TRANSFORMER The Step down Transformer is used to step down the main supply voltage from 230V AC to lower value. This 230 AC voltage cannot be used directly, thus it is stepped down. The Transformer consists of primary and secondary coils. To reduce or step down the voltage, the transformer is designed to contain less number of turns in its secondary core. The output from the secondary coil is also AC waveform. Thus the conversion from AC to DC is essential. This conversion is achieved by using the Rectifier Circuit/Unit.
3.3. RECTIFIER UNIT: The Rectifier circuit is used to convert the AC voltage into its corresponding DC voltage. There are Half-Wave, Full-Wave and bridge Rectifiers available for this specific function. The most important and simple device used in Rectifier circuit is the diode. The simple function of the diode is to conduct when forward biased and not to conduct in reverse bias. The Forward Bias is achieved by connecting the diodeâ„¢s positive with positive of the battery and negative with batteryâ„¢s negative. The efficient circuit used is the Full wave Bridge rectifier circuit. The output voltage of the rectifier is in rippled form, the ripples from the obtained DC voltage are removed using other circuits available. The circuit used for removing the ripples is called Filter circuit. 3.4 INPUT FILTER: Capacitors are used as filter. The ripples from the DC voltage are removed and pure DC voltage is obtained. And also these capacitors are used to reduce the harmonics of the input voltage. The primary action performed by capacitor is charging and discharging. It charges in positive half cycle of the AC voltage and it will discharge in
negative half cycle. So it allows only AC voltage and does not allow the DC voltage. This filter is fixed before the regulator. Thus the output is free from ripples. 3.5 REGULATOR UNIT:
FIG 3.1.2 7805 Regulator Regulator regulates the output voltage to be always constant. The output voltage is maintained irrespective of the fluctuations in the input AC voltage. As and then the AC voltage changes, the DC voltage also changes. Thus to avoid this Regulators are used. Also when the internal resistance of the power supply is greater than 30 ohms, the output gets affected. Thus this can be successfully reduced here. The regulators are mainly classified for low voltage and for high voltage. Further they can also be classified as: i) Positive regulator 1---> input pin 2---> ground pin 3---> output pin It regulates the positive voltage. ii) Negative regulator 1---> ground pin 2---> input pin 3---> output pin It regulates the negative voltage.
3.6 OUTPUT FILTER: The Filter circuit is often fixed after the Regulator circuit. Capacitor is most often used as filter. The principle of the capacitor is to charge and discharge. It charges during the positive half cycle of the AC voltage and discharges during the negative half cycle. So it allows only AC voltage and does not allow the DC voltage. This filter is fixed after the Regulator circuit to filter any of the possibly found ripples in the output received finally.
Here we used 0.1Ã‚ÂµF capacitor. The output at this stage is 5V and is given to the Microcontroller.
LCD INTERFACING WITH AT89C51
LCD INTERFACING WITH AT89C51 4.1 DESCRIPTION
FIG: 4.1. LCD is used in this project for the purpose of displaying message at the station. LCD interfacing consists of several parts like AT89C451 microprocessor, 2 Ãƒâ€” 16 line LCD are main components needed. AT89C51 is a 40 pin DIP micro processor. LCD is a 2 line 16 pin device, 2 lines means it contains 2 rows to display. To develop a protocol to interface this LCD with 89C51 first we have to understand how they functions. These displays contain two internal byte-wide registers, one for command and second for characters to be displayed. There are three control signals called R/W, DI/RS and En. Select By making RS/DI signal 0 you can send different commands to display. These commands are used to initialize LCD, to display pattern, to shift cursor or screen etc.
AT89C51 can be divided in to 4 ports, and each port consists of 8 pins. All the data lines of LCD are connected with port P1. i.e., data lines D0-D1 are connected to port P1 i.e., to pin numbers 1 to 8 through a SIL, SIL is a few ohms of resistance connected to withstand the large voltages and currents. ËœENâ„¢ pin is connected with P2.0, ËœDIâ„¢ (RS) is connected with P2.1 and R/W pin is connected with P2.2. i.e., the three pins are connected to the port two. The operation of LCD depends upon these three pin only. For the pins 18 and 19 a crystal oscillator circuit is connected to generate clock signals to the micro processor to enable its pins. And 20th pin is grounded with oscillator. 40th pin is given to the Vcc i.e., supply lines. And P2.6 is given to out put terminals of IR sensors. And ground terminal of IR sensor is given to 20th pin. 4.2 Description of LCD interfacing program: A C-language program is written to interface the LCD with AT89C51 is written in keel c software. Initially all the variables and pins are set to zero i.e., initialized, all the required codes to write this program are in reg51.h header file. First the data lines are initialized to byte of pins i.e., to a port using SFR instruction. And RS, RW, EN, SENSE and LED variables are initialized to p2.0, p2.1, p2.2, p2.5 and p2.7 simultaneously. A delay of 25 is given after the each execution of the instruction. And port 0 is initialized as output port. In the program a separate function is written for display message. When R3, R4 sensor senses the signal to the microcontroller then the variable SENSE set to Ëœlogical highâ„¢ i.e., to 1. And RS=1 and RW =0. Then first display function calls for display on first line of LCD. After that it calls for display message on second line of the LCD. Now, the message is displayed and reached the station. So, it stays for some time. A delay of 2500 sec is given to run program to display the message.
During this, LCD displaysâ„¢ a message like TRAIN IS COMING HI-TECH COLLEGE Then again SENSE variable set to zero i.e., Ëœlogical lowâ„¢. In this RS=0 and RW=0.
STEPPER MOTOR INTERFACING WITH AT89C51 USING ULN2003
Stepper motor interfacing with AT89C51 5.1. introduction:
Fig 5.1. Shows the complete diagram of a stepper motor interfacing
Fig shows the stepper motor interfacing with AT89C51 using ULN2003. The interfacing of stepper motor consists of several parts like AT89C51 microcontroller, stepper motor, and ULN2003 current driver chip. This can be used in this project for the purpose of gate control and track switching. For the gate control a 12v stepper motor is used, and for the purpose of track switching 5v stepper motor is used. ULN2003 is a current driver chip used for supply control to the stepper motor; it is a 16 pin dip. AT89C51 is a 40 pin dip micro controller, can be divided in to four ports, it is driven by 5v supply.
Fig5.1.1 shows the two stepper motors interfaced with AT89C51 using ULN2003 for the purpose of this project. Here a stepper motor is used for controlling the gates and track switching. A stepper motor is a widely used device that translates electrical pulses into mechanical movement. They function as their name suggests - they step a little bit at a time. Steppers donâ„¢t simply respond to a clock signal. They have several windings which need to be energized in the correct sequence before the motorâ„¢s shaft will rotate. Reversing the order of the sequence will cause the motor to rotate the other way. The block diagram of stepper motor interfacing is shown bellow:
Fig 5.1.2 The connections according to the diagram shown can be as follows: The two output terminals of sensors are given to the port one terminals 1 and 2. Remaining two terminals are grounded at 20th pin and the buzzer terminals are given at 4 and 5 pins of micro controller and 6th is given to LED which operates for two trains opposite case. 9th pin is reset pin through capacitor parallel with resistor. 18th and 19th pins are given to the crystal oscillator for the purpose of generating clock signals and 20th pin is grounded. 40th pin is given to supply i.e., Vcc. Port 0 is given to current driver chip ULN2003 through a 4-pin real connector for which middle two pins are grounded and one is given to 5v supply line and another is to 12v supply line. Port 2 is given to another ULN2003 chip to drive another stepper motor. These two chips connected to microcontroller through a source in line Called SIL.
Fig 5.1.3 shows connection diagram of stepper motor with ULN2003. ULN2003 is a 16 pin dip. Its connections can be explained as follows: First 4-pins of chip are connected to microcontroller pin at 37-40 pins and second at 21-24 pins. And 8th pin of chip is grounded. A stepper contains 5 terminals, 4 winding wires and a power supply wire. These 4 winding wires are connected to chip and another to supply. in this circuit too the four pins "Controller pin 1",2,3 and 4 will control the motion and direction of the stepper motor according to the step sequence sent by the controller.
5.2 Description of C-program for gate control, track switching, and two trains opposite case: A C-language program is written to interface the LCD with AT89C51 is written in keel c software. Initially all the variables and pins are set to zero i.e., initialized, all the required codes to write this program are in reg51.h header file. Two sensors are initialized with variables sense1, sense2 at port pins p1.0 and p1.1. with buzzers buzzer1 and buzzer2 as buz1, buz2 at p1.4 and p1.5. and the led is connected at pins p2.7. In the program port1 is set as output port and all sensor and buzzer variables are initialized to zero. For gate opening the program execution will be as follows: The sense1 pin go es high with detection of first pair of sensors then it sends a signal to drive stepper motor. Then automatically the gate opens. For gate closing the program execution will be as follows: The sense2 pin goes high with detection of first pair of sensors then it sends a signal to drive stepper motor. Then automatically the gate closes. By rotating the stepper motor in reverse direction. For two trains opposite case the execution of program will be as follows: The sense1 and sense2 pins goes high at a time and the buzzer gives alarm and gate closes because we are doing this at that part of the module. And us gives a user or the person at control should take this to them. The execution of program for track changing as follows:
When sense2 pin goes high the microcontroller should operate the stepper motor for track changing, which by use of pulley helps in changing track to avoid accidents. This mechanism can be used for two purposes, one in the case of two trains opposite case and another in the case of auto signaling at the platforms.
Infrared sensors 6.1.0 introduction:
This infrared sensor also called as IR sensors, consists of two parts: 1. IR transmitter circuit 2. IR receiver unit The transmitter unit consists of an infrared LED and its associated circuitry. 6.1.1 IR Transmitter unit:
The IR transmitter circuit is shown in the figure 6.1.1. The transmitter circuit consists of the following components: 1. IC 555 2. Resistors 3. Capacitors
4. IR LED The IR LED emitting infrared light is put on in the transmitting unit. To generate IR signal, 555 IC based astable multivibrator is used. Infrared LED is driven through transistor BC 548. IC 555 is used to construct an astable multivibrator which has two quasi-stable states. It generates a square wave of frequency 38kHz and amplitude 5Volts. It is required to switch ËœONâ„¢ the IR LED.
6.1.2 IR Receiver circuit:
The IR receiver circuit is shown in the figure 6.1.2. The receiver circuit consists of the following components: 1. TSOP1738 (sensor) 2. IC 555 3. Resistors 4. Capacitors
The receiver unit consists of a sensor and its associated circuitry. In receiver section, the first part is a sensor, which detects IR pulses transmitted by IR-LED. Whenever a train crosses the sensor, the output of IR sensor momentarily transits through a low state. As a result the monostable is triggered and a short pulse is applied to the port pin of the 8051 microcontroller. On receiving a pulse from the sensor circuit, the controller activates the circuitry required for closing and opening of the gates and for track switching.
EMBEDDED SYSTEMS 7.1 introduction: A system is something that maintains its existence and functions as a whole through the interaction of its parts. E.g. Body, Access Control, etc. An embedded system is micro controller-based, software driven, reliable, real-time control system. Micro controllers and Microprocessors are widely used in embedded system products. An embedded product uses a Micro controller to do one task only. A Printer is an example of embedded system that it is getting the data and printing it. Â¢ Â¢ Â¢ Â¢ Embedded System is a combination of hardware and software used to achieve a single specific task. Embedded systems are computer systems that monitor, respond to, or control an external environment. Environment connected to systems through sensors, actuators and other I/O interfaces. Embedded system must meet timing & other constraints imposed on it by environment. High-end embedded & lower end embedded systems. High-end embedded system Generally 32, 64 Bit Controllers used with OS. Examples Personal Digital Assistant and Mobile phones etc. Lower end embedded systems - Generally 8,16 Bit Controllers used with a minimal operating systems and hardware layout designed for the specific purpose. Examples Small controllers and devices in our every day life like Washing Machine, Microwave Ovens, where they are embedded in.
Microcontroller 7.2 introduction: A computer-on-a-chip is a variation of a microprocessor, which combines the processor core (CPU), some memory, and I/O (input/output) lines, all on one chip. The computer-on-a-chip is called the microcomputer whose proper meaning is a computer using a (number of) microprocessor(s) as its CPUs, while the concept of the microcomputer is known to be a microcontroller. A microcontroller can be viewed as a set of digital logic circuits integrated on a single silicon chip. This chip is used for only specific applications. 7.2.1 ADVANTAGES OF USING A MICROCONTROLLER OVER MICROPROCESSOR: A designer will use a Microcontroller to 1. Gather input from various sensors 2. Process this input into a set of actions 3. Use the output mechanisms on the Microcontroller to do something useful 4. RAM and ROM are inbuilt in the MC. 5. Cheap compared to MP. 6. Multi machine control is possible simultaneously. Examples: 8051, 89C51 (ATMAL), PIC (Microchip), Motorola (Motorola), ARM Processor, Applications: Cell phones, Computers, Robots, Interfacing to two pcâ„¢s.
89c51 Microcontroller IC The AT89C51 is a low-power, high-performance CMOS 8-bit microcomputer with 4Kbytes of Flash programmable and erasable read only memory (PEROM). The device is manufactured using Atmelâ„¢s high-density nonvolatile memory technology and is compatible with the industry-standard MCS-51 instruction set and pin out. The on-chip Flash allows the program memory to be reprogrammed in-system or by a conventional nonvolatile memory programmer. By combining a versatile 8-bit CPU with Flash on a monolithic chip, the Atmel AT89C51 is a powerful microcomputer, which provides a highly-flexible and cost-effective solution to many embedded control applications. The AT89C51 provides the following standard features: 4Kbytes of Flash, 128 bytes of RAM, 32 I/O lines, two 16-bit timer/counters, a five vector two-level interrupt architecture, a full duplex serial port, on-chip oscillator and clock circuitry. In addition, the AT89C51 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 contents but freezes the oscillator disabling all other chip functions until the next hardware reset.
7.2.2 Pin description of ATMEL At89c51:
The AT 89c51 micro controller is a 40-pin IC. The 40th pin of the controller is Vcc pin and the 5V dc supply is given to this pin. This 20th pin is ground pin. A 12 MHZ crystal oscillator is connected to 18th and 19th pins of the AT 89c51 micro controller and two 22pf capacitors are connected to ground from 18th and 19th pins. The 9th pin is Reset pin.
Port 0 Port 0 is an 8-bit open-drain bi-directional I/O port. As an output port, each pin can sink eight TTL inputs. When 1s are written to port 0 pins, the pins can be used as high impedance inputs. Port 0 may also be configured to be the multiplexed low order address/data bus during accesses to external program and data memory. In this mode P0 has internal pull-ups. Port 0 also receives the code bytes during Flash programming, and outputs the code bytes during program verification. External pull-ups are required during program verification.
Port 1 is an 8-bit bi-directional I/O port with internal pull-ups. The Port 1 output buffers can sink/source four TTL inputs. When 1s are written to Port 1 pins they are pulled high by the internal pull-ups and can be used as inputs. As inputs, Port 1 pins that are externally being pulled low will source current (IIL) because of the internal pull-ups. Port 1 also receives the low-order address bytes during Flash programming and verification.
Port 2 is an 8-bit bi-directional I/O port with internal pull-ups. The Port 2 output buffers can sink/source four TTL inputs. When 1s are written to Port 2 pins they are pulled high by the internal pull-ups and can be used as inputs. As inputs Port 2 pins that are externally being pulled low will source current (IIL) because of the internal pull-ups. Port 2 emits the high-order address byte during fetches from external program memory and during accesses to external data memory that uses 16-bit addresses (MOVX @ DPTR). In this application, it uses strong internal pull-ups when emitting 1s. During accesses to external data memory that uses 8-bit addresses (MOVX @ RI), Port 2 emits the contents of the P2
Special Function Register. Port 2 also receives the high-order address bits and some control signals during Flash programming and verification.
Port 3 is an 8-bit bi-directional I/O port with internal pull-ups. The Port 3 output buffers can sink/source four TTL inputs. When 1s are written to Port 3 pins they are pulled high by the internal pull-ups and can be used as inputs. As inputs, Port 3 pins that are externally being pulled low will source current (IIL) because of the pull-ups. Port 3 also serves the functions of various special features of the AT89C51 as listed below:
P3.0 P3.1 P3.2 P3.3 P3.4 P3.5 P3.6 P3.7
RXD (serial input port) TXD (serial output port) INT0 (external interrupt 0) INT1 (external interrupt 1) T0 (timer 0 external input) T1 (timer 1 external input) WR (external data memory write strobe) RD (external data memory read strobe)
Port 3 also receives some control signals for Flash programming and verification.
RST Reset input. A high on this pin for two machine cycles while the oscillator is running resets the device.
Address Latch Enable output pulse for latching the low byte of the address during accesses to external memory. This pin is also the program pulse input (PROG) during Flash programming. In normal operation ALE is emitted at a constant rate of 1/6 the oscillator frequency, and may be used for external timing or clocking purposes. Note, however, that one ALE pulse is skipped during each access to external Data Memory. If desired, ALE operation can be disabled by setting bit 0 of SFR location 8EH. With the bit set, ALE is active only during a MOVX or MOVC instruction. Otherwise, the pin is weakly pulled high. Setting the ALE-disable bit has no effect if the micro controller is in external execution mode.
Program Store Enable is the read strobe to external program memory. When the AT89C51 is executing code from external program memory, PSEN is activated twice each machine cycle, except that two PSEN activations are skipped during each access to external data memory.
External Access Enable. EA must be strapped to GND in order to enable the device to fetch code from external program memory locations starting at 0000H up to FFFFH. Note, however, that if lock bit 1 is programmed, EA will be internally latched on reset. EA should be strapped to VCC for internal program executions. This pin also receives the
12-volt programming enable voltage (VPP) during Flash programming, for parts that require 12-volt VPP. XTAL1 Input to the inverting oscillator amplifier and input to the internal clock operating circuit. XTAL2 It is the output from the inverting oscillator amplifier.
Relay drivers 7.3 introduction:
IC, ULN2003A description:
Â¢ Â¢ Â¢ Â¢ Â¢ Â¢ Â¢ Â¢ Â¢ Â¢ Â¢ Â¢ Â¢ Â¢ Â¢ Â¢ Â¢ Â¢
Pins, No. of:16 Temperature, Operating Range:-20Ã‚Â°C to +85Ã‚Â°C Transistor Polarity:NPN Transistors, No. of:7 Case Style:DIP-16 Temp, Op. Min:-20Ã‚Â°C Temp, Op. Max:85Ã‚Â°C Base Number:2003 Channels, No. of:7 Current, Output Max:500mA Device Marking:ULN2003A IC Generic Number:2003 Input Type:TTL, CMOS 5V Logic Function Number:2003 Output Type: Open Collector Transistor Type: Power Darlington Voltage, Input Max:5V Voltage, Output Max:50V
7.3.1 PIN CONNECTIONS OF ULN2003:
Fig: 7.3.1 The ULN2001A, ULN2002A, ULN2003 and ULN2004Aare high Voltage, high current Darlington arrays each containing seven open collector Darlington pairs with common emitters. Each channel rated at 500mAand can withstand peak currents of 600mA.Suppressiondiodesare included for inductive load driving and the inputs are pinned opposite the outputs to simplify board layout. These versatile devices are useful for driving a wide range of loads including solenoids, relays DC motors; LED displays filament lamps, thermal print heads and high power buffers. The ULN2001A/2002A/2003A and 2004A are supplied in 16 pin plastic DIP packages with a copper lead frame to reduce thermal resistance. They are available also in small outline package (SO-16) as ULN2001D/2002D/2003D/2004D.
7.3.2 Schematics of Darlingtonâ„¢s pair:
Fig: 7.3.2 Darlington pairs are back to back connection of two transistors with some source resistors.
Fig:7.3.3 shows the Darlington pair connection of transistor. The circuit above is a ËœDarlington Pairâ„¢ driver. The first transistorâ„¢s emitter feeds into the second transistorâ„¢s base and as a result the input signal is amplified by the time it reaches the output. The important point to remember is that the Darlington Pair is made up of two transistors
and when they are arranged as shown in the circuit they are used to amplify weak signals. The amount by which the weak signal is amplified is called the ËœGAINâ„¢. 7.3.3 FEATURES OF DRIVER: Â¢ Â¢ Â¢ Â¢ Â¢ Â¢ Â¢ Seven Darlingtonâ„¢s per package Output currents500mA per driver(600mA peak) Integrated suppression diodes for inductive loads Outputs can be paralleled for high currents TTL/CMOS/PMOS/DTL compatible inputs. Inputs pinned opposite to outputs Simplified layout .
IC 555 TIMERS 7.4.0 Description:
Fig7.4.0 shows 8-pin dip for IC 555 timer
IC 555 TIMER used in this project for the purpose of IR sensor circuits. It can operate in several modes, its internal circuit and description is as explained below: Standard 555 and 556 ICs create a significant 'glitch' on the supply when their output changes state. This is rarely a problem in simple circuits with no other ICs, but in more complex circuits a smoothing capacitor (e.g. 100Ã‚ÂµF) should be connected across the +Vs and 0V supply near the 555 or 556. The input and output pin functions are described briefly below and there are fuller explanations covering the various circuits:
Â¢ Â¢ Â¢
Astable - producing a square wave Monostable - producing a single pulse when triggered Bistable - a simple memory which can be set and reset
Buffer - an inverting buffer (Schmitt trigger)
Inputs of 555:
Trigger input: when < 1/3 Vs ('active low') this makes the output high (+Vs). It monitors the discharging of the timing capacitor in an astable circuit. It has a high input impedance > 2M . Threshold input: when > 2/3 Vs ('active high') this makes the output low (0V)*. It monitors the charging of the timing capacitor in astable and monostable circuits. It has a high input impedance > 10M . * providing the trigger input is > 1/3 Vs, otherwise the trigger input will override the threshold input and hold the output high (+Vs). Reset input: when less than about 0.7V ('active low') this makes the output low (0V), overriding other inputs. When not required it should be connected to +Vs. It has an input impedance of about 10k . Control input: this can be used to adjust the threshold voltage which is set internally to be
/3 Vs. Usually this function is not required and the control input is connected to 0V with
a 0.01Ã‚ÂµF capacitor to eliminate electrical noise. It can be left unconnected if noise is not a problem. The discharge pin is not an input, but it is listed here for convenience. It is connected to 0V when the timer output is low and is used to discharge the timing capacitor in astable and monostable circuits. Output of 555 The output of a standard 555 or 556 can sink and source up to 200mA. This is more than most ICs and it is sufficient to supply many output transducers directly, including Ledâ„¢s (with a resistor in series), low current lamps, piezo transducers, loudspeakers (with a capacitor in series), relay coils (with diode protection) and some motors (with diode
protection). The output voltage does not quite reach 0V and +Vs, especially if a large current is flowing. To switch larger currents you can connect a transistor. The ability to both sink and source current means that two devices can be connected to the output so that one is on when the output is low and the other is on when the output is high. The top diagram shows two Ledâ„¢s connected in this way. This arrangement is used in the Level Crossing project to make the red Ledâ„¢s flash alternately. 7.4.1 555 timers as astable: An astable circuit produces a 'square waveâ„¢; this is a digital waveform with sharp transitions between low (0V) and high (+Vs). Note that the durations of the low and high states may be different. The circuit is called an astable because it is not stable in any state: the output is continually changing between 'low' and 'high'. The time period (T) of the square wave is the time for one complete cycle, but it is usually better to consider frequency (f) which is the number of cycles per second. 1.4 (R1 + 2R2) Ãƒâ€” C1
T = 0.7 Ãƒâ€” (R1 + 2R2) Ãƒâ€” C1 and f =
T = time period in seconds (s) f = frequency in hertz (Hz) R1 = resistance in ohms ( ) R2 = resistance in ohms ( ) C1 = capacitance in farads (F) The time period can be split into two parts: T = Tm + Ts Mark time (output high): Tm = 0.7 Ãƒâ€” (R1 + R2) Ãƒâ€” C1 Space time (output low): Ts = 0.7 Ãƒâ€” R2 Ãƒâ€” C1
Many circuits require Tm and Ts to be almost equal; this is achieved if R2 is much larger than R1.
fig fig 7.4.1 For a standard astable circuit Tm cannot be less than Ts, but this is not too restricting because the output can both sink and source current. For example an LED can be made to flash briefly with long gaps by connecting it (with its resistor) between +Vs and the output. This way the LED is on during Ts, so brief flashes are achieved with R1 larger than R2, making Ts short and Tm long. If Tm must be less than Ts a diode can be added to the circuit as explained under duty cycle below. Choosing R1, R2 and C1 R1 and R2 should be in the range 1k to 1M . It is best to choose C1 first because
capacitors are available in just a few values.
Choose C1 to suit the frequency range you require (use the table as a guide). Choose R2 to give the frequency (f) you require. Assume that R1 is much smaller than R2 (so that Tm and Ts are almost equal), then you can use: R2 = 0.7 f Ãƒâ€” C1
Choose R1 to be about a tenth of R2 (1k
min.) unless you want the mark time
Tm to be significantly longer than the space time Ts.
If you wish to use a variable resistor it is best to make it R2. If R1 is variable it must have a fixed resistor of at least 1k (this is not required for R2 if it is variable). in series
Astable operation With the output high (+Vs) the capacitor C1 is charged by current flowing through R1 and R2. The threshold and trigger inputs monitor the capacitor voltage and when it reaches 2/3Vs (threshold voltage) the output becomes low and the discharge pin is connected to 0V.
Fig 22.214.171.124 The capacitor now discharges with current flowing through R2 into the discharge pin. When the voltage falls to 1/3Vs (trigger voltage) the output becomes high again and the discharge pin is disconnected, allowing the capacitor to start charging again. This cycle repeats continuously unless the reset input is connected to 0V which forces the output low while reset is 0V. An astable can be used to provide the clock signal for circuits such as counters. A low frequency astable (< 10Hz) can be used to flash an LED on and off, higher frequency flashes are too fast to be seen clearly. Driving a loudspeaker or piezo
transducer with a low frequency of less than 20Hz will produce a series of 'clicks' (one for each low/high transition) and this can be used to make a simple metronome. An audio frequency astable (20Hz to 20kHz) can be used to produce a sound from a loudspeaker or piezo transducer. The sound is suitable for buzzes and beeps. The natural (resonant) frequency of most piezo transducers is about 3kHz and this will make them produce a particularly loud sound.
Duty cycle The duty cycle of an astable circuit is the proportion of the complete cycle for which the output is high (the mark time). It is usually given as a percentage. For a standard 555/556 astable circuit the mark time must be greater than the space time (Ts), so the duty cycle must be at least 50%:
Duty cycle =
Tm R1 + R2 = Tm + Ts R1 + 2R2
] Fig126.96.36.199 shows the 555 timer in astable operation with R2. To achieve a duty cycle of less than 50% a diode can be added in parallel with R2 as shown in the diagram. This bypasses R2 during the charging (mark) part of the cycle so that Tm depends only on R1 and C1:
Tm = 0.7 Ãƒâ€” R1 Ãƒâ€” C1 (ignoring 0.7V across diode) Ts = 0.7 Ãƒâ€” R2 Ãƒâ€” C1 (unchanged) duty cycle with diode = Tm R1 = Tm + Ts R1 + R2
7.4.2 555 Monostable
Fig: 188.8.131.52 A monostable circuit produces a single output pulse when triggered. It is called a monostable because it is stable in just one state: 'output low'. The 'output high' state is temporary. The duration of the pulse is called the time period (T) and this is determined by resistor R1 and capacitor C1:
time period, T = 1.1 Ãƒâ€” R1 Ãƒâ€” C1
T = time period in seconds (s) R1 = resistance in ohms ( ) C1 = capacitance in farads (F) The maximum reliable time period is about 10 minutes.
Choose C1 first (there are relatively few values available).
Â¢ Â¢ Â¢
Choose R1 to give the time period you need. R1 should be in the range 1k to 1M , so use a fixed resistor of at least 1k in series if R1 is variable. Beware that electrolytic capacitor values are not accurate; errors of at least 20% are common. Beware that electrolytic capacitors leak charge which substantially increases the time period if you are using a high value resistor - use the formula as only a very rough guide!
184.108.40.206 Monostable operation The timing period is triggered (started) when the trigger input (555 pin 2) is less than 1 /3 Vs, this makes the output high (+Vs) and the capacitor C1 starts to charge through resistor R1. Once the time period has started further trigger pulses are ignored. The threshold input (555 pin 6) monitors the voltage across C1 and when this reaches 2 /3 Vs the time period is over and the output becomes low. At the same time discharge (555 pin 7) is connected to 0V, discharging the capacitor ready for the next trigger.
The reset input (555 pin 4) overrides all other inputs and the timing may be cancelled at any time by connecting reset to 0V, this instantly makes the output low and discharges the capacitor. If the reset function is not required the reset pin should e connected to +Vs.
7.4.3 555/556 Inverting Buffer (Schmitt trigger) or NOT gate
555 inverting buffer circuit (a NOT gate)
NOT gate symbol
Fig: 220.127.116.11 the buffer circuit's input has a very high impedance (about 1M ) so it requires only a few Ã‚ÂµA, but the output can sink or source up to 200mA. This enables a high impedance signal source (such as an LDR) to switch a low impedance output transducer (such as a lamp). It is an inverting buffer or NOT gate because the output logic state (low/high) is the inverse of the input state:
Input low (< 1/3 Vs) makes output high, +Vs Input high (> 2/3 Vs) makes output low, 0V
When the input voltage is between 1/3 and 2/3 Vs the output remains in its present state. This intermediate input region is a dead space where there is no response, a property called hysteresis, it is like backlash in a mechanical linkage. This type of circuit is called a Schmitt trigger. If high sensitivity is required the hysteresis is a problem, but in many circuits it is a helpful property. It gives the input a high immunity to noise because once the circuit
output has switched high or low the input must change back by at least 1/3 Vs to make the output switch back.
7.4.5 555 timer to modulate infrared (IR) light An IR emitter is going to be modulated using an astable 555 timer in this electronics exercise. The IR emitter needs to be modulated by a frequency of 38 kHz since the detector used in this exercise only detects 38 kHz modulated IR. The detector is set to only see 38 kHz modulated IR because there are random IR sources such as overhead lights, the sun, heaters, etc. in most environments that can cause interference if using unmodulated IR. The following two circuits shown in Fig.4 and Fig. 5 are modulated IR transmitter and receivers. Each circuit should be soldered on separate proto-boards.
Fig. 18.104.22.168 modulated IR transmitter
Fig.22.214.171.124 modulated IR receiver Verify with the TA that everything is soldered correctly. Then apply power to the transmitter circuit. Use an oscilloscope to observe the signal at node A. Adjust the 10kO variable resistor until the signal at node A is a 38 kHz series of pulses. Apply power to the receiver circuit Point the IR light emitting diode (LED) on the transmitter to the detector on the receiver. When the pushbutton is depressed the visible LED on the receiver should blink. If the visible led is blinking randomly, put exposed 35 mm camera film around the IR detector.
Stepper motor 7.5.1 Description: 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 control). 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).
7.5.2 Fundamentals of Operation
Stepper motors operate differently from normal DC 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. 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 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 integral number of steps making a full rotation. In that way, the motor can be turned by a precise angle.
7.5.3 Stepper motor characteristics
Stepper motors are constant power devices. As motor speed increases, torque decreases. The torque curve may be extended by using current limiting drivers and increasing the driving voltage. Steppers exhibit more vibration than other motor types, as the discrete step tends to snap the rotor from one position to another. This vibration can become very bad at some speeds and can cause the motor to lose torque. The effect can be mitigated by accelerating quickly through the problem speed range, physically damping the system, or using a micro-stepping driver. Motors with a greater number of phases also exhibit smoother operation than those with fewer phases.
7.5.4 Open-loop versus closed-loop commutation
Steppers are generally commutated open loop, i.e. 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
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 logically 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 (e.g. 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.
Fig 126.96.36.199 Unipolar stepper motor coils
In the construction of unipolar stepper motor there are four coils. One end of each coil is tide together and it gives common terminal which is always connected with positive terminal of supply. The other ends of each coil are given for interface. Specific color code may also be given. Like in my motor orange is first coil (L1), brown is second (L2), yellow is third (L3), black is fourth (L4) and red for common terminal. By means of controlling a stepper motor operation we can 1. Increase or decrease the RPM (speed) of it 2. Increase or decrease number of revolutions of it 3. Change its direction means rotate it clockwise or anticlockwise To vary the RPM of motor we have to vary the PRF (Pulse Repetition Frequency). Number of applied pulses will vary number of rotations and last to change direction we have to change pulse sequence. So all these three things just depends on applied pulses. Now there are three different modes to rotate this motor 1. Single coil excitation 2. Double coil excitation 3. half coil excitation Unipolar stepper motors with six or eight wires may be driven using bipolar drivers by leaving the phase commons disconnected, and driving the two windings of each phase together [diagram needed]. It is also possible to use a bipolar driver to drive only one winding of each phase, leaving half of the windings unused [diagram needed]. Bipolar motor Bipolar motors have logically 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 utilized, 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.
7.5.6 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 hyb