User manual

Copyright © Dr Robot Inc. 2005
38
GetSensorBatteryADX returns the current value of the relevant power supply voltage if
the battery voltage monitor is enabled (default), or returns the relevant custom A/D inputs,
if the custom A/D input is enabled which is configured by the jumpers on PMS5005. Please
refer to Chapter IV.I PMS5005 Robot Sensing and Motion Controller (Page 67) for
detailed information on hardware setting.
Syntax: ival = GetSensorBatteryAD1(); /* for battery of DSP circuits,
or custom A/D channel #1 */
ival = GetSensorBatteryAD2(); /* for battery of DC motors,
or custom A/D channel #2 */
ival = GetSensorBatteryAD3(); /* battery for servo motors,
or custom A/D channel #3 */
Parameter: void
Return value: short ival;
Return data interpretation:
The return data is the raw value of the analog to digital converter indicating the output
voltage of the monitor. The data range is between 0 and 4095.
When monitoring the voltage of the power supply, following equations can be used to
calculate the real voltage values.
(1) Power supply voltage of DSP circuits = (ival / 4095) * 9 (V)
(2) Power supply voltage of DC motors = (ival / 4095) * 24 (V)
(3) Power supply voltage of servo motors = (ival / 4095) * 9 (V)
42 short GetSensorRefVoltage ();
43 short GetSensorPotVoltage ();
Description:
GetSensorRefVoltage returns the current value of the reference voltage of the A/D
converter of the controller DSP.
GetSensorPotVoltage returns the current value of the power supply voltage of the
potentiometer position sensors.
Syntax: ival = GetSensorRefVoltage ();
ival = GetSensorPotVoltage ();
Parameter: void
Return value: short ival;
Return data interpretation: