Alert.png

Notice: This page contains information for the legacy Phidget21 Library.

Phidget21 is out of support. Bugfixes may be considered on a case by case basis.

Phidget21 does not support VINT Phidgets, or new USB Phidgets released after 2020. We maintain a selection of legacy devices for sale that are supported in Phidget21.

We recommend that new projects be developed against the Phidget22 Library.


Click on the 2phidget22.jpg button in the menu bar to go to the Phidget22 version of this page.

Alert.png

1061 User Guide

From Phidgets Legacy Support
Revision as of 14:55, 24 July 2012 by Mparadis (talk | contribs) (Created page with "Category:UserGuide Category:DELETE_ME_BEFORE_WE_GO_LIVE ==Getting Started== ===Checking the Contents=== {{UGbox| '''You should have received:''' * A PhidgetAdvancedS...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


Getting Started

Checking the Contents

You should have received:

  • A PhidgetAdvancedServo 8-Motor
  • A Mini-USB Cable

In order to test your new Phidget you will also need:

  • Some RC Servo Motors
  • A 6 - 15V DC Power Supply (if it's a barrel connector it should have center positive polarity)

Connecting the Pieces

  1. Connect the RC Servo Motors to the PhidgetAdvancedServo.
  2. Plug in a power supply using the barrel connector.
  3. You can also connect a power supply to the Terminal Block for high-current applications. Be sure to observe correct polarity.
  4. Connect the PhidgetAdvancedServo to your computer using the USB cable.

1061 0 Connecting The Hardware.jpg

Testing Using Windows 2000 / XP / Vista / 7

Make sure you have the current version of the Phidget library installed on your PC. If you don't, follow these steps:

  1. Go to the Quick Downloads section on the Windows page
  2. Download and run the Phidget21 Installer (32-bit, or 64-bit, depending on your system)
  3. You should see the Ph.jpg icon on the right hand corner of the Task Bar.

Running Phidgets Sample Program

Double clicking on the Ph.jpg icon loads the Phidget Control Panel; we will use this program to ensure that your new Phidget works properly.

The source code for the AdvancedServo-full sample program can be found in the quick downloads section on the C# Language Page. If you'd like to see examples in other languages, you can visit our Languages page.

Updating Device Firmware

If an entry in this list is red, it means the firmware for that device is out of date. Double click on the entry to be given the option of updating the firmware. If you choose not to update the firmware, you can still run the example for that device after refusing.

Double Click on the Ph.jpg icon to activate the Phidget Control Panel and make sure that the Phidget Advanced Servo Controller 8-Motor is properly attached to your PC.

1061 0 Control Panel Screen.jpg
  1. Double click on Phidget Advanced Servo Controller 8-Motor in the Phidget Control Panel to bring up AdvancedServo-full and check that the box labelled Attached contains the word True.
  2. Select a connected servo. In this example, a servo is connected at position 0.
  3. Select your servo type. If your servo is not in the list, select “default”.
  4. Use the Velocity slider to set the velocity limit. The servo will try to accelerate to this point during motion.
  5. Use the Acceleration slider to set the acceleration.
  6. Use the Min/Max Position slider to set the position range. It can prevent the servo from trying to go beyond its actual range of motion.
  7. Check the Engaged box to power the servo. If the servo is not already the target position, it should begin to move.
  8. Move the Position slider to set a target position. The servo will turn until its actual position equals the target position. If Speed Ramping is enabled, the servo will move using the user set acceleration and velocity.
  9. When the servo has reached the target position, a tick mark will appear in the Stopped box.
  10. These boxes report the controller’s internally calculated position and velocity of the servo, as well as current consumed in amps.
1061 0 Motor Control Screen.jpg

Testing Using Mac OS X

  1. Go to the Quick Downloads section on the Mac OS X page
  2. Download and run the Phidget OS X Installer
  3. Click on System Preferences >> Phidgets (under Other) to activate the Preference Pane
  4. Make sure that the Phidget Advanced Servo Controller 8-Motor is properly attached.
  5. Double Click on Phidget Advanced Servo Controller 8-Motor in the Phidget Preference Pane to bring up the AdvancedServo-full Sample program. This program will function in a similar way as the Windows version.

Using Linux

For a step-by-step guide on getting Phidgets running on Linux, check the Linux page.

Using Windows Mobile / CE 5.0 / CE 6.0

For a step-by-step guide on getting Phidgets running on Windows CE, check the Windows CE page.

Technical Details

API

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 in the Quick Downloads section for that language. For exact values, refer to the device specifications.

Data Structures

enum Phidget_ServoType {

PHIDGET_SERVO_DEFAULT = 1,
PHIDGET_SERVO_RAW_us_MODE,
PHIDGET_SERVO_HITEC_HS322HD,
PHIDGET_SERVO_HITEC_HS5245MG,
PHIDGET_SERVO_HITEC_805BB,
PHIDGET_SERVO_HITEC_HS422,
PHIDGET_SERVO_TOWERPRO_MG90,
PHIDGET_SERVO_HITEC_HS1425CR,
PHIDGET_SERVO_HITEC_HS785HB,
PHIDGET_SERVO_HITEC_HS485HB,
PHIDGET_SERVO_HITEC_HS645MG,
PHIDGET_SERVO_HITEC_HS815BB,
PHIDGET_SERVO_USER_DEFINED

}

Used with the ServoType [get,set] functions. These are servos that have been quantified by Phidget Inc. for your convenience. The Default setting is included for historical reasons, so that the API will be backwards compatible by default. RAW_us_MODE is used for quantifying new servos, or simply when a microsecond based interface makes more sense then a degree based abstraction. USER_DEFINED should never be set directly with ServoType - this is returned when a custom servo type has been defined with setServoParameters.

Functions

int Count() [get]

Returns the number of servos this PhidgetAdvancedServo can control. In the case of the 1061, this will always return 8. This call does not return the number of servos actually connected.


double Acceleration(int ServoIndex) [get,set]

Acceleration is the maximum change in velocity the PhidgetAdvancedServo uses when speeding up / slowing down a servo.
  • The range of valid Acceleration is bounded by AccelerationMax/AccelerationMin.
  • There is a practical limit on how fast your servo can accelerate, based on load and the physical design of the motor.
  • This property should always be set by the user as part of initialization. The value does not initialize to the value last set on the device.


double AccelerationMax(int ServoIndex) [get] : Constant

AccelerationMax is the upper limit to which Acceleration can be set. For the 1061, this will always return 320000.


double AccelerationMin(int ServoIndex) [get] : Constant

AccelerationMin is the lower limit to which Acceleration can be set. For the 1061, this will always return 19.53125.


double Velocity(int ServoIndex) [get]

Velocity returns the actual velocity that a particular servo is being driven at. A negative value means it is moving towards a lower position. This call does not return the actual physical velocity of the connected motor.


double VelocityLimit(int ServoIndex) [get, set]

Gets or sets the maximum absolute velocity that the PhidgetAdvancedServo controller will drive the servo. If it’s changed mid-movement, the controller will accelerate accordingly. If the target position of the controller is near enough, then the VelocityLimit may never be reached.
  • This property should always be set by the user as part of initialization.
  • There is a practical limit on how fast your servo can rotate, based on the physical design of the motor.
  • The range of VelocityLimit is bounded by VelocityMax/VelocityMin
  • Note that when VelocityLimit is set to 0, the servo will not move.


double VelocityMax(int ServoIndex) [get] : Constant

VelocityMax is the absolute upper limit to which Velocity can be set. For the1061, this will always return 6400.


double VelocityMin(int ServoIndex) [get] : Constant

VelocityMin is the absolute lower limit to which Velocity can be set. For the 1061, this will always return 0.


double Position(int ServoIndex) [get,set]

Position is used for both the target and actual position for a particular servo. If the servo is currently engaged and a new value is set, then the controller will continuously try to move to this position. Otherwise, this call will return the current position of the servo. This call does not return the actual physical position of the servo.
  • The range of Position is bounded by PositionMin/PositionMax
  • If the servo is not engaged, then the position cannot be read.
  • The position can still be set while the servo is not engaged. Once engaged, the servo will snap to position if it is not there already.
  • This property should be set by the user as part of initialization. If not, it will report the last value set on the device (unless the 1061 has been power-cycled).
  • Get will return the last value as reported by the device. This means sets to this value will take a small amount of time to propagate.


double PositionMax(int ServoIndex) [get,set]

PositionMax is the upper limit to which Position can be set, and is initialized to 233. It can be used to prevent the controller from going beyond a servo’s range of motion. A PhidgetException will be thrown if this is set above 233 or below PositionMin.


double PositionMin(int ServoIndex) [get,set]

PositionMin is the lower limit to which Position can be set, and is initialized to -22.9921875. It can be used to prevent the controller from going beyond a servo’s range of motion. A PhidgetException will be thrown if this is set below -22.9921875 or above PositionMax.


double Current(int ServoIndex) [get]

Current returns the power consumption in amps for a particular servo. The value returned for a disconnected or idle servo will be slightly above zero due to noise.


bool SpeedRamping(int ServoIndex) [get,set]

SpeedRamping enables or disables whether the PhidgetAdvancedServo tries to smoothly control the motion of a particular servo. If enabled, then the 1061 will progressively send commands based on velocity, acceleration and position.
  • This property should be set by the user as part of initialization. If not, it will report the last value set on the device (unless the 1061 has been power-cycled).
  • Get will return the last value as reported by the device. This means sets to this value will take a small amount of time to propagate.


bool Engaged(int ServoIndex) [get,set]

Enables a particular servo to be positioned. If this property is false, no power is applied to the motors. Note that when it is first enabled, the servo will snap to position, if it is not physically positioned at the same point.Engaged is useful for relaxing a servo 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.
  • This property should be set by the user as part of initialization. If not, it will report the last value set on the device (unless the 1061 has been power-cycled).
  • Get will return the last value as reported by the device. This means sets to this value will take a small amount of time to propagate.


bool Stopped(int ServoIndex) [get]

Stopped returns false if the servo is currently in motion. It guarantees that the servo is not moving (unless you are moving it by hand), and that there are no commands in the pipeline to the servo. Note that virtually any API calls will cause Stopped to be temporarily false, even changing Acceleration or VelocityLimit on a stopped servo.


Phidget_ServoType ServoType(int ServoIndex) [get,set]

Gets / Sets the servo type for an index. There is a list of some common servos that have been predefined by Phidgets Inc. This sets the PCM range (range of motion), the PCM to degrees ratios used internally and the maximum velocity. This allows the degree based functions to be accurate for a specific type of servo.
Note that servos are generally not very precise, so two servos of the same type may not behave exactly the same. Specific servo motors, as well as servos not in the list, can be independently quantified by the user and set up with the setServoParameters funtion. This is detailed in the technical section.

void setServoParameters(int ServoIndex, double MinUs, double MaxUs, double Degrees, double VelocityMax)

Sets the parameters for a custom servo motor. MinUs is the minimum PCM in microseconds, MaxUs is the maximum PCM in microseconds, Degrees is the degrees of rotation represented by the given PCM range and VelocityMax is the maximum velocity that the servo can maintain, in degrees/second.
Quantifying a custom servo motor is detailed in the technical section.

Events

Product History

Date Board Revision Device Version Comment