Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[VEX IQ] not smooth during remote control #1

Closed
salvantj opened this issue Apr 11, 2016 · 3 comments
Closed

[VEX IQ] not smooth during remote control #1

salvantj opened this issue Apr 11, 2016 · 3 comments
Labels

Comments

@salvantj
Copy link

forward and back are really slow and not smooth at all.. turning seems to be doing ok but not as smooth as your video..

@salvantj
Copy link
Author

/ Variables to control the reference speed and steering
int speed = 0,
steering = 0;

//Joystick positions
int joyStickLeft = 0,
joyStickRight = 0;

//Maximum speed and steering when remote joysticks are fully moved forward
const int kMaxRemoteSpeed = 20;
const int kMaxRemoteSteering = 10;

//Initialization complete
setTouchLEDRGB(touchLed, 0, 255, 0);

//Run the main loop until the touch LED is touched.
while(getTouchLEDValue(touchLed)==0)
{

  ///////////////////////////////////////////////////////////////
  //
  //  Driving and Steering. Modify the <<speed>> and <<steering>>
  //  variables as you like to make your segway go anywhere!
  //
  //  (If you don't have the controller, just delete the four lines
  //  below. Then <<speed>> and <<steering>> remain zero.)
  //
  ///////////////////////////////////////////////////////////////

  joyStickLeft  = getJoystickValue(ChA);
  joyStickRight = getJoystickValue(ChD);

displayControllerValues(1, ChD);
displayControllerValues(2, ChA);
speed = (joyStickRight + joyStickLeft)/2.0 * (kMaxRemoteSpeed /100.0);
steering = (joyStickRight - joyStickLeft)/2.0 * (kMaxRemoteSteering/100.0);

@laurensvalk
Copy link
Owner

forward and back are really slow

This is currently limited by kMaxRemoteSpeed, which is currently set to 20

//Maximum speed and steering when remote joysticks are fully moved forward
const int kMaxRemoteSpeed = 20;
const int kMaxRemoteSteering = 10;

You can set it to a higher value, but that leaves "less speed" for balancing.

Smoothness is controlled by these tuning parameters:

gainGyroAngle                  = 1000,
gainGyroRate                   = 40,   
gainMotorAngle                 = 15, 
gainMotorAngularSpeed          = 9.6, 
gainMotorAngleErrorAccumulated = 3;

These values indicate how much power is applied to the motor for each of the signals (Gyro angle, etc.) deviating from their normal value.

Increasing gainGyroAngle, for example, will make it respond more aggressively when you push the robot a bit. Try playing with these values and adjust them slightly to see if you can make it more smooth.

@laurensvalk laurensvalk changed the title not smooth during remote control [VEX IQ] not smooth during remote control May 6, 2016
@LPArigma
Copy link

LPArigma commented Jul 7, 2016

mines just moving the wheels forward and backward really fast in order to balance, not really balancing smooth though i dont even know what half the tuning variables mean

          gainGyroAngle                  = 1000, 
          gainGyroRate                   = 85,   
          gainMotorAngle                 = 15,   
          gainMotorAngularSpeed          = 9.6,   
          gainMotorAngleErrorAccumulated = 3;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants