Manual

Copyright © Dr Robot Inc. 2008
16
Parameter: void // for GetSensorPotX
short channel; /* 0, 1, 2, 3, 4, or 5 for Potentiometer #
1, 2, 3, 4, 5, 6 */
Return value: short ival;
Return data interpretation & Remark:
1. The return data is the raw value of the analog to digital converter indicating the output
voltage of the sensor. The data range is between 0 and 4095. The angular position can
be calculated as follows, with the 180˚ position defined at sensor’s physical middle
position. Single sensor or dual sensor can be used for rotation measurement.
2. Single sensor is mainly used for the control of robot joint with limited rotation range.
The effective mechanical rotation range is 14˚ to 346˚, corresponding to the effective
electrical rotation range 0˚ to 332˚.
Angle position (˚) = (ival - 2048)/4095*333 + 180
3. Dual-sensor configuration is mainly used for continuous rotating joint control (such as
wheels). The effective rotation range is 0˚ to 360˚. Dual sensor configuration is only
available for channel 0 and 1. By connecting two potentiometers to potentiometer
channel 0 and channel 5, and specify the sensor type with command
SetDCMotorSensorUsage() to “Dual potentiometer sensor”, the channel 0 reading
will combine these two sensor readings into 0˚ to 360˚ range. For channel 1, you
should connect the two potentiometers to channel 1 and 4.
Angle position (˚) = (ival - 2214)/2214*180 + 180
See also: SetDcMotorSensorUsage().
III.1.9. Motor Current Sensors
51 short GetMotorCurrent1 ();
52 short GetMotorCurrent2 ();
53 short GetMotorCurrent3 ();
54 short GetMotorCurrent4 ();
55 short GetMotorCurrent5 ();
56 short GetMotorCurrent6 ();
57 short GetMotorCurrent (short channel);
Description:
GetMotorCurrentX returns the sampling value of motor current sensor.
Syntax: ival = GetMotorCurrent1 (); // Current sensor #1
ival = GetMotorCurrent2 (); // Current sensor #2
ival = GetMotorCurrent3 (); // Current sensor #3