battery and motors

We are using:

  • 4 motors for 4 wheels in the base (2 right side are connected by Y cable to one port on controller, 2 left side are connected by Y cable to one port on controller)

  • 2 motors for the lift (Both of these are connected by Y cable to one port on controller)

  • 1 motor for the arm (Connected to a port on controller)

  • 1 motor for the claw (Connected to a port on controller)

  • All of these are 2 wire 393 motors.

and we are using one 7.2V battery that is connected to the cortex.

Is this configuration okay? We notice that sometime the lift motor does not respond to remote control buttons - when we expect it to go up it doesn’t lift. This is bit random - not sure what is causing this.

Any pointers/thoughts on if we need to do anything differently? Should we use 3 wire servos for the lift instead? Would that make any difference?


Well, you didn’t specify which particular ports are you using. They are split into two groups - 1-5, 6-10. You want to distribute your load evenly (i.e. drivebase in 2, 9; lift in 3, 8) between them (search the forum for PTC).
You certainly do not want both lift motors on a single port.


Port 2: Claw Motor
Port 3: Right Wheels Motor
Port 4: Left Wheels Motor
Port 8: Lift Motors
Port 10: Arm Motor

What is PTC?

May I ask why I shouldn’t put both lift motors on a single port using Y cable?

This way it is easier for me to specify power for the motor by simply saying:

motor[liftMotor] = 127;

instead of:

motor[rightLiftMotor] = 127;
motor[leftLiftMotor] = 127;


PTC refers to Positive Temperature Coefficient, and it is used to protect your motors from getting overworked. It’s a physical part inside your motors. You can read more on this great post by @jpearman

Thanks MayorMonty!

My best guess as to the cause of lag an the lift would be a programming thing. I have noticed in several cases that if you have multiple things happening in the same task (and by multiple I mean like drive, lift, claw, MoGo control, PIDs maybe), the cortex is not looking for a button input when you are pressing it, so you get some lag.

So if you do not already have at least 2 tasks for driver inputs, plus PIDs each in their own tasks, that can help a lot. If you already use multiple tasks, then I would just wonder if you drive with your joystick plugged into your computer. When we drive connected to the computer to watch sensor readings and stuff, we sometimes get very noticeable input lag across the whole program. Unplug and back to instant response, at least in my experience.

Here is our task for lift. Does it look problematic? Is it because we are giving it full power of 127 or -127 - and the controller is drawing too much current? Should I simply change it from 127 to 63/-63 or there is some other problem as well?

task lift {
	while true {
		//Bring up the lift from the ground
		if(vexRT[Btn7U] == 1) {
			while(vexRT[Btn7U] == 1) {
				motor[liftMotor] = -127;
			motor[liftMotor] = 0;
		//lower the lift to the ground
		if(vexRT[Btn7D] == 1) {
			while(vexRT[Btn7D] == 1) {
				motor[liftMotor] = 127;
			motor[liftMotor] = 0;

The only thing I see that could be problematic is the 2 separate if() statements. When the robot is checking if you are pressing down as you press up, it could cause some lag. Make the down portion an else if() and you should be good.
I personally don’t like using a while inside an if to wait for a button, because that can cause the program to get stuck in the loop… However this being in its own task it shouldn’t be an issue, and I don’t think its actually “wrong,” I just don’t like it.
You could try and do this: if(up), else if(down), else(zero), and just remove the while loop and include only the motor line in each if() branch.

Think of PTC as a (resettable) fuse. Now, besides each motor having one, there is one shared for ports 1-5 and another one shared for ports 6-10.
With both lift motors powered through a single PTC, you’re limiting your maximum power - if you split the motors between the two PTCs, you could draw twice the power before the the PTC triggers (and severely limits the available power for several seconds).
The same goes for the drivebase…

Well, both forms are clumsier than defining a function, like:

void setLift(int power) {
    motor[rightLiftMotor] = power;
    motor[leftLiftMotor] = power;

The added benefit of such a function-based abstraction is that when you re-wire the motors, you need to update only a single place.

Your lift task is correct, though unnecessarily complicated. You could as well do:

task lift {
	while true {
		if(vexRT[Btn7U] == 1) { //Bring up the lift from the ground
		} else if(vexRT[Btn7D] == 1) { //lower the lift to the ground
                } else {
                sleep(15); // don't hog the CPU unnecessarily