|
|
|
|
Introduction For many applications, stepping motors are preferable to conventional DC motors or servomotors. Typical advantages of stepping motors are:
In this Application Note we demonstrate how a small stepping motor can be directly connected to the ADB I/O through Port A. What is a stepping motor A stepping motor is an electrical motor which has no brush but windings (2 or 4) on the stator only.
It turns of one step each time that at least one winding is connected or disconnected from the supply. The number of step per revolution is variable but the most common values are 100 or 200 steps/turn meaning an angular resolution of 3.6 or 1.8 degrees. In principle a stepping motor can turn continuously if the windings are successively powered in a well defined sequence. This is why it is often driven by an electronic interface which controls the windings. In this Application the electronic interface is completely replaced by the Mac and the ADB I/O. As can be seen on Fig. 1, the only parts are the ADB I/O,
The motor and a battery. How to recognise a unipolar stepping motor There are two types of stepping motors:
Since this application works only with unipolar stepping
motors, we give the following rules to recognise a unipolar
stepping motor:
The windings of a unipolar motor are connected as shown
on Fig.2. They are made of two independent windings with a
middle point wire on each (6 wires unipolar). Possibly the
two middle points may be internally connected to a single
wire called Common (C)(5 wires unipolar). What type of stepping motor to choose Since the motor windings are driven by the ADB I/O
relays, one must choose a motor compatible with the relays
characteristics (max. 100 V, 500 mA). How to identify the wires The first task when starting with a stepping motor is to
identify the wires.
Fig. 3 Determination of the good colour sequence Now all A wires are not equivalent, this is why they have a different colour. Unfortunately the colours are not universal and you will have to determine what is the "good colour sequence". The "good sequence" is the one which will make the motor to run continuously and smoothly, not going back and forth. To do that, connect the C wire to one (say +) of the pole of a small battery (4.5 V is OK). Then connect successively the 4 A wires to the other pole (Fig. 3). If the motor has always turned in the same direction you won: write quickly that the "good sequence" was brown, blue, green, red! But if you noticed the motor going in the wrong direction while connecting the 3rd wire, this means that the 3rd wire is wrong in the sequence. Repeat the beginning of the sequence but change the 3rd colour. Doing like this, you should quickly determine what is the
"good sequence".
This also means that no matter the colour you are starting from to test a given sequence. Connecting the stepping motor to ADB I/O
Fig. 4 Connection of the ADB I/O to the motor As shown on Fig.4 a, the wiring requires a common
"ground" wire connected to one side of each relay screw
terminal. This is done by the yellow wire directly screwed
on blocks (Fig.1 and Fig. 4 b) which connects all the ADB
I/O right output screws. Once the good sequence has been
determined just connect the first motor wire of the motor
(say brown) to channel 1, the second to channel 2 ... That's all for the hardware... You can now test that the motor moves a bit each time you set one of the channel of Port A to HIGH with the ADB I/O standard controller. In the second part of this Note, we give some examples of HyperTalk Scripts, and briefly describe an HyperCard Applications used to run the motor.
The Software The HyperCard Application The software is an HyperCard stack made of 2 Cards with HyperTalk scripts. The stack can be downloaded here. It's called ADB I/O SMC. If you want to create your own stack, remind to install first the XCMDs for ADB I/O (see ADB I/O Manual P. 21) The first card only contains one script to configure ADB
ports A and B, and to define the sequence numbers (listN).
This script is executed by clicking in the card. At the end
of the script, the second card is opened. The second card has 5 buttons and 6 fields.
Buttons The "Backward" button is used to make the motor run
backward until the shift key is pressed or the lower limit
is reached. The " Go To OK" button is used to make the motor reach
the value (target). First enter the target value in the
field just above (card field 6) and click the "OK"
Button. The "switch off current" button opens all 4 relays.
The "Reset " makes the counter to reset the zero at the
present position. This is to be used at the beginning or to
set a new origin for angles. Fields
The left-centre field (card field 2) is the step counter. It is cumulative for successive operations (Forward, Backward, Go To). The value of the step counter is stored in the field even after closing the stack or shutting down the Mac.
The right-centre field (card field 3) displays the number of steps made since the present movement has started, while the motor is running.
The field on the right of the "Go To button" (card field 6) is the field where you enter the target to be reached. The target is first checked to be within the limits defined in the above fields.
This Menu Button proposes 10 speeds. The speed of the motor is proportional to the speed numbers. Speed 10 corresponds to no waiting time, so the real speed of the motor is determined by the speed of your Mac. Speed 1 corresponds to approx. 1 step per second. This can be changed by changing the value of "speedfactor" in the speed button script. When you choose an item in the menu, the lower left field displays the speed number, the waiting time and the number of ticks. This is to make easier a tuning of the speed range (by changing the speedfactor) according to the speed of your Mac and to your needs.
The bottom left field (card field 1) is an information field (not for input).
The principle to move the motor is simply to make the current to flow in the windings according to the following sequence:
Example HyperTalk Scripts This four steps sequence can be executed by the following script: on mouseUp Here is a script to make an arbitrary number of steps. It uses the (j mod 4) function which returns the remainder of the division of j by 4. Note the correspondence:
since item 0 is invalid and (j mod 4) never reaches the value 4. on mouseUp
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Note: The ADB I/O is no longer made or sold. These ADB I/O pages are hosted by Kaj Bjorkman as a favor to Sven Grenander (the founder and former Head Drone of BeeHive Technologies, Inc.)
Please let other ADB I/O users know that these archival pages are again available. |