PhidgetMotorControl

PhidgetMotorControl

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

Summary
PhidgetMotorControlA class for controlling a PhidgetMotorControl.
EventsEvents supported by PhidgetMotorControl.
Properties
InputCountGets the number of digital inputs supported by this controller.
MotorCountGets the number of motors supported by this controller.
EncoderCountGets the number of encoders supported by this controller.
SensorCountGets the number of sensors supported by this controller.
RatiometricGets the ratiometric state for the board.
SupplyVoltageGets the supply voltage for the board.
Functions
getAccelerationMinGets the minimum acceleration that a motor can be set to.
getAccelerationMaxGets the maximum acceleration that a motor can be set to.
getInputStateGets the state of a digital input.
getAccelerationGets the last acceleration that a motor was set at.
getVelocityGets the current velocity of a motor.
getCurrentGets the current current draw of a motor.
getEncoderPositionGets the current current draw of a motor.
getBackEMFSensingStateGets the state of BackEMF sensing on a motor.
getBackEMFGets the current BacKEMF value for a motor.
getBrakingGets the current braking value for a motor.
getSensorValueGets the value of a sensor (0-1000).
getSensorRawValueGets the raw 12-bit value of a sensor (0-4095).
setAccelerationSets the acceleration for a motor.
setVelocitySets the velocity for a motor.
setBackEMFSensingStateEnables/Disables BackEMF sensing on a motor.
setBraking
setEncoderPositionSets/Resets the position of an encoder.
Properties
RatiometricSets the ratiometric state for a board.

Events

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

PhidgetDataEvent.INPUT_CHANGEdigital input change
PhidgetDataEvent.VELOCITY_CHANGEvelocity change
PhidgetDataEvent.CURRENT_CHANGEcurrent change
PhidgetDataEvent.CURRENT_UPDATEcurrent updates (fixed rate)
PhidgetDataEvent.POSITION_CHANGEencoder position change (Array:[timeChange, posnChange])
PhidgetDataEvent.POSITION_UPDATEencoder position updates (fixed rate)
PhidgetDataEvent.BACKEMF_UPDATEbackemf updates (fixed rate)
PhidgetDataEvent.SENSOR_UPDATEanalog sensor updates (fixed rate)

Properties

InputCount

public function get InputCount():int

Gets the number of digital inputs supported by this controller.

MotorCount

public function get MotorCount():int

Gets the number of motors supported by this controller.

EncoderCount

public function get EncoderCount():int

Gets the number of encoders supported by this controller.

SensorCount

public function get SensorCount():int

Gets the number of sensors supported by this controller.

Ratiometric

public function get Ratiometric():Boolean

Gets the ratiometric state for the board.

SupplyVoltage

public function get SupplyVoltage():Number

Gets the supply voltage for the board.

Functions

getAccelerationMin

public function getAccelerationMin(index: int):Number

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

Parameters

indexmotor index

getAccelerationMax

public function getAccelerationMax(index: int):Number

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

Parameters

indexmotor index

getInputState

public function getInputState(index: int):Boolean

Gets the state of a digital input.

Parameters

indexdigital input index

getAcceleration

public function getAcceleration(index: int):Number

Gets the last acceleration that a motor was set at.

Parameters

indexmotor index

getVelocity

public function getVelocity(index: int):Number

Gets the current velocity of a motor.

Parameters

indexmotor index

getCurrent

public function getCurrent(index: int):Number

Gets the current current draw of a motor.  Note that not all motor controllers support current sense.

Parameters

indexmotor index

getEncoderPosition

public function getEncoderPosition(index: int):Number

Gets the current current draw of a motor.  Note that not all motor controllers support current sense.

Parameters

indexmotor index

getBackEMFSensingState

public function getBackEMFSensingState(index: int):Boolean

Gets the state of BackEMF sensing on a motor.

Parameters

indexmotor index

getBackEMF

public function getBackEMF(index: int):Number

Gets the current BacKEMF value for a motor.

Parameters

indexmotor index

getBraking

public function getBraking(index: int):Number

Gets the current braking value for a motor.

Parameters

indexmotor index

getSensorValue

public function getSensorValue(index: int):int

Gets the value of a sensor (0-1000).

Parameters

indexsensor index

getSensorRawValue

public function getSensorRawValue(index: int):int

Gets the raw 12-bit value of a sensor (0-4095).

Parameters

indexsensor index

setAcceleration

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

Sets the acceleration for a motor.

Parameters

indexmotor index
valacceleraion

setVelocity

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

Sets the velocity for a motor.

Parameters

indexmotor index
valvelocity

setBackEMFSensingState

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

Enables/Disables BackEMF sensing on a motor.

Parameters

indexmotor index
valstate

setBraking

public function setBraking(index: int,
val: Number):void
Sets the braking for a motorenabled at velocity 0.

Parameters

indexmotor index
valbraking ammount (0-100%)

setEncoderPosition

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

Sets/Resets the position of an encoder.

Parameters

indexencoder index
valposition

Properties

Ratiometric

public function set Ratiometric(val: Boolean):void

Sets the ratiometric state for a board.

Parameters

valratiometric state
Base Phidget class from which all specific device classes inherit.
public function get InputCount():int
Gets the number of digital inputs supported by this controller.
public function get MotorCount():int
Gets the number of motors supported by this controller.
public function get EncoderCount():int
Gets the number of encoders supported by this controller.
public function get SensorCount():int
Gets the number of sensors supported by this controller.
public function get Ratiometric():Boolean
Gets the ratiometric state for the board.
public function get SupplyVoltage():Number
Gets the supply voltage for the board.
public function getAccelerationMin(index: int):Number
Gets the minimum acceleration that a motor can be set to.
public function getAccelerationMax(index: int):Number
Gets the maximum acceleration that a motor can be set to.
public function getInputState(index: int):Boolean
Gets the state of a digital input.
public function getAcceleration(index: int):Number
Gets the last acceleration that a motor was set at.
public function getVelocity(index: int):Number
Gets the current velocity of a motor.
public function getCurrent(index: int):Number
Gets the current current draw of a motor.
public function getEncoderPosition(index: int):Number
Gets the current current draw of a motor.
public function getBackEMFSensingState(index: int):Boolean
Gets the state of BackEMF sensing on a motor.
public function getBackEMF(index: int):Number
Gets the current BacKEMF value for a motor.
public function getBraking(index: int):Number
Gets the current braking value for a motor.
public function getSensorValue(index: int):int
Gets the value of a sensor (0-1000).
public function getSensorRawValue(index: int):int
Gets the raw 12-bit value of a sensor (0-4095).
public function setAcceleration(index: int,
val: Number):void
Sets the acceleration for a motor.
public function setVelocity(index: int,
val: Number):void
Sets the velocity for a motor.
public function setBackEMFSensingState(index: int,
val: Boolean):void
Enables/Disables BackEMF sensing on a motor.
public function setBraking(index: int,
val: Number):void
public function setEncoderPosition(index: int,
val: int):void
Sets/Resets the position of an encoder.
Close