Stepper Motor interfacing with the Micro Controller

Description

A stepper motor is a brush less DC motor whose rotor rotates in discrete angular increments, when its stator windings are energized in a programmed manner. Rotation occurs because of magnetic interaction between rotor poles and poles of the sequentially energized stator windings. The rotor has no electrical windings but has salient and/or magnetic poles.

Comments
Would you like to comment?

Sign In if already a member, or Join Now for a free account.

Presentation Transcript Presentation Transcript

STEPPER MOTOR : STEPPER MOTOR Stepper Motor interfacing with the Micro Controller ½ OR 1KG STEPPER MOTOR 200 STEPS,1.8 DEGREE EACH 12V , 200 mAMP CURRENT CONSUMPTION PERMANENT MAGNET S/M

Slide 2 : Definition of the stepper motor: A stepper motor is a brush less DC motor whose rotor rotates in discrete angular increments, when its stator windings are energized in a programmed manner. Rotation occurs because of magnetic interaction between rotor poles and poles of the sequentially energized stator windings. The rotor has no electrical windings but has salient and/or magnetic poles. Thus stepper motor is a digital actuator whose input is in the form of programmed energization of the stator windings and whose output is in the form of discrete angular rotation. Types Of the Stepper Motor : 1) Stepper motors with Permanent magnet :- These stepper motors are further classified as, Claw Pole (PM) Hybrid (PMH) Enhanced Hybrid (EHYB) Disc Magnet (DM) 2)Without Permanent Magnet (Variable Reluctance Stepper Motor) Stepper angle ?s :- It is the angle through which an unloaded stepper motor rotates for every step of the energization sequence shown in below table It is determined by the no. of teeth on the rotor and stator, as well as the No. of steps in the energization sequence.

Slide 3 : To select appropriate stepper motor for our system was important task before us. We gone through following criterion of the stepper motor to get the appropriate one. The selected stepper motor must provide specified, Positioning accuracy (?), expressed in mm/microns, or deg/minutes of arc Speed of operation (V), specified in mm/sec or deg/sec or rad/sec Acceleration (?), expressed as the operating speed v, starting from rest The steps involved in the selection of stepper motor are as follows, Compute, Step angle ?s from ? Stepping rate Fs (Steps/sec) from V Acceleration ? (rad/sec2) Total moment of inertia Jt reflected on the motor shaft Total torque Tm required to be developed by the motor Select a range of stepper motors having a step angle ?s Refer to torque Vs. stepping rate curves of the motor selected in step 2. Select a stepper motor which is capable of delivering torque T ? Tm computed in step 1(v) at a stepping rate F ? Fs (steps/sec) computed in step 1(ii) Determine whether the stepper motor selected can provide the necessary acceleration ?

Slide 4 : RS 232: RS –232: RS –232 CHIP IS USED TO INTERFACE MICROCONTROLLER TO PC General Description THE DS14C232 IS A LOW POWER DUAL DRIVER/RECEIVER FEATURINGAN ONBOARD DC TO DC CONVERTER, ELIMINATING THE NEED FOR ±12V POWER SUPPLIES. THE DEVICE ONLY REQUIRES A +5V POWER SUPPLY. ICC IS SPECIFIED AT 3.0 MA MAXIMUM, MAKING THE DEVICE IDEAL FOR BATTERY AND POWER CONSCIOUS APPLICATIONS. THE DRIVERS’ SLEW RATE IS SET INTERNALLY AND THE RECEIVERS FEATURE INTERNAL NOISE FILTERING, ELIMINATING THE NEED FOR EXTERNAL SLEW RATE AND FILTER CAPACITORS. THE DEVICE IS DESIGNED TO INTERFACE DATA TERMINAL EQUIPMENT (DTE) WITH DATA CIRCUIT-TERMINATING EQUIPMENT (DCE). THE DRIVER INPUTS AND RECEIVER OUTPUTS ARE TTL AND CMOS COMPATIBLE. DS14C232C DRIVER OUTPUTS AND RECEIVER INPUTS MEET TIA/EIA-232-E (RS-232) AND CCITT V.28 STANDARDS.

Slide 5 : RS 232 IC FEATURES: SINGLE +5V POWER SUPPLY LOW POWER—ICC 3.0 MA MAXIMUM DS14C232C MEETS TIA/EIA-232-E (RS-232) AND CCITT .28 STANDARDS CMOS TECHNOLOGY RECEIVER NOISE FILTER PACKAGE EFFICIENCY—2 DRIVERS AND 2 RECEIVERS AVAILABLE IN PLASTIC DIP, NARROW AND WIDE SOIC PACKAGES TIA/EIA-232 COMPATIBLE EXTENDED TEMPERATURE RANGE OPTION: DS14C232T -40°C TO +85°C

Slide 6 : RS--232 CONNECTION DIAGRAM:

Slide 7 : SERIAL MEMORY 24C04 (I2C PROTOCOL):

Slide 8 : DATA TRANSFER FLOW DIAGRAM:

Slide 9 : READ AND WRITE CYCLES

Slide 10 : Ucontroller ---?mobile init0: db 'atz' ;wakeup call init4: db 'atR0' ;echo off init1: db 'at+cngi=2,1,2,0,0' ;indication to uc new msg init2: db 'at+crc=0' ;check sum init3: db 'at+cmsf=1' ;format—0PDU,1--txt mode default: db 'at+cdms="SM","SM","ME"' ;tx and rx msg sms is received readonly: db 'at+cpms="ME","SM","ME"' ;read the msg mode take1: db 'at+cmgr=' ;read the msg Del1: db 'at+cmgd=' ;del the msg Send: db 'at+cmgs=' ;send the msg MOBILE BASED SMS FOR THIS THE MCS-51 HAS TO INITIALISE THE MOBILE THROUGH THE AT COMMANDS.THE AT COMMAND ARE USED TO OPERATE THE DEDICATED MOBILE .EXAMPLE OF SUCH AT COMMANDS IS GIVEN BELOW

Slide 13 : LCD pin description: VCC, VSS and VEE :-- While VCC and VSS provide the +5V and ground, respectively, VEE is used for controlling LCD contrast. RS, register selec:-- There are two very important registers inside the LCD. The RS pin is used for their selection If RS=0 , the instruction command code register is selected, allowing the user to send a 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 minimum of 450ns wide.

Slide 14 : OPERATIONAL OVERVIEW: 1] BUSY FLAG (BF) When the busy flag is HIGH level, it indicates that the controller is in the internal operation mode and the next instruction will not be accepted. When R/W is ‘1’ and RS is ‘0’ the busy flag is output from DB. The next instruction must be written after the busy flag goes low. 2] ADDRESS COUNTER (AC) The address counter (AC) generates the address for the DD RAM, the CG RAM and for the cursor display. When an instruction code for DD or CG RAM address is written to the controller, after deciding whether it is DD RAM or CG RAM, the address information is transferred to AC. After writing into (or reading from) DD or CG RAM display data, AC is automatically incremented (decremented). The data of the AC is output to DB0-DB6 when RS is ‘0’ and R/W is ‘1’. 3] CHARACTER GENERATOR ROM (CG ROM) The character generator ROM generates 5 x 7 dot or 5 x 10 dot character patterns from 8- bit character codes. It can generate 160 types of 5 x 7 dot character patterns and 32 types of 5 x 10 dot character patterns. When the 8-bit character code of a CG ROM is written to the DD RAM, the character pattern of the CG ROM corresponding to the code is displayed on the LCD display position corresponding to the DD RAM. 4] CHARACTER GENERATOR RAM (CG RAM) The character generator RAM (CG RAM) is the RAM with which the user can generate character patterns by program. The CG RAM has the capacity to store 8 kinds of 5 x 7 dots or 4 kinds of 5 x 10 dots. Programming of these character patterns is explained in CG RAM programming. 5] DISPLAY DATA RAM (DD RAM) The display data RAM (DD RAM) stores display data represented in 8- bit (hexadecimal) character codes. Its capacity is 80 x 8 bits, or 80 characters. The display data RAM (DD RAM) that is not used for display can be used as general data RAM. Depending on the 8- bit character code that is written into the DD RAM. LCD will select the character pattern either from Character Generator RAM (CG RAM) or from Character Generator ROM (CG ROM). 6] UNDERLINE/BLINKING BLOCK CURSOR Cursor is under the control of the MPU Programme. The display of the cursor on the LCD is made at a position corresponding to the DD RAM address set to the address counter (AC). 7] TIMING GENERATION CIRCUIT The timing generation circuit is used to generate timing signals to operate internal operations upon receipt of MPU instruction and also for such internal circuits as the DD RAM, CG RAM, and CG ROM. It is so designed that the external operation caused by accessing from the MPU will not interfere with the internal operation caused by the LCD display. Therefore, when writing data to the DD RAM, for example, there will be no undesirable influence, such as flickering on the display area. In addition, this circuit also generates the transfer signal to the externally

Slide 15 : Keypad : The keypad is also standard 4x4 which has 8 pin connector. The 4x4 keypad has the layout like the table shown below. BK is backspace while entering the password. EN is enter and is used do enable/disable menu item or enable the system 123ˆ456?789BK0EN Keyboards are the most widely used input device of the 8051, and the basic understanding of them is essential. At the lowest level, keyboards are arranged in matrix form of rows and columns. The CPU accesses both rows and columns through ports: therefore, with two 8-bit ports, an 8 X 8 matrix of keys can be connected to microcontroller. When a key is pressed, a row and a column make a contact: otherwise, there is no connection between them. Scanning and identifying the key The rows are connected to an output port and the columns are connected to an input port. If no key has been pressed, reading the input port will yield 1s for all columns since they are all connected to high (VCC). If all the rows are grounded and a key is pressed , one of the columns will have 0 since the key pressed provides a path to ground. It is the function of the microcontroller to scan the keyboard continuously detect and identify the key pressed.

Slide 16 : To detect pressed key , the microcontroller grounds all rows by providing 0 to the output latch, then it reads the column. If the data read from the columns D3 to D0 =1111 , no key has been pressed and the process continues until a key press is detected. However, if one of the column bits has a 0 , this means that a key press has occurred . for eg. If D3 to D0 = 1101 , this means that a key in the D1 column has been pressed. After a key press is detected, the microcontroller will go through a process of identifying the key , starting with the top row, the microcontroller grounds it by providing a low to D0 only:then it reads the columns.the data read is all 1s , no key in that row is activated and the process is moved to the next row. It grounds the next row, reads the columns , and checks for any 0. this process continues until row is identified. After the identification of the row in which the key has been pressed , the next task is to find out which column the pressed key belongs to.

Slide 17 : Reset Circuit : The 8051 uses an active high reset pin. The reset input must go high for two machine cycles when power is first applied and then sink low. We have used simple RC circuit, which provide system voltage(Vcc) to the reset pin until the capacitor begins to charge .The time for which the reset pin is kept high depends on the RC time constant of the reset circuit. RECOMMENDED TIME : 1MSEC 10 µF * 10 KOHM =100 mSEC OSCILLATOR CIRCUIT: In AT 89C51 two pins viz.pin no 18 &19 ( XTAL1 & XTAL2 ) are provided for connecting a resonant network to form an oscillator. A quartz crystal is used with ceramic capacitors as shown in above circuit diagram. The crystal frequency is the basic internal frequency of the micro controller. The range of the crystal that can be connected to the micro controller is 1Mhz to 16 Mhz. Different crystals are available such as the Quartz, Rochelle salts, and Tourmaline etc. We have preferred to use Quartz crystal because it is inexpensive and readily available. WE USE 11.0592 MHz CRYSTAL FOR SERIAL COMMUNICATION

Slide 18 : ADC 0804: SINGLE CHANNEL, 8BIT ADC To use the internal clock generator of the ADC 0804 (self-clocking mode) the CLK IN and CLK R pins are connected to a capacitor and a resistor as shown in above fig. In this case the clock frequency is determined by the following equation, f = 1 / 1.1RC Typical values for R and C are, R = 10K and C = 150 pF For these values f is 606 kHz and conversion time is 110 ?S. ADC 0804 HAS 3 CONTROL PINS: RD , WR , INTR. RD: START OF CONVERSION (SOC) GIVEN BY Uc WR: END OF CONVERSION (EOC) GIVEN BY ADC INTR: ENABLE Reference voltage and clock circuit for the ADC :

Slide 19 : SINCE WE WANT THE RANGE OF INPUT VOLTAGE IN BETWEEN 0 V TO 2.5 V WE HAVE CONNECTED THE VOLTAGE DIVIDER CONTAINING 10 K RESISTOR AND 10 K POT. IT WILL GIVE THE VREF/2 OF 1.28 V. THIS VOLTAGE IS APPLIED TO PIN 9 OF ADC 0804 TO GET THE INPUT VOLTAGE RANGE IN BETWEEN 0 TO 2.5 V. WHEN THIS PIN IS OPEN (NOT CONNECTED) THE ANALOG INPUT VOLTAGE FOR THE ADC 0804 IS IN THE RANGE OF 0 TO 5 V. THE ADC0804 CHIP WORKS WITH + 5V AND THE RESOLUTION OF 8 BITS. CONVERSION TIME IS A MAJOR FACTOR IN JUDGING AN ADC. CONVERSION TIME IS DEFINED AS THE TIME TAKEN BY ADC TO CONVERT ANALOG TO DIGITAL. IN ADC0804, IT VARIES DEPENDING UPON THE CLOCKING SIGNAL APPLIED TO CLK R AND CLK IN PINS BUT IT CANNOT BE FASTER THAN 110µS. ADC0804 STARTS. IF CS =0 WHEN WR MAKES LOW TO HIGH TRANSITION , THE ADC0804 STARTS CONVERTING THE ANALOG INPUT VALUE OF VIN TO AN 8 BIT VALUE. THE CLK IN IS AN INPUT PIN CONNECTED TO AN EXTERNAL CLOCK SOURCE WHEN AN EXTERNAL CLOCK IS USED FOR TIMING. ADC0804 HAS AN INTERRUPT CLOCK GENERATOR .TO USE THIS INTERNAL CLOCK GENERATOR (ALSO CALLED SELF CLOCKING) OF THE ADC0804, THE CLK IN AND CLK R PINS ARE CONNECTED TO A CAPACITOR AND A RESISTOR. THE CLOCK FREQUENCY IS CALCULATED AS F =1/ (1.1RC) TYPICAL VALUES ARE R= 10K? AND C=150PF. WE GET F=606 KHZ AND THEREFORE CONVERSION TIME COMES OUT TO BE 110µS.

Slide 20 : Relay and Relay Driver Circuit : Relay is an electromagnetic switch, consist of a coil, 1 common terminal, 1 normally closed terminal, and one normally open terminal. Circuit symbol for a relay The relay's switch connections are usually labeled COM, NC and NO: COM = Common, always connect to this, it is the moving part of the switch NC = Normally Closed, COM is connected to this when the relay coil is off. NO = Normally Open, COM is connected to this when the relay coil is on. Relays allow one circuit to switch a second circuit, which can be completely separate from the first. For example a low voltage battery circuit can use a relay to switch a 230V AC mains circuit. There is no electrical connection inside the relay between the two circuits; the link is magnetic and mechanical. IN OUR PROJECT WE ARE USING THE FOLLOWING RELAY: 12V,50mAMP INPUT 230V, 10 AMP OUTPUT SINGLE CHANGEOVER

Slide 21 : In our project two SPDT Relays (Single Pole Double Throw Relay) are used. Relay is driven by the micro controller as per system requirements .One of them is used to cut off the power supply when balance goes to zero and other relay is for off hook or on hook notification to MSEB. Advantages of relays: Relays can switch AC and DC, transistors can only switch DC. Relays can switch high voltages, transistors cannot. Relays are a better choice for switching large currents (> 5A). Relays can switch many contacts at once. Relay driver interface:

Copyrights © 2009 authorGEN. All rights reserved.