Lab 5 microcontroller

3,016 views

Published on

Published in: Education, Business
0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
3,016
On SlideShare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
282
Comments
0
Likes
3
Embeds 0
No embeds

No notes for slide

Lab 5 microcontroller

  1. 1. CENTRE OF DIPLOMA STUDIESCOMPUTER ADDED DESIGN LABORATORY LABORATORY INSTRUCTION SHEET DEK 3133Subject Code and Name MICROCONTROLLER Experiment Code 05 Experiment Title Introduction to Stepper Motor Course Code DET/DEE/DEX
  2. 2. Document Reference No. RPP-05 Page. Number Page |1 Edition 1 LABORATORY Revision No. 4 Document Title PRACTICUM Effective Date 12/8/2010 Amendment Date 12/8/2010 SUBJECT INFORMATIONSUBJECT : DEK 3133 MICROCONTROLLERTOPIC : Lab 5 – Introduction to Stepper Motor.AIM To apply the knowledge and understanding on theory and applications of Stepper Motor.1 OBJECTIVES 1.1 To understand the design of keypad. 1.2 To determine and analyze the function of keypad. 1.3 To understand the configuration of LCD.2 EQUIPMENT 2.1 PIC Development Board – PICDEV 2.2 PIC16F877A 2.3 MPLAB IDE Program 2.4 Mikro C 2.5 Proteus 2.6 The PIC Development Board User manual 2.7 Power supply 9V3 THEORY 3.1 STEPPER MOTORA stepper motor is a widely used device that translates electrical pulses into mechanical movement. Inapplications such as disk drives, dot matrix printers, PCB drilling mill, camera panning system, automatic fishfeeder, and robotic, the stepper motor is used for position control.
  3. 3. Document Reference No. RPP-05 Page. Number Page |2 Edition 1 LABORATORY Revision No. 4 Document Title PRACTICUM Effective Date 12/8/2010 Amendment Date 12/8/2010 3.2 HOW STEPPER MOTOR WORKS? Stepper motors are very different from a regular DC motors. Instead of spinning like DC motors do, stepper motor steps at a specific resolution for each pulse. The motor that we are using needs 48 steps / pulses just to complete a single revolution! That should be enough to tell about its precision. Another advantage of stepper motors is the fact that their speed of rotation can be achieved almost instantly even if you change the spinning direction. Stepper motor consists of a - the permanent magnet that rotates inside, and - four coils (north, east, south, west) that are part of the case, and which . Rotor can be moved by sequentially applying a pulsed DC voltage to one or two coils at a time. 3.3 STEPPER MOTOR DRIVERIn able to move the rotor you will need a driver. Driver is a circuit that applies a voltage to any of the fourstator coils. Driver can be built with IC such as ULN2003 (pictured on the circuit diagram), four darlingtontransistors or four power transistors such as 2N3055. 3.4 STEPPER MOTOR CONNECTIONSThere are also steppers called variable reluctance stepper motors that do not have permanent magnet rotor. Themost common stepper motors have four stator windings that are paired with a center-tapped common as shownif Figure below.Unipolar motor should have five or six connections depending on the model. If the motor has six connectionslike the one pictured above, you have to join pins 1 and 2 (red) together and connect them to a (+) 12-24Vvoltage supply. The remaining pins; a1 (yellow), b1 (black), a2 (orange), b2 (brown) should be connected to adriver (ULN2003) as shown on the schematic below.
  4. 4. Document Reference No. RPP-05 Page. Number Page |3 Edition 1 LABORATORY Revision No. 4 Document Title PRACTICUM Effective Date 12/8/2010 Amendment Date 12/8/2010 Figure of Stepper motor control using ULN2003 driver.This type of stepper motor is commonly referred to as a four phase or unipolar stepper motor. The center tapallows a change of current direction in each of two coils when a winding is grounded, thereby resulting in apolarity change of the stator. Notice that while a conventional motor shaft runs freely, the stepper motors shaftmoves in a fixed repeatable increment, which allows one to move it to a precise position. This repeatable fixedmovement is possible as a result of basic magnetic theory where poles of the same polarity repel and oppositepoles attract. The direction of the rotation is dictated by the stator poles. The stator poles are determined by thecurrent sent through the wire coils. As the direction of the current is changed, the polarity is also changedcausing the reverse motion of the motor. The stepper motor discussed here has a total of six leads: four leadsrepresenting the four stator windings and two commons for the center-tapped leads. As the sequence of poweris applied to each stator winding, the rotor will rotate. There are several widely used sequences, each of whichhas different degree of precision. Table below shown the finer resolutions that called an 8 –step switchingsequence. The 8 step sequence is also called half-stepping, because in the 8-step sequence each step is half ofthe normal step angle.
  5. 5. Document Reference No. RPP-05 Page. Number Page |4 Edition 1 LABORATORY Revision No. 4 Document Title PRACTICUM Effective Date 12/8/2010 Amendment Date 12/8/2010Clockwise Step # Winding A Winding B Winding C Winding D Counter Clockwise 1 1 0 0 1 2 1 0 0 0 3 1 1 0 0 4 0 1 0 0 5 0 1 1 0 6 0 0 1 0 7 0 0 1 1 8 0 0 0 1 Table 1: Half-Step 8 –Step Sequence 3.5 MOTOR SPEEDThe motor speed, measured in steps per second, is a function of the switching rate. By changing the length ofthe time delay loop, we can achieve various rotation speeds. Decreasing the delay time will increase therotation speed and vice versa.
  6. 6. Document Reference No. RPP-05 Page. Number Page |5 Edition 1 LABORATORY Revision No. 4 Document Title PRACTICUM Effective Date 12/8/2010 Amendment Date 12/8/20104 ATTENTION 4.1 Do not move any IC or device inside the board without any order from your instructor.5 EXPERIMENT PROCEDURE 5.1.1 Before test the source code on the PIC development board, the connection of PORTC must 5.1 STEPPER MOTOR (See Circuit 1) be connected to the steeper motor driver (ULN2003A) using jumper wires. The connections are shown below: M1 C0 M2 C1 M3 C2 M4 C3 5.1.2 The code below is show how the stepper motor is rotate in clockwise and counter clockwise for about 20 seconds. Type the code and test on the development board. Write your observation.
  7. 7. Document ReferenceNo. RPP-05 Page. Number Page |6 Edition 1 LABORATORY Revision No. 4 Document Title PRACTICUM Effective Date 12/8/2010 Amendment Date 12/8/2010
  8. 8. Document Reference No. RPP-05 Page. Number Page |7 Edition 1 LABORATORY Revision No. 4 Document Title PRACTICUM Effective Date 12/8/2010 Amendment Date 12/8/2010 5.2.1 Base on the code above; modify the program, so that the motor rotation speed is increase. 5.2 Exercise 1 5.2.2 Write you observations. 5.3.1 Base on the circuit 1, develop a program, so that the stepper motor will rotate if the 5.3 Exercise 2 button is pressed and stop if the button is not pressed. 5.3.2 Draw a flow chart for the complete program. 5.4.1 Base on circuit 1, develop a program to toggle the direction of stepper motor rotation if 5.4 Exercise 3 button is pressed. 5.4.2 Draw a flow chart for the complete program.6 REPORT PREPARATION AND SCHEMA.(1) 2 persons for 1 report.(2) Due date to send report is 1 weeks after lab date.(3) Report schema following below requirements: Lab report cover sheet for 1st page. Objective, theory, equipments for the 2nd page. (5) (5M) Observations. (10) 1.Motor rotation observation from 5.1.2 (5 M) 2.Motor Speed observation from 5.2.2 (5 M ) Result. (65) 1. Exercise 1 source code (15 M) 2. Exercise 2 source code & Flow Chart (25 M)
  9. 9. Document Reference No. RPP-05 Page. Number Page |8 Edition 1 LABORATORY Revision No. 4 Document Title PRACTICUM Effective Date 12/8/2010 Amendment Date 12/8/2010 3. Exercise 3 source code & Flow chart (25M ) Discussion. (10) 1. What is the function of ULN2003A device? (5 M) 2. How to increase and reduce the rotation speed of stepper motor? (5 M) Conclusions. (10)7 CIRCUIT ATTACMENT Circuit 1: STEPPER MOTOR

×