1065 User Guide: Difference between revisions

From Phidgets Support
No edit summary
Line 1: Line 1:
[[Category:UserGuide]]
[[Category:UserGuide]]
{{UserguideTOC|1065.jpg|1065}}
==Getting Started==


===Checking the Contents===
===Required Hardware===
{{UGbox|
 
'''You should have received:'''
* A 1065 DC Motor Phidget
* A PhidgetMotorControl 1-Motor
* A USB Cable
* A Mini-USB cable
* A 9-28V DC Power Supply
|
* A DC Motor
'''In order to test your new Phidget you will also need:'''
* A 9 to 28VDC power supply (If using the barrel jack, ensure your power supply is '''center-positive''' polarity)
* A DC motor with integrated encoder
* An Analog Sensor (we are using an a temperature sensor)
* A piece of wire to test the digital inputs
||}}


===Connecting the Pieces===
===Connecting the Pieces===
{{UGbox|
[[Image:1065_Functional.jpg|300px|right|link=]]
# Connect the Motor to the PhidgetMotorControl
# Connect the positive wire (usually red) of the motor to the "+" terminal on the side of the Phidget opposite the USB port. Connect the negative wire (usually black) to the "-" terminal next to the red wire.
# Connect the Encoder
# Connect your device to your computer using the USB cable.
# Plug in a power supply using the barrel connector.
# Plug the DC power supply into the barrel jack, or if it doesn't have a jack, connect the loose leads to the "+" and "G" terminals between the barrel jack and USB port.
# You can also connect a power supply to the Terminal Block.  Be sure to observe correct polarity.
# Ensure that the DC power supply is plugged in.
# Connect your sensor to an analog input.  We are using a Phidget Slider-60.
# Connect one end of the wire to the Ground connector and the other end to connector 0.
# Connect the MotorControl to your computer using the USB cable.
|
[[File:1065_0_Connecting_The_Hardware.jpg|400px|link=]]
||}}


===Testing Using Windows 2000 / XP / Vista / 7===
<br clear="all">
==Testing Using Windows==


{{UGwin}}
{{UGcontrolpanel|1065}}


===Running Phidgets Sample Program===
{{ugDCMotor}}


{{UGwin2|'''MotorControl-full'''}}
{{ugEncoder}}


{{UGbox|
{{ugCurrentInput}}
Double Click on the [[File:Ph.jpg|link=]] icon to activate the Phidget Control Panel and make sure that the '''Phidget Motor Controller 1-Motor''' is properly attached  to your PC.
|[[File:1065_0_Control_Panel_Screen.jpg|400px|link=]]
|
#Double Click on '''Phidget Motor Controller 1-Motor''' in the Phidget Control Panel to bring up MotorControl-full and check that the box labelled Attached contains the word True.
# Move the target velocity slider to a target velocity setting.  The Current Velocity is displayed in the Current Velocity Box.  The motor will accelerate until the current velocity is equal to the target velocity.
# You can change the acceleration by using the acceleration slider.
# Turn On Back EMF Sensing.
# When the motor is stopped, you can create some shaft resistance by using the braking slider.
# Test the digital input by disconnecting the wire end connected to the digital input connector. The tick mark in the box will go away.
# You can read the Encoder Position and reset it to 0 by clicking on the Reset button.
# The sensors box displays the SensorValue of  the Analog Inputs. Click on the Ratiometric box if your sensor is ratiometric.
|[[File:1065_0_Motor_Control_Screen.jpg|400px|link=]]
}}


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


{{UGmac|Phidget MorotControl 1-Motor|MotorControl-full}}
{{ugVoltageInputSensor}}


===Using Linux===
{{ugVoltageRatioSensor}}


{{UGlinux}}
{{UGotheros}}
 
===Using Windows Mobile / CE 5.0 / CE 6.0===
 
{{UGce}}


==Technical Details==
==Technical Details==
Line 80: Line 50:
For more information about DC motors and how to control them, check the [[DC Motor and Controller Primer]].
For more information about DC motors and how to control them, check the [[DC Motor and Controller Primer]].


==API==
{{UGnext|}}
{{UGapih}}
 
===Functions===
 
{{UGapi|int MotorCount() [get] : Constant <nowiki>=</nowiki> 1
|Returns the number of Motors that can be controlled by this PhidgetMotorControl. 
}}
 
{{UGapi|double Velocity (int MotorIndex) [get,set]
|Velocity is the percentage of time the motor is being powered for.  The PhidgetMotorControl rapidly switches power to the motor on/off.  Velocity can be set between –100 and +100.  –100 corresponds to the motor being driven 100% of the time in reverse, +100 driven 100% of the time forward. When velocity is 0, the motor is controlled by the Braking property, which defaults to 0%.
}}
 
{{UGapi|double Acceleration (int MotorIndex) [get,set]
|Returns how fast a motor will be accelerated between given velocities.  The valid range is between AccelerationMax and AccelerationMin.  Acceleration is in %(duty cycle)/s.
}}
 
{{UGapi|double AccelerationMax (int MotorIndex) [get] : Constant <nowiki>=</nowiki> 6250% Duty Cycle/s
|Returns the maximum acceleration that a motor will accept, or return, in %(duty cycle)/s.
}}
 
{{UGapi|double AccelerationMin (int MotorIndex) [get] : Constant <nowiki>=</nowiki> 24.51% Duty Cycle/s
|Returns the minimum acceleration that a motor will accept, or return, in %(duty cycle)/s.
}}
 
{{UGapi|double Current(int MotorIndex) [get]
|Gets the current usage of a motor, in Amps.
}}
 
{{UGapi|bool BackEMFSensingState(int MotorIndex) [get,set]
|Gets/Sets the back-EMF sensing state for a motor. When back-EMF sensing is enabled, the motor will coast (freewheel) 5% of the time while the back EMF measurement is taken (800us every 16ms). Therefore at a velocity of 100%, the motor is only powered 95% of the time. By default, this is disabled.
}}
 
{{UGapi|double BackEMF(int MotorIndex) [get]
|Gets the back-EMF measurement for a motor, in Volts. This is only available if BackEMFSensingState is set to true. Back-EMF generally corresponds roughly to true motor velocity - see technical section for details.
}}
 
{{UGapi|double Braking(int MotorIndex) [get,set]
|Gets/sets the braking amount for a motor at rest, with a range of 0-100%. Braking is only active when the motor velocity is 0. By default, braking is 0%, allowing the motor to coast (free-wheel). The holding strength of a braked motor depends on the motor, but is generally quite low.
}}
 
{{UGapi|double SupplyVoltage() [get]
|Gets the board supply voltage, in Volts.
}}
 
{{UGapi|int InputCount() [get] : Constant <nowiki>=</nowiki> 2
|Returns the number of digital inputs.
}}
 
{{UGapi|bool InputState(int InputIndex) [get]
|Returns the state of a digital input. True means that the input is activated, and False indicated the default state.
}}
 
{{UGapi|int EncoderCount() [get] : Constant <nowiki>=</nowiki> 1
|Returns the number of encoder inputs.
}}
 
{{UGapi|int EncoderPosition(int EncoderIndex) [get,set]
|Sets/gets the current encoder position of an encoder. Note that precision is 1/4 of that supported by the PhidgetEncoders 1047 and 1057 - see the technical section for more information.
}}
 
{{UGapi|int SensorCount() [get] : Constant <nowiki>=</nowiki> 2
|Returns the number of analog sensor inputs.
}}
 
{{UGapi|int SensorValue(int SensorIndex) [get]
|Gets the current value for a sensor input. Range is 0-1000.
}}
 
{{UGapi|int SensorRawValue(int SensorIndex) [get]
|gets the raw 12-bit value for a sensor input. Range is 0-4096.
}}
 
{{UGapi|bool Ratiometric() [get,set]
|Gets/sets the ratiometric state for the analog sensor inputs. Defaults to true.
}}
 
===Events===
{{UGapi| | }}
 
{{UGapi|OnVelocityChange(int MotorIndex, double Velocity) [event]
|An event issued when the velocity a motor is being driven at changes.
}}
 
{{UGapi|OnCurrentChange(int MotorIndex, double Current) [event]
|An event issued whenever the current consumed by a motor changes.
}}
 
{{UGapi|OnCurrentUpdate(int MotorIndex, double Current) [event]
|An event containing current consumption information for a motor, which is issued at a set interval of 8ms. This is generally used for PID torque control.
}}
 
{{UGapi|OnBackEMFUpdate(int MotorIndex, double BackEMF) [event]
|An event containing the back-EMF value for a motor, which is issued at a set interval of 16ms, when back-EMF sensing is enabled. This is generally used for PID velocity control.
}}
 
{{UGapi|OnInputChange(int InputIndex, bool State) [event]
|An event issued when the state of a digital input changes.
}}
 
{{UGapi|OnEncoderPositionChange(int EncoderIndex, int Time, int PositionChange) [event]
|An event issued when the position of an encoder changes. Time is in 1/3ms and represents the amount of time in which PositionChange counts occurred.
}}
 
{{UGapi|OnEncoderPositionUpdate(int EncoderIndex, int PositionChange) [event]
|An event containing position change information for an encoder, which is issued at a set interval of 8ms, regardless of whether the position has changed. This is generally used for PID velocity and/or position control.
}}
 
{{UGapi|OnSensorUpdate(int SensorIndex, int SensorValue) [event]
|An event containing sensor value information for sensors plugged into the Analog Inputs, which is issued at a set interval of 8ms. This may be used for PID control loops depending on the type of sensor being used.
}}
 
{{UGapi|OnError(int ErrorCode, String ErrorDescription) [event]
|The PhidgetMotorControl 1-Motor will throw error events under certain circumstances:
 
::'''ErrorCode <nowiki>=</nowiki> EEPHIDGET_WRAP''' - The position value for an encoder is wrapping around (between 2147483647 and -2147483648).
 
::'''ErrorCode <nowiki>=</nowiki> EEPHIDGET_PACKETLOST''' - A packet of data has been lost. This should be taken into consideration when the Update events are being used, as a gap will be present in the data - 8ms/packet lost error event.
 
::'''ErrorCode <nowiki>=</nowiki> EEPHIDGET_OVERTEMP''' - An over-temperature, or short-circuit condition has occurred. The output will be clamped at 5-8 Amps.
 
::'''ErrorCode <nowiki>=</nowiki> EEPHIDGET_BADPOWER''' - The supply voltage is too low or too high. This is thrown if the voltage is <nowiki><=7V, or >=34V</nowiki>. There are several different messages depending on how far out of spec the voltage is. Quick load/velocity changes can cause spike in the supply voltage - if these spikes exceed 40V, the motor is automatically placed in 100% braking - braking ends when the supply voltage falls to <38V. When error states have ended, there will be an error event with the EEPHIDGET_OK code.See the ErrorDescription string for specific error details.
}}
 
<span style="color:#ff0000">'''C and .NET based APIs only:'''</span>
 
{{UGapi|OnIndexChange(int EncoderIndex, int IndexPosition) [event]
|An event that is issued whenever there is a pulse on the index pin. (Note: Many encoders do not support the index channel and leave the index pin unconnected)
}}


==Product History==
==Product History==

Revision as of 20:01, 29 August 2016


Required Hardware

  • A 1065 DC Motor Phidget
  • A USB Cable
  • A 9-28V DC Power Supply
  • A DC Motor

Connecting the Pieces

  1. Connect the positive wire (usually red) of the motor to the "+" terminal on the side of the Phidget opposite the USB port. Connect the negative wire (usually black) to the "-" terminal next to the red wire.
  2. Connect your device to your computer using the USB cable.
  3. Plug the DC power supply into the barrel jack, or if it doesn't have a jack, connect the loose leads to the "+" and "G" terminals between the barrel jack and USB port.
  4. Ensure that the DC power supply is plugged in.


Testing Using Windows

Phidget Control Panel

In order to demonstrate the functionality of the 1065, 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 1065.

First Look

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

1065 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.

DC Motor

Double-click on the DC Motor object, labelled {{{2}}}, in order to run the example: [[Image:{{{1}}}_DCMotor_Example.jpg|center|link=]]


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

  • Toggle the BackEMF Sensing checkbox to enable/disable back-EMF sensing on the {{{1}}}.
  • Drag the Target Velocity slider from -1 (full reverse) to 1 (full forward) to make the motor move.
  • Manipulate the Acceleration slider to increase/decrease the amount of time it takes the DC Motor to reach a target velocity.


Encoder

Double-click on the Encoder object, labelled {{{2}}}, in order to run the example: [[Image:{{{1}}}_Encoder_Example.jpg|center|link=]]


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

  • Position Change: the number of ticks (or quadrature cycles) that have occurred since the last change event.
  • Time Change: the amount of time in milliseconds that has elapsed since the last change event.
  • Position: the total position in ticks relative to where the encoder was when the window was opened.
  • Index Position: the position where the index channel was last encountered. Some encoders do not support index, check your encoder's datasheet for more information.
  • Velocity: the average velocity in rotations per second. A CPR must be specified to enable this functionality.
  • Specify a counts per revolution (CPR) value to enable velocity calculation.

Current Input

Double-click on the Current Input object {{{2}}} in order to run the example: [[Image:{{{1}}}_CurrentInput_Example.jpg|center|link=]]


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.

Template:UgDigitalInputAL

Voltage Input

Double-click on a Voltage Input object in order to run the example: [[Image:{{{1}}}_VoltageInputSensor_Example.jpg|center|link=]]


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.
  • If you have an analog sensor connected that you bought from us, you can select it from the Sensor Type drop-down menu. The example will then convert the voltage into a more meaningful value based on your sensor, with units included, and display it beside the Sensor Value label. Converting voltage to a Sensor Value is not specific to this example, it is handled by the Phidget libraries, with functions you have access to when you begin developing!


For more information about Voltage Inputs, check out the Voltage Input Primer.

Voltage Ratio Input

Double-click on a Voltage Ratio Input object in order to run the example: [[Image:{{{1}}}_VoltageRatioSensor_Example.jpg|link=|center]]


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

  • The voltage ratio is reported in Volts per Volt. For example, if the Phidget is providing 5V and the sensor is sending back 2.5V, the ratio will be 0.5V/V.
  • 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.
  • If you have an analog sensor connected that you bought from us, you can select it from the Sensor Type drop-down menu. The example will then convert the voltage into a more meaningful value based on your sensor, with units included, and display it beside the Sensor Value label. Converting voltage to a Sensor Value is not specific to this example, it is handled by the Phidget libraries, with functions you have access to when you begin developing!


For more information about Voltage Ratio Inputs, check out the Voltage Ratio Input Primer.

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 your device is properly attached
  5. Double click on your device's objects in the listing to open them. The Preference Pane and examples will function very similarly to the ones described above in the Windows section.

Testing Using Linux

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

Using a Remote OS

We recommend testing your Phidget on a desktop OS before moving on to remote OS. Once you've tested your Phidget, you can go to the PhidgetSBC, or iOS pages to learn how to proceed.

Technical Details

Connections

The ports and terminal blocks on this board are labelled on the underside to save space:

1065 0 Under.jpg

Further Reading

For more information on the analog inputs on the 1065, check the Analog Input Primer.

For more information about encoders, check the Encoder Primer.

For more information about DC motors and how to control them, check the DC Motor and Controller Primer.

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.


Product History

Template:UGhist Template:UGrow Template:UGrow