User manual
Copyright © Dr Robot Inc. 2005  
50
Syntax:  DcMotorVelocityNonTimeCtr (channel, cmdValue); 
Parameter:  short channel;    // 0, 1, 2, 3, 4, or 5 
    short cmdValue;   // Target velocity value         
Return value:  void 
Remarks: 
1.  Motor will be enabled automatically by the system when this command is received 
2.  No velocity is available for motor channel using single potentiometer sensor 
3.  The unit of the velocity is (Position change in A/D sampling data) / second when 
using dual potentiometer sensor for rotational position measurement and pulse/ 
second when using quadrature encoder. 
4.  Please refer to the description of GetSensorPot for data conversion between 
angular values and the A/D sampling data values. 
See also: DcMotorVelocityTimeCtr, GetSensorPot 
96  void DcMotorPwmTimeCtr(short channel, short cmdValue, short timePeriod); 
Description: 
DcMotorPwmTimeCtr sends the PWM control command to the specified motion control 
channel on the Sensing and Motion Controller (PMS5005). The command includes the 
target pulse width value and the time period to execute the command. The current 
trajectory planning method for time control is linear. 
Syntax:  DcMotorPwmTimeCtr (channel, cmdValue, timePeriod); 
Parameter:  short channel;    // 0, 1, 2, 3, 4, or 5 
    short cmdValue;    // Target pulse width value 
    short timePeriod;  // Executing time in milliseconds 
Return value:  void 
Remarks: 
1.  The specified channel (motor) will be enabled automatically by the system when 
this command is received 
2.  Target pulse width value range is 0 to 32767 (0x7FFF), corresponding to the duty 
cycle of 0 to 100% linearly. 
3.  A pulse width value of 16363 means 50% duty cycle, putting motor in “Stop” stage. 
Any value in between 16364 - 32767 will put the motor to turn clockwise (facing 
the front side of the motor) and any value in between 0 – 16362 will put the motor 
to turn counter-clockwise. 










