View unanswered posts | View active topics It is currently Sat Aug 30, 2014 6:34 pm






Reply to topic  [ 2 posts ] 
Trouble getting gradual turning 
Author Message
Rookie

Joined: Sat Oct 25, 2008 9:55 am
Posts: 1
Post Trouble getting gradual turning
we have been able to get the robot to turn on point with the program at the end but what we want to be able to do is turn gradually using only one wheel. Its really time consuming of those 2 min we have to do on point turns every time. The button press requirement is to compensate for the lack of our controllers accuracy when coming back to zero. That is another problem, we would like to get rid of the button pressing so if anyone can tell use how to redefine zero we would deffinantly like to know! the following are our two programs, the first is our current one with the button pressing and the working point turn. The second is an expiramental program that we were trying to redefine zero and it didnt work :/

Code:
#pragma config(Hubs,  S1, HTMotor,  HTServo,  none,     none)
#pragma config(Motor,  mtr_S1_C1_1,     motorD,        tmotorNormal, PIDControl)
#pragma config(Motor,  mtr_S1_C1_2,     motorE,        tmotorNormal, PIDControl)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//

#include "JoystickDriver.c"

task main()
{
  while(true)
  {
     getJoystickSettings(joystick);
    if (joystick.joy1_Buttons == 32)
  {
    motor[motorD] = joystick.joy1_y1;
    motor[motorE] = joystick.joy1_y2;
  }
  else
  {
  motor[motorD] = 0;
  motor[motorE] = 0;
  }
  }
}



Program 2

Code:
#pragma config(Hubs,  S1, HTMotor,  HTMotor,  HTServo,  none)
#pragma config(Motor,  motorA,          ,              tmotorNormal, PIDControl)
#pragma config(Motor,  mtr_S1_C1_1,     motorD,        tmotorNormal, PIDControl)
#pragma config(Motor,  mtr_S1_C1_2,     motorE,        tmotorNormal, PIDControl)
#pragma config(Motor,  mtr_S1_C2_1,     ,              tmotorNone, openLoop)
#pragma config(Motor,  mtr_S1_C2_2,     ,              tmotorNone, openLoop)
#pragma config(Servo,  srvo_S1_C3_1,    servoA,               tServoNormal)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//

#include "JoystickDriver.c"

task main()
{

  while (true)
{
   getJoystickSettings(joystick);
   motor[motorE] = joystick.joy1_y2;
    if (-5 < (joystick.joy1_y1) < 0)
    {
       motor[motorD] = 0;
    }
    else
    {
       motor[motorD] = joystick.joy1_y1;
    }
    //motor[motorD] = joystick.joy1_y1;
    motor[motorE] = joystick.joy1_y2;
   // if ((joystick.joy1_y1) > -5)
   // {
   //    motor[motorD] = 100;
   // }
   // else
   // {
   //    motor[motorD] = joystick.joy1_y1;
   // }
}
    //else
    //{
      //  motor[motorE] = joystick.joy1_y2;
    //}
    //if (joystick.joy1_y2) = (5,-5)
    //{
    //  motor[motorD] = 0;
    //}
    //else
    //{
      //  motor[motorE] = joystick.joy1_y2;
    //}

  //}
//}
}


Sat Oct 25, 2008 10:03 am
Profile
Site Admin
Site Admin

Joined: Wed Jan 24, 2007 10:42 am
Posts: 602
Post Re: Trouble getting gradual turning
I'm not sure how you're going to "redefine zero".

You might want to look at the "dead band" code and the "single joystick drive" code available here on the forums for some more assistance.

_________________
Timothy Friez
ROBOTC Developer - SW Engineer
tfriez@robotc.net


Wed Oct 29, 2008 3:48 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 2 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.