V5 Controller Axis 2 Values are Wrong

My team’s controller is in its default state has its Axis 2 measured as a negative value. Is there any fix for this? Thanks in advance!

Edit: after using the calibrate function on the controller, the sensor values have become correct. However, the code still acts just as if the sensor values were wrong. Is the controller defective? Can the VEX Staff please provide an answer?

you theoretically count counter the error with some math, but in the long run getting a new controller is probably worth it.

Try the “calibrate” feature of the controller. This may resolve some of your issues. It’s on the settings menu of the controller.

But as @Xenon27 said, probably in the long run for competition use look at either RMAing or getting a new controller.


You could add a deadband in the code, that is, the axis must reach a certain threshold before being activated.

1 Like

Hold on, this is common practice, right? I put one in for every joystick (even with v5, I don’t like drift :slight_smile: )

Yup it should be, joystick values at rest tend to be floating around 0, not adding the threshold would draw power slowly, which isn’t good.

1 Like

It also prevented that low squeel that cortex motors made at low speeds :smile:

YESSS OH MY GOODNESS that was ULTRA annoying.


How do you add a deadband code for the joysticks in C++?

You would do something like:

if ( abs( joystick_value ) > 5 ) {
    drive_motors.move ( joystick_value );
else {
    drive_motors.move ( 0 );

In this example 5 would be your deadband value. This makes it so that if the joystick is greater than 5, the drive motors will respond to the joystick value and if the joystick is less than 5 the drive motors won’t move.
Obviously the above code won’t work out of the box and you should try and expand on that quite a bit but that’s the basic concept. Hope this helps :slight_smile:

edit to add the absolute to the if statement.