VexCode V5 Blocks to Reduce Drivetrain Velocity

I’m using Vexcode V5 Blocks for a very basic program for the standard clawbot. I’m not using plug and play driver control because the drivetrain moves too fast and the joysticks are too sensitive. My goal is to slow the drivetrain down. Strangely the code below does slow the claw and arm motors but changing the drivetrain drive and turn velocity does not have any impact. Looking for a simple way to slow down the drivetrain. Thanks!





I’m interested if anyone can answer this because I have a team that’s experiencing a similar problem. They’ve even set the velocity to 10%, and it doesn’t seem to have any effect.

If I remember correctly from going through the VEXcode VR course, 50% is the default velocity. So, anything 51%-100% would be faster and 0%-49% slower. I assume V5 is the same, but maybe there’s a difference with a physical motor.

50% is the default velocity, at least for Drivetrain. If you want to halve it, try using 25 instead.

The default velocity for the drivetrain using the controller is maximum speed. The blocks that control the speed (set drive velocity and set turn velocity) only change the speed for other blocks. For example, if you set the drive velocity to 25% and push the joystick(s) on the controller all the way forward, the robot will still move at full speed. However, if you add a block that says drive forward for 20 inches, it will only move at 25% speed.

To answer the OP’s question, as far as I know, there’s no easy way to reduce the speed in blocks. But you may be able to create custom code that converts the joysticks’ positions into velocities for the left and right sides.

2 Likes

@7187k is correct.

If you use graphical assignment of joystick to drivetrain.

The generated code just sends controller joystick axis percentage to the drivetrain motors. If that’s not working for you, remove the drivetrain graphical assignment and write some code that does what you need, it’s really not that hard.

2 Likes

(You can do the joystick axis percentage divided by a constant in an operator)

1 Like

How did you setup the device to get the RBack, Front, etc?

I think this person is using a custom drivetrain. All you need to do is replace those devices with your drivetrain

Here is how I set it up the basic clawbot using your suggestion. I tried to download and run but still no change in speed. Do you see what I’m doing wrong?



Blocks is somewhat limiting when it comes to the drivetrain.

If you have assigned the drivetrain to the controller using graphical configuration, there’s really not much you can do, the controller joystick values will be sent to the drivetrain motors directly. The “set drive velocity” and “set turn velocity” blocks have no meaning if you are doing that, they only have meaning when using the “drive forward …” and "turn " blocks.

You can remove the drivetrain, create left and right motors (reverse the right motor) and then write some code to control it directly, then you can determine how fast it should move by scaling the joystick or left/right drive velocities as needed. The drawback to this approach is that now you do not have access to the “drive forward” and “turn” blocks, you would have to create that logic yourself if you wanted that capability.

Your forever loop above in any case would not ever do anything as it is not connected to a “when hat…” (or other block that would allow it to run).

An example of code just to control left and right motors on the clawbot.

1 Like