0 evaluări0% au considerat acest document util (0 voturi)
60 vizualizări21 pagini
Phidgets 1063 - PhidgetStepper Bipolar 1-Motor - Product Manual for board Revision 1 (c) 2012 Contents 5 Product Features 5 Programming Environment 5 Connection 6 Getting Started 6 Checking the Contents 6 Running the sample program 7 Testing using Linux 8 If you are using Windows Mobile / CE 5. Or 6. 9 Programming a Phidget 9 Architecture 9 Libraries 9 Programming Hints 9 Networking Phidget 10 Documentation 10 Programming Manual 10 Getting Star
Phidgets 1063 - PhidgetStepper Bipolar 1-Motor - Product Manual for board Revision 1 (c) 2012 Contents 5 Product Features 5 Programming Environment 5 Connection 6 Getting Started 6 Checking the Contents 6 Running the sample program 7 Testing using Linux 8 If you are using Windows Mobile / CE 5. Or 6. 9 Programming a Phidget 9 Architecture 9 Libraries 9 Programming Hints 9 Networking Phidget 10 Documentation 10 Programming Manual 10 Getting Star
Phidgets 1063 - PhidgetStepper Bipolar 1-Motor - Product Manual for board Revision 1 (c) 2012 Contents 5 Product Features 5 Programming Environment 5 Connection 6 Getting Started 6 Checking the Contents 6 Running the sample program 7 Testing using Linux 8 If you are using Windows Mobile / CE 5. Or 6. 9 Programming a Phidget 9 Architecture 9 Libraries 9 Programming Hints 9 Networking Phidget 10 Documentation 10 Programming Manual 10 Getting Star
Phidgets 1063 - Product Manual For Board Revision 1 Phidgets Inc. 2012 Contents 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/7 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 15 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 17 Continuous Rotation 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 Product History 21 Support 5 1063_1_Product_Manual - July 18, 2012 10:21 AM 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... Digital Input terminal block exposes +5V of USB power for application use. Power/Motor terminal blocks accept 12-24AWG wires. 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 computers USB port. 6 1063_1_Product_Manual - July 18, 2012 10:21 AM Connect the motor to the PhidgetStepper board. 1. If you are having diffculty connecting your motor, refer to the technical section. 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 Mini-USB Cable Connecting all the pieces Testing Using Windows 2000/XP/Vista/7 Downloading the Phidgets drivers Make sure that you have the current version of the Phidget library installed on your PC. If you dont, 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. 7 1063_1_Product_Manual - July 18, 2012 10:21 AM 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. Double Click on 1. 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. 8 1063_1_Product_Manual - July 18, 2012 10:21 AM 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 fle Build Phidget21 There is no Control Panel written for Linux, but there are C/C++ and Java code samples available for all Phidgets which will compile and run on Linux without modifcation. 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 confgured 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 fles. The most popular languages are C/C++, .NET Compact Framework (VB.NET and C#). A desktop version of Visual Studio can usually be confgured to target your Windows Mobile Platform, whether you are compiling to machine code or the .NET Compact Framework. 9 1063_1_Product_Manual - July 18, 2012 10:21 AM 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 dont 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 specifc 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. 10 1063_1_Product_Manual - July 18, 2012 10:21 AM Documentation Programming Manual The Phidget Programming Manual documents the Phidgets software programming model in a language and device unspecifc way, providing a general overview of the Phidgets API as a whole. You can fnd 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 frst 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 specifc 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 specifc 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 specifc language, refer to the associated API manual. For exact values, refer to the device specifcations. 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 specifed 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). 11 1063_1_Product_Manual - July 18, 2012 10:21 AM 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). 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. 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 undefned 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. 12 1063_1_Product_Manual - July 18, 2012 10:21 AM 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 its 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 foating, 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. 13 1063_1_Product_Manual - July 18, 2012 10:21 AM 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. Stepper motors can be run in forward or reverse by telling them to spin to a target position that is greater than or less than the current position, respectively. 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 specifcations of these motors are often confusing and may seem contradictory. Our users are often confused attempting to relate the specifcations of their motor to the capabilities of the 1063. If you are in doubt if your motor will work with the 1063, call us. 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. Its 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 foating 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. How to connect your Stepper to the 1063 Introduction Bipolar Steppers motors are available in 4, 6 or 8 wire confgurations. Driving a motor in the Bipolar Confguration Technical Section 14 1063_1_Product_Manual - July 18, 2012 10:21 AM produces maximum torque. The word Bipolar means that the controlling electronics have to be able to produce a current fow in either direction in each coil, to produce magnetic felds 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 fow, 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. 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. Lets 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) : 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. 6 wire motor + A B C D + Red White Yellow Purple Green Blue Red 10 10 White 10 10 Yellow 20 Purple Green 20 Blue Green Blue Yellow Red Green 30 Blue Yellow 30 Red A B C D 4 wire motor 15 1063_1_Product_Manual - July 18, 2012 10:21 AM 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 diffcult 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): 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: Choose one wire from a pair 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. 8 wire motor + + A B C D Red Yellow White Blue Green Brown Purple Orange Red 1 Yellow 1 White 1 Blue 1 Green Brown Purple Orange 16 1063_1_Product_Manual - July 18, 2012 10:21 AM 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 fre 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. 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, fnd 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 specifcation - 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. Its 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, frst 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/second 2 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 motors 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 its 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 fnd a maximum current. Move up the current limit until the current feedback is not increasing. 17 1063_1_Product_Manual - July 18, 2012 10:21 AM 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. Disabling the motor or reducing current when the motor is not moving Holding torque is the amount of torque required to rotate the motor against its will when the full rated current is fowing 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 suffcient 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 specifc 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. Starting the motor When the steppers are frst 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% D C
c u r r e n t
( A m p s ) 2.5A 0A time 100% 2.5A 0A current limit of coil d e f n e d
c u r r e n t
l i m i t r e s u l t i n g
c o i l
c u r r e n t 18 1063_1_Product_Manual - July 18, 2012 10:21 AM 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 > 280A, the Digital Input is guaranteed to report TRUE. If the MOSFET is conducting < 190A, 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. 100nF 15K 15K +5V +5V INPUT GROUND INPUT GROUND USER S W I T C H Wiring a switch to a Digital Input Phidget Digital Input x1 APPLICATION Monitoring the position ofa Relay K1 FSR Isolating a Digital Input with an Optocoupler Phidget Digital Input Closing switch causes digital input to report TRUE Detail of Digital Input USER APPLICATION Relay contact causes Digital Input to report TRUE 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 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 f unction, but is a good idea. Be sure not to exceed VGS of the mosf et. Drain-Source Current > 270uA causes Digital Input to report TRUE Drain-Source Current < 67uA guarantees Digital Input to report TRUE Actual Voltage Required to switch is dependent on VGS required to turn on M OSFET USER APPLICATION USER APPLICATION USER APPLICATION VS1 10K R1 VS1 1K R1 VS1 U1 OptoCoupler Q1 INPUT GROUND Phidget Digital Input INPUT GROUND Phidget Digital Input INPUT GROUND Phidget Digital Input INPUT GROUND Phidget Digital Input INPUT GROUND Phidget Digital Input 100nF 15K 15K +5V +5V INPUT GROUND INPUT GROUND USER S W I T C H Wiring a switch to a Digital Input Phidget Digital Input x1 APPLICATION Monitoring the position ofa Relay K1 FSR Isolating a Digital Input with an Optocoupler Phidget Digital Input Closing switch causes digital input to report TRUE Detail of Digital Input USER APPLICATION Relay contact causes Digital Input to report TRUE 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 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 f unction, but is a good idea. Be sure not to exceed VGS of the mosf et. Drain-Source Current > 270uA causes Digital Input to report TRUE Drain-Source Current < 67uA guarantees Digital Input to report TRUE Actual Voltage Required to switch is dependent on VGS required to turn on M OSFET USER APPLICATION USER APPLICATION USER APPLICATION VS1 10K R1 VS1 1K R1 VS1 U1 OptoCoupler Q1 INPUT GROUND Phidget Digital Input INPUT GROUND Phidget Digital Input INPUT GROUND Phidget Digital Input INPUT GROUND Phidget Digital Input INPUT GROUND Phidget Digital Input 100nF 15K 15K +5V +5V INPUT GROUND INPUT GROUND USER S W I T C H Wiring a switch to a Digital Input Phidget Digital Input x1 APPLICATION Monitoring the position ofa Relay K1 FSR Isolating a Digital Input with an Optocoupler Phidget Digital Input Closing switch causes digital input to report TRUE Detail of Digital Input USER APPLICATION Relay contact causes Digital Input to report TRUE 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 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 f unction, but is a good idea. Be sure not to exceed VGS of the mosf et. Drain-Source Current > 270uA causes Digital Input to report TRUE Drain-Source Current < 67uA guarantees Digital Input to report TRUE Actual Voltage Required to switch is dependent on VGS required to turn on M OSFET USER APPLICATION USER APPLICATION USER APPLICATION VS1 10K R1 VS1 1K R1 VS1 U1 OptoCoupler Q1 INPUT GROUND Phidget Digital Input INPUT GROUND Phidget Digital Input INPUT GROUND Phidget Digital Input INPUT GROUND Phidget Digital Input INPUT GROUND Phidget Digital Input 19 1063_1_Product_Manual - July 18, 2012 10:21 AM 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 280A to cause the digital input to report TRUE, and less than 190A 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 > 280A, 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 100nF 15K 15K +5V +5V INPUT GROUND INPUT GROUND USER S W I T C H Wiring a switch to a Digital Input Phidget Digital Input x1 APPLICATION Monitoring the position ofa Relay K1 FSR Isolating a Digital Input with an Optocoupler Phidget Digital Input Closing switch causes digital input to report TRUE Detail of Digital Input USER APPLICATION Relay contact causes Digital Input to report TRUE 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 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 f unction, but is a good idea. Be sure not to exceed VGS of the mosf et. Drain-Source Current > 270uA causes Digital Input to report TRUE Drain-Source Current < 67uA guarantees Digital Input to report TRUE Actual Voltage Required to switch is dependent on VGS required to turn on M OSFET USER APPLICATION USER APPLICATION USER APPLICATION VS1 10K R1 VS1 1K R1 VS1 U1 OptoCoupler Q1 INPUT GROUND Phidget Digital Input INPUT GROUND Phidget Digital Input INPUT GROUND Phidget Digital Input INPUT GROUND Phidget Digital Input INPUT GROUND Phidget Digital Input 100nF 15K 15K +5V +5V INPUT GROUND INPUT GROUND USER S W I T C H Wiring a switch to a Digital Input Phidget Digital Input x1 APPLICATION Monitoring the position ofa Relay K1 FSR Isolating a Digital Input with an Optocoupler Phidget Digital Input Closing switch causes digital input to report TRUE Detail of Digital Input USER APPLICATION Relay contact causes Digital Input to report TRUE 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 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 f unction, but is a good idea. Be sure not to exceed VGS of the mosf et. Drain-Source Current > 270uA causes Digital Input to report TRUE Drain-Source Current < 67uA guarantees Digital Input to report TRUE Actual Voltage Required to switch is dependent on VGS required to turn on M OSFET USER APPLICATION USER APPLICATION USER APPLICATION VS1 10K R1 VS1 1K R1 VS1 U1 OptoCoupler Q1 INPUT GROUND Phidget Digital Input INPUT GROUND Phidget Digital Input INPUT GROUND Phidget Digital Input INPUT GROUND Phidget Digital Input INPUT GROUND Phidget Digital Input 100nF 15K 15K +5V +5V INPUT GROUND INPUT GROUND USER S W I T C H Wiring a switch to a Digital Input Phidget Digital Input x1 APPLICATION Monitoring the position ofa Relay K1 FSR Isolating a Digital Input with an Optocoupler Phidget Digital Input Closing switch causes digital input to report TRUE Detail of Digital Input USER APPLICATION Relay contact causes Digital Input to report TRUE 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 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 f unction, but is a good idea. Be sure not to exceed VGS of the mosf et. Drain-Source Current > 270uA causes Digital Input to report TRUE Drain-Source Current < 67uA guarantees Digital Input to report TRUE Actual Voltage Required to switch is dependent on VGS required to turn on M OSFET USER APPLICATION USER APPLICATION USER APPLICATION VS1 10K R1 VS1 1K R1 VS1 U1 OptoCoupler Q1 INPUT GROUND Phidget Digital Input INPUT GROUND Phidget Digital Input INPUT GROUND Phidget Digital Input 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 20 1063_1_Product_Manual - July 18, 2012 10:21 AM 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 fltering on the digital input, to eliminate false triggering from electrical noise. The digital input is frst RC fltered by a 15K/100nF node, which will reject noise of higher frequency than 1Khz. This flter 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. 100nF 15K 15K +5V +5V INPUT GROUND INPUT GROUND USER S W I T C H Wiring a switch to a Digital Input Phidget Digital Input x1 APPLICATION Monitoring the position ofa Relay K1 FSR Isolating a Digital Input with an Optocoupler Phidget Digital Input Closing switch causes digital input to report TRUE Detail of Digital Input USER APPLICATION Relay contact causes Digital Input to report TRUE 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 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 f unction, but is a good idea. Be sure not to exceed VGS of the mosf et. Drain-Source Current > 270uA causes Digital Input to report TRUE Drain-Source Current < 67uA guarantees Digital Input to report TRUE Actual Voltage Required to switch is dependent on VGS required to turn on M OSFET USER APPLICATION USER APPLICATION USER APPLICATION VS1 10K R1 VS1 1K R1 VS1 U1 OptoCoupler Q1 INPUT GROUND Phidget Digital Input INPUT GROUND Phidget Digital Input INPUT GROUND Phidget Digital Input INPUT GROUND Phidget Digital Input INPUT GROUND Phidget Digital Input 100nF 15K 15K +5V +5V INPUT GROUND INPUT GROUND USER S W I T C H Wiring a switch to a Digital Input Phidget Digital Input x1 APPLICATION Monitoring the position ofa Relay K1 FSR Isolating a Digital Input with an Optocoupler Phidget Digital Input Closing switch causes digital input to report TRUE Detail of Digital Input USER APPLICATION Relay contact causes Digital Input to report TRUE 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 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 f unction, but is a good idea. Be sure not to exceed VGS of the mosf et. Drain-Source Current > 270uA causes Digital Input to report TRUE Drain-Source Current < 67uA guarantees Digital Input to report TRUE Actual Voltage Required to switch is dependent on VGS required to turn on M OSFET USER APPLICATION USER APPLICATION USER APPLICATION VS1 10K R1 VS1 1K R1 VS1 U1 OptoCoupler Q1 INPUT GROUND Phidget Digital Input INPUT GROUND Phidget Digital Input INPUT GROUND Phidget Digital Input INPUT GROUND Phidget Digital Input INPUT GROUND Phidget Digital Input 21 1063_1_Product_Manual - July 18, 2012 10:21 AM Product History Date Board Revision Device Version Comment January 2009 0 100 Product Release February 2011 1 100 Mini-USB connector, added more capacitance to the board, Digital Input terminal block exposes +5V, 12-24 AWG terminal blocks 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: support@phidgets.com