Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Exercise - Stepper Motor - Fundamentals of Microcontrollers | EMCH 367, Study notes of Mechanical Engineering

Material Type: Notes; Professor: Giurgiutiu; Class: MICROCNTROLLRS MECH ENGR; Subject: Mechanical Engineering; University: University of South Carolina - Columbia; Term: Fall 2009;

Typology: Study notes

Pre 2010

Uploaded on 10/01/2009

koofers-user-mea-1
koofers-user-mea-1 🇺🇸

4

(1)

10 documents

1 / 4

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
EMCH 367 Fundamentals of Microcontrollers Exercise STEPPER MOTOR
EXERCISE – STEPPER MOTOR
OBJECTIVE
This exercise will help you learn how to control a stepper motor through keyboard using the serial
communication and parallel ports of the M68HC11: The following objectives are considered:
Review the use and control of stepper motors.
Discuss the stepper motor energizing patterns, 1- and 2-phase energizing types, full- and half-
step motion.
Introduce the concept of creating quasi-continuous motion through a sequence of steps
Introduce the concept of sequential accessing a finite set of stored patterns through index
addressing with a continuously updating pointer.
Illustrate a method to ‘load’ a single-precision (2-hex) variable into a double precision (4-hex)
register.
Introduce the concept of automatic incrementation/decrementation of the addressing pointer
with a programmable step size
Discuss the reset actions to be taken when the pointer hits the ‘roof’ or ‘floor’.
Review the use of keystroke commands for controlling a process
Introduce the concept of ‘multiple sort’ and its ‘sequential sort’ equivalent
Use a subroutine that can implement a long delay between stepper motor steps
Introduce the concept of how to achieve double precision delays (4-hex) using single precision
(2-hex) variables
BASIC CONCEPTS
1) Using a stepper motor involves "stepping" through a series of control signals. For the stepper motor
configuration discussed in class, show the 2-hex numbers corresponding to full-step and half-step
operation during a complete revolution. 30 point(s)
Full-step operation Half-step operation
Step
Sequence
number
2-hex
number
Number
of excited
coils Step
Sequence
number
2-hex
number
Number of
excited
coils
½ S0 $08 1
1 S1 $09 2 1 S1 $09 2
2 2
3 3
4≡0 4≡0
2) How could the stepper motor obtain a rotation in the opposite direction from that in
question 1)? 4 point(s)
Dr. Victor Giurgiutiu Page 1 12/1/2020
pf3
pf4

Partial preview of the text

Download Exercise - Stepper Motor - Fundamentals of Microcontrollers | EMCH 367 and more Study notes Mechanical Engineering in PDF only on Docsity!

EXERCISE – STEPPER MOTOR

OBJECTIVE

This exercise will help you learn how to control a stepper motor through keyboard using the serial communication and parallel ports of the M68HC11: The following objectives are considered:  Review the use and control of stepper motors.  Discuss the stepper motor energizing patterns, 1- and 2-phase energizing types, full- and half- step motion.  Introduce the concept of creating quasi-continuous motion through a sequence of steps  Introduce the concept of sequential accessing a finite set of stored patterns through index addressing with a continuously updating pointer.  Illustrate a method to ‘load’ a single-precision (2-hex) variable into a double precision (4-hex) register.  Introduce the concept of automatic incrementation/decrementation of the addressing pointer with a programmable step size  Discuss the reset actions to be taken when the pointer hits the ‘roof’ or ‘floor’.  Review the use of keystroke commands for controlling a process  Introduce the concept of ‘multiple sort’ and its ‘sequential sort’ equivalent  Use a subroutine that can implement a long delay between stepper motor steps  Introduce the concept of how to achieve double precision delays (4-hex) using single precision (2-hex) variables

BASIC CONCEPTS

  1. Using a stepper motor involves "stepping" through a series of control signals. For the stepper motor configuration discussed in class, show the 2-hex numbers corresponding to full-step and half-step operation during a complete revolution. 30 point(s) Full-step operation Half-step operation Step Sequence number 2-hex number Number of excited coils Step Sequence number 2-hex number Number of excited coils ½ S0 $08 1 1 S1 $09 2 1 S1 $09 2 1½ 2 2 2½ 3 3 3½ 4≡0 4≡
  2. How could the stepper motor obtain a rotation in the opposite direction from that in question 1)? 4 point(s)
  1. If a half step pattern is used, the number of steps per rotation is doubled. This technique decreases the "holding power" of the motor. Explain why. 4 point(s)
  2. Describe the difference between unipolar and bipolar connection of stepper motor coils. 4 point(s)
  3. The stepper motors used in this lab are low speed devices. The maximum effective rotation speed is approximately 200 steps/sec. This physical condition necessitates a wait loop between each step. It is suggested that you use wait loop to let the stepper motor perform the command before sending to it another command. A timer offset could be used and altered to meet the changing speed requirements of the program. Considering the speed of the microprocessor, what is the smallest wait loop that could be used? Enter your answer here: _________________________4 point(s)

PROGRAM STEPPER MOTOR

Note: This program will be based on the examples Step, Sort, and Long Delay. In fact, it can be assembled from these two examples. Before performing the present programming, review, duplicate, and operate the example codes Ex_Step.asm, Ex_Sort_asm, and Ex_Long_Delay. This program should make the stepper motor run forward and backward, at half speed and full speed, according to control keystrokes send through the keyboard and echoed on the screen. The "half-speed" and "full-speed" commands are part of the coarse speed control. Fine speed control (increase speed, decrease speed) should be attained by modifying the delay inserted between steps. The program should recognize five keystroke commands: i) Move forward > ii) Move backward < iii) Increase speed (decrease delay) + iv) Decrease speed (increase delay) - v) Stop program S This program will take a little more thought. The programming will need to be done at several layers of complexity, using program segments and subroutines from the examples Step, Sort, and Long Delay and from previous examples. The following is the ‘big-picture’ of your program:

 At beginning of delay subroutine  At beginning of step subroutine  At SWI Arrange windows for maximum benefit. Press the RESET button. a) Run your program to the first breakpoint. The program should go through initialization and give values to the variables S0—S7, STEP, POINTER, DELAY. Paste your screen. 4 point(s). b) Run further. The program should be looping at the beginning and wait for a keystroke. c) Enter the character > into the serial transmitter window and Send. After a few moments, the character should be received and the program should stop at the breakpoint. d) Run further. The program should be waiting for SCI transmission to happen. After a few moments it should stop. e) Step through the program f) Repeat with the other control keys and check that your program runs successfully. If you do not get the desired results, debug your program.

WHAT YOU HAVE LEARNED

In this exercise, you have:  Reviewed the use and control of stepper motors.  Discussed the stepper motor energizing patterns, 1- and 2-phase energizing types, full- and half-step motion.  Introduced the concept of creating quasi-continuous motion through a sequence of steps  Introduced the concept of sequential accessing a finite set of stored patterns through index addressing with a continuously updating pointer.  Illustrated a method to ‘load’ a single-precision (2-hex) variable into a double precision (4-hex) register.  Introduced the concept of automatic incrementation/decrementation of the addressing pointer with a programmable step size  Discussed the reset actions to be taken when the pointer hits the ‘roof’ or ‘floor’.  Reviewed the use of keystroke commands for controlling a process  Introduced the concept of ‘multiple sort’ and its ‘sequential sort’ equivalent  Used a subroutine that can implement a long delay between stepper motor steps  Introduced the concept of how to achieve double precision delays (4-hex) using single precision (2-hex) variables