Phidget Motor Control HC for Phidget
Module 1064_1
This element allows you to control the angular velocity and
acceleration of up to two high-current DC motors with a 1064 Phidget
module. Many variations of brushed DC motors exist: permanent
magnet motors, electromagnet motors, coreless motors, linear motors...
the PhidgetMotorController can be used with any of these, as well as
other devices like:
- small solenoids,
- incandescent light bulbs,
- hydraulic or pneumatic devices like small pumps and valves.
The 1064:
- Provides bi-directional control for 2 DC motors
- Requires external 6 to 15VDC Power Supply
- USB port is isolated from the motor control outputs
Usage
To use any Phidget element, drag an drop its icon to the list of
model elements of your model. Then, edit the connection parameters and
invoke phidget.connect() in your code.
All methods returning a boolean will return true on
successful completion of the command, false otherwise. Methods
returning a double value will return Double.NaN if there is any
error when connecting to the phidget.
Available method for this particular phidgets include:
- public boolean connect();
// establish the connection. Returns true if successful
- public boolean setPowerPWM(int
index, double value); // sets the power on the specified output
- public double getPowerPWM(int
index); // reads the applied PWM excitation on the given output
- public double set
OutputRamping(int index, ,double percentage); // Returns
how fast a motor (a load) will be accelerated (powered) between given
velocities (max and min ramping values). The valid range is
between OutputRampingMax and OutputRampingMin. This parameter
is measured in percent, where 100% is the fastest velocity ramping
available.
- public double
getOutputRamping(int index); // returns the output ramping value
- public double getCurrent(int
index); // Returns the current (Amps) being consumed by a load
connected to the interface.
- public double
getOutputRampingMax(int index); // Returns the max value of
output ramping
- public double
getOutputRampingMin(int index); // Returns the min value of
output ramping
Example of use
// Init the module
if (!phidget1064.connect()) _view.alert(null,"Connection error","Can't connect to Motor Control phidget");
// set the PWM value
phidget1064.setPowerPWM(0, 25); // sets 25% of total power on the first output
// get the applied PWM excitation value and the current being consumed
double value = phidget1064.getPowerPWM(0);
double current = phidget1064.getCurrent(0);