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

Lab 5: Stepper Motors and A/D Conversion with the 68HC11 Microcontroller in EMCH 367 - Pro, Lab Reports of Mechanical Engineering

The objectives, procedures, and experimental setup for lab 5 in the emch 367 fundamentals of microcontrollers course. Students will learn to use stepper motors under microprocessor control and perform a/d conversion with the 68hc11 microcontroller. Pre-test procedures, wiring diagrams, and test procedures for both stepper motor control and a/d conversion.

Typology: Lab Reports

Pre 2010

Uploaded on 10/01/2009

koofers-user-tjn-1
koofers-user-tjn-1 🇺🇸

10 documents

1 / 9

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
EMCH 367 Fundamentals of Microcontrollers
LAB 5 STEPPER MOTOR AND A/D CONVERSION
OBJECTIVE
The objective of this laboratory is to introduce the student to the use of:
1. Stepper motors under microprocessor control
2. A/D conversion with the 68HC11 microcontroller
The physical principles and the programming features of these devices will be studied and applied.
PART I – STEPPER MOTORS
PREREQUISITES
Floppy disk with the asm codes for the programs:
LASTNAME_Firstname_Stepper_Motor.asm
Hard copy (printout) of Hmwk7 – Stepper Motor. When printing, use the 'pages per sheet' option
in the lower right corner of the print dialog-box with settings of 4 or 2 (depending on your
eyesight) to save paper. (We may want to experiment a little with this before printing the full
document.)
PROCEDURE
The students will utilize the asm code developed with the THRSim11 simulator for Hmwk 7 and Hmwk
8. The students will go through the printout of Hmwk7 step by step and will verify that the MCU
responds to instructions as expected.
The lab is divided into sections. After completing each section, the student will ask the TA to check the
student’s work and make a check mark on that section.
The asm code is activated into the MCU following the standard procedure learned in Lab 1.
EXPERIMENTAL SETUP
The experimental setup for this experiment consists of a stepper motor (Figure 1) and its controller
board (Figure 2). The stepper motor controller board is connected to the MCU port B. The MCU
generates a sequence of binary patterns that are used by the controller board to energize the stepper
motor coils and generate motion.
Dr. Victor Giurgiutiu Page 1 11/28/2020
pf3
pf4
pf5
pf8
pf9

Partial preview of the text

Download Lab 5: Stepper Motors and A/D Conversion with the 68HC11 Microcontroller in EMCH 367 - Pro and more Lab Reports Mechanical Engineering in PDF only on Docsity!

LAB 5 STEPPER MOTOR AND A/D CONVERSION

OBJECTIVE

The objective of this laboratory is to introduce the student to the use of:

  1. Stepper motors under microprocessor control
  2. A/D conversion with the 68HC11 microcontroller The physical principles and the programming features of these devices will be studied and applied.

PART I – STEPPER MOTORS

PREREQUISITES

Floppy disk with the asm codes for the programs:  LASTNAME_Firstname_Stepper_Motor.asm Hard copy (printout) of Hmwk7 – Stepper Motor. When printing, use the 'pages per sheet' option in the lower right corner of the print dialog-box with settings of 4 or 2 (depending on your eyesight) to save paper. (We may want to experiment a little with this before printing the full document.)

PROCEDURE

The students will utilize the asm code developed with the THRSim11 simulator for Hmwk 7 and Hmwk

  1. The students will go through the printout of Hmwk7 step by step and will verify that the MCU responds to instructions as expected. The lab is divided into sections. After completing each section, the student will ask the TA to check the student’s work and make a check mark on that section. The asm code is activated into the MCU following the standard procedure learned in Lab 1.

EXPERIMENTAL SETUP

The experimental setup for this experiment consists of a stepper motor (Figure 1) and its controller board (Figure 2). The stepper motor controller board is connected to the MCU port B. The MCU generates a sequence of binary patterns that are used by the controller board to energize the stepper motor coils and generate motion.

8 - pin input connector Controller board Stepper motor Figure 1 Stepper motor and its controller board. Control signals to the controller board are sent through the 8-pin input connector.

CIRCUIT DIAGRAM

RED BLACK Figure 2 Circuit diagram of the stepper motor controller board

WIRING DIAGRAM

Wire Connection

S0 1000 $08 1 phase Half step S1 1001 $09 2 phase Full step S2 0001 $01 1 phase Half step S3 0101 $05 2 phase Full step S4 0100 $04 1 phase Half step S5 0110 $06 2 phase Full step S6 0010 $02 1 phase Half step S7 1010 $0A 2 phase Full step

STEPPER MOTOR CONTROL PROGRAM

Run the program of homework 7 using the commands >, <, +, -, S: Verify that it can be controlled to do forward and backward motion, slower and faster. Verify that it stops. i) Move forward > Check mark ii) Move backward < Check mark iii) Increase speed (decrease delay) + Check mark iv) Decrease speed (increase delay) - Check mark v) Stop program S Check mark When satisfied with the program operation, show it to your TA. TA checkmark ________

PART II – A/D CONVERSION

PREREQUISITES

Floppy disk with the asm codes for the program:  LASTNAME_Firstname_AD.asm Hard copy (printout) of Hmwk8 – A/D Conversion. When printing, use the 'pages per sheet' option in the lower right corner of the print dialog-box with settings of 4 or 2 (depending on your eyesight) to save paper. (We may want to experiment a little with this before printing the full document.)

PROCEDURE

The students will utilize the asm code developed with the THRSim11 simulator for Hmwk8. The students will go through the printout of Hmwk8 step by step and will verify that the MCU responds to instructions as expected. The lab is divided into sections. After completing each section, the student will ask the TA to check the student’s work and make a check mark on that section. The asm code is activated into the MCU following the standard procedure learned in Lab 1.

EXPERIMENTAL SETUP

Variable

Potentiometer

+5 V

Power

Supply

Port E

Protection Card

MCU

Port E pin

PE

Multimeter

MCU

Port B

8 - LED

Display

Figure 3 AD conversion experiment: block diagram The analog-to-digital (AD) converter function of the M68HC11 microprocessor will be used to record, as eight-bit digital data, the analog signals developed by a variable potentiometer and sent to the MCU through port E pin PE4. The experimental setup (Figure 3) consists of a variable potentiometer, port E protection card, multimeter, the MCU port E, the MCU port B, and an 8-LED display. The potentiometer generates an adjustable voltage (analog signal) in the range 0 – 5 V. The analog signal is through the port E protection card to the MCU port E. The multimeter records the value (mV) of the analog signal that enters the MCU. Inside the MCU, the analog signal is converted to 8-bit digital. Conversion is effected continuously, in a round-robin fashion and stored internally in four variables (VAL1 – VAL4). The average of these four values is calculated by software and output through MCU port B for digital display on the 8-LED display.

WIRING DIAGRAM

Wire Connection Red wire +5 V Black wire 0 V (Ground) Yellow wire Potentiometer variable output (0 – 5 V)

EQUIPMENT LIST

 +5V power supply  variable potentiometer  8-LED display  multi-meter

PRE-TEST PROCEDURE

Before starting your test, perform the following pre-test procedure to verify that your experimental set- up is performing correctly:

  1. Check the correct wiring of the potentiometer, port E protection card, port E pin PE4: Wire Connection Check mark Red wire +5 V Black wire 0 V (Ground)

Table 2

Voltage at pin PE4 (mV) Digital values from AD conversion TA check

Target Actual Predicted Displayed mark Hex Binary 1 750 $ % % 2 1600 $ % % 3 2200 $ % % 4 3000 $ % % 5 4000 $ % % 6 5000 $ % %