


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
Material Type: Notes; Professor: Giurgiutiu; Class: MICROCNTROLLRS MECH ENGR; Subject: Mechanical Engineering; University: University of South Carolina - Columbia; Term: Fall 2009;
Typology: Study notes
1 / 4
This page cannot be seen from the preview
Don't miss anything!
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
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.
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