Question about changing default code for Clawbot

Hello Everyone,

We are a new VEX team this year, and we are trying to figure out how to make a small change to the default code for the VEX Clawbot. Currently, our Clawbot is pulling to the left, so we wanted to reduce the power to our right motor to see if we can even it out from there. We watched the video on how to manually change the code in RobotC (that is the programming language we are using), but when going into the default code, we could not figure out which place to change the 127 power value. Our right drive motor is currently plugged into motor port 10 as instructed in the initial instructions for the Clawbot, but we could not figure out which place that would be in the default code when we started to look into it. We were also looking for the -127 values as it does the same thing while backing up, again pulling slightly to the left due to more power on the right, but we could not find anything with a negative number (the positive 127 was all over the place, we just did not know which one to change). Could anyone help with this? Thanks for any suggestions!

Haha, a few minutes ago this was in the official answers thread so I started a reply thread in the unofficial forum, but now it was moved here, so I can comment directly to your message. I’ll try to delete the thread, here’s what I wrote:

If your robot is veering to the one side, something most likely is not right with the robot, and I would highly recommend you try to fix it on the robot. Changing power levels in the program is not the best solution, because the issue is that as the battery level is higher or lower, the speeds of the motors and thus power levels needed is different.

First, check on your robot that all four motors are working fine, and also that they are all on the same high/low speed internal gearing. Next we should check for friction, make sure all holes with an axle have bearings that are aligned with the holes and that the wheels aren’t rubbing on anything.

Another important but tricky thing is to make sure the bearings line up with the motor. To do this, remove the axle and wheel, and very slightly loosen the motor screws so the motor can move a bit. Stick only the axle through the bearings, and then align the motor so you don’t need any force to put the axle in, it almost falls into the motor. Once it’s as close to perfect, tighten the motor screws again.

Let us know if any of this helps. If not, you might have one motor that is a bit weaker or stronger, so try flipping motors around a bit.

What configuration are you running the clawbot in? ie. where do you have the jumpers to select tank/arcade drive, motor reversal etc. There are several places that control the right side motors, you are looking for lines of code like this.

motor[RightDrive10] = -vexRT[Ch2];        // up = CCW

This code is sending the value of channel 2 on the joystick (negated) to the motor on port10. To slow this down you might do something like this.

motor[RightDrive10] = -vexRT[Ch2] * 90 / 100;        // up = CCW

This would send 9/10th of the power when the joystick was pushed all the way forwards (or backwards).

The thread was moved because VEX/RECF do not usually answer specific programming questions (they make the hardware not the software), however, there are plenty of others in the VEX community that can.

Thanks to everyone who volunteered some information on this! We really appreciate it. I’ll have the students give the changing up of the motors a try next week right away, and if that doesn’t work, we’ll try to change up the code. I’ll let you know how it goes. I am working with 7th, 8th, and 9th graders who are new to robotics (I was involved with FIRST more as a scouting/strategy coach in the past, a little with building, but nothing with programming!), so any help is very welcome. Thanks again!