Motors continuously spin without control.

Hi VEX Forums,

My motors (both port 2 and port 3) keep spinning without me controlling them on the Vex Joystick.
Here is the RobotC program:


#pragma config(Motor,  port2,           rightWheel,    tmotorVex269, openLoop)
#pragma config(Motor,  port3,           leftWheel,     tmotorVex269, openLoop, reversed)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//

task main()
{
	while(1 == 1)
	{
	motor[rightWheel] = vexRT[Ch2]; 
	motor[leftWheel] = vexRT[Ch3]; 
	} 

} 

Here is the procedures to how I download & compile the code onto my Vex Cortex Microcontroller:

  • Turn the Vex Microcontroller on
  • Click the “Robot” tab in RobotC, then go to VEX Cortex Communication Mode, and make sure it’s set to “VEXnet or USB.”
  • Using the orange cord in your returnable kit, connect the Vex Microcontroller to the computer
  • Click the “Robot” tab in RobotC, press “Download & Compile” (this downloads & compiles the code to our robot)
  • When it finishes downloading & compiling, a popup should appear, x that popup out
  • While the Vex microcontroller is still connected to the computer, turn the microcontroller off, wait 10 seconds, then turn it back on, then disconnect the microcontroller from the computer
  • Now plug in the wireless USB drives to the Vex Joystick & Vex Microcontroller
  • Turn the Vex Joystick on
  • Test the program!

This program is for the BEST Robotics 2016 competition.
The motors are connected to port 2 & port 3 in the 10 motor slot area of the Vex Cortex Microcontroller EDR.

Are you plugging your motors directly into the ports, or are you using the model 29 motor speed controllers? Model 393 motors plugged directly into the ports will do what you are describing.

That’s not a standard VEX motor. I suggest that you contact BEST directly for instructions on its use with a Cortex.

My motors have the Motor Controller 29.

Here’s a picture of the Motor Controller 29 that we have:

What would the new #pragmas look like if I’m using this Motor Controller?
The motors are connected to port 2 & port 3 in the 10 motor slot area of the Vex Cortex Microcontroller EDR.

The pragmas shouldn’t change, for it is just a program. If I were you, I’d double check to see if the Controllers are connected to the CORTEX, and mess with the type of motor it is on the motors and sensors setup. Maybe try telling the sensor setup that it’s a VEX 393 regular motor and see if it has a difference…

According to some research, the Motor Controller 29 is used for 2-Wire Motors.

However, I don’t see the 2-Wire Motor option in the “Motors and Sensors Setup” menu of RobotC. I only see the 3-Wire Motor option.

No matter what, whatever enters the CORTEX’s motor inputs between ports 2 and 9 will always have 3 pins connecting the CORTEX. The motor controller is basically an “Adapter” that turns a two-pin motor into 3 pins. For the Controller and how it works on the 3-Wire side, the first pin sent by the cortex is the + Charge Electricity, the second is a - Charge Electricity, and the third is the signal for the speed. The Motor Controller basically grabs that signal from the cortex and sends electricity to the motor depending on how strong the signal is via the CORTEX. So there shouldn’t or doesn’t need to be an option for a “2-Wire Motor” option in ROBOTC since there is the adapter that grabs the 3-Wire and converts it to 2-Wire.

The real answer was that I had to calibrate my Joysticks.

How to calibrate: