Go to Post If you're destroying game pieces left and right, you're doin' it wrong. - Ian Curtis [more]
Home
Go Back   Chief Delphi > Other > FIRST Tech Challenge
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Spotlight this post!  
Unread 06-11-2010, 18:01
rzoeller rzoeller is offline
MN GOFIRST Recruitment Officer
AKA: Ryan Zoeller
FRC #2169 (RI3D 'Snow Problem; KING TeC)
Team Role: Alumni
 
Join Date: Nov 2009
Rookie Year: 2007
Location: Savage, MN
Posts: 111
rzoeller is a jewel in the roughrzoeller is a jewel in the roughrzoeller is a jewel in the rough
Re: [FTC]: Not Deadbands now.....speed limits

To circumvent the double compile problem (I have experienced it as well), use a different name for each version. You should do this anyways, but just tag it with a version number and it will update correctly.

One solution to the other problem is to use a parabolic system, demonstrated by the code below.
Code:
#include "JoystickDriver.c"  //Include file to "handle" the Bluetooth messages.
void initializeRobot()
{
  return;
}
void scaleMotor(char motorname, int joyVal)
{
  int sign = joyVal / abs(joyVal); //Returns a 1 or -1
  float ratio = ((joyVal * joyVal) / (16129)); //Gets a ratio from a parabolic curve
  int scaledVal = (sign * 100) * ratio;
  motor[motorname] = scaledVal;
}

task main()
{
  initializeRobot();

  waitForStart();   // wait for start of tele-op phase
  while (true)
  {
    getJoystickSettings(joystick);
    scaleMotor(DriveL, joystick.joy1_y1);
    scaleMotor(DriveR, joystick.joy1_y2);
  }
}
You add if statements to that to limit when it will scale the motors, I.E. below 75%.
__________________
Ri3D - 'Snow Problem Programmer
MN GOFIRST Recruitment Officer
FRC 2169 Alumni
Reply With Quote
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[FTC]: Deadbands (axis/motor power restrictions) JohnFogarty FIRST Tech Challenge 4 04-11-2010 19:03
[FTC]: Anyone new to FTC or TETRIX, READ THIS NOW! PhilBot FIRST Tech Challenge 21 04-12-2009 17:34
[FTC]: DC Motor Speed ethan_orion FIRST Tech Challenge 8 28-10-2009 12:36
[FTC]: Your in Atlanta...now what? gdo FIRST Tech Challenge 0 10-04-2008 21:49
Speed Controller Limits yaman Technical Discussion 11 15-01-2003 18:40


All times are GMT -5. The time now is 08:24.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi