1063 User Guide: Difference between revisions

From Phidgets Support
No edit summary
No edit summary
(25 intermediate revisions by 3 users not shown)
Line 1: Line 1:
__NOINDEX__
<metadesc>Accurately control the position, velocity, acceleration and current limit of a bipolar stepper motor with the PhidgetStepper Bipolar 1-Motor.</metadesc>
[[Category:UserGuide]]
[[Category:UserGuide]]
{{UserguideTOC|1063.jpg|1063}}
==Getting Started==
==Getting Started==
{{UGIntro|1063}}
*[{{SERVER}}/products.php?product_id=1063 1063 PhidgetStepperBipolar] motor controller
*USB cable and computer
*power supply
*bipolar stepper motor


===Checking the Contents===
{{UGbox|
'''You should have received:'''
* A PhidgetStepperBipolar 1-Motor Controller Board
* A Mini-USB Cable
|
'''In order to test your new Phidget you will also need:'''
* A 9 to 30V DC Power Supply (If you're using the barrel jack, make sure your power supply is '''center positive''' polarity)
* A bipolar stepper motor
* A length of wire
||}}


===Connecting the Pieces===
Next, you will need to connect the pieces:
{{UGbox|
[[Image:1063_1_Connecting_The_Hardware.jpg|600px|right|link=]]
# Connect the motor to the PhidgetStepper board. If you are having difficulty connecting your motor, refer to the technical section.
# Connect the motor to the PhidgetStepper's inputs. If you are having difficulty connecting the wires, refer to the [[#Technical_Details|technical section]].
# Connect the power supply to the board using the barrel connector.
# Connect the power supply using the barrel connector.
# Power supplies with higher current (more than 2.5 Amps) should be wired directly to the terminal block.
# Power supplies with higher current (more than 2.5 Amps) should be wired directly to the terminal block.
# Connect one end of the piece of wire to digital input port 0 and the other end to the ground connector.
# Connect the Phidget to your computer using the USB cable.
# Connect the PhidgetStepper board to your PC using the USB cable.
<br clear="all">
|
{{UGIntroDone|1063}}
[[File:1063_1_Connecting_The_Hardware.jpg|400px|link=]]
||}}


===Testing Using Windows 2000 / XP / Vista / 7===
==Using the 1063==
{{UGcontrolpanel|1063}}


{{UGwin}}
{{ugStepperCurrent|1063|Bipolar Stepper Controller}}


===Running Phidgets Sample Program===
{{ugDigitalInput|1063|{{UGDigitalInputActiveLow}}}}


{{UGwin2|'''Stepper-full'''}}
{{ugCurrentInput|1063|, labelled ''Bipolar Stepper Current Sensor'', }}


{{UGbox|
{{ugAddressingInformation}}
Double Click on the [[File:Ph.jpg|link=]] icon to activate the Phidget Control Panel and make sure that '''Phidget Bipolar Stepper Controller 1-Motor''' is properly attached to your PC.
|[[File:1063_1_Control_Panel_Screen.jpg|400px|link=]]
|
#Double Click on '''Phidget Bipolar Stepper Controller 1-Motor''' in the Phidget Control Panel to bring up Stepper-full and check that the box labelled Attached contains the word True.
# Check the Engaged box to power up the motor.
# Move the Target Position slider to the right or the left.  The target motor position will be displayed in the Position Target box and the motor will start turning until the Actual position is the same as the target.
# Use the Velocity Limit slider to set the maximum velocity. The motor will accelerate until the Actual velocity is equal to the Velocity Limit. Keep in mind that the maximum value on this slider is not actually the maximum velocity. See the [[#API|API]] for more information.
# Use the Acceleration slider to increase or decrease the acceleration.
# Use the Current Limit slider to modify the current going through the motor and affect torque. 
# When the motor has reached the position target, a tick mark will appear in the Stopped box.
# Move the Current Position slider to change the position the device is currently at.
# To test the Digital input, connect a wire between the digital input port 0 and the ground connector.  The check mark in the Input 0 box should appear
|[[File:1063_1_Stepper_screen.jpg|400px|link=]]
}}


===Testing Using Mac OS X===
{{ugUsingYourOwnProgram|1063}}
 
{{UGmac|Phidget Bipolar Stepper Controller 1-Motor|Stepper-full}}
 
===Using Linux===
 
{{UGlinux}}
 
===Using Windows Mobile / CE 5.0 / CE 6.0===
 
{{UGce}}


==Technical Details==
==Technical Details==
===How does the 1063 control Stepper Motors?===
===How does the 1063 control Stepper Motors?===
The 1063 can be used to control 4, 6, or 8 wire bipolar stepper motors.
The 1063 can be used to control 4, 6, or 8 wire bipolar stepper motors.


The PhidgetStepper Bipolar is most effective when used with stepper motors designed to be driven with a chopper drive stepper controller. These motors are often large, with a rectangular industrial appearance. The specifications of these motors are often confusing and may seem contradictory. Our users are often confused attempting to relate  the specifications of their motor to the capabilities of the 1063. If you are in doubt if your motor will work with the 1063, call us.
The PhidgetStepper Bipolar is most effective when used with stepper motors designed to be driven with a chopper drive stepper controller. These motors are often large, with a rectangular industrial appearance. The specifications of these motors are often confusing and may seem contradictory. Our users are often confused attempting to relate  the specifications of their motor to the capabilities of the 1063. If you are in doubt if your motor will work with the 1063, call us.


When the steppers are first engaged from software, the stepper motor likely will not be at the same state as the default output state of the controller.  This will cause the stepper to ‘snap’ to the position asserted by the controller - potentially moving by 2 full steps.
When the steppers are first engaged from software, the stepper motor likely will not be at the same state as the default output state of the controller.  This will cause the stepper to ‘snap’ to the position asserted by the controller - potentially moving by 2 full steps.
Line 312: Line 281:
===Choosing a Power Supply Voltage===
===Choosing a Power Supply Voltage===


The 1063 can operate from 9 to 30 VDC. It is able to reduce the voltage if your motor requires less, but it cannot increase the voltage. First, find the resistance of the coils in your motor. We will assume 4 Ohms. Add 0.5 Ohms to this to account for the electronics on the 1063.  Decide the maximum current you want to push through the coils. 
When looking at a stepper motor's specifications, you may come across a "Rated Voltage" value. This value is usually equal to the rated current multiplied by the resistance of the coils of the motor, making it somewhat of a redundant specification. As mentioned earlier, you can increase your controller's supply voltage in order to allow the motor to reach higher speeds at a lower current (because high current causes high inductance which puts a hard limit on how much speed and torque a motor can produce). The motor will also produce more heat as you increase the supply voltage, so it's a good idea to choose a supply voltage based on the performance you need for the motor. Some motors will have a "Recommended Voltage" for a particular controller, which is the amount of voltage needed to reach the optimal speed and torque of the motor with minimal heating.
 
This current limit is per coil, and you set this through the software API when you write your application.  We assume 2 Amps. The maximum current for your stepper is part of the motor specification - you can use the stepper with less current, to reduce power consumption, but you will get reduced torque.  Multiply 4.5 Ohms * 2 Amps = 9 Volts. The minimum voltage you can operate this motor at will be 9 Volts + 0.5 Volts for the controller.  If the voltage you provide is less than what is required for the motor (but still more than 9 volts), the motor will still run, but not at full spec, and often will be rough when microstepping (<1000 steps / second).
 
If you plan on running the 1063 at 30V constantly, you may want to add heat dissipation to the driver chip (A3979) on the 1063. One thing that can be done if you are expecting to really push the hardware is to put a jumper on the polarity diode of the 1063. This removes polarity protection from the device but it does make it less likely to be damaged as it dumps some of the strain onto the power supply. Note that this does increase the chance of damaging the power supply but replacing a power supply is cheaper than replacing a 1063.


For more information about how supply voltage affects your motor's maximum speed and torque, check the [[Stepper Motor and Controller Primer#Controlling the Stepper Motor|Stepper Motor Primer]].
For more information about how supply voltage affects your motor's maximum speed and torque, check the [[Stepper Motor and Controller Primer#Controlling the Stepper Motor|Stepper Motor Primer]].
Line 339: Line 304:
===Continuous Rotation ===
===Continuous Rotation ===


A stepper motor can be caused to rotate continuously by simply setting the motor position property to an extremely large number of steps.  The valid range of values for the motor position property is large enough to be able to cause the motor to continuously turn at maximum velocity for 194 days. You can also reset the current position variable whenever the motor reaches a certain position. If the target position is kept the same, this will also produce continuous rotation.  
A stepper motor can be caused to rotate continuously by simply setting the motor position property to an extremely large number of steps.  The valid range of values for the motor position property is large enough to be able to cause the motor to continuously turn at maximum velocity for 194 days.


===Saving Power===
===Saving Power===
Line 354: Line 319:
===Synchronization of Multiple Motors===
===Synchronization of Multiple Motors===
Many applications call for several steppers motors operating in unison - for example, operating a CNC table, or a robot arm. Highly precise synchronization of steppers using the PhidgetStepper is not possible, as the sequencing will be affected by the real-time performance of your operating system. Each stepper is controlled as a independent unit, so there is no way of arranging for a particular action to happen to all motors at the same time. Typical jitter can be 10-30mS.
Many applications call for several steppers motors operating in unison - for example, operating a CNC table, or a robot arm. Highly precise synchronization of steppers using the PhidgetStepper is not possible, as the sequencing will be affected by the real-time performance of your operating system. Each stepper is controlled as a independent unit, so there is no way of arranging for a particular action to happen to all motors at the same time. Typical jitter can be 10-30mS.
===Compatibility Guidelines===
When looking for a motor that will be compatible with the 1063, check the motor's data sheet and make sure it meets the following specifications.
* '''Bipolar motor''' - While the 1063 can control some six-wire unipolar motors, we recommend you look for bipolar stepper motors.
* '''4, 6, or 8-wire motor''' - A 5-wire motor cannot be used with the 1063, because the coils of the motor are connected internally.
* '''Rated/Recommended Voltage''' - If the motor comes with a rated or recommended voltage, it should be no more than '''30 volts''', and you should use a power supply that can output that voltage.
* '''Rated Current''' - The motor should be rated for a maximum of 1.5A per coil.


===Troubleshooting===
===Troubleshooting===
Line 367: Line 341:
For more information about stepper motors, check the [[Stepper Motor and Controller Primer]].
For more information about stepper motors, check the [[Stepper Motor and Controller Primer]].


==API==
{{UGnext|}}
{{UGapih}}
 
===Functions===
 
{{UGapi|int MotorCount() [get]
|Returns the number of motors this PhidgetStepper can control.  In the case of the 1063, this will always return 1. 
This call does not return the number of motors actually connected. 
}}
 
{{UGapi|double Acceleration(int MotorIndex) [get,set]
|Acceleration is the maximum change in velocity the PhidgetStepper uses when speeding up or slowing down the motor (But not when the motor is in mid-spin). This is specified in the same units used for Position - in the case of the 1063, 1/16th steps.
* If your motor is heavily loaded, or not supplied with a high enough voltage, there will be a practical limit on how fast it can accelerate. If the acceleration is set too high, the motor may not be able to respond quickly enough and end up missing steps.
* The range of acceptable Acceleration is bounded by the software properties AccelerationMax and AccelerationMin. 
* Acceleration should be set explicitly before beginning to use the PhidgetStepper, and will read as unknown until set by the application.
* VelocityLimit and Acceleration are set on the device in one discrete operation - if Acceleration is not set when VelocityLimit is set, it will default to (AccelerationMax / 2).
}}
 
{{UGapi|double AccelerationMax(int MotorIndex) [get] : Constant
|AccelerationMax is the maximum Acceleration the PhidgetStepper can accept and apply to the motor. In the case of the 1063, this will always return 1020000.
}}
 
{{UGapi|double AccelerationMin(int MotorIndex) [get] : Constant
|AccelerationMin is the minimum Acceleration the PhidgetStepper can accept and apply to the motor. In the case of the 1063, this will always return 4000.
}}
 
{{UGapi|double Velocity(int MotorIndex) [get]
|Velocity returns the current speed that a particular motor is being driven at, as the number of 1/16th steps per second.  With the PhidgetStepper, there is no way of directly controlling the velocity of a motor. The Velocity is also returned from the device, so typically there will be a 30- 50 ms USB delay.
}}
 
{{UGapi|double VelocityLimit(int MotorIndex) [get,set]
|Sets the maximum velocity that the stepper controller will drive the motor.  Please note that this is not necessarily the speed that the motor is being turned at.  The motor is accelerated up to the VelocityLimit, and decelerated as it approaches the target.  If the target position is close enough or Acceleration set low enough, the VelocityLimit might never be reached.
* The range of acceptable VelocityLimit is bounded by the software properties VelocityMax and VelocityMin. 
* VelocityLimit should be set explicitly before beginning to use the PhidgetStepper.
* VelocityLimit and Acceleration are set on the device in one discrete operation. If VelocityLimit is not set when Acceleration is set, it will default to (VelocityMax / 2).
* Reducing the velocity limit to zero causes the controller to ramp down. This could be a good way of implementing a pause on a long move.
}}
 
{{UGapi|double VelocityMax(int MotorIndex) [get] : Constant
|VelocityMax is the maximum VelocityLimit the PhidgetStepper can accept. In the case of the 1063, this will always return 32768. Functionally, it is the maximum speed that the 1063 can drive your motor at.
}}
 
{{UGapi|double VelocityMin(int MotorIndex) [get]
|VelocityMin is the minimum VelocityLimit the PhidgetStepper can accept. In the case of the 1063, this will always return 0. Functionally, it is the minimum speed that the 1063 can drive your motor at. For very low speeds, you can increment position inside a slow software based timing loop. Note that if VelocityLimit is set to 0, the motor will not turn. The smallest velocity that will turn the motor is 8 for the Bipolar Stepper.
}}
 
{{UGapi|int64 CurrentPosition(int MotorIndex) [get,set]
|Get returns the current position of a motor in 1/16th step units.  Note that there will be some delay (typically 30-50ms) between the PhidgetStepper reporting a position, and that position being read by your application. This property will return unknown when the motor is not engaged.  When the motor is re-engaged, the property will return the last known position. Set allows you to overwrite the position that the PhidgetStepper is at right now.  This can be useful for zeroing the position when a limit is reached.  To keep accurate track of position, CurrentPosition should only be set when the Stopped property is true.
}}
 
{{UGapi|int64 TargetPosition(int MotorIndex) [get,set]
|Sets the desired motor position.  Note that setting TargetPosition will override the previous command, and the motor will begin tracking to the new position immediately.  The velocity of the motor will be ramped appropriately. TargetPosition is bounded by PositionMin, and PositionMax.
}}
 
{{UGapi|int64 PositionMax(int MotorIndex) [get] : Constant
|MotorPositionMax is the maximum MotorPosition the 1063 can accept.  Functionally, this is the largest position that the 1063 can move your motors toward.  The initial MotorPosition is halfway between Min and Max.  Behavior is undefined if MotorPosition is driven past Min or Max.
}}
 
{{UGapi|int64 PositionMin(int MotorIndex) [get] : Constant
|MotorPositionMin is the minimum MotorPosition the 1063 can move your motors toward.
}}
 
{{UGapi|bool Engaged(int MotorIndex) [get,set]
|Enables a particular stepper to be positioned.  If this property is false, no power is applied to the motor.  Note that when the motor is enabled, the coils may not be exactly aligned and the motor will snap to position.
* Engaged defaults to false.
* Engaged is useful to reduce the power consumed by a motor once it’s reached a given position.  If you are concerned about keeping accurate track of position, Engaged should not be disabled until Stopped <nowiki>=</nowiki> True.
}}
 
{{UGapi|bool Stopped(int MotorIndex) [get]
|Stopped guarantees that the motor is not moving (without an external force), and that there are no commands in the pipeline to the motor.  Note that virtually any API calls will cause Stopped to be temporarily false, including changing Acceleration or VelocityLimit on a stopped motor.
}}
 
{{UGapi|double Current(int MotorIndex) [get]
|Gets the actual current being consumed by a particular motor in amps.  This property can also be used to determine if a motor is physically connected, by checking for a minimum current.  A stalled motor can also be detected by checking for larger than normal currents.
}}
 
{{UGapi|double CurrentLimit(int MotorIndex) [get, set]
|Sets the maximum current allowed through each coil of the stepper in amps.  Current corresponds roughly to power consumption, and the torque produced by the motor.  Reducing the current limit is often useful when the motor just has to hold a position.  Please review the section of the manual on determining an appropriate current limit.
* CurrentLimit should be set explicitly before beginning to use the motor.
}}
 
{{UGapi|double CurrentMax(int MotorIndex) [get] : Constant
|CurrentMax is the largest CurrentLimit value the PhidgetStepper can accept. In the case of the 1063, this will always return 2.492.
}}
 
{{UGapi|double CurrentMin(int MotorIndex) [get]
|CurrentMin is the smallest CurrentLimit the PhidgetStepper can accept. In the case of the 1063, this will always return 0.0542.
}}
 
{{UGapi|int InputCount() [get]
|Returns the number of Digital Inputs available on this PhidgetStepper.  In the case of the 1063, there are 4 Digital Inputs.
}}
 
{{UGapi|bool InputState(int InputIndex) [get]
|Returns the state of a particular Digital Input.  True is signalled when the digital input is pulled to ground. If the digital input is left floating, it is reported as false.
}}
 
===Events===
 
{{UGapi|InputChange(int InputIndex, bool State) [event]
|Designates an event handler to run whenever a digital input changes state.
}}
 
{{UGapi|CurrentChange(int MotorIndex, bool State) [event]
|Designates an event handler to run whenever the current through a stepper changes.
}}
 
{{UGapi|VelocityChange(int MotorIndex, double Velocity) [event]
|Designates an event handler to run whenever the velocity changes on a motor.
}}
 
{{UGapi|PositionChange(int MotorIndex, int64 Velocity) [event]
|Designates an event handler to run whenever the position changes on the motor.  You are not guaranteed to receive events for every motor position as updates are throttled at approximately 30ms.
}}
 
==Product History==
{{UGhist}}
{{UGrow|January 2009 |0|100|Product Release}}
{{UGrow|February 2011|1|100|Mini-USB connector, added more capacitance to the board, Digital Input terminal block exposes +5V, 12-24 AWG terminal blocks}}

Revision as of 16:15, 17 October 2019


Getting Started

Welcome to the 1063 user guide! In order to get started, make sure you have the following hardware on hand:


Next, you will need to connect the pieces:

1063 1 Connecting The Hardware.jpg
  1. Connect the motor to the PhidgetStepper's inputs. If you are having difficulty connecting the wires, refer to the technical section.
  2. Connect the power supply using the barrel connector.
  3. Power supplies with higher current (more than 2.5 Amps) should be wired directly to the terminal block.
  4. Connect the Phidget to your computer using the USB cable.


Now that you have everything together, let's start using the 1063!

Using the 1063

Phidget Control Panel

In order to demonstrate the functionality of the 1063, the Phidget Control Panel running on a Windows machine will be used.


The Phidget Control Panel is available for use on both macOS and Windows machines.

Windows

To open the Phidget Control Panel on Windows, find the Ph.jpg icon in the taskbar. If it is not there, open up the start menu and search for Phidget Control Panel

Windows PhidgetTaskbar.PNG

macOS

To open the Phidget Control Panel on macOS, open Finder and navigate to the Phidget Control Panel in the Applications list. Double click on the Ph.jpg icon to bring up the Phidget Control Panel.


For more information, take a look at the getting started guide for your operating system:


Linux users can follow the getting started with Linux guide and continue reading here for more information about the 1063.

First Look

After plugging the 1063 into your computer and opening the Phidget Control Panel, you will see something like this:

1063 Panel.jpg


The Phidget Control Panel will list all connected Phidgets and associated objects, as well as the following information:

  • Serial number: allows you to differentiate between similar Phidgets.
  • Channel: allows you to differentiate between similar objects on a Phidget.
  • Version number: corresponds to the firmware version your Phidget is running. If your Phidget is listed in red, your firmware is out of date. Update the firmware by double-clicking the entry.


The Phidget Control Panel can also be used to test your device. Double-clicking on an object will open an example.

Stepper Motor

Double-click on the Stepper object, labelled Bipolar Stepper Controller, in order to run the example:

1063 Stepper Example.jpg


General information about the selected object will be displayed at the top of the window. You can also experiment with the following functionality:

  • Toggle the Engage button to provide power to the motor coils.
  • By default, motor position, velocity, and acceleration are measured in sixteenths of a step. If you want to use different units, change the value in the Rescale Factor textbox.
  • Use the Target Position slider to set a new target position. Change the Acceleration and Velocity sliders to speed up or slow down the 1063's approach.
  • Use the Current Limit slider to change the maximum amount of current supplied to the motor's coils. See your motor's datasheet for the recommended coil current.
  • Select the Velocity (Continuous) Control tab for continuous rotation instead of specifiying a position.


Digital Input

Double-click on a Digital Input object in order to run the example:

1063 DigitalInput Example.jpg

General information about the selected object will be displayed at the top of the window. You can also experiment with the following functionality:

  • This is an active-low device, therefore, it will be true when connected to ground, and false when connected to a high voltage.

For more information about Digital Inputs, take a look at the Digital Input Primer

Current Input

Double-click on the Current Input object , labelled Bipolar Stepper Current Sensor, in order to run the example:

1063 CurrentInput Example.jpg


General information about the selected object will be displayed at the top of the window. You can also experiment with the following functionality:

  • Modify the change trigger and/or data interval value by dragging the sliders. For more information on these settings, see the data interval/change trigger page.

Finding The Addressing Information

Before you can access the device in your own code, and from our examples, you'll need to take note of the addressing parameters for your Phidget. These will indicate how the Phidget is physically connected to your application. For simplicity, these parameters can be found by clicking the button at the top of the Control Panel example for that Phidget.

The locate Phidget button is found in the device information box

In the Addressing Information window, the section above the line displays information you will need to connect to your Phidget from any application. In particular, note the Channel Class field as this will be the API you will need to use with your Phidget, and the type of example you should use to get started with it. The section below the line provides information about the network the Phidget is connected on if it is attached remotely. Keep track of these parameters moving forward, as you will need them once you start running our examples or your own code.

All the information you need to address your Phidget

Using Your Own Program

You are now ready to start writing your own code for the device. The best way to do that is to start from our Code Samples.

Select your programming language of choice from the drop-down list to get an example for your device. You can use the options provided to further customize the example to best suit your needs.

Code Sample Choose Language.png


Once you have your example, you will need to follow the instructions on the page for your programming language to get it running. To find these instructions, select your programming language from the Programming Languages page.

Technical Details

How does the 1063 control Stepper Motors?

The 1063 can be used to control 4, 6, or 8 wire bipolar stepper motors.

The PhidgetStepper Bipolar is most effective when used with stepper motors designed to be driven with a chopper drive stepper controller. These motors are often large, with a rectangular industrial appearance. The specifications of these motors are often confusing and may seem contradictory. Our users are often confused attempting to relate the specifications of their motor to the capabilities of the 1063. If you are in doubt if your motor will work with the 1063, call us.

When the steppers are first engaged from software, the stepper motor likely will not be at the same state as the default output state of the controller. This will cause the stepper to ‘snap’ to the position asserted by the controller - potentially moving by 2 full steps.

At low speeds, less than 1024 1/16th steps per second, the 1063 uses a microstepping scheme to allow precise control of the current to each coil, and therefore the position of the stepper. It’s important to note that many steppers are not designed to be microstepped precisely, and will not accurately produce the expected angle.

At higher speeds, the 1063 switches to a full stepping mode. The 1063 will automatically switch back to microstepping when approaching the target position.

To avoid the use of floating point in the APIs, the position, velocity and acceleration parameters are expressed in microsteps (1/16th steps), instead of full steps. If your application wants to move the motor by 1 full step, you change the position by 16.

Open and Closed Loop Control

Because stepper motors do not have the inherent ability to sense their actual shaft position, they are considered open loop systems.

This means that the value contained in the current position property is merely a count of the number of steps that have occurred towards the target value; it can not be relied upon as a measure of the actual shaft angle, as external forces may also be affecting the motor.

There are several ways of overcoming this drawback. The simplest is to allow the motor load to depress a limit switch located at a known position. This can be used to fire an event in software to recalibrate the shaft position values. A more elegant solution might involve the mounting of an optical encoder on the shaft and the development of a control system.

How to Connect your Stepper to the 1063

Bipolar Steppers motors are available in 4, 6 or 8 wire configurations. Driving a motor in the Bipolar Configuration produces maximum torque. The word Bipolar means that the controlling electronics have to be able to produce a current flow in either direction in each coil, to produce magnetic fields in opposite directions.

4 Wire Stepper Motors

A 4 wire Stepper motor can only be controlled as a bipolar. There are two coils, with the ends of each coil brought out. By applying current to the two coils in sequence, and changing the direction of current flow, the motor can be made to rotate.

Determining how to connect a 4 wire stepper to the 1063 can be done by following this procedure. Suppose we have four wires: red, green, yellow and blue.

Start by measuring the resistance between all the wires. Below is a sample table of resistance data, in ohms. This table contains example values, your readings may be different but should still produce a similar pattern.

1063 1 Motor Types 4wire.jpg
Wire Color Green Blue Yellow Red
Green 30
Blue
Yellow 30
Red


Looking at the table, you see that there are two pairs of wires (Green-Blue, and Yellow-Red), with roughly the same resistance measured between the wires in each pair. Pick one of the four wires and wire it to the A terminal. The other wire in this pair is connected to the B terminal. At random, wire the other pair to C and D. The motor will turn in clockwise or counter-clockwise rotation. Swapping the A and B wires or the C and D wires will change whether the motor considers “forward” to mean clockwise or counter-clockwise rotation (Remember, steppers can be run in forward or reverse by choosing a target position greater than or less than the current position).

6 Wire Stepper Motors

In a 6 – wire bipolar motor, there is two + wires, one for each coil, which are the center taps for each coil. You will need to isolate which are the center tap wires and the corresponding wires for their coil.

These center taps are left unconnected to operate as a bipolar. Let’s assume our six wire stepper motor wires are colored as follows: red, green, blue, white, purple, and yellow.

We measure the resistance between all wires and are presented with the following values in ohms (these are simply example values):


1062 1 Motor Types 6wire.jpg


Wire Color Red White Yellow Purple Green Blue
Red 10 10
White 10 10
Yellow 20
Purple
Green 20
Blue

Looking at our table, we can see our pattern. The red wire has the same resistance to the green and blue wires. The white wire has the same resistance to the yellow and purple wire. Red, green, and blue are for one pole, and white, yellow, and purple are the other pole. The red and white wires are the center of their coils. Leave the red/white wires unconnected, and follow the instructions for connecting a 4-Wire Bipolar Motor as described earlier in this section.

There are in fact two valid combinations, one that will produce a clockwise rotation in the stepper motor for increasing position and one that will produce counter-clockwise rotation. Swapping the A and B wires or the C and D wires will change whether the motor considers “forward” to mean clockwise or counter-clockwise rotation.

8 Wire Stepper Motors

8 Wire Motors are very difficult to wire up if you do not have a schematic showing how the wires are connected to the internal coils. Only follow these instructions if you are really desperate.

In an 8 wire motor, the coils are split, and we have to reconnect the coils, to reduce them to a 4 wire. Assume our eight wire stepper motor wires are colored as follows: red, yellow, purple, orange, blue, green, brown, and white. In an 8-wire stepper motor, these wires would be part of 4 coils, 2 wires per coil. We need to determine the cable pairings.

We measure the resistance between each wire and are presented with the following values in ohms (these are simply example values):


1062 1 Motor Types 8wire.jpg
Wire Color Orange Red Yellow Purple Blue Green Brown White
Orange 1
Red 1
Yellow 1
Purple 1
Blue
Green
Brown
White


This table tells us which wires are parts of a coil. From the table we can tell that red/green, yellow/brown, purple/white, and orange/blue are the coils. We are now left with the following situation; we need to determine the proper orientation of the wires to determine our connections. Of each pair, one of the wires will be assigned to A, B, C, or D, and the other wire will be connected to another pair. The number of combinations to be tried to see if they produce rotation is large, but can be reduced to a maximum of 96 possibilities by following these steps:

  1. Choose one wire from a pair to connect to A. (2 possibilities)
  2. Choose one wire of the other pairs (6 possibilities) and connect to B. The other wire from this pair is connected to the wire from Step 1 not connected to A.
  3. Choose one wire from the two remaining pairs (4 possibilities) and connect to C.
  4. Choose one wire from the remaining pair (2 possibilities) and connect to the wire from Step 3 not connected to C. The remaining wire from this pair is connected to D.
  5. After trying each permutation, engage the motor from software and try to rotate it. Do not connect the pairs to anything - as if you were using a 6-wire stepper in bipolar mode.

If you attempt to use this algorithm, build a table of permutations beforehand and proceed in a systematic way.

There are a total of 96 wiring combinations, of which there are 2 valid combinations where one will cause a clockwise motor rotation and the other will cause a counter-clockwise rotation.

If you are not using a Phidget stepper, we suggest consulting any manuals or data sheets that are associated with your particular motor in order to determine the proper wiring for your motor.

Choosing a Power Supply Voltage

When looking at a stepper motor's specifications, you may come across a "Rated Voltage" value. This value is usually equal to the rated current multiplied by the resistance of the coils of the motor, making it somewhat of a redundant specification. As mentioned earlier, you can increase your controller's supply voltage in order to allow the motor to reach higher speeds at a lower current (because high current causes high inductance which puts a hard limit on how much speed and torque a motor can produce). The motor will also produce more heat as you increase the supply voltage, so it's a good idea to choose a supply voltage based on the performance you need for the motor. Some motors will have a "Recommended Voltage" for a particular controller, which is the amount of voltage needed to reach the optimal speed and torque of the motor with minimal heating.

For more information about how supply voltage affects your motor's maximum speed and torque, check the Stepper Motor Primer.

Setting Current Limit

The 1063 allows the current applied to the motor to be programmatically set. This is important - if the current limit is set too high, the motor’s internal resistance will cause the sine-wave approximations used to implement microstepping to clip at the maximum current possible, given your motor/supply voltage. This clipping will cause rough operation, or prevent the motor from turning. If the limit is set too low, the motor may not be able to handle it’s load, by missing steps, or not turning at all at high accelerations.

1063 1 Current Limiting.jpg

How to determine CurrentLimit

  • Disconnect one coil from the Phidget and make sure your power supply is set at the voltage you will use in your application.
  • The CurrentLimit has to be less than the current limit of your motor, so start CurrentLimit at a small value.
  • Using our example, change the position until you find a maximum current.
  • Move up the current limit until the current feedback is not increasing.

This is your current limit. If you do not need so much torque, you can reduce the current limit to save power and reduce heating. If you need more current than the 1063 is specified to provide, you'll need to add some form of heat dissipation to the driver chip (A3979), in the form of a heatsink, air circulation, or both. The only problem with artificially increasing this limit through cooling is that you have no way of knowing how much further you can push the controller without some sort of temperature monitoring.

For more information about setting the current limit, check the Stepper Motor Primer.

Continuous Rotation

A stepper motor can be caused to rotate continuously by simply setting the motor position property to an extremely large number of steps. The valid range of values for the motor position property is large enough to be able to cause the motor to continuously turn at maximum velocity for 194 days.

Saving Power

Holding torque is the amount of torque required to rotate the motor ‘against it’s will’ when the full rated current is flowing through the coils. If current consumption / heating is a problem, and full holding torque is not required, the Current Limit can be decreased in software when the motor is not moving. Holding torque will decrease linearly with the Current Limit.

There is also a small resistance to movement within the motor even when there is no current, called Detent Torque. This may be sufficient to prevent rotation in your application, particularly if the stepper has a gearbox on it.

If the motor is not supporting a load or is not required to maintain a specific angle, it is recommended to set the Enable property to false. This will allow the motor shaft to rotate freely, but the present angle may be lost if forces on the motor-shaft are greater than can be resisted by the detent torque of the unpowered motor.

High Precision Applications

Stepper motor precision is limited by the manufacturing process used to build them. Errors in the rotor and coils will cause some degree of inaccuracy. In our experience, inexpensive stepper motors will often have positioning errors approaching a half-step. Gearing a stepper motor down with a gearbox will reduce this error proportional to the reduction ratio of the gearbox.

Synchronization of Multiple Motors

Many applications call for several steppers motors operating in unison - for example, operating a CNC table, or a robot arm. Highly precise synchronization of steppers using the PhidgetStepper is not possible, as the sequencing will be affected by the real-time performance of your operating system. Each stepper is controlled as a independent unit, so there is no way of arranging for a particular action to happen to all motors at the same time. Typical jitter can be 10-30mS.

Compatibility Guidelines

When looking for a motor that will be compatible with the 1063, check the motor's data sheet and make sure it meets the following specifications.

  • Bipolar motor - While the 1063 can control some six-wire unipolar motors, we recommend you look for bipolar stepper motors.
  • 4, 6, or 8-wire motor - A 5-wire motor cannot be used with the 1063, because the coils of the motor are connected internally.
  • Rated/Recommended Voltage - If the motor comes with a rated or recommended voltage, it should be no more than 30 volts, and you should use a power supply that can output that voltage.
  • Rated Current - The motor should be rated for a maximum of 1.5A per coil.

Troubleshooting

If your stepper motor is not behaving correctly, you can use a multimeter to determine whether it is the controller or the motor that is at fault.

Disconnect the motor and set the current limit to 0. Set the target position to 7 and measure the voltage difference between the A and B terminals it should be either -12, or +12V assuming you are using a 12V power supply (just depending on which terminal you have the positive multimeter lead connected to). Then set the target position to 8, the voltage should drop to 0, and it will go to the opposite at 9 (-12 or +12). This pattern will repeat for 39,40,41 and 71,72,73 and 103,104,105 etc... in increments of 32. If this is behaving as expected then the problem is probably with how you have connected your motor, or your code.

Further Reading

For more information about the digital inputs on the 1063, check the Digital Input Primer.

For more information about stepper motors, check the Stepper Motor and Controller Primer.

What to do Next

  • Programming Languages - Find your preferred programming language here and learn how to write your own code with Phidgets!
  • Phidget Programming Basics - Once you have set up Phidgets to work with your programming environment, we recommend you read our page on to learn the fundamentals of programming with Phidgets.