Motors moving too fast with controller

Hey guys! My team recently built a holonomic base and my controllers have been complaining that the turning on Axis1 and the strafing on Axis4 of the controllers have been moving too fast. Is there any way that I can reduce the speed of the motors?

The code is here:

// ----------------------------------------------------------------------------
//                                                                            
//    Project:                                               
//    Author:
//    Created:
//    Configuration:        
//                                                                            
// ----------------------------------------------------------------------------

// Include the V5 Library
#include "vex.h"

// Allows for easier use of the VEX Library
using namespace vex;

motor leftfront = motor(PORT1,gearSetting::ratio18_1,true);
motor leftback = motor(PORT2,gearSetting::ratio18_1,true);
motor rightfront = motor(PORT3,gearSetting::ratio18_1,false);
motor rightback = motor(PORT4,gearSetting::ratio18_1,false);

controller H = controller(primary);

// Begin project code

void preAutonomous(void) {
  // actions to do when the program starts
  Brain.Screen.clearScreen();
  Brain.Screen.print("pre auton code");
  wait(1, seconds);
}

void autonomous(void) {
  Brain.Screen.clearScreen();
  Brain.Screen.print("autonomous code");
  // place automonous code here
}

void userControl(void) {
  Brain.Screen.clearScreen();
  // place driver control in this while loop
  while (true) {
    wait(20, msec);
  }
}

int main() {
  // create competition instance
  competition Competition;

  // Set up callbacks for autonomous and driver control periods.
  Competition.autonomous(autonomous);
  Competition.drivercontrol(userControl);

  // Run the pre-autonomous function.
  preAutonomous();

  // Prevent main from exiting with an infinite loop.
  while (true) {
    int fwd = H.Axis3.position(vex::percent);
    int sideways = H.Axis4.position(vex::percent);
    int rotate = H.Axis1.position(vex::percent);

    rightfront.spin(directionType::fwd, fwd - sideways + rotate, velocityUnits::pct);
    leftfront.spin(directionType::fwd, fwd + sideways - rotate, velocityUnits::pct);
    rightback.spin(directionType::fwd, fwd + sideways + rotate, velocityUnits::pct);
    leftback.spin(directionType::fwd,  fwd - sideways - rotate, velocityUnits::pct);

    wait(100, msec);
  }
}

Thanks in advance!

Firstly, put your driver control in user control section. There are 2 very similar ways to solve this problem. The first method involves changing the variable that the joystick value is inputted into. Like this (this is only for one variable and you can change the value or add it to different variables as needed)

    int fwd = H.Axis3.position(vex::percent);
    int sideways = .8*H.Axis4.position(vex::percent);
    int rotate = H.Axis1.position(vex::percent);

The second way is to modify them when used

rightfront.spin(forward, fwd - .8*sideways + rotate, percent);
    leftfront.spin(forward, fwd + .8*sideways - rotate,percent);
    rightback.spin(forward, fwd + .8*sideways + rotate, percent);
    leftback.spin(forward,  fwd - .8*sideways - rotate,percent);
4 Likes