PRODUCTS
 
   

DOCUMENTATION
INDEX

 
 

Stepper Block Documentation

 
Stepper Block
 
 

The Stepper Block permits the control of one unipolar stepper motor. Stepper motors are often an ideal way to move objects or mechanisms in a controlled way. They are commonly available from numerous sources including surplus stores and are often surprisingly cheap. The catch is that they are harder to control than a regular DC motor because they are moved step by step by a series of pulses sent to coils inside the motor. With the application of some very simple control voltages, the Stepper Block can create these pulses and in some modes keep track of the step position of the motor.

It can operate in four different modes, controlled by the function switch. The modes are as follows:

Manual - Bidirectional Mode - the stepper runs forwards and backwards under the control of a single voltage

Manual - Unidirectional Mode - the stepper's speed is controlled by a voltage in one direction only, however it may be reversed by the application of another control voltage

Scaled Mode - the stepper goes to a position specified by a voltage. The range of travel is controlled by another voltage.

Automatic Mode - the stepper goes to a position specified by a voltage. The range of travel is determined at power up by searching for the upper and lower limits.

The Stepper Block's mode is determined by the Function switch. Each combination of switch-on's and switch-off's causes a particular mode to be activated.

The functionality of the Stepper Block is controlled by voltages arriving on the various inputs. For example, in Manual - Bidirectional mode, a voltage applied to I0 will control the absolute step rate of the Block. Three of the four modes use the last input, I3 to set some parameter. This input is special in that it is optionally connected to an on-board trimpot. When the Trimpot jumper is attached, the trimpot voltage is applied to I3. When the jumper is detached, the I3 input may be controlled externally like any other.

Two of the inputs function in the same way for all modes: the L0 and L1 inputs. These inputs are connections for limit switches. They are tied into the microprocessor firmware at a very low level to prevent the Stepper mechanism from being driven beyond the limits permissible for the machine. These inputs are optional - leaving them un-attached will leave them unused. However, if the functionality is desired, the L0 and L1 inputs need to be connected to switches (or other devices) that produce +5v when the stepper device reaches the respective limit. The diagram below depicts a common way to organize the limit switches. When the bar attached to the belt reaches the end of it's travel, the corresponding microswitch is activated. The microswitch is wired up so that when it is connected it conveys 5V to the respective limit switch input on the Stepper Block (L0 or L1).

Limit switches are a very important part of building mechanical devices. They help to prevent situations where a motor or other actuator might act in such a way as to harm the mechanism it is driving. In addition, in Automatic Mode the limit switches are used to mark the operating envelop of the device automatically.

 
 
 
Motor Selection
 

The Stepper Block will work with a variety of different motors. Although there are one or two things to watch out for.

There are two major kinds of Stepper - unipolar and bipolar. The bipolar kind typically have four wires and can not be used with the Stepper Block. The unipolar kind have six or more wires and can be used. See below for how to connect these motors up.

The motor must have a voltage rating that you can supply. If the votlage corresponds to the V+ (12V on many systems) the motor can be plugged into the V+ terminal on the board. If the motor has a lower voltage, don't be tempted to connect it to the 5V line from the Stepper Block. That is a very low current supply and should not be used for the stepper. If the motor needs a voltage that is not the same as V+, an external power supply can be used. See below for details.

At any voltage, the motor must draw less than 2A per coil. Remember to use Ohm's Law to work out what the current would be if it's not specified. Watch out for motors that require low voltage drives. If they are accidentally connected to the Stepper Block and the V+ line they will almost certainly draw too much current. Note also that even if the rated current is observed for the motors, there is a chance that they will warm up during use. Stepper motors frequently need heatsinks to prevent them from overheating and burning coils up.

 
 
Connections
 

Unipolar stepper motors have six or more wires - corresponding to two coils. Which wire emerging from the motor is which is sometimes not obvious. Ideally, a manufacturer's data sheet is consulted to determine how the motor is wired internally. Failing this, the wiring can be determined with a little detective work and a multimeter. The wires are determined using the following observations:

  • wires from separate coils will have no connection at all (i.e. very high resistance)
  • one common wire and a wire from the same armature will have a certain resistance that is the same (or roughly so) on all coils
  • non-common wires from the same armature will have double that resistance

Once the various wires have been identified, they need to be connected to the Block in the correct order. The block activates the coils in order (i.e. O0, O1, O2, O3), so the wires that are inserted into the outputs should come from alternating armatures.

Wiring in this way will result in one wire going to each of the Stepper Block outputs, and two wires going to the V+ line.

If the Stepper requires an external power supply, connect the common terminals of the Stepper up to the positive side of the power supply. Connect the negative side of the power supply to the 0V connector on the Stepper Block.

Probably the best way to test a motor is to wire it up to the Stepper Block with the power off and with nothing mechanically connected to the stepper motor. Then select Mode 00 - Manual Bidirectional Mode. You'll need a potentiometer on I0 - the Speed input. Adjust the Trimpot (Speed Midpoint with the jumper on) to around midway. Adjust the Speed potentiometer to around the same. Now apply power. If nothing gets too warm, that's the first step. If wired correctly, the stepper will probably start slowly stepping. If it just twiches, check the wiring possibly trying another combination. If it runs slowly in one direction, then you can play with the Speed input potentiometer to get it to go forward and backwards. You'll also be able to note the point at which the motor (without a load) can no longer keep up with the Stepper Block.

You may have noticed that there is more than one correct way to wire a stepper motor up. Without a datasheet, or other information, some experimentation might be required to get it completely right. If the stepper motor just twitches when you run it, try swapping O0 and O2, or O1 and O3. If the motor runs properly, although in the opposite direction from the way you'd like it, completely reverse the wires.

The limit switches are connected so that each limit switch is connected on one side to +5V, and the other side to the L0 and L1 inputs on the Stepper Block.

 

 
 
Manual Bidirectional Mode 00 - 00
 
 
Speed : A
I0

O0
S : Stepper Phase 0
Reverse : D
I1 O1
S : Stepper Phase 1
Lower Limit Switch : D
L0 O2
S : Stepper Phase 2
Upper Limit Switch : D
L1 O3
S : Stepper Phase 3
  I2
Speed Midpoint : A
I3
Trimpot : A
Tr
 
   
 

When the Manual Bidirectional Mode is selected, the Stepper is under manual control. An analog signal provided at I0 determines the speed the stepper runs at by comparing subtracting the I3, Speed Midpoint voltage. This way, if the I0 - Speed input voltage is higher than the I3 - Speed Midpoint voltage, the stepper runs forward. If the voltage at I0 is less than the voltage at I3, the stepper runs backwards. The direction the motor goes in can be reversed by applying a 5V signal to the I1 - Reverse input.

If, at any time, a 5V signal is applied to either of the Limit Switch inputs (L0 or L1) motion in the corresponding direction will cease. It is important to make sure that the stepper is wired up in such a way as to permit this to function correctly. This means that there is a requirement to make sure that the limit switch governs motion in the correct direction.

 
 
Manual Unidirectional Mode 01 - 01
 
 
Speed : A
I0

O0
S : Stepper Phase 0
Reverse : D
I1 O1
S : Stepper Phase 1
Lower Limit Switch : D
L0 O2
S : Stepper Phase 2
Upper Limit Switch : D
L1 O3
S : Stepper Phase 3
  I2
I3
Trimpot : A
Tr
 
 

When the Manual Unidirectional Mode is selected, the Stepper is under manual control. An analog signal provided at I0 determines the speed the stepper runs at. The stepper runs in one direction - at zero speed when the I0 voltage is zero and at maximum speed (1023 steps per second) when 5V is applied. The motor can be reversed by applying a 5V signal to the Reverse input.

If, at any time, a 5V signal is applied to either of the Limit Switch inputs (L0 or L1) motion in the corresponding direction will cease. It is important to make sure that the stepper is wired up in such a way as to permit this to function correctly. This means that there is a requirement to make sure that the limit switch governs motion in the correct direction.

   
 
 
Scaled Mode 02 - 10
 
 
Target Position : A
I0

O0
S : Stepper Phase 0
Scale :A
I1 O1
S : Stepper Phase 1
Lower Limit Switch : D
L0 O2
S : Stepper Phase 2
Upper Limit Switch : D
L1 O3
S : Stepper Phase 3
Acceleration : A
I2
Maximum Speed : A
I3
Trimpot : A
Tr
 
   
 

In Scaled Mode, the Stepper tries to go to a position specified by the I0 - Target Position input. 0V applied to the Target Position input causes the Stepper Block to attempt to position the stepper to the 0 position. 5V applied to the TargetPosition input causes the Stepper Block to attempt to position the stepper to some location specifed by the I1 - Scale input. The higher the voltage (up to 5V) on the Scale input, the further the Stepper travels. Any intermediate voltage will cause the block to try to position the stepper motor at the appropriate position.

The function that relates the Scale voltage to the number of steps in the range is as follows:

steps = ( ( ( 1023 * Scale / 5 ) / 128 ) ^ 2 ) * 1024

This function has been designed to provide smooth scaling from a small handful of steps (8) at the lowest possible value (0V) up to approximately 65000 at the highest (5V)

When the mode is activated, it assumes that it's at the uppermost position. It then runs in reverse, trying to find the 0 position, or until it activates the Lower Limit Switch. This has the effect of bringing the mechanism back to a reset position from where it can be extended to known positions. Once either 0 is reached or the Lower Limit Switch is activated, normal positioning is permitted.

At any time, if either of the limit switches are activated, the system will immediately assume that the stepper is at the corresponding position and movement in the corresponding direction will be stopped.

 
 
Automatic Mode 03 - 11
 
 
Target Position : A
I0

O0
S : Stepper Phase 0
Scan Speed : A
I1 O1
S : Stepper Phase 1
Lower Limit Switch : D
L0 O2
S : Stepper Phase 2
Upper Limit Switch : D
L1 O3
S : Stepper Phase 3
Acceleration : A
I2
Maximum Speed : A
I3
Trimpot : A
Tr
 
   
 

In Automatic mode, the block relies on the presence of good limit switches on the mechanism. When it powers up, it first moves the stepper forward seeking to activate the the upper limit sensor. When it does, it takes a note of the position at which that occured. Then it tries to move back in the opposite direction, seeking the lower limit switch. When it finds that, it attempts to find the distance it traveled and makes that the full range of the block. The speed that it does this scanning at is governed by the scanning speed input. If this input is 0, the I3 - Maximum Speed value is used. If it is greater than zero, then that value is used instead. This permits very slow scans to be performed to protect the equipment against the damage that might be caused by a full speed collision with the end of travel.

When a voltage is applied to the Target Position input, the stepper is moved to a place that corresponds to that position. (0V to the lower limit, 5V to the upper limit, etc.)

If either of the limit switches are subsequently activated, the position the block holds is updated, and motion in that direction halted.

   

copyright © 2002-2005 MakingThings LLC