VEXPro - Problems with motor ports (from Official Q&A)

Been a while since I used my VEXPro but there are only four “motors” available, the other 12 ports are “servos”.

From libquerk include files.

qemotor.h


#define QEMOT_NUM_MOTORS       4

also (for example) in qemotortraj.h

  static void *TrajThread(void *arg);
  long long m_trajectoryEndPosition[QEMOT_NUM_MOTORS]; // enc << posScale
  int m_trajectoryVelocity[QEMOT_NUM_MOTORS]; // enc/period << posScale
  unsigned int m_trajectoryAcceleration[QEMOT_NUM_MOTORS]; // enc/period/period
 
  // Trajectory generator output   
  int           m_generatedTrajectoryVelocity[QEMOT_NUM_MOTORS];   
  int           m_generatedTrajectoryVelocityUs[QEMOT_NUM_MOTORS];   
  long long     m_generatedTrajectoryPosition[QEMOT_NUM_MOTORS];
  Axis_position m_generatedTrajectoryPositionUs[QEMOT_NUM_MOTORS]; 
  int           m_accIntegral[QEMOT_NUM_MOTORS]; // enc << posScale
  Axis_position m_readPositionUs[QEMOT_NUM_MOTORS];

Also from qemotortraj.h

 /**
   * Initiate a motor movement with specified velocity.
   * If the current motor velocity is not equal to the specified 
   * velocity, the motor will either accelerate or decelerate with 
   * the specified acceleration  to the
   * specified velocity. 
   *** @param axis the axis in question, either 0, 1, 2, or 3, corresponding**
   *** to motor ports 13, 14, 15, and 16, respectively.**
   * @param velocity the desired velocity, can be positive or negative.
   * @param acceleration desired acceleration/deceleration,
   * strictly positive value.
   */

So in other words, I think what you have observed is normal behavior.

1 Like

This is correct, thanks for the solution. I ended up using the Servo classes until I got an answer from the Vex community, but with the servo functions I have to invoke SetCommand(0) for forward and SetCommand(250) for reverse, no big deal I suppose.

Thanks again for the information jpearman.

1 Like