Академический Документы
Профессиональный Документы
Культура Документы
II. SCOPE
A. Theory
Figure 6.1
Stepper motor is an electric motor that moves according to the particular steps,
it is triggered by the magnetic field in the coils inside of the motor. The inner part
STATOR
STATOR
ROTOR
STATOR
STATOR
Figure 6.2
There are some methods to activate a stepper motor, Half Step and Full Step.
Full Step is a method to move a stepper motor by activating one of the coils inside
the stepper motor. In the practicum class, the stepper motor have red wire for +V,
brown for coil1, orange for coil2, black for coil3, and yellow for coil4. See the
Figure below.
Figure 6.3
Half Step is a method to move a stepper motor in such a way, so that the
movement of the motor is smoother. See the Figure below.
Figure 6.4
B. References
III. DEVICES
Wincupl Program
GAL Module
Stepper Motor Module
A. Procedure
Type the list of the program in the attachment, then try to make a stepper
motor to move with 2 phase full step!
The points below should be explained and developed in the digital system final
reports. State at least 6 conclusions in the end of the final reports.
Stepper motor
DC motor and Stepper motor
Unipolar and Bipolar stepper motor
The methods of moving a stepper motor
The advantages and disadvantages of a stepper motor
GAL
How to use clock in GAL
The function of an OE pin
Make a program to move a stepper motor in halfstep and can be set up its direction
(clockwise/counter-clockwise)!
Make a 4 bit Counter by using a sequential program! (Make sure that the program
is not error while compiling)
Make a 5 bit Shift Register by using a sequential program! (Make sure that the
program is not error while compiling)
Table 6.1
SEQUENCE SEQUENCE state_var_list {
SEQUENCED PRESENT state_n0 statements ;
SEQUENCEJK PRESENT state_nn statements ;
SEQUENCERS }
SEQUENCET
The syntax above indicate to a
sequential program, prefix D, JK,
RS, T show the type of the flip-
flop used
Conditional NEXT Statement PRESENT state_n
IF expr NEXT state_n;
IF expr NEXT state_n;
[DEFAULT NEXT state_n;]
o Extension table
Table 6.2
Description
Extension Side
Used
.AP L Asynchronous preset of flip-flop
.AR L Asynchronous reset of flip-flop
.APMUX L Asynchronous preset multiplexer selection
.ARMUX L Asynchronous reset multiplexer selection
.BYP L Programmable register bypass
.CA L Complement array
.CE L CE input of enabled D-CE type flip-flop
.CK L Programmable clock of flip-flop
.CKMUX L Clock multiplexer selection
.D L D input of D-type flip-flop
o Examples
An example of a program using the extension:
Name Shift Reg ;
PartNo 01 ;
Date 1/30/08 ;
Revision 01 ;
Designer Engineer ;
Company Atmel ;
Assembly None ;
Location ;
Device G16V8 ;
/* *************** INPUT PINS *********************/
PIN 1 = Clk ; /*Clock */
PIN 2 = Din ; /*Data input */
PIN 3 = ER ; /*Enable Rotate */
PIN 11 = EA ; /*Enable Output */
PIN 4 = !RST ; /*Reset*/
Q0.D = (Din&!ER)# (Q3&ER&RST); /* Show that the D part in D flip-flop has this equation */
Q1.D = Q0&RST ; /* */
Q2.D = Q1&RST ; /* */
Q3.D = Q2&RST ; /* */
/**********************************************************************/
/*This program is used to control a stepper motor */
/* PIN configuration used: */
/* PIN 12 = P1 in the Stepper Motor */
/* PIN 13 = P2 in the Stepper Motor */
/* PIN 14 = P3 in the Stepper Motor */
/* PIN 15 = P4 in the Stepper Motor */
/*Dont forget to see the cable colour configuration in the stepper motor */
/* the numbers in the brackets on the right side are for the notation, dont put in the program */
Notation:
1. Part (1) and (2) are used to declare the name of the input and output pins as a name of
a variable.
2. Part (3) is a declaration of a more complex variable name.
field count = [Q3..0];
o To combine varibale name Q0,Q1,Q2,Q3 to become a new variable name count
$define S0 'b'0000
o $define is a Preprocessor Command to define number, symbol or character to
become a new name. In this case S0 is defined as b0000 after being compiled.
field mode = RST;
o it is used to classify the variable name RST with the name mode (can be more than
one variable by using a bracket, for example: field mode = [clr,dir] )
go = mode:0;
o go is a new variable name containing mode 0. mode:0 means RST = 0
stop = mode:1;
o stop is a new variable name containing mode 1. mode:1 means RST = 1
o if you are using 2 variables you may use wait = mode:2 (the first variable is 1 and
the second variable is 0) or back = mode:3 (both of the variables are 1)
- The present state is S0 (b0000), if there is mode go, then the next state is S1
(b0001). If the mode is stop then the next state is S0 (b0000). The syntax out
is a syntax used to directly give the output on the particular pin.
Name SisDig ;
PartNo 00 ;
Date 2008.01.28. ;
Revision 01 ;
Designer Engineer ;
Company Atmel ;
Assembly None ;
Location ;
Device G16v8 ;