1066 User Guide: Difference between revisions

From Phidgets Support
 
(29 intermediate revisions by 4 users not shown)
Line 1: Line 1:
__NOINDEX__
<metadesc>Control one RC servo motor or actuator with the PhidgetAdvancedServo 1-Motor. Powered and controlled solely by your computer via USB.</metadesc>
[[Category:UserGuide]]
[[Category:UserGuide]]
{{UserguideTOC|1066.jpg|1066}}
==Getting Started==
==Getting Started==
{{UGIntro|1066}}
*[{{SERVER}}/products.php?product_id=1066 1066 PhidgetAdvancedServo 1-Motor]
*USB cable and computer
*{{CT|Servo|Servo motor}}


===Checking the Contents===
{{UGbox|
'''You should have received:'''
* A PhidgetAdvancedServo 1-Motor
* A USB Cable
|
'''In order to test your new Phidget you will also need:'''
* An RC Servo Motor
||}}


===Connecting the Pieces===
Next, you will need to connect the pieces:
{{UGbox|
[[Image:1066_0_Connecting_The_Hardware.jpg|500px|right|link=]]
# Connect the RC servo Motor to the PhidgetAdvancedServo 1-Motor.
# Connect the servo motor to the PhidgetAdvancedServo controller.
# Connect the PhidgetAdvancedServo 1-Motor to your computer using the USB cable.
# Connect the Phidget to your computer using the USB cable.
|
[[File:1066_0_Connecting_The_Hardware.jpg|400px|link=]]
||}}


===Testing Using Windows 2000 / XP / Vista / 7===
<br clear="all">
{{UGIntroDone|1066}}


{{UGwin}}
==Using the 1066==


===Running Phidgets Sample Program===
{{UGcontrolpanel|1066}}


{{UGwin2|'''AdvancedServo-full'''}}
{{ugServo|1066|RC Servo Motor Controller}}


{{UGbox|
{{ugCurrentInput|1066|, labelled ''RC Servo Motor Current Sensor'', }}
Double Click on the [[File:Ph.jpg|link=]] icon to activate the Phidget Control Panel and make sure that '''Phidget Advanced Servo Controller 1-Motor''' is properly attached  to your PC.
|[[File:1066_0_Control_Panel_Screen.jpg|400px|link=]]
|
Double click on Phidget Advanced Servo Controller
# 1-Motor in the Phidget Control Panel to bring up AdvancedServo-full and check that the box labelled Attached contains the word True.
# The “Choose Servo” box shows 0.
# Use the Velocity slider to set the velocity limit. The servo will try to accelerate to this point during motion.
# Use the Acceleration slider to set the acceleration.
# 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.
# Check the Engaged box to power the servo. If the servo is not already the target position, it should begin to move.
# 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.
# When the servo has reached the target position, a tick mark will appear in the Stopped box.
# These boxes report the controller’s internally calculated position and velocity of the servo, as well as current consumed in amps.
|[[File:1066_0_AdvancedServo_Screen.jpg|400px|link=]]
}}


===Testing Using Mac OS X===
{{ugAddressingInformation}}


{{UGmac|Phidget Advanced Servo Controller 1-Motor|AdvancedServo-full}}
{{ugUsingYourOwnProgram|1066}}
 
==Technical Details==
===General===
An RC servo motor can be instructed to move to a desired position by the controller. Internally, it monitors the current position, and drives the motor as fast as it can until it reaches the desired position.
This is a very cheap and simple way to control a motor.  It has some limitations - there is no way for the controller to know the current position and speed of the motor.  Applications that want smooth movement suffer from the aggressive acceleration.
 
The 1066 is able to address some of these limitations. Instead of sending the desired position immediately, the 1066 sends a series of progressive positions according to  acceleration and velocity parameters. In most applications, this dramatically smooths the operation of the servo, and allows reasonably precise control of position, velocity and acceleration. The 1066 has a built in switching regulator - this allows it to efficiently operate from a wide voltage range (6-15VDC), and maintain proper power to the servo motors even if the power supply is varying. This built in voltage regulator will not operate if your power supply is undersized.


===Using Linux===


{{UGlinux}}
For more information about servo motors and controllers, check out the [[Servo Motor and Controller Guide]].


===Using Windows Mobile / CE 5.0 / CE 6.0===
===Selecting Min and Max Pulse Width===


{{UGce}}
The easiest way to determine the range of pulse widths to use is to check your servo's datasheet or specification table and use the numbers provided. If you do not have the numbers, you can determine them by following this process:


==Technical Details==
* Set the minimum to 1000us and the maximum to 1001us. This will probably be a safe midpoint to start from.
* Reduce the minimum to 900us and hit apply. Enable the servo and test moving the position to either extreme.
* Continue to reduce the minimum and test the range. If at any point the servo vibrates or makes a buzzing noise, it means it's stalled out and you've gone past its minimum. Continue increasing the minimum until there is no buzzing or vibration when holding the minimum position.
* Repeat this process for the maximum pulse width, increasing it until the motor stalls out and then decreasing until it doesn't.


An RC Servo can be instructed to move to a desired position by the controller. Internally, it monitors the current position, and drives the motor as fast as it can until it reaches the desired position.
This process is important because selecting a minimum or maximum pulse width that results in the motor stalling could have an impact on the motor's lifespan if it spends a lot of time holding position at those locations.
This is a very cheap and simple way to control a motor.  It has some limitations - there is no way for the controller to know the current position and speed of the motor.  Applications that want smooth movement suffer from the aggressive acceleration.


The PhidgetAdvancedServo is able to address some of these limitations. Instead of sending the desired position immediately, the PhidgetAdvancedServo sends a series of progressive positions according to  acceleration and velocity parameters.  In most applications, this dramatically smooths the operation of the servo, and allows reasonably precise control of position, velocity and acceleration. The PhidgetAdvancedServo has a built in switching regulator - this allows it to efficiently operate from a wide voltage range (6-15VDC), and maintain proper power to the servo motors even if the power supply is varying.  This built in voltage regulator will not operate if your power supply is undersized.
If you have a continuous rotation servo, you don't have to worry about it stalling so you can just increase the maximum and decrease the minimum until you reach the servo's maximum speed.


For more information about servo motors and controllers, check out the [[Servo Motor and Controller Primer]].


===Connecting your Servo Motor to the 1066===
===Connecting your Servo Motor to the 1066===
 
[[File:1066_0_Pins.jpg|500px|link=|center]]
[[File:1066_0_Pins.jpg|400px|link=]]


The pins on the 1066 are labelled B R W on the board:
The pins on the 1066 are labelled B R W on the board:
Line 77: Line 62:


===Current Sense===
===Current Sense===
The PhidgetAdvancedServo continuously measures the current consumed by each motor. The current roughly corresponds to torque, making it possible to detect several scenarios.   
The 1066 continuously measures the current consumed by each motor. The current roughly corresponds to torque, making it possible to detect several scenarios.   
* By monitoring for no current, it’s possible to determine if the servo is not connected.  It may not be possible to distinguish between a servo at rest and a servo not attached.   
* By monitoring for no current, it’s possible to determine if the servo is not connected.  It may not be possible to distinguish between a servo at rest and a servo not attached.   
* Stalled motors can be detected, by monitoring for the maximum current possible with your motor.   
* Stalled motors can be detected, by monitoring for the maximum current possible with your motor.   
Line 83: Line 68:


===Limitations===
===Limitations===
The PhidgetAdvancedServo does not know the current position of the motor on its own.  If your motor is free to  
The 1066 does not know the current position of the motor on its own.  If your motor is free to  
move, and is not being driven beyond the physical limitations of the motor, the position returned to your application  
move, and is not being driven beyond the physical limitations of the motor, the position returned to your application will be very close to the position of the motor.
will be very close to the position of the motor.
 
===Degree Abstraction===
The PhidgetAdvancedServo software component uses degrees to specify position, velocity, and acceleration. The degree unit is translated into a pulse sent to the servo, but it’s up to the servo to translate this signal into a particular position.  This translation varies between servo models and manufacturers, and it is up to the user to set up their particular servo so that the degree abstraction matches up with reality. Phidgets Inc. has quantified a number of common servo motors (see API section), which can be used with the ServoType function for to set these parameters. For servos not in this list, or to quantify a specific servo, the setServoParameters function can be used.
 
===Defining a Custom Servo===
 
Servos are driven with a PCM (Pulse Code Modulation) signal. To define a custom servo, you need to find the minimum and maximum PCM values that the servo supports.
 
The easiest way to do this is by bringing up the example and choosing RAW_us_MODE. This will display all positions in microseconds instead of degrees. Move the servo to both of its extremes, stopping when it hits the stops, then easing up a little (leave a few degrees of leaway), and record these values. You could also choose a specific range in degrees that you require and find the PCM values that correspond. Most servos operate within 500us - 2500us.
 
Record the degrees of rotation that this PCM range represents (using a protractor, for example).
 
Calculate the maximum velocity of your servo, in degrees/second. Most servos list their max speed in sec/60 degrees. convert this into degrees/second:
 
<math>\text{Velocity(^{o}/s)} = \frac{1}{\frac{\text{s}}{\text{60^{o}}}} * 60</math>
 
The actual maximum velocity of your servo may be slightly higher or lower, as velocity depends on voltage.
 
Feed these four values into the serServoParameters function to complete the set up. This should be done before any other function are called (in the attach event ideally).
 
Note that many servos can operate quite a bit outside of their rated ranges.
 
===Degree Abstraction (Historical Model)===
Historically, our degree abstraction has been based on the Futaba FP-S148 servo. This is the default abstraction used for the PhidgetAdvancedServo, to maintain backwards compatibility when the new model was added.
 
PWM(ms)= [(degrees + 23) * 4/375]
 
===Using the 1066 with a Servo Motor===
The PhidgetAdvancedServo has been designed to be used with a variety of RC servo motors independent of the motor-specific position, velocity and torque limits. Select a motor that suits your application and falls within the PhidgetAdvancedServo device specifications.
 
To use a servo motor, first select (in software) which attached motor the PhidgetAdvancedServo should affect. Position, velocity and acceleration can be controlled for each individual motor.  The software can also display a readout of the electrical current flowing through each motor.


===Using the 1066 with Continuous Rotation Servos===
===Using the 1066 with Continuous Rotation Servos===
A continuous rotation servo is a servo motor that has had its headgear-stop removed and potentiometer replaced by two matched-value resistors.  This has the effect of allowing the motor to rotate freely through a full range of motion, but disables the motor’s ability to control it’s position.   
A continuous rotation servo is a servo motor that has had its headgear-stop removed and potentiometer replaced by two matched-value resistors.  This has the effect of allowing the motor to rotate freely through a full range of motion, but disables the motor’s ability to control it’s position.   


When using the PhidgetAdvancedServo with a servo motor modified in this way, the position control in software becomes the motor’s speed control.  Because the two resistors that replace the motor’s potentiometer are matched in value, the motor will always think its shaft is at center position. If the target position in software is set to center, the motor will believe it has achieved the target and will therefore not rotate.  The further away from center the target position is set to, the faster the motor will rotate (trying to reach that position, but never doing so).  Changing the value above or below center changes the direction of rotation.
When using the 1066 with a servo motor modified in this way, the position control in software becomes the motor's speed control.  Because the two resistors that replace the motor’s potentiometer are matched in value, the motor will always think its shaft is at center position. If the target position in software is set to center, the motor will believe it has achieved the target and will therefore not rotate.  The further away from center the target position is set to, the faster the motor will rotate (trying to reach that position, but never doing so).  Changing the value above or below center changes the direction of rotation.


===Using the 1066 with Electronic Speed Controllers (ESCs)===
===Using the 1066 with Electronic Speed Controllers (ESCs)===
Electronic Speed Controllers are commonly used in RC hobby planes, cars, helicopters. It’s a controller that accepts a PWM input signal, and controls a motor based on that signal. The ESC accepts power from an external source, normally a battery pack.   
Electronic Speed Controllers are commonly used in RC hobby planes, cars, helicopters. It's a controller that accepts a PWM input signal, and controls a motor based on that signal. The ESC accepts power from an external source, normally a battery pack.   


ESCs can be controlled by the 1066, but the vast majority of ESCs on the market will destroy the 1066 if they are plugged in without modification. In a hobby RC system, the ESC is responsible for regulating some of the battery current down to ~5V, and supplying it to the radio receiver. An ESC designed to the power the receiver will advertise that it has a Battery Eliminator Circuit (BEC). When you plug an ESC into the 1066, the 1066 is acting as the radio receiver. The 1066 was not designed to be powered by the devices it controls, and the voltage regulator on the 1066 will self-destruct if a device tries to power it. If the center pin from the 3-wire servo connector between the 1066 and the ESC is disconnected, the BEC on the ESC will not be able to power the 1066, and the voltage regulator will not fail.
ESCs can be controlled by the 1066, but the vast majority of ESCs on the market will destroy the 1066 if they are plugged in without modification. In a hobby RC system, the ESC is responsible for regulating some of the battery current down to ~5V, and supplying it to the radio receiver. An ESC designed to the power the receiver will advertise that it has a Battery Eliminator Circuit (BEC). When you plug an ESC into the 1066, the 1066 is acting as the radio receiver. The 1066 was not designed to be powered by the devices it controls, and the voltage regulator on the 1066 will self-destruct if a device tries to power it. If the center pin from the 3-wire servo connector between the 1066 and the ESC is disconnected, the BEC on the ESC will not be able to power the 1066, and the voltage regulator will not fail.


How the ESC inteprets the PWM signal and controls the motor is a function of the ESC.  Higher end ESCs can be configured based on the application.
How the ESC inteprets the PWM signal and controls the motor is a function of the ESC.  Higher end ESCs can be configured based on the application.


The hobby RC market has transitioned to Brushless DC Motors (BLDC). As you select an ESC, watch that the battery voltage input matches that of your system, and the type of motor controlled is what you have. Brushed DC and Brushless DC Motors are completely different, and require different controllers.
The hobby RC market has transitioned to Brushless DC Motors (BLDC). As you select an ESC, watch that the battery voltage input matches that of your system, and the type of motor controlled is what you have. Brushed DC and Brushless DC Motors are completely different, and require different controllers.
 
Wiring layout is critical with ESCs.  The currents to the motor and on the ground return can be enormous.  If these currents end up travelling back through USB cables, the system will not be stable.  Some ESCs are optically isolated (OPTO) - a big advantage that reduces interference. 


===Using the 1066 with High-Voltage Servos===
Wiring layout is critical with ESCs.  The currents to the motor and on the ground return can be enormous.  If these currents end up travelling back through USB cables, the system will not be stable.  Some ESCs are optically isolated (OPTO) - a big advantage that reduces interference.


You can still use the 1066 to power servos that are rated for a higher voltage, but you will need to provide an external power supply. Cut and reattach the red and black wires as shown in the diagram below.
===Synchronization of Multiple Servo Motors===
Many applications call for several servo motors operating in unison - for example, operating a CNC table, or a robot arm. Highly precise synchronization of servos using the 1066 is not possible, as the sequencing will be affected by the real-time performance of your operating system. Each servo 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.


[[File:Servopower.png|link=|800px]]
===Using the 1066 with High-Power Servos===
You can still use the 1066 to power servos that are rated for a higher power, but you will need to provide an external power supply. Cut and reattach the red and black wires as shown in the diagram below.


[[File:Servopower.png|link=|800px|center]]
Make sure you disconnect the red wire from the 1066 as pictured, because reverse current from the external power supply could damage the servo controller board.
Make sure you disconnect the red wire from the 1066 as pictured, because reverse current from the external power supply could damage the servo controller board.


<br clear=all>
<br clear=all>


===Servo Calibration===
{{UGnext|}}
{{ServoCalibration}}
 
==API==
{{UGapih}}
 
===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===
{{UGapi|int Count() [get]
|Returns the number of servos this PhidgetAdvancedServo can control.  In the case of the 1066, this will always return 8.  This call does not return the number of servos actually connected. 
}}
 
{{UGapi|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.
}}
 
{{UGapi|double AccelerationMax(int ServoIndex) [get] : Constant
|AccelerationMax is the upper limit to which Acceleration can be set.  For the 1066, this will always return 320000.
}}
 
{{UGapi|double AccelerationMin(int ServoIndex) [get] : Constant
|AccelerationMin is the lower limit to which Acceleration can be set.  For the 1066, this will always return 19.53125.
}}
 
{{UGapi|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.
}}
 
{{UGapi|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.
}}
 
{{UGapi|double VelocityMax(int ServoIndex) [get] : Constant
|VelocityMax is the absolute upper limit to which Velocity can be set. For the1066, this will always return 6400.
}}
 
{{UGapi|double VelocityMin(int ServoIndex) [get] : Constant
|VelocityMin is the absolute lower limit to which Velocity can be set. For the 1066, this will always return 0.
}}
 
{{UGapi|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 1066 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.
}}
 
{{UGapi|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.
}}
 
{{UGapi|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.
}}
 
{{UGapi|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.
}}
 
{{UGapi|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 1066 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 1066 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.
}}
 
{{UGapi|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 <nowiki>=</nowiki> 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 1066 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.
}}
 
{{UGapi|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.
}}
 
{{UGapi|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.
}}
{{UGapi|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===
 
{{UGapi|VelocityChange(int ServoIndex, double Velocity) [event]
|An event issued when the velocity changes on a motor.
}}
 
{{UGapi|PositionChange(int ServoIndex, double Position) [event]
|An event issued when the position changes on a motor.
}}
 
{{UGapi|CurrentChange(int ServoIndex, double Current) [event]
|An event issued when the current consumed changes on a servo.
}}
 
==Product History==
{{UGhist}}
{{UGrow|July 2009|0|100|Product Release}}

Latest revision as of 16:24, 1 June 2023


Getting Started

Welcome to the 1066 user guide! In order to get started, make sure you have the following hardware on hand:


Next, you will need to connect the pieces:

1066 0 Connecting The Hardware.jpg
  1. Connect the servo motor to the PhidgetAdvancedServo controller.
  2. Connect the Phidget to your computer using the USB cable.


Now that you have everything together, let's start using the 1066!

Using the 1066

Phidget Control Panel

In order to demonstrate the functionality of the 1066, the Phidget Control Panel running on a Windows machine will be used.


The Phidget Control Panel is available for use on both macOS and Windows machines.

Windows

To open the Phidget Control Panel on Windows, find the Ph.jpg icon in the taskbar. If it is not there, open up the start menu and search for Phidget Control Panel

Windows PhidgetTaskbar.PNG

macOS

To open the Phidget Control Panel on macOS, open Finder and navigate to the Phidget Control Panel in the Applications list. Double click on the Ph.jpg icon to bring up the Phidget Control Panel.


For more information, take a look at the getting started guide for your operating system:


Linux users can follow the getting started with Linux guide and continue reading here for more information about the 1066.

First Look

After plugging the 1066 into your computer and opening the Phidget Control Panel, you will see something like this:

1066 Panel.jpg


The Phidget Control Panel will list all connected Phidgets and associated objects, as well as the following information:

  • Serial number: allows you to differentiate between similar Phidgets.
  • Channel: allows you to differentiate between similar objects on a Phidget.
  • Version number: corresponds to the firmware version your Phidget is running. If your Phidget is listed in red, your firmware is out of date. Update the firmware by double-clicking the entry.


The Phidget Control Panel can also be used to test your device. Double-clicking on an object will open an example.

RC Servo

Double-click on the RCServo object, labelled RC Servo Motor Controller, in order to run the example:

1066 Servo Example.jpg


General information about the selected object will be displayed at the top of the window. You can also experiment with the following functionality:

  • Motor calibration options are provided. You can change the minimum and maximum pulse widths for your RC servo motor in the appropriate boxes. You can also change which position these pulse widths map to.
  • The SpeedRampingState checkbox lets the 1066 know whether or not to take the Acceleration and Velocity values into account when moving the RC servo motor.
  • Use the Position slider to change the target position and move the RC servo motor.


Current Input

Double-click on the Current Input object , labelled RC Servo Motor Current Sensor, in order to run the example:

1066 CurrentInput Example.jpg


General information about the selected object will be displayed at the top of the window. You can also experiment with the following functionality:

  • Modify the change trigger and/or data interval value by dragging the sliders. For more information on these settings, see the data interval/change trigger page.

Finding The Addressing Information

Before you can access the device in your own code, and from our examples, you'll need to take note of the addressing parameters for your Phidget. These will indicate how the Phidget is physically connected to your application. For simplicity, these parameters can be found by clicking the button at the top of the Control Panel example for that Phidget.

The locate Phidget button is found in the device information box

In the Addressing Information window, the section above the line displays information you will need to connect to your Phidget from any application. In particular, note the Channel Class field as this will be the API you will need to use with your Phidget, and the type of example you should use to get started with it. The section below the line provides information about the network the Phidget is connected on if it is attached remotely. Keep track of these parameters moving forward, as you will need them once you start running our examples or your own code.

All the information you need to address your Phidget

Using Your Own Program

You are now ready to start writing your own code for the device. The best way to do that is to start from our Code Samples.

Select your programming language of choice from the drop-down list to get an example for your device. You can use the options provided to further customize the example to best suit your needs.

Code Sample Choose Language.png


Once you have your example, you will need to follow the instructions on the page for your programming language to get it running. To find these instructions, select your programming language from the Programming Languages page.

Technical Details

General

An RC servo motor can be instructed to move to a desired position by the controller. Internally, it monitors the current position, and drives the motor as fast as it can until it reaches the desired position. This is a very cheap and simple way to control a motor. It has some limitations - there is no way for the controller to know the current position and speed of the motor. Applications that want smooth movement suffer from the aggressive acceleration.

The 1066 is able to address some of these limitations. Instead of sending the desired position immediately, the 1066 sends a series of progressive positions according to acceleration and velocity parameters. In most applications, this dramatically smooths the operation of the servo, and allows reasonably precise control of position, velocity and acceleration. The 1066 has a built in switching regulator - this allows it to efficiently operate from a wide voltage range (6-15VDC), and maintain proper power to the servo motors even if the power supply is varying. This built in voltage regulator will not operate if your power supply is undersized.


For more information about servo motors and controllers, check out the Servo Motor and Controller Guide.

Selecting Min and Max Pulse Width

The easiest way to determine the range of pulse widths to use is to check your servo's datasheet or specification table and use the numbers provided. If you do not have the numbers, you can determine them by following this process:

  • Set the minimum to 1000us and the maximum to 1001us. This will probably be a safe midpoint to start from.
  • Reduce the minimum to 900us and hit apply. Enable the servo and test moving the position to either extreme.
  • Continue to reduce the minimum and test the range. If at any point the servo vibrates or makes a buzzing noise, it means it's stalled out and you've gone past its minimum. Continue increasing the minimum until there is no buzzing or vibration when holding the minimum position.
  • Repeat this process for the maximum pulse width, increasing it until the motor stalls out and then decreasing until it doesn't.

This process is important because selecting a minimum or maximum pulse width that results in the motor stalling could have an impact on the motor's lifespan if it spends a lot of time holding position at those locations.

If you have a continuous rotation servo, you don't have to worry about it stalling so you can just increase the maximum and decrease the minimum until you reach the servo's maximum speed.


Connecting your Servo Motor to the 1066

1066 0 Pins.jpg

The pins on the 1066 are labelled B R W on the board:

  • B for Black is the Ground
  • R for Red is 5V
  • W for White (or Yellow depending on your servo motor) is the Data Line

Current Sense

The 1066 continuously measures the current consumed by each motor. The current roughly corresponds to torque, making it possible to detect several scenarios.

  • By monitoring for no current, it’s possible to determine if the servo is not connected. It may not be possible to distinguish between a servo at rest and a servo not attached.
  • Stalled motors can be detected, by monitoring for the maximum current possible with your motor.
  • The position limits of the servo can be programmatically determined by moving the servo until it stalls against the internal or external stops.

Limitations

The 1066 does not know the current position of the motor on its own. If your motor is free to move, and is not being driven beyond the physical limitations of the motor, the position returned to your application will be very close to the position of the motor.

Using the 1066 with Continuous Rotation Servos

A continuous rotation servo is a servo motor that has had its headgear-stop removed and potentiometer replaced by two matched-value resistors. This has the effect of allowing the motor to rotate freely through a full range of motion, but disables the motor’s ability to control it’s position.

When using the 1066 with a servo motor modified in this way, the position control in software becomes the motor's speed control. Because the two resistors that replace the motor’s potentiometer are matched in value, the motor will always think its shaft is at center position. If the target position in software is set to center, the motor will believe it has achieved the target and will therefore not rotate. The further away from center the target position is set to, the faster the motor will rotate (trying to reach that position, but never doing so). Changing the value above or below center changes the direction of rotation.

Using the 1066 with Electronic Speed Controllers (ESCs)

Electronic Speed Controllers are commonly used in RC hobby planes, cars, helicopters. It's a controller that accepts a PWM input signal, and controls a motor based on that signal. The ESC accepts power from an external source, normally a battery pack.

ESCs can be controlled by the 1066, but the vast majority of ESCs on the market will destroy the 1066 if they are plugged in without modification. In a hobby RC system, the ESC is responsible for regulating some of the battery current down to ~5V, and supplying it to the radio receiver. An ESC designed to the power the receiver will advertise that it has a Battery Eliminator Circuit (BEC). When you plug an ESC into the 1066, the 1066 is acting as the radio receiver. The 1066 was not designed to be powered by the devices it controls, and the voltage regulator on the 1066 will self-destruct if a device tries to power it. If the center pin from the 3-wire servo connector between the 1066 and the ESC is disconnected, the BEC on the ESC will not be able to power the 1066, and the voltage regulator will not fail.

How the ESC inteprets the PWM signal and controls the motor is a function of the ESC. Higher end ESCs can be configured based on the application.

The hobby RC market has transitioned to Brushless DC Motors (BLDC). As you select an ESC, watch that the battery voltage input matches that of your system, and the type of motor controlled is what you have. Brushed DC and Brushless DC Motors are completely different, and require different controllers.

Wiring layout is critical with ESCs. The currents to the motor and on the ground return can be enormous. If these currents end up travelling back through USB cables, the system will not be stable. Some ESCs are optically isolated (OPTO) - a big advantage that reduces interference.

Synchronization of Multiple Servo Motors

Many applications call for several servo motors operating in unison - for example, operating a CNC table, or a robot arm. Highly precise synchronization of servos using the 1066 is not possible, as the sequencing will be affected by the real-time performance of your operating system. Each servo 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.

Using the 1066 with High-Power Servos

You can still use the 1066 to power servos that are rated for a higher power, but you will need to provide an external power supply. Cut and reattach the red and black wires as shown in the diagram below.

Servopower.png

Make sure you disconnect the red wire from the 1066 as pictured, because reverse current from the external power supply could damage the servo controller board.


What to do Next

  • Programming Languages - Find your preferred programming language here and learn how to write your own code with Phidgets!
  • Phidget Programming Basics - Once you have set up Phidgets to work with your programming environment, we recommend you read our page on to learn the fundamentals of programming with Phidgets.