PhidgetAdvancedServo

PhidgetAdvancedServo

A class for controlling a PhidgetAdvancedServo.  See your product manual for more specific API details, supported functionality, units, etc.

Summary
PhidgetAdvancedServoA class for controlling a PhidgetAdvancedServo.
EventsEvents supported by PhidgetAdvancedServo.
Constants
Servo TypesThese are the some predefined servo motors.
Properties
MotorCountGets the number of motors supported by this controller.
Functions
getAccelerationMinGets the minimum settable acceleration for a motor.
getAccelerationMaxGets the maximum settable acceleration for a motor.
getPositionMinGets the minimum position that a motor can go to.
getPositionMaxGets the maximum position that a motor can go to.
getVelocityMinGets the minimum velocity that a motor can be set to.
getVelocityMaxGets the maximum velocity that a motor can be set to.
getAccelerationGets the last acceleration that a motor was set to.
getVelocityGets the current velocity of a motor
getVelocityLimitGets the last velocity limit that a motor was set to.
getCurrentGets the current current that a motor is drawing.
getPositionGets the current position of a motor.
getEngagedGets the engaged state of a motor.
getStoppedGets the stopped state of a motor.
getSpeedRampingOnGets the speed ramping state of the motor.
getServoTypeGets the servo motor type.
setAccelerationSets the acceleration of a motor.
setVelocityLimitSets the velocity limit of a motor.
setPositionSets the position of a motor.
setPositionMaxSets the maximum position that a motor can be set to.
setPositionMinSets the minimum position that a motor can be set to.
setEngagedSets the engaged state of a motor.
setSpeedRampingOnSets the speed ramping state of a motor.
setServoTypeSets the servo type
setServoParametersSets the servo parameters

Events

Events supported by PhidgetAdvancedServo.  Pass these constants to the addEventListener() function when adding event listeners to a Phidget object.

PhidgetDataEvent.VELOCITY_CHANGEvelocity change
PhidgetDataEvent.POSITION_CHANGEposition change
PhidgetDataEvent.CURRENT_CHANGEcurrent change

Constants

Servo Types

These are the some predefined servo motors.  Setting one of these will set degree-PCM ratio, min and max angle, and max velocity.  Custom servo parameters can be set with the setServoParameters function.

PHIDGET_SERVO_DEFAULTDefault - This is what the servo API been historically used, originally based on the Futaba FP-S148
PHIDGET_SERVO_RAW_us_MODERaw us mode - all position, velocity, acceleration functions are specified in microseconds rather then degrees
PHIDGET_SERVO_HITEC_HS322HDHiTec HS-322HD Standard Servo
PHIDGET_SERVO_HITEC_HS5245MGHiTec HS-5245MG Digital Mini Servo
PHIDGET_SERVO_HITEC_805BBHiTec HS-805BB Mega Quarter Scale Servo
PHIDGET_SERVO_HITEC_HS422HiTec HS-422 Standard Servo
PHIDGET_SERVO_TOWERPRO_MG90Tower Pro MG90 Micro Servo
PHIDGET_SERVO_HITEC_HSR1425CRHiTec HSR-1425CR Continuous Rotation Servo
PHIDGET_SERVO_HITEC_HS785HBHiTec HS-785HB Sail Winch Servo
PHIDGET_SERVO_HITEC_HS485HBHiTec HS-485HB Deluxe Servo
PHIDGET_SERVO_HITEC_HS645MGHiTec HS-645MG Ultra Torque Servo
PHIDGET_SERVO_HITEC_815BBHiTec HS-815BB Mega Sail Servo
PHIDGET_SERVO_FIRGELLI_L12_30_50_06_RFirgelli L12 Linear Actuator 30mm 50:1
PHIDGET_SERVO_FIRGELLI_L12_50_100_06_RFirgelli L12 Linear Actuator 50mm 100:1
PHIDGET_SERVO_FIRGELLI_L12_50_210_06_RFirgelli L12 Linear Actuator 50mm 210:1
PHIDGET_SERVO_FIRGELLI_L12_100_50_06_RFirgelli L12 Linear Actuator 100mm 50:1
PHIDGET_SERVO_FIRGELLI_L12_100_100_06_RFirgelli L12 Linear Actuator 100mm 100:1
PHIDGET_SERVO_SPRINGRC_SM_S2313MSpringRC SM-S2313M Micro Servo
PHIDGET_SERVO_SPRINGRC_SM_S3317MSpringRC SM-S3317M Small Servo
PHIDGET_SERVO_SPRINGRC_SM_S3317SRSpringRC SM-S3317SR Small Continuous Rotation Servo
PHIDGET_SERVO_SPRINGRC_SM_S4303RSpringRC SM-S4303R Standard Continuous Rotation Servo
PHIDGET_SERVO_SPRINGRC_SM_S4315MSpringRC SM-S4315M High Torque Servo
PHIDGET_SERVO_SPRINGRC_SM_S4315RSpringRC SM-S4315R High Torque Continuous Rotation Servo
PHIDGET_SERVO_SPRINGRC_SM_S4505BSpringRC SM-S4505B Standard Servo
PHIDGET_SERVO_USER_DEFINEDUser defined servo parameters

Properties

MotorCount

public function get MotorCount():int

Gets the number of motors supported by this controller.

Functions

getAccelerationMin

public function getAccelerationMin(index: int):Number

Gets the minimum settable acceleration for a motor.

Parameters

indexmotor index

getAccelerationMax

public function getAccelerationMax(index: int):Number

Gets the maximum settable acceleration for a motor.

Parameters

indexmotor index

getPositionMin

public function getPositionMin(index: int):Number

Gets the minimum position that a motor can go to.

Parameters

indexmotor index

getPositionMax

public function getPositionMax(index: int):Number

Gets the maximum position that a motor can go to.

Paramters

indexmotor index

getVelocityMin

public function getVelocityMin(index: int):Number

Gets the minimum velocity that a motor can be set to.

parameters

indexmotor index

getVelocityMax

public function getVelocityMax(index: int):Number

Gets the maximum velocity that a motor can be set to.

Parameters

indexmotor index

getAcceleration

public function getAcceleration(index: int):Number

Gets the last acceleration that a motor was set to.

Parameters

indexmotor index

getVelocity

public function getVelocity(index: int):Number

Gets the current velocity of a motor

Parameters

indexmotor index

getVelocityLimit

public function getVelocityLimit(index: int):Number

Gets the last velocity limit that a motor was set to.

Parameters

indexmotor index

getCurrent

public function getCurrent(index: int):Number

Gets the current current that a motor is drawing.

Parameters

indexmotor index

getPosition

public function getPosition(index: int):Number

Gets the current position of a motor.

Parameters

indexmotor index

getEngaged

public function getEngaged(index: int):Boolean

Gets the engaged state of a motor.  This is whether or not the motor is powered.

Parameters

indexmotor index

getStopped

public function getStopped(index: int):Boolean

Gets the stopped state of a motor.  This is whether or not the motor is moving/processing commands.

Parameters

indexmotor index

getSpeedRampingOn

public function getSpeedRampingOn(index: int):Boolean

Gets the speed ramping state of the motor.  This is whether the motor used acceleration and velocity or not.

Parameters

indexmotor index

getServoType

public function getServoType(index: int):int

Gets the servo motor type.  This is one of the PHIDGET_SERVO_* constants.

Parameters

indexmotor index

setAcceleration

public function setAcceleration(index: int,
val: Number):void

Sets the acceleration of a motor.

Parameters

indexmotor index
valacceleration

setVelocityLimit

public function setVelocityLimit(index: int,
val: Number):void

Sets the velocity limit of a motor.

Parameters

indexmotor index
valvelocity limit

setPosition

public function setPosition(index: int,
val: Number):void

Sets the position of a motor.

Parameters

indexmotor index
valmotor position

setPositionMax

public function setPositionMax(index: int,
val: Number):void

Sets the maximum position that a motor can be set to.

Parameters

indexmotor index
valmotor position

setPositionMin

public function setPositionMin(index: int,
val: Number):void

Sets the minimum position that a motor can be set to.

Parameters

indexmotor index
valmotor position

setEngaged

public function setEngaged(index: int,
val: Boolean):void

Sets the engaged state of a motor.  This determines whether a motor is powered or not.

Parameters

indexmotor index
valengaged state

setSpeedRampingOn

public function setSpeedRampingOn(index: int,
val: Boolean):void

Sets the speed ramping state of a motor.  This is whether the motor uses acceleration and velocity or not.

Parameters

indexmotor index
valspeed ramping state

setServoType

public function setServoType(index: int,
val: int):void

Sets the servo type

Parameters

indexmotor index
valservoType

setServoParameters

public function setServoParameters(index: int,
minUs: Number,
maxUs: Number,
degrees: Number,
velocityMax: Number):void

Sets the servo parameters

Parameters

indexmotor index
minUsminimum PCM in microseconds
maxUsmaximum PCM in microseconds
degreestotal range of motion in degrees
velocityMaxmaximum velocity of servo in degrees/second
Base Phidget class from which all specific device classes inherit.
public function get MotorCount():int
Gets the number of motors supported by this controller.
public function getAccelerationMin(index: int):Number
Gets the minimum settable acceleration for a motor.
public function getAccelerationMax(index: int):Number
Gets the maximum settable acceleration for a motor.
public function getPositionMin(index: int):Number
Gets the minimum position that a motor can go to.
public function getPositionMax(index: int):Number
Gets the maximum position that a motor can go to.
public function getVelocityMin(index: int):Number
Gets the minimum velocity that a motor can be set to.
public function getVelocityMax(index: int):Number
Gets the maximum velocity that a motor can be set to.
public function getAcceleration(index: int):Number
Gets the last acceleration that a motor was set to.
public function getVelocity(index: int):Number
Gets the current velocity of a motor
public function getVelocityLimit(index: int):Number
Gets the last velocity limit that a motor was set to.
public function getCurrent(index: int):Number
Gets the current current that a motor is drawing.
public function getPosition(index: int):Number
Gets the current position of a motor.
public function getEngaged(index: int):Boolean
Gets the engaged state of a motor.
public function getStopped(index: int):Boolean
Gets the stopped state of a motor.
public function getSpeedRampingOn(index: int):Boolean
Gets the speed ramping state of the motor.
public function getServoType(index: int):int
Gets the servo motor type.
public function setAcceleration(index: int,
val: Number):void
Sets the acceleration of a motor.
public function setVelocityLimit(index: int,
val: Number):void
Sets the velocity limit of a motor.
public function setPosition(index: int,
val: Number):void
Sets the position of a motor.
public function setPositionMax(index: int,
val: Number):void
Sets the maximum position that a motor can be set to.
public function setPositionMin(index: int,
val: Number):void
Sets the minimum position that a motor can be set to.
public function setEngaged(index: int,
val: Boolean):void
Sets the engaged state of a motor.
public function setSpeedRampingOn(index: int,
val: Boolean):void
Sets the speed ramping state of a motor.
public function setServoType(index: int,
val: int):void
Sets the servo type
public function setServoParameters(index: int,
minUs: Number,
maxUs: Number,
degrees: Number,
velocityMax: Number):void
Sets the servo parameters
Close