Phidgets - Servo

Navigation:  Widget Designer > Devices > Phidgets >

Phidgets - Servo

prev main next

Navigation:  Widget Designer > Devices > Phidgets >

Phidgets - Servo

prev main next

Please wait. Due to its content this page might take a while to load...

PhidgetAdvancedServo 8-Motor - P/N RCC0004_0 (Image licensed by Phidgets under CC BY-NC-ND 3.0)

PhidgetAdvancedServo 8-Motor - P/N RCC0004_0
(Image licensed by Phidgets under CC BY-NC-ND 3.0)

The Servo Phidgets are controller boards for interfacing with RC servo motors or linear actuators.


Currently available are boards to with one, eight or sixteen slots.

If you are using more than one servo slot per board, you need to create a second Phidgets Servo device for each additional motor and assign the respective channel number.


Note that all Phidget devices are only available in the licensed Widget Designer edition, not the Free version.



Adding a New Phidgets Servo

To add a Phidgets Servo device, open the Devices menu and select Phidgets Device > Servo Device. This opens the Configuration dialog. Alternatively, you can add a new device in the Configuration dialog with the "+" button.

On the right side, you can name, dis-/enable the device or configure it as explained in the next paragraph.

The name is the unique identifier for this Phidgets Servo object in WD and the general rules for naming objects apply here as well (only letters, numbers and underscore are allowed, the first symbol must be a letter).
If you like, you can change the default name to a more descriptive one. When scripting, enter the name to access available members as described further down.

The "Enable" check box is ticked per default. On the left side, you should see that the icon in front of your Phidgets Servo is a filled blue circle. An empty blue circle indicates an enabled device which is not connected. A filled gray circle indicates a disabled device.

You can close the dialog at any time. The newly created device will also be added to the Devices menu > Phidgets Device > Phidgets Servo Device and can be opened from here or with Devices menu > Configuration.

The Phidgets Servo Settings

click to enlargeSelect the Serial number of the connected device from the drop-down. If your device is connected to a Hub, use its serial number respectively.
If the correct serial does not show in the drop-down, make sure that the device (or Hub) is shown in the Phidget Control Panel.
To access devices connected via the Network Server feature, you need to add the respective Phidgets Server device first.

Fill out Hub Port, Channel and Is Hub Port Device according to the Phidget Addressing Information dialog.

The Min and Max Pulse Width need to be set according to the connected servo motor's specifications. Please make sure you have the correct values here to avoid damaging your motor.
Adjust the Min and Max Position values as well if necessary.
Press Apply to confirm your settings.
After the connection is established and the pulse widths are set, the Acceleration and Velocity fields will update according to the current setting.

Important Note:
Before a Servo motor can be used, it must be set to "Engaged", using the respective Script described below!
Also, before a Servo motor can be engaged, a position value must have been sent to the device in advance!
This can happen either via scripting or via node.

Using the Device in Regular Scripting

After adding a Phidgets Servo, you can also use it via scripting which allows to perform actions on the device as well as retrieve information from it.

To send commands to the device, first create a CustomScript button or use the Macro editor or anything else with a scripting field. If you enter the device's identifier name into the script field (per default that is e.g. "Phidgets_Servo1"), Script Assist will offer you a list of all available members.

You can for example set a start position and engage the device using scripting:

You can also read out the minimum acceleration value that can be achieved with the current settings:
vdouble = Phidgets_Servo1.MinAcceleration
Or use this value to move the motor into a certain position as slowly as possible:

The scripting structure for Phidgets provides two different approaches for setting and retrieving values.
If you are already familiar with the object-based notation and using properties, all device properties can be used like any other object property you have already encountered:
Label5.Text = "Current Position: " + Phidgets_Servo1.Position

If you prefer a command structure that distinctly implies the action to be performed, you can use the "Set..." and "Get..." members:
Label5.Text = "Current Position: " + Phidgets_Servo1.GetPosition

Both approaches can be used interchangeably.

Please keep in mind that some properties are read-only properties, e.g. the acceleration and velocity limit values, and do not provide a "Set..." member.
Furthermore, the higher-level properties of the device itself, like the Enabled state, need to be scripted as properties and do not provide the "Set..." and "Get..." members.

For a list with all available members and commands with examples and descriptions, please refer to the chapter Phidgets Servo Members.

Using the Device with Event Listeners

Event Listeners can be added to the Configuration dialog and provide a simple way of listening to triggers from connected devices.

Please see the chapter Event Listener for a detailed description of its functionality and the Phidgets Servo Events chapter for a list (with examples and description) of the possible events raised by this device type.

Using the Device in the Node System

After creating a Phidgets Servo device, you can also use it in the node system as an input node to retrieve position, acceleration and velocity information.
There also is an output node for the Servo device, enabling you to move the motor to a certain position and influence the movement parameters.
It is for example possible to create a Fader in Widget Designer which controls the position of the servo motor.

Please see the chapters "Phidgets Servo Input" and "Phidgets Servo Output" for more information about the nodes themselves or the chapter "Tutorial: Nodes" for information about the node system.