Phidgets 1063 Product Manual

Specifications

Brand: Phidgets
Category: Controller
Model: 1063 (Product Manual)
File Type: PDF
File Size: —
Pages: 21

Read Online

Read the Phidgets 1063 Product Manual online using the built-in PDF viewer.

Text of the manual

5 Product Features

5 Programming Environment 5 Connection 6 Getting Started 6 Checking the Contents 6 Connecting all the pieces 6 Testing Using Windows 2000/XP/Vista 6 Downloading the Phidgets drivers 6 Running Phidgets Sample Program 7 Testing Using Mac OS X 8 If you are using Linux 8 If you are using Windows Mobile/CE 5.0 or 6.0 9 Programming a Phidget 9 Architecture 9 Libraries 9 Programming Hints 9 Networking Phidgets 10 Documentation 10 Programming Manual 10 Getting Started Guides 10 API Guides 10 Code Samples 10 API for the PhidgetStepper Bipolar 1-Motor 10 Functions 12 Events 13 Technical Section 13 Introduction to Stepper Motors 13 How does the 1063 control Stepper Motors? 13 How to connect your Stepper to the 1063 13 Introduction 14 4 Wire Stepper Motors

Controlling Steppers - Open and Closed Loop

16 Choosing a power supply voltage 16 Figuring out your wattage / power supply current requirements 16 API Variables used to control your motor 16 Continuous Rotation 17 Disabling the PhidgetStepperBipolar 17 Starting the motor 17 High Precision Applications 17 Synchronization of multiple motors 18 Digital Inputs 18 Using the Digital Inputs 20 Functional Block Diagram 20 Digital Input Hardware Filter 20 Digital Input Sampling Characteristics 21� Device�Specifications 21 Product History 21 Support

1063_0_Product_Manual - October 27, 2010 2:54 PM

Product Features Controls the position, velocity, and acceleration of 1 bipolar stepper motor. •� •� Requires an external 9 to 30VDC power supply with center positive polarity Provides very precise positioning •� Can control larger industrial stepper motors •� Suitable for applications that need a lot of torque. •� •� Includes 4 digital inputs which can be used to convey the state of push buttons, limit switches, relays, logic levels, etc... Programming Environment Operating Systems: Windows 2000/XP/Vista/7, Windows CE, Linux, and Mac OS X Programming Languages (APIs): VB6, VB.NET, C#.NET, C++, Flash 9, Flex, Java, LabVIEW, Python, Max/MSP, and Cocoa. Examples: Many example applications for all the operating systems and development environments above are available for download at www.phidgets.com >> Programming. Connection The board connects directly to a computer’s USB port.

1063_0_Product_Manual - October 27, 2010 2:54 PM

Connect the motor to the PhidgetStepper board. 1. If�you�are�having�difficulty�connecting�� your motor, refer to the technical section on page 8. Connect the power supply to the board using 2. the barrel connector. Power supplies with higher current (more than 3. 2.5 Amps) should be wired directly to the terminal block. Connect one end of the piece of wire to digital 4. input port 0 and the other end to the ground connector. Connect the PhidgetStepper board to your PC 5. using the USB cable. 2 1 4 5 3 Getting Started Checking the Contents In order to test your new Phidget you will also need: •� A 9 to 30V DC Power Supply with center positive polarity* A bipolar stepper motor •� •� A length of wire * When using a power supply with a barrel connector, make sure that your power supply has center positive polarity. You should have received: •� A PhidgetStepperBipolar 1-Motor Controller Board A USB Cable •� Connecting all the pieces Testing Using Windows 2000/XP/Vista Downloading the Phidgets drivers Make sure that you have the current version of the Phidget library installed on your PC. If you don’t, do the following: Go to www.phidgets.com >> Drivers Download and run Phidget21 Installer (32-bit, or 64-bit, depending on your PC) You should see the icon on the right hand corner of the Task Bar. Running Phidgets Sample Program Double clicking on the icon loads the Phidget Control Panel; we will use this program to make sure that your new Phidget works properly. The source code for the Stepper-Full sample program can be found under C# by clicking on Phidget.com > Programming.

1063_0_Product_Manual - October 27, 2010 2:54 PM

Double Click on the icon to activate the Phidget Control Panel and make sure that Phidget Bipolar Stepper Controller 1-Motor is properly attached to your PC. 1. 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. 2. Move the Target Position slider to the right or the left. The target 3. 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 4. motor will accelerate until the Actual velocity is equal to the Velocity Limit. Use the Acceleration slider to increase or decrease the 5. acceleration. Use the Current Limit slider to modify the current going through 6. the motor and affect torque. When the motor has reached the position target, a tick mark will 7. appear in the Stopped box. Move the Current Position slider to change the position the device 8. is currently at. To test the Digital input, connect a wire between the digital input 9. port 0 and the ground connector. The check mark in the Input 0 box should appear. 1 8 7 3 2 4 5 6 9 Testing Using Mac OS X Click on System Preferences >> Phidgets (under Other) to activate the Preference Pane •� •� Make sure that the Phidget Bipolar Stepper Controller 1-Motor is properly attached. •� Double Click on Phidget Bipolar Stepper Controller 1-Motor in the Phidget Preference Pane to bring up the Stepper-Full example. This example will function in a similar way as the Windows version, but note that it does not include an Advanced Sensor Display.

1063_0_Product_Manual - October 27, 2010 2:54 PM

If you are using Linux There are no sample programs written for Linux. Go to www.phidgets.com >> Drivers Download Linux Source Have�a�look�at�the�readme�file� •� Build Phidget21 •� The most popular programming languages in Linux are C/C++ and Java. Notes: Many Linux systems are now built with unsupported third party drivers. It may be necessary to uninstall these drivers for our libraries to work properly. Phidget21 for Linux is a user-space library. Applications typically have to be run as root, or udev/hotplug must be configured�to�give�permissions�when�the�Phidget�is�plugged�in. If you are using Windows Mobile/CE 5.0 or 6.0 Go to www.phidgets.com >> Drivers Download x86, ARMV4I or MIPSII, depending on the platform you are using. Mini-itx and ICOP systems will be x86, and most mobile devices, including XScale based systems will run the ARMV4I. The�CE�libraries�are�distributed�in�.CAB�format.��Windows�Mobile/CE�is�able�to�directly�install�.CAB�files. The most popular languages are C/C++, .NET Compact Framework (VB.NET and C#). A desktop version of Visual Studio�can�usually�be�configured�to�target�your�Windows�Mobile�Platform,�whether�you�are�compiling�to�machine� code or the .NET Compact Framework.

1063_0_Product_Manual - October 27, 2010 2:54 PM

Programming a Phidget Phidgets’ philosophy is that you do not have to be an electrical engineer in order to do projects that use devices like sensors, motors, motor controllers, and interface boards. All you need to know is how to program. We have developed a complete set of Application Programming Interfaces (API) that are supported for Windows, Mac OS X, and Linux. When it comes to languages, we support VB6, VB.NET, C#.NET, C, C++, Flash 9, Flex, Java, LabVIEW, Python, Max/MSP, and Cocoa. Architecture We have designed our libraries to give you the maximum amount of freedom. We do not impose our own programming model on you. To achieve this goal we have implemented the libraries as a series of layers with the C API at the core surrounded by other language wrappers. Libraries The lowest level library is the C API. The C API can be programmed against on Windows, CE, OS X and Linux. With the C API, C/C++, you can write cross-platform code. For systems with minimal resources (small computers), the C API may be the only choice. The Java API is built into the C API Library. Java, by default is cross-platform - but your particular platform may not support it (CE). The .NET API also relies on the C API. Our default .NET API is for .NET 2.0 Framework, but we also have .NET libraries for .NET 1.1 and .NET Compact Framework (CE). The COM API relies on the C API. The COM API is programmed against when coding in VB6, VBScript, Excel (VBA), Delphi and Labview. The ActionScript 3.0 Library relies on a communication link with a PhidgetWebService (see below). ActionScript 3.0 is used in Flex and Flash 9. Programming Hints •� Every Phidget has a unique serial number - this allows you to sort out which device is which at runtime. Unlike USB devices which model themselves as a COM port, you don’t have to worry about where in the USB bus you plug your Phidget in. If you have more than one Phidget, even of the same type, their serial numbers enable you to sort them out at runtime. •� Each�Phidget�you�have�plugged�in�is�controlled�from�your�application�using�an�object/handle�specific�to�that� phidget. This link between the Phidget and the software object is created when you call the .OPEN group of commands. This association will stay, even if the Phidget is disconnected/reattached, until .CLOSE is called. •� For full performance, the Phidget APIs are designed to be used in an event driven architecture. Applications that require receiving all the data streaming from the device will have to use event handlers, instead of polling. Networking Phidgets The PhidgetWebService is an application written by Phidgets Inc. which acts as a network proxy on a computer. The PhidgetWebService will allow other computers on the network to communicate with the Phidgets connected to that computer. ALL of our APIs have the capability to communicate with Phidgets on another computer that has the PhidgetWebService running. The PhidgetWebService also makes it possible to communicate with other applications that you wrote and that are connected to the PhidgetWebService, through the PhidgetDictionary object.

1063_0_Product_Manual - October 27, 2010 2:54 PM

Documentation Programming Manual The Phidget Programming Manual documents the Phidgets software programming model in a language and device unspecific�way,�providing�a�general�overview�of�the�Phidgets�API�as�a�whole.��You�can�find�the�manual�at�www. phidgets.com >> Programming. Getting Started Guides We have written Getting Started Guides for most of the languages that we support. If the manual exists for the language�you�want�to�use,�this�is�the�first�manual�you�want�to��read.�The�Guides�can�be�found�at�www.phidgets.com >> Programming, and are listed under the appropriate language. API Guides We maintain API references for COM (Windows), C (Windows/Mac OSX/Linux), Action Script, .Net and Java. These references document the API calls that are common to all Phidgets. These API References can be found under www. phidgets.com >> Programming�and�are�listed�under�the�appropriate�language.�To�look�at�the�API�calls�for�a�specific� Phidget, check its Product Manual. Code Samples We have written sample programs to illustrate how the APIs are used. Due to the large number of languages and devices we support, we cannot provide examples in every language for every Phidget. Some of the examples are very minimal, and other examples will have a full-featured GUI allowing all the functionality of the device to be explored. Most developers start by modifying existing examples until they have an understanding of the architecture. Go to www.phidgets.com >> Programming to see if there are code samples written for your device. Find the language you want to use and click on the magnifying glass besides “Code Sample”. You will get a list of all the devices for which we wrote code samples in that language. API for the PhidgetStepper Bipolar 1-Motor We�document�API�Calls�specific�to�this�product�in�this�section.�Functions�common�to�all�Phidgets�and�functions�not� applicable to this device are not covered here. This section is deliberately generic. For calling conventions under a specific�language,�refer�to�the�associated�API�manual.�For�exact�values,�refer�to�the�device�specifications. Functions 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. double Acceleration(int MotorIndex) [get,set] Acceleration is the maximum change in velocity the PhidgetStepper uses when speeding up or slowing down the motor.��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).

1063_0_Product_Manual - October 27, 2010 2:54 PM

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. 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. 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. 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). 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. 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. 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. 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. 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. int64 PositionMin(int MotorIndex) [get] : Constant MotorPositionMin is the minimum MotorPosition the 1063 can move your motors toward.

1063_0_Product_Manual - October 27, 2010 2:54 PM

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 = True. 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. 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. 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. •� 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. 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. int InputCount() [get] Returns the number of Digital Inputs available on this PhidgetStepper. In the case of the 1063, there are 4 Digital Inputs. 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 InputChange(int InputIndex, bool State) [event] Designates an event handler to run whenever a digital input changes state. CurrentChange(int MotorIndex, bool State) [event] Designates an event handler to run whenever the current through a stepper changes. VelocityChange(int MotorIndex, double Velocity) [event] Designates an event handler to run whenever the velocity changes on a motor. 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.

1063_0_Product_Manual - October 27, 2010 2:54 PM

Introduction to Stepper Motors Stepper motors are broadly available motors commonly used for positioning. DC Motors are controlled by simply applying power which sends them blindly spinning. Steppers Motors are controlled in a series of discrete steps, allowing them to be sent to a very precise position. By repeating the set of steps over and over, the motor can be made to rotate while your system tracks the position. Some steppers will require hundreds of steps to do a full rotation, while others, like the air core motor, can do a full rotation with only 4 steps. The vast majority of steppers are built using two coils of wire, whose magnetism pulls or repels a rotating magnet attached to an exposed shaft. Depending on how these two coils are available to wire up, we get 4, 5, 6 or 8 wire 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 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. The relationship between maximum motor voltage, coil resistance, maximum current, and power supply voltage is not intuitive. Under most circumstances, the 1063 controls these parameters automatically. The 1063 PhidgetStepper is different from many familiar stepper controllers. Many stepper controllers rely on the resistance of the coils of wire inside the stepper motor to control the amount of current. In fact, the 1062 PhidgetStepper uses this simpler (and cheaper) method. The 1063 uses high speed electronics and the magnetic field�within�the�motor�coils�to�control�the�current,�effectively�reducing�the�voltage�to�what�is�required�for�your�motor. The PhidgetStepper Bipolar can be used with smaller steppers that are designed to limit current through their own coil resistance. Special attention must be paid to the CurrentLimit property set in software. The�PhidgetStepper�Bipolar�uses�constant�current�control�to�control�the�power�flowing�through�the�motor�coils.�� The constant current is implemented by allowing the current in the coil to ramp up until it reaches a setpoint, then turning off the coil, allowing the current to recirculate and gradually reduce. The coils being rapidly turned on/off produces a slightly audible whine. 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. How to connect your Stepper to the 1063 Introduction 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. Technical Section

1063_0_Product_Manual - October 27, 2010 2:54 PM

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. 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. Looking at the table, you see that there are two pairs of wires (Green-White, and Brown-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. To switch between clockwise and counter-clockwise rotation, simply swap the A and B or the C and D wires. 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, black, white, brown, and yellow. We measure the resistance between all wires and are presented with the following values in ohms (these are simply example values) : Looking at our table, we can see our pattern. The red wire has the same resistance to the brown and yellow wires. The green wire has the same resistance to the black and white wire. Red, brown, and yellow are for one pole, and green, black, and white are the other pole. The red and green wires are the center of their coils. Leave the red/green wires unconnected, and follow the instructions for connecting a 4-Wire Bipolar Motor. There are in fact two valid combinations, one that will produce a clockwise rotation in the stepper motor for increasing position and one to produce counter-clockwise rotation. In order to reverse this rotation, simply swap the (A, B) wire pair and the (C, D) wire pair. Green White Brown Red Green 30 ∞ ∞ White ∞ ∞ Brown 30 Red A B C D 4 wire motor 6 wire motor + A B C D + Red Green Black White Brown Yellow Red ∞ ∞ ∞ 10 10 Green 10 10 ∞ ∞ Black 20 ∞ ∞ White ∞ ∞ Brown 20 Yellow

1063_0_Product_Manual - October 27, 2010 2:54 PM

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, black, 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): This table tells us which wires are parts of a coil. From the table we can tell that red/blue, yellow/green, black/ brown, and orange/white 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: Choose Red/Blue to connect to A. (2 possibilities) 1. Choose one wire of the other pairs (6 possibilities) and connect to B. The other wire from this pair is connected 2. to the wire from Step 1 not connected to A. Choose one wire from the two remaining pairs (4 possibilities) and connect to C. 3. Choose one wire from the remaining pair (2 possibilities) and connect to the wire from Step 3 not connected to 4. C. The remaining wire from this pair is connected to D. After trying each permutation, engage the motor from software and try to rotate it. Do not connect the pairs to 5. 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. Controlling Steppers - Open and Closed Loop 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. 8 wire motor + + A B C D Red Yellow Black Orange Blue Green Brown White Red ∞ ∞ ∞ 1 ∞ ∞ ∞ Yellow ∞ ∞ ∞� 1 ∞ ∞ Black ∞ ∞ ∞ 1 ∞ Orange ∞ ∞ ∞ 1 Blue ∞ ∞ ∞ Green ∞ ∞ Brown ∞ White

1063_0_Product_Manual - October 27, 2010 2:54 PM

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. 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). Figuring out your wattage / power supply current requirements The maximum power is when one coil is being driven at 100%. Calculate power = (2 Amps)^2 * 4.5 Ohms = 18 Watts. It’s good practice to not run your power supplies at 100% capacity, so budget at least 18 watts * 125% = 23 watts for this setup. You can calculate the current requirement of your power supply by Current = Required Watts / Power Supply Voltage. We assume a 24 VDC power supply, so 23/24 = 0.96 Amps. Your power supply should be able to provide at least 0.96 Amps. API Variables used to control your motor To�use�a�stepper�motor,�first�select�(in�software)�which�motor�the�PhidgetStepperBipolar�should�affect.��Step� position, maximum velocity, acceleration ramping, and torque/current can be controlled for each motor in both directions: Step position is controlled in a graduating scale dependant upon the speed of the motor •� Up to 1016 1/16th steps/second, shaft angle is affected in 1/16th step increments •� 1024 1/16th steps/second and higher, shaft angle is affected in full step increments •� The position property always contains a count of 1/16th steps •� Maximum velocity is controlled in 1/16th steps/second up to 32768 1/16th steps/second •� Acceleration/deceleration is controlled in 1/16th steps/second •� 2 up to 1020000 1/16th steps/second2 Current limit is varied between 0 and ~2.5A and is directly proportional to the maximum current through •� the motor up to 2.5 Amps Effects of 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. 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. 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.

1063_0_Product_Manual - October 27, 2010 2:54 PM

Disabling the PhidgetStepperBipolar When the stepper motor has rotated the requested number of steps, and is stopped, the coils will remain energized to hold it in position. This is necessary to allow the motor to support a load on its shaft without rotating to an unknown position. The amount of current required to hold a motor shaft in place is called the holding current, and is based mainly on the resistance of the motor coils and the load being supported by the motor. The current required to produce the holding torque can often be large enough to cause the motor to generate heat from the power dissipated in the coils.��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 iforces on the motor-shaft are greater than can be resisted by the detent torque of the unpowered motor. It is also possible to reduce the CurrentLimit in software, to retain some holding torque while consuming less power. Starting the motor 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. 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. 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. time 100% DC current (Amps) 2.5A 0A time 100% 2.5A 0A current limit of coil def ned curr ent lim it resu ltin g co il c urr ent

1063_0_Product_Manual - October 27, 2010 2:54 PM

Digital Inputs Using the Digital Inputs Here are some circuit diagrams that illustrate how to connect various devices to the digital inputs on your Phidget. Wiring a switch to a Digital Input Closing the switch causes the digital input to report TRUE. Monitoring the position of a relay The relay contact can be treated as a switch, and wired up similarly. When the relay contact is closed, the Digital Input will report TRUE. Detecting an external Voltage with an N-Channel MOSFET A MOSFET can be used to detect the presence of an external voltage. The external voltage will turn on the MOSFET, causing it to short the Digital Input to Ground. If the MOSFET is conducting > 280µA, the Digital Input is guaranteed to report TRUE. If the MOSFET is conducting < 190µA, the Digital Input is guaranteed to report FALSE. The voltage level required to turn on the MOSFET depends on the make of of MOSFET you are using. Typical values are 2V-6V. INPUT GROUND USER SWITCH W iring a switch to a Digital Input APPLICATION Phidget Digital Input Closing switch causes digital input to report TRUE Detecting an external Voltage with an N-Channe 1K R1 Drain-Source Current > 270uA causes Digital Input to Drain-Source Current < 67uA guarantees Digital Input The resistor on the Gate is not required f or it to function Be sure not to exceed VGS of the mosfet. Actual Voltage Required to switch is dependent on VG USER APPLICATION VS1 Q1 INPUT GROUND Phidget Digital Input 100nF 15K 15K +5V +5V NPUT ROUND Phidget Digital Input x1 Monitoring the position of a Relay K 1 Isolating a Digital Input with an Optocoupler Detail of Digital Input USER APPLICATION Relay contact causes Digital Input to report TRUE Current through LED causes Digital Input to rep Using an FSR as a switch FSR Resistance f alling below 3.75k Ohms causes Digit FSR Resistance rising above 75k Ohms causes Digital I This design can be used with any variable resistance se Detecting an external Voltage with an NPN Transistor Collector-Emitter Current > 270uA causes Digital Input to report TRUE Collector-Emitter Current < 67uA guarantees Digital Input to report FALSE E TRUE good idea. Drain-Source Current > 270uA causes Digital Input to Drain-Source Current < 67uA guarantees Digital Input to turn on M OSFET USER APPLICATION 1K R1 VS1 U1 OptoCoupler IN GROU Ph Dig In INPUT GROUND Phidget Digital Input IN GR INPUT GROUND USER SWITCH W iring a switch to a Digital Input APPLICATION Phidget Digital Input Closing switch causes digital input to report TRUE Detecting an external Voltage with an N-Channel MOSFET 1K R1 Drain-Source Current > 270uA causes Digital Input to report TRUE Drain-Source Current < 67uA guarantees Digital Input to report TR The resistor on the Gate is not required f or it to function, but is a g Be sure not to exceed VGS of the mosfet. Actual Voltage Required to switch is dependent on VGS required t USER APPLICATION VS1 Q1 INPUT GROUND Phidget Digital Input

1063_0_Product_Manual - October 27, 2010 2:54 PM

Isolating a Digital Input with an Optocoupler When driving current through the LED, the Digital Input will report TRUE. The amount of current required will depend on the optocoupler used. Design to sink at least 280µA to cause the digital input to report TRUE, and less than 190µA to report FALSE. Detecting an external Voltage with an NPN Transistor This circuit can be used to measure if a battery is connected, or if 12V (for example) is on a wire. By designing to have Collector-Emitter current > 280µA, the digital input will report TRUE. Using a Capacitive or Inductive Proximity Switch Capacitive proximity switches can detect the presence of nearby non-metallic objects, whereas inductive proximity switches can detect only the presence of metallic objects. To properly interface one of these proximity switches to the digital inputs, a 3-wire proximity switch is required, as well as an external power supply. We have checked the following switch from Automation Direct to verify that it works with the Digital Inputs. Similar capacitive or inductive proximity switches from other manufacturers should work just as well. Manufacturer Web Page Capacitive Part No Inductive Part No Automation Direct www.automationdirect.com CT1 Series AM1 Series FSR Current through LED causes Digital Input to report TRUE USER Using an FSR as a switch APPLICATION FSR Resistance f alling below 3.75k Ohms causes Digital Input to go TRUE FSR Resistance rising above 75k Ohms causes Digital Input to go FALSE This design can be used with any variable resistance sensor - CDS Photocells Q1 Detecting an external Voltage with an NPN Transistor Collector-Emitter Current > 270uA causes Digital Input to report TRUE Collector-Emitter Current < 67uA guarantees Digital Input to report FALSE Drain-Source Current > 270uA causes Digital Input to report TRUE Drain-Source Current < 67uA guarantees Digital Input to report TRUE USER APPLICATION USER APPLICATION 10K R1 VS1 1K R1 VS1 U1 OptoCoupler INPUT GROUND Phidget Digital Input INPUT GROUND Phidget Digital Input INPUT GROUND Phidget Digital Input Q1 Detecting an external Voltage with an NPN Transistor Collector-Emitter Current > 270uA causes Digital Input to report TRU Collector-Emitter Current < 67uA guarantees Digital Input to report F 1K R1 USER APPLICATION VS1 10K R1 VS1 Q1 INPUT GROUND Input INPUT GROUND Phidget Digital Input 100nF 15K 15K +5V +5V INPUT GROUND INPUT GROUND USER SWITCH W iring a switch to a Digital Input Phidget Digital Input x1 APPLICATION Phidget Digital Input Closing switch causes digital input to report TRUE Detail of Digital Input Q1 Detecting an external Voltage with an NPN Transistor Collector-Emitter Current > 270uA causes Digital Input to report TRUE Collector-Emitter Current < 67uA guarantees Digital Input to report FALSE Detecting an external Voltage with an N-Channel MOSFET 1K R1 Drain-Source Current > 270uA causes Digital Input to report TRUE Drain-Source Current < 67uA guarantees Digital Input to report TRUE The resistor on the Gate is not required f or it to function, but is a good idea. Be sure not to exceed VGS of the mosfet. Actual Voltage Required to switch is dependent on VGS required to turn on M OSFET USER APPLICATION USER APPLICATION VS1 10K R1 VS1 Q1 INPUT GROUND Phidget Digital Input INPUT GROUND Phidget Digital Input USER APPLICATION INPUT GROUND Phidget Digital Input Q1 +10-30V Connecting a 3-wire Capacitive or Inductive Proximity Switch Proximity Switch

1063_0_Product_Manual - October 27, 2010 2:54 PM

Using an FSR or other variable resistor as a switch The digital inputs can be easily wired to use many variable resistors as switches. If the resistance falls below 2.8k Ohms, the Digital Input will go TRUE. If the resistance rises above 11k Ohms, the Digital Input will go FALSE. Functional Block Diagram The digital inputs have a built in 15K pull-up resistor. By connecting external circuitry, and forcing the input to Ground, the Digital Input in software will read as TRUE. The default state is FALSE - when you have nothing connected, or your circuitry (switch, etc) is not pulling the input to ground. Digital Input Hardware Filter There�is�built-in�filtering�on�the�digital�input,�to�eliminate�false�triggering�from�electrical�noise.��The�digital�input�is� first�RC�filtered�by�a�15K/100nF�node,�which�will�reject�noise�of�higher�frequency�than�1Khz.��This�filter�generally� eliminates the need to shield the digital input from inductive and capacitive coupling likely to occur in wiring harnesses. Digital Input Sampling Characteristics The state of the digital inputs are reported back to the PC periodically. During this sampling period, if a digital input was true for greater than 4.0ms, the digital input is guaranteed to be reported as true in software. This makes the digital input much more sensitive to reporting TRUE state, and makes it useful to watch for short events. Any Digital Input True events of less than 1.5ms are never reported. FSR USER APPLICATION FSR Resistance rising above 75k Ohms causes Digital Input This design can be used with any variable resistance sensor Q1 Collector-Emitter Current > 270uA causes Digital Input to report TRUE Collector-Emitter Current < 67uA guarantees Digital Input to report FALSE USER APPLICATION 10K R1 VS1 INPUT GROUND Phidget Digital Input INPUT GROUND Phidget Digital Input 100nF 15K 15K +5V +5V INPUT GROUND INPUT GROUND USER SWITCH W iring a switch to a Digital Input Phidget Digital Input x1 APPLICATION Phidget Digital Input Closing switch causes digital input to report TRUE Detail of Digital Input Detecting an external V Collector-Emitter Current > 270 Collector-Emitter Current < 67u Detecting an external Voltage with an N-Channel MOSFET 1K R1 Drain-Source Current > 270uA causes Digital Input to report TRUE Drain-Source Current < 67uA guarantees Digital Input to report TRUE The resistor on the Gate is not required f or it to function, but is a good idea. Be sure not to exceed VGS of the mosfet. Actual Voltage Required to switch is dependent on VGS required to turn on M OSFET USER APPLICATION USER APPLICATIO VS1 Q1 INPUT GROUND Phidget Digital Input

1063_0_Product_Manual - October 27, 2010 2:54 PM

Device Specifications Characteristic Value Position Resolution 1/16th step (40-bit signed) Maximum Position Limit 239 - 1 1/16th steps (40-bit signed) Minimum Position Limit -(239 -1) 1/16th steps Velocity Resolution 8 1/16th steps/second (12-bit) Velocity Limit 32,768 1/16th steps/second Acceleration Resolution 4,000 1/16th steps/second2 (8-bit) Acceleration Minimum 4,000 1/16th steps/second2 Acceleration Limit 1,020,000 1/16th steps/second2 Maximum Top End Torque 1,000 oz/in @ 2.5 amps Digital Input Update Rate ~125 samples/second Digital Input Pull-Up Resistance 15K ohms Digital Input Recommended Wire Size 16 - 26 AWG Minimum Power Supply Voltage 9V Maximum Power Supply Voltage 30V Max Current Per Coil 2.5A USB-Power�Current�Specification 100mA Product History Date Board Revision Device Version Comment January 2009 0 Product Release Support Call the support desk at 1.403.282.7335 9:00 AM to 5:00 PM Mountain Time (US & Canada) - GMT-07:00 or E-mail us at: [email protected]

Other Controller Manuals