Page 805 - Mechatronics with Experiments
P. 805
LABORATORY EXPERIMENTS 791
standard power transistors or a transistor array integrated circuit (IC). ULN2003A is the
stepper drive circuit (power transistor “switch set”). Hence, the ULN2003A high voltage
and high current transistor array is used to connect between the EDE1200 integrated circuit
chip (translator) and the stepper motor. It is capable of controlling full-step and half-step
modes and direction as well. It does not have an in-built oscillator, so a 4 MHz external
oscillator is connected to it.
The following are the input command signals to the translator EDE1200 IC that must
be controlled by the microcontroller,
1. Step: Pin 9 = 1, should be maintained high for a step motion.
2. Direction: Pin 7, 1 = clockwise, 0 = counter-clockwise.
3. Full/Half Stepping: Pin 8, 1 = for full stepping, 0 = for half stepping.
When the EDE1200 is running at an external clock speed of 4 MHz, the “Step”
pin signal can range up to 5 kHz resulting in a motor speed over 6250 RPM with a 7.5
degree per step motor. Very high acceleration rates should be avoided. That is, we should
not instantly apply high speed requests to a stopped motor. In other words, commanded
acceleration should not exceed a maximum value. Otherwise, the motor may not be able
follow the very high acceleration rate and this results in “step loss,” meaning that the motor
does not make the commanded number of step motions. The only way to detect the step
loss is to measure the rotor position with a position sensor (i.e., incremental encoder). Once
we determine that the motor did not make the commanded number of steps, the additional
missing number of steps can be re-commanded in a closed loop control algorithm.
Application Software Description
The stepper motor is driven by the stepper motor driver chip, which in turn is given a step
input by the PIC microcontroller. A schematic of the arrangement is shown in Figure 11.29
and a picture of the assembled circuit is shown in Figure 11.30.
The code generates a pulse signal of the required frequency using one of the port
output pins of the PIC. This is done by simply raising that particular pin to a high status,
waiting a certain delay time, and then lowering it to low. The basic code layout is given
below. Figure 11.29 shows that Port B, pins 0, 1, 2, 3 are used to interface the PIC
microcontroller to the EDE 1200 IC.
1. Clear selected port values, and configure ports to act as outputs for Step, Direction,
and Full/Half Step Mode commands.
2. Select “Direction” and “Full/Half Step” mode by writing 1 or 0 to the corresponding
port pins (which should be connected to Pins 7 and 8 on the EDE1200 IC).
3. Raise the “Step” pin (which should be connected to Pin 9 on the EDE 1200) to high.
Wait for a specified time (depending on the required stepping frequency).
4. Drop pin to low. Wait for a specified time (depending on the required stepping
frequency).
5. Experiment with different numbers of steps. Verify that the step motor runs as
expected and moves the expected number of steps.
6. Experiment with different directions.
7. Experiment with Full Step and Half Step mode.
8. Experiment with different rates of step signals (speed control).